edu.rice.cs.cunit.classFile.code
Class Opcode

java.lang.Object
  extended by edu.rice.cs.cunit.classFile.code.Opcode

public abstract class Opcode
extends java.lang.Object

Java opcode class.

Author:
Mathias Ricken

Field Summary
static byte AALOAD
           
static byte AASTORE
           
static byte ACONST_NULL
           
static byte ALOAD
           
static byte ALOAD_0
           
static byte ALOAD_1
           
static byte ALOAD_2
           
static byte ALOAD_3
           
static byte ANEWARRAY
           
static byte ANEWARRAY_QUICK
           
static byte ARETURN
           
static byte ARRAYLENGTH
           
static byte ASTORE
           
static byte ASTORE_0
           
static byte ASTORE_1
           
static byte ASTORE_2
           
static byte ASTORE_3
           
static byte ATHROW
           
static byte BALOAD
           
static byte BASTORE
           
static byte BIPUSH
           
static byte BREAKPOINT
           
static byte CALOAD
           
static byte CASTORE
           
static byte CHECKCAST
           
static byte CHECKCAST_QUICK
           
static byte D2F
           
static byte D2I
           
static byte D2L
           
static byte DADD
           
static byte DALOAD
           
static byte DASTORE
           
static byte DCMPG
           
static byte DCMPL
           
static byte DCONST_0
           
static byte DCONST_1
           
static byte DDIV
           
static byte DLOAD
           
static byte DLOAD_0
           
static byte DLOAD_1
           
static byte DLOAD_2
           
static byte DLOAD_3
           
static byte DMUL
           
static byte DNEG
           
static byte DREM
           
static byte DRETURN
           
static byte DSTORE
           
static byte DSTORE_0
           
static byte DSTORE_1
           
static byte DSTORE_2
           
static byte DSTORE_3
           
static byte DSUB
           
static byte DUP
           
static byte DUP_X1
           
static byte DUP_X2
           
static byte DUP2
           
static byte DUP2_X1
           
static byte DUP2_X2
           
static byte F2D
           
static byte F2I
           
static byte F2L
           
static byte FADD
           
static byte FALOAD
           
static byte FASTORE
           
static byte FCMPG
           
static byte FCMPL
           
static byte FCONST_0
           
static byte FCONST_1
           
static byte FCONST_2
           
static byte FDIV
           
static byte FLOAD
           
static byte FLOAD_0
           
static byte FLOAD_1
           
static byte FLOAD_2
           
static byte FLOAD_3
           
static byte FMUL
           
static byte FNEG
           
static byte FREM
           
static byte FRETURN
           
static byte FSTORE
           
static byte FSTORE_0
           
static byte FSTORE_1
           
static byte FSTORE_2
           
static byte FSTORE_3
           
static byte FSUB
           
static byte GETFIELD
           
static byte GETFIELD_QUICK
           
static byte GETFIELD_QUICK_W
           
static byte GETFIELD2_QUICK
           
static byte GETSTATIC
           
static byte GETSTATIC_QUICK
           
static byte GETSTATIC2_QUICK
           
static byte GOTO
           
static byte GOTO_W
           
static byte I2B
           
static byte I2C
           
static byte I2D
           
static byte I2F
           
static byte I2L
           
static byte I2S
           
static byte IADD
           
static byte IALOAD
           
static byte IAND
           
static byte IASTORE
           
static byte ICONST_0
           
static byte ICONST_1
           
static byte ICONST_2
           
static byte ICONST_3
           
static byte ICONST_4
           
static byte ICONST_5
           
static byte ICONST_M1
           
static byte IDIV
           
static byte IF_ACMPEQ
           
static byte IF_ACMPNE
           
static byte IF_ICMPEQ
           
static byte IF_ICMPGE
           
static byte IF_ICMPGT
           
static byte IF_ICMPLE
           
static byte IF_ICMPLT
           
static byte IF_ICMPNE
           
static byte IFEQ
           
static byte IFGE
           
static byte IFGT
           
static byte IFLE
           
static byte IFLT
           
static byte IFNE
           
static byte IFNONNULL
           
static byte IFNULL
           
static byte IINC
           
static byte ILOAD
           
static byte ILOAD_0
           
static byte ILOAD_1
           
static byte ILOAD_2
           
static byte ILOAD_3
           
static byte IMPDEP1
           
static byte IMPDEP2
           
static byte IMUL
           
static byte INEG
           
static byte INSTANCEOF
           
static byte INSTANCEOF_QUICK
           
static byte INVOKEINTERFACE
           
static byte INVOKEINTERFACE_QUICK
           
static byte INVOKENONVIRTUAL_QUICK
           
static byte INVOKESPECIAL
           
static byte INVOKESTATIC
           
static byte INVOKESTATIC_QUICK
           
static byte INVOKESUPER_QUICK
           
static byte INVOKEVIRTUAL
           
static byte INVOKEVIRTUAL_QUICK
           
static byte INVOKEVIRTUAL_QUICK_W
           
static byte INVOKEVIRTUALOBJECT_QUICK
           
static byte IOR
           
static byte IREM
           
static byte IRETURN
           
private static boolean[] isBranch
          Table determining if an code is a branch instruction.
static byte ISHL
           
static byte ISHR
           
static byte ISTORE
           
static byte ISTORE_0
           
static byte ISTORE_1
           
static byte ISTORE_2
           
static byte ISTORE_3
           
static byte ISUB
           
static byte IUSHR
           
static byte IXOR
           
static byte JSR
           
static byte JSR_W
           
static byte L2D
           
static byte L2F
           
static byte L2I
           
static byte LADD
           
static byte LALOAD
           
static byte LAND
           
static byte LASTORE
           
static byte LCMP
           
static byte LCONST_0
           
static byte LCONST_1
           
static byte LDC
           
static byte LDC_QUICK
           
static byte LDC_W
           
static byte LDC_W_QUICK
           
static byte LDC2_W
           
static byte LDC2_W_QUICK
           
static byte LDIV
           
static byte LLOAD
           
static byte LLOAD_0
           
static byte LLOAD_1
           
static byte LLOAD_2
           
static byte LLOAD_3
           
static byte LMUL
           
static byte LNEG
           
static byte LOOKUPSWITCH
           
static byte LOR
           
static byte LREM
           
static byte LRETURN
           
static byte LSHL
           
static byte LSHR
           
static byte LSTORE
           
static byte LSTORE_0
           
static byte LSTORE_1
           
static byte LSTORE_2
           
static byte LSTORE_3
           
static byte LSUB
           
static byte LUSHR
           
static byte LXOR
           
static byte MONITORENTER
           
static byte MONITOREXIT
           
static byte MULTIANEWARRAY
           
static byte MULTIANEWARRAY_QUICK
           
private static java.lang.String[] NAMES
          Table of mnemonics.
static byte NEW
           
static byte NEW_QUICK
           
static byte NEWARRAY
           
static byte NOP
           
private static byte[] OFFSET
          Table with code offsets.
static byte POP
           
static byte POP2
           
static byte PUTFIELD
           
static byte PUTFIELD_QUICK
           
static byte PUTFIELD_QUICK_W
           
static byte PUTFIELD2_QUICK
           
static byte PUTSTATIC
           
static byte PUTSTATIC_QUICK
           
static byte PUTSTATIC2_QUICK
           
static byte RET
           
static byte RETURN
           
static byte SALOAD
           
static byte SASTORE
           
static byte SIPUSH
           
static byte SWAP
           
static byte TABLESWITCH
           
static byte UNKNOWN_DC
           
static byte UNKNOWN_E5
           
static byte UNKNOWN_E6
           
static byte UNKNOWN_E7
           
static byte UNKNOWN_E8
           
static byte UNKNOWN_E9
           
static byte UNKNOWN_EA
           
static byte UNKNOWN_EB
           
static byte UNKNOWN_EC
           
static byte UNKNOWN_ED
           
static byte UNKNOWN_EE
           
static byte UNKNOWN_EF
           
static byte UNKNOWN_F0
           
static byte UNKNOWN_F1
           
static byte UNKNOWN_F2
           
static byte UNKNOWN_F3
           
static byte UNKNOWN_F4
           
static byte UNKNOWN_F5
           
static byte UNKNOWN_F6
           
static byte UNKNOWN_F7
           
static byte UNKNOWN_F8
           
static byte UNKNOWN_F9
           
static byte UNKNOWN_FA
           
static byte UNKNOWN_FB
           
static byte UNKNOWN_FC
           
static byte UNKNOWN_FD
           
static byte WIDE
           
static byte XXXUNUSEDXXX
           
 
Constructor Summary
Opcode()
           
 
Method Summary
static int[] getBranchTargets(byte[] code, int pc, int paddingPC)
          Returns an array of branch targets for the instruction.
static int getInstrSize(byte[] code, int pc)
          Return the length of the instruction at the specified offset in the bytecode array.
static int getInstrSize(byte[] code, int pc, int paddingPC)
          Return the length of the instruction at the specified offset in the bytecode array.
static java.lang.String getOpcodeName(byte opcode)
          Return a human-readable version of the code.
static AInstruction getShortestLoadStoreInstruction(byte baseOpcode, short index)
          Return the shortest instruction possible that loads/stores local variable index onto the stack.
static boolean isBranch(byte opcode)
          Return true if the specified code is a branch instruction.
static boolean isJSR(byte opcode)
          Return true if the specified code is a subroutine call.
static boolean isReturn(byte opcode)
          Return true if the specified code is a return instruction.
static boolean isUnconditionalBranch(byte opcode)
          Return true if the specified code is an unconditional branch instruction.
static byte[] repadInstr(byte[] code, int pc, int paddingPC, int newPC)
          Change the padding on the inside of the instruction found at pc, so that it is padded for a PC=newPC, not for a PC=paddingPC.
static void setBranchTargets(byte[] code, int pc, int[] branchTargets)
          Sets the branch targets for an instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOP

public static final byte NOP
See Also:
Constant Field Values

ACONST_NULL

public static final byte ACONST_NULL
See Also:
Constant Field Values

ICONST_M1

public static final byte ICONST_M1
See Also:
Constant Field Values

ICONST_0

public static final byte ICONST_0
See Also:
Constant Field Values

ICONST_1

public static final byte ICONST_1
See Also:
Constant Field Values

ICONST_2

public static final byte ICONST_2
See Also:
Constant Field Values

ICONST_3

public static final byte ICONST_3
See Also:
Constant Field Values

ICONST_4

public static final byte ICONST_4
See Also:
Constant Field Values

ICONST_5

public static final byte ICONST_5
See Also:
Constant Field Values

LCONST_0

public static final byte LCONST_0
See Also:
Constant Field Values

LCONST_1

public static final byte LCONST_1
See Also:
Constant Field Values

FCONST_0

public static final byte FCONST_0
See Also:
Constant Field Values

FCONST_1

public static final byte FCONST_1
See Also:
Constant Field Values

FCONST_2

public static final byte FCONST_2
See Also:
Constant Field Values

DCONST_0

public static final byte DCONST_0
See Also:
Constant Field Values

DCONST_1

public static final byte DCONST_1
See Also:
Constant Field Values

BIPUSH

public static final byte BIPUSH
See Also:
Constant Field Values

SIPUSH

public static final byte SIPUSH
See Also:
Constant Field Values

LDC

public static final byte LDC
See Also:
Constant Field Values

LDC_W

public static final byte LDC_W
See Also:
Constant Field Values

LDC2_W

public static final byte LDC2_W
See Also:
Constant Field Values

ILOAD

public static final byte ILOAD
See Also:
Constant Field Values

LLOAD

public static final byte LLOAD
See Also:
Constant Field Values

FLOAD

public static final byte FLOAD
See Also:
Constant Field Values

DLOAD

public static final byte DLOAD
See Also:
Constant Field Values

ALOAD

public static final byte ALOAD
See Also:
Constant Field Values

ILOAD_0

public static final byte ILOAD_0
See Also:
Constant Field Values

ILOAD_1

public static final byte ILOAD_1
See Also:
Constant Field Values

ILOAD_2

public static final byte ILOAD_2
See Also:
Constant Field Values

ILOAD_3

public static final byte ILOAD_3
See Also:
Constant Field Values

LLOAD_0

public static final byte LLOAD_0
See Also:
Constant Field Values

LLOAD_1

public static final byte LLOAD_1
See Also:
Constant Field Values

LLOAD_2

public static final byte LLOAD_2
See Also:
Constant Field Values

LLOAD_3

public static final byte LLOAD_3
See Also:
Constant Field Values

FLOAD_0

public static final byte FLOAD_0
See Also:
Constant Field Values

FLOAD_1

public static final byte FLOAD_1
See Also:
Constant Field Values

FLOAD_2

public static final byte FLOAD_2
See Also:
Constant Field Values

FLOAD_3

public static final byte FLOAD_3
See Also:
Constant Field Values

DLOAD_0

public static final byte DLOAD_0
See Also:
Constant Field Values

DLOAD_1

public static final byte DLOAD_1
See Also:
Constant Field Values

DLOAD_2

public static final byte DLOAD_2
See Also:
Constant Field Values

DLOAD_3

public static final byte DLOAD_3
See Also:
Constant Field Values

ALOAD_0

public static final byte ALOAD_0
See Also:
Constant Field Values

ALOAD_1

public static final byte ALOAD_1
See Also:
Constant Field Values

ALOAD_2

public static final byte ALOAD_2
See Also:
Constant Field Values

ALOAD_3

public static final byte ALOAD_3
See Also:
Constant Field Values

IALOAD

public static final byte IALOAD
See Also:
Constant Field Values

LALOAD

public static final byte LALOAD
See Also:
Constant Field Values

FALOAD

public static final byte FALOAD
See Also:
Constant Field Values

DALOAD

public static final byte DALOAD
See Also:
Constant Field Values

AALOAD

public static final byte AALOAD
See Also:
Constant Field Values

BALOAD

public static final byte BALOAD
See Also:
Constant Field Values

CALOAD

public static final byte CALOAD
See Also:
Constant Field Values

SALOAD

public static final byte SALOAD
See Also:
Constant Field Values

ISTORE

public static final byte ISTORE
See Also:
Constant Field Values

LSTORE

public static final byte LSTORE
See Also:
Constant Field Values

FSTORE

public static final byte FSTORE
See Also:
Constant Field Values

DSTORE

public static final byte DSTORE
See Also:
Constant Field Values

ASTORE

public static final byte ASTORE
See Also:
Constant Field Values

ISTORE_0

public static final byte ISTORE_0
See Also:
Constant Field Values

ISTORE_1

public static final byte ISTORE_1
See Also:
Constant Field Values

ISTORE_2

public static final byte ISTORE_2
See Also:
Constant Field Values

ISTORE_3

public static final byte ISTORE_3
See Also:
Constant Field Values

LSTORE_0

public static final byte LSTORE_0
See Also:
Constant Field Values

LSTORE_1

public static final byte LSTORE_1
See Also:
Constant Field Values

LSTORE_2

public static final byte LSTORE_2
See Also:
Constant Field Values

LSTORE_3

public static final byte LSTORE_3
See Also:
Constant Field Values

FSTORE_0

public static final byte FSTORE_0
See Also:
Constant Field Values

FSTORE_1

public static final byte FSTORE_1
See Also:
Constant Field Values

FSTORE_2

public static final byte FSTORE_2
See Also:
Constant Field Values

FSTORE_3

public static final byte FSTORE_3
See Also:
Constant Field Values

DSTORE_0

public static final byte DSTORE_0
See Also:
Constant Field Values

DSTORE_1

public static final byte DSTORE_1
See Also:
Constant Field Values

DSTORE_2

public static final byte DSTORE_2
See Also:
Constant Field Values

DSTORE_3

public static final byte DSTORE_3
See Also:
Constant Field Values

ASTORE_0

public static final byte ASTORE_0
See Also:
Constant Field Values

ASTORE_1

public static final byte ASTORE_1
See Also:
Constant Field Values

ASTORE_2

public static final byte ASTORE_2
See Also:
Constant Field Values

ASTORE_3

public static final byte ASTORE_3
See Also:
Constant Field Values

IASTORE

public static final byte IASTORE
See Also:
Constant Field Values

LASTORE

public static final byte LASTORE
See Also:
Constant Field Values

FASTORE

public static final byte FASTORE
See Also:
Constant Field Values

DASTORE

public static final byte DASTORE
See Also:
Constant Field Values

AASTORE

public static final byte AASTORE
See Also:
Constant Field Values

BASTORE

public static final byte BASTORE
See Also:
Constant Field Values

CASTORE

public static final byte CASTORE
See Also:
Constant Field Values

SASTORE

public static final byte SASTORE
See Also:
Constant Field Values

POP

public static final byte POP
See Also:
Constant Field Values

POP2

public static final byte POP2
See Also:
Constant Field Values

DUP

public static final byte DUP
See Also:
Constant Field Values

DUP_X1

public static final byte DUP_X1
See Also:
Constant Field Values

DUP_X2

public static final byte DUP_X2
See Also:
Constant Field Values

DUP2

public static final byte DUP2
See Also:
Constant Field Values

DUP2_X1

public static final byte DUP2_X1
See Also:
Constant Field Values

DUP2_X2

public static final byte DUP2_X2
See Also:
Constant Field Values

SWAP

public static final byte SWAP
See Also:
Constant Field Values

IADD

public static final byte IADD
See Also:
Constant Field Values

LADD

public static final byte LADD
See Also:
Constant Field Values

FADD

public static final byte FADD
See Also:
Constant Field Values

DADD

public static final byte DADD
See Also:
Constant Field Values

ISUB

public static final byte ISUB
See Also:
Constant Field Values

LSUB

public static final byte LSUB
See Also:
Constant Field Values

FSUB

public static final byte FSUB
See Also:
Constant Field Values

DSUB

public static final byte DSUB
See Also:
Constant Field Values

IMUL

public static final byte IMUL
See Also:
Constant Field Values

LMUL

public static final byte LMUL
See Also:
Constant Field Values

FMUL

public static final byte FMUL
See Also:
Constant Field Values

DMUL

public static final byte DMUL
See Also:
Constant Field Values

IDIV

public static final byte IDIV
See Also:
Constant Field Values

LDIV

public static final byte LDIV
See Also:
Constant Field Values

FDIV

public static final byte FDIV
See Also:
Constant Field Values

DDIV

public static final byte DDIV
See Also:
Constant Field Values

IREM

public static final byte IREM
See Also:
Constant Field Values

LREM

public static final byte LREM
See Also:
Constant Field Values

FREM

public static final byte FREM
See Also:
Constant Field Values

DREM

public static final byte DREM
See Also:
Constant Field Values

INEG

public static final byte INEG
See Also:
Constant Field Values

LNEG

public static final byte LNEG
See Also:
Constant Field Values

FNEG

public static final byte FNEG
See Also:
Constant Field Values

DNEG

public static final byte DNEG
See Also:
Constant Field Values

ISHL

public static final byte ISHL
See Also:
Constant Field Values

LSHL

public static final byte LSHL
See Also:
Constant Field Values

ISHR

public static final byte ISHR
See Also:
Constant Field Values

LSHR

public static final byte LSHR
See Also:
Constant Field Values

IUSHR

public static final byte IUSHR
See Also:
Constant Field Values

LUSHR

public static final byte LUSHR
See Also:
Constant Field Values

IAND

public static final byte IAND
See Also:
Constant Field Values

LAND

public static final byte LAND
See Also:
Constant Field Values

IOR

public static final byte IOR
See Also:
Constant Field Values

LOR

public static final byte LOR
See Also:
Constant Field Values

IXOR

public static final byte IXOR
See Also:
Constant Field Values

LXOR

public static final byte LXOR
See Also:
Constant Field Values

IINC

public static final byte IINC
See Also:
Constant Field Values

I2L

public static final byte I2L
See Also:
Constant Field Values

I2F

public static final byte I2F
See Also:
Constant Field Values

I2D

public static final byte I2D
See Also:
Constant Field Values

L2I

public static final byte L2I
See Also:
Constant Field Values

L2F

public static final byte L2F
See Also:
Constant Field Values

L2D

public static final byte L2D
See Also:
Constant Field Values

F2I

public static final byte F2I
See Also:
Constant Field Values

F2L

public static final byte F2L
See Also:
Constant Field Values

F2D

public static final byte F2D
See Also:
Constant Field Values

D2I

public static final byte D2I
See Also:
Constant Field Values

D2L

public static final byte D2L
See Also:
Constant Field Values

D2F

public static final byte D2F
See Also:
Constant Field Values

I2B

public static final byte I2B
See Also:
Constant Field Values

I2C

public static final byte I2C
See Also:
Constant Field Values

I2S

public static final byte I2S
See Also:
Constant Field Values

LCMP

public static final byte LCMP
See Also:
Constant Field Values

FCMPL

public static final byte FCMPL
See Also:
Constant Field Values

FCMPG

public static final byte FCMPG
See Also:
Constant Field Values

DCMPL

public static final byte DCMPL
See Also:
Constant Field Values

DCMPG

public static final byte DCMPG
See Also:
Constant Field Values

IFEQ

public static final byte IFEQ
See Also:
Constant Field Values

IFNE

public static final byte IFNE
See Also:
Constant Field Values

IFLT

public static final byte IFLT
See Also:
Constant Field Values

IFGE

public static final byte IFGE
See Also:
Constant Field Values

IFGT

public static final byte IFGT
See Also:
Constant Field Values

IFLE

public static final byte IFLE
See Also:
Constant Field Values

IF_ICMPEQ

public static final byte IF_ICMPEQ
See Also:
Constant Field Values

IF_ICMPNE

public static final byte IF_ICMPNE
See Also:
Constant Field Values

IF_ICMPLT

public static final byte IF_ICMPLT
See Also:
Constant Field Values

IF_ICMPGE

public static final byte IF_ICMPGE
See Also:
Constant Field Values

IF_ICMPGT

public static final byte IF_ICMPGT
See Also:
Constant Field Values

IF_ICMPLE

public static final byte IF_ICMPLE
See Also:
Constant Field Values

IF_ACMPEQ

public static final byte IF_ACMPEQ
See Also:
Constant Field Values

IF_ACMPNE

public static final byte IF_ACMPNE
See Also:
Constant Field Values

GOTO

public static final byte GOTO
See Also:
Constant Field Values

JSR

public static final byte JSR
See Also:
Constant Field Values

RET

public static final byte RET
See Also:
Constant Field Values

TABLESWITCH

public static final byte TABLESWITCH
See Also:
Constant Field Values

LOOKUPSWITCH

public static final byte LOOKUPSWITCH
See Also:
Constant Field Values

IRETURN

public static final byte IRETURN
See Also:
Constant Field Values

LRETURN

public static final byte LRETURN
See Also:
Constant Field Values

FRETURN

public static final byte FRETURN
See Also:
Constant Field Values

DRETURN

public static final byte DRETURN
See Also:
Constant Field Values

ARETURN

public static final byte ARETURN
See Also:
Constant Field Values

RETURN

public static final byte RETURN
See Also:
Constant Field Values

GETSTATIC

public static final byte GETSTATIC
See Also:
Constant Field Values

PUTSTATIC

public static final byte PUTSTATIC
See Also:
Constant Field Values

GETFIELD

public static final byte GETFIELD
See Also:
Constant Field Values

PUTFIELD

public static final byte PUTFIELD
See Also:
Constant Field Values

INVOKEVIRTUAL

public static final byte INVOKEVIRTUAL
See Also:
Constant Field Values

INVOKESPECIAL

public static final byte INVOKESPECIAL
See Also:
Constant Field Values

INVOKESTATIC

public static final byte INVOKESTATIC
See Also:
Constant Field Values

INVOKEINTERFACE

public static final byte INVOKEINTERFACE
See Also:
Constant Field Values

XXXUNUSEDXXX

public static final byte XXXUNUSEDXXX
See Also:
Constant Field Values

NEW

public static final byte NEW
See Also:
Constant Field Values

NEWARRAY

public static final byte NEWARRAY
See Also:
Constant Field Values

ANEWARRAY

public static final byte ANEWARRAY
See Also:
Constant Field Values

ARRAYLENGTH

public static final byte ARRAYLENGTH
See Also:
Constant Field Values

ATHROW

public static final byte ATHROW
See Also:
Constant Field Values

CHECKCAST

public static final byte CHECKCAST
See Also:
Constant Field Values

INSTANCEOF

public static final byte INSTANCEOF
See Also:
Constant Field Values

MONITORENTER

public static final byte MONITORENTER
See Also:
Constant Field Values

MONITOREXIT

public static final byte MONITOREXIT
See Also:
Constant Field Values

WIDE

public static final byte WIDE
See Also:
Constant Field Values

MULTIANEWARRAY

public static final byte MULTIANEWARRAY
See Also:
Constant Field Values

IFNULL

public static final byte IFNULL
See Also:
Constant Field Values

IFNONNULL

public static final byte IFNONNULL
See Also:
Constant Field Values

GOTO_W

public static final byte GOTO_W
See Also:
Constant Field Values

JSR_W

public static final byte JSR_W
See Also:
Constant Field Values

BREAKPOINT

public static final byte BREAKPOINT
See Also:
Constant Field Values

LDC_QUICK

public static final byte LDC_QUICK
See Also:
Constant Field Values

LDC_W_QUICK

public static final byte LDC_W_QUICK
See Also:
Constant Field Values

LDC2_W_QUICK

public static final byte LDC2_W_QUICK
See Also:
Constant Field Values

GETFIELD_QUICK

public static final byte GETFIELD_QUICK
See Also:
Constant Field Values

PUTFIELD_QUICK

public static final byte PUTFIELD_QUICK
See Also:
Constant Field Values

GETFIELD2_QUICK

public static final byte GETFIELD2_QUICK
See Also:
Constant Field Values

PUTFIELD2_QUICK

public static final byte PUTFIELD2_QUICK
See Also:
Constant Field Values

GETSTATIC_QUICK

public static final byte GETSTATIC_QUICK
See Also:
Constant Field Values

PUTSTATIC_QUICK

public static final byte PUTSTATIC_QUICK
See Also:
Constant Field Values

GETSTATIC2_QUICK

public static final byte GETSTATIC2_QUICK
See Also:
Constant Field Values

PUTSTATIC2_QUICK

public static final byte PUTSTATIC2_QUICK
See Also:
Constant Field Values

INVOKEVIRTUAL_QUICK

public static final byte INVOKEVIRTUAL_QUICK
See Also:
Constant Field Values

INVOKENONVIRTUAL_QUICK

public static final byte INVOKENONVIRTUAL_QUICK
See Also:
Constant Field Values

INVOKESUPER_QUICK

public static final byte INVOKESUPER_QUICK
See Also:
Constant Field Values

INVOKESTATIC_QUICK

public static final byte INVOKESTATIC_QUICK
See Also:
Constant Field Values

INVOKEINTERFACE_QUICK

public static final byte INVOKEINTERFACE_QUICK
See Also:
Constant Field Values

INVOKEVIRTUALOBJECT_QUICK

public static final byte INVOKEVIRTUALOBJECT_QUICK
See Also:
Constant Field Values

UNKNOWN_DC

public static final byte UNKNOWN_DC
See Also:
Constant Field Values

NEW_QUICK

public static final byte NEW_QUICK
See Also:
Constant Field Values

ANEWARRAY_QUICK

public static final byte ANEWARRAY_QUICK
See Also:
Constant Field Values

MULTIANEWARRAY_QUICK

public static final byte MULTIANEWARRAY_QUICK
See Also:
Constant Field Values

CHECKCAST_QUICK

public static final byte CHECKCAST_QUICK
See Also:
Constant Field Values

INSTANCEOF_QUICK

public static final byte INSTANCEOF_QUICK
See Also:
Constant Field Values

INVOKEVIRTUAL_QUICK_W

public static final byte INVOKEVIRTUAL_QUICK_W
See Also:
Constant Field Values

GETFIELD_QUICK_W

public static final byte GETFIELD_QUICK_W
See Also:
Constant Field Values

PUTFIELD_QUICK_W

public static final byte PUTFIELD_QUICK_W
See Also:
Constant Field Values

UNKNOWN_E5

public static final byte UNKNOWN_E5
See Also:
Constant Field Values

UNKNOWN_E6

public static final byte UNKNOWN_E6
See Also:
Constant Field Values

UNKNOWN_E7

public static final byte UNKNOWN_E7
See Also:
Constant Field Values

UNKNOWN_E8

public static final byte UNKNOWN_E8
See Also:
Constant Field Values

UNKNOWN_E9

public static final byte UNKNOWN_E9
See Also:
Constant Field Values

UNKNOWN_EA

public static final byte UNKNOWN_EA
See Also:
Constant Field Values

UNKNOWN_EB

public static final byte UNKNOWN_EB
See Also:
Constant Field Values

UNKNOWN_EC

public static final byte UNKNOWN_EC
See Also:
Constant Field Values

UNKNOWN_ED

public static final byte UNKNOWN_ED
See Also:
Constant Field Values

UNKNOWN_EE

public static final byte UNKNOWN_EE
See Also:
Constant Field Values

UNKNOWN_EF

public static final byte UNKNOWN_EF
See Also:
Constant Field Values

UNKNOWN_F0

public static final byte UNKNOWN_F0
See Also:
Constant Field Values

UNKNOWN_F1

public static final byte UNKNOWN_F1
See Also:
Constant Field Values

UNKNOWN_F2

public static final byte UNKNOWN_F2
See Also:
Constant Field Values

UNKNOWN_F3

public static final byte UNKNOWN_F3
See Also:
Constant Field Values

UNKNOWN_F4

public static final byte UNKNOWN_F4
See Also:
Constant Field Values

UNKNOWN_F5

public static final byte UNKNOWN_F5
See Also:
Constant Field Values

UNKNOWN_F6

public static final byte UNKNOWN_F6
See Also:
Constant Field Values

UNKNOWN_F7

public static final byte UNKNOWN_F7
See Also:
Constant Field Values

UNKNOWN_F8

public static final byte UNKNOWN_F8
See Also:
Constant Field Values

UNKNOWN_F9

public static final byte UNKNOWN_F9
See Also:
Constant Field Values

UNKNOWN_FA

public static final byte UNKNOWN_FA
See Also:
Constant Field Values

UNKNOWN_FB

public static final byte UNKNOWN_FB
See Also:
Constant Field Values

UNKNOWN_FC

public static final byte UNKNOWN_FC
See Also:
Constant Field Values

UNKNOWN_FD

public static final byte UNKNOWN_FD
See Also:
Constant Field Values

IMPDEP1

public static final byte IMPDEP1
See Also:
Constant Field Values

IMPDEP2

public static final byte IMPDEP2
See Also:
Constant Field Values

NAMES

private static final java.lang.String[] NAMES
Table of mnemonics.


OFFSET

private static final byte[] OFFSET
Table with code offsets.


isBranch

private static final boolean[] isBranch
Table determining if an code is a branch instruction.

Constructor Detail

Opcode

public Opcode()
Method Detail

getOpcodeName

public static final java.lang.String getOpcodeName(byte opcode)
Return a human-readable version of the code.

Parameters:
opcode - code
Returns:
mnemonic

getInstrSize

public static final int getInstrSize(byte[] code,
                                     int pc)
Return the length of the instruction at the specified offset in the bytecode array. This includes the code itself and its operands.

Parameters:
code - the bytecode array.
pc - offset
Returns:
the length of the code and operands

getInstrSize

public static final int getInstrSize(byte[] code,
                                     int pc,
                                     int paddingPC)
Return the length of the instruction at the specified offset in the bytecode array. This includes the code itself and its operands.

Parameters:
code - the bytecode array.
pc - offset
paddingPC - offset for calculating padding
Returns:
the length of the code and operands

repadInstr

public static final byte[] repadInstr(byte[] code,
                                      int pc,
                                      int paddingPC,
                                      int newPC)
Change the padding on the inside of the instruction found at pc, so that it is padded for a PC=newPC, not for a PC=paddingPC.

Parameters:
code - bytecode
pc - start of instruction in bytecode array
paddingPC - old PC used for padding
newPC - new PC used for padding
Returns:
repadded bytecode array

isReturn

public static final boolean isReturn(byte opcode)
Return true if the specified code is a return instruction. NOTE: ATHROW is not a return instruction. It does not leave immediately if there are matching exception handlers.

Parameters:
opcode - code to check
Returns:
true if the code is a return instruction

isBranch

public static final boolean isBranch(byte opcode)
Return true if the specified code is a branch instruction.

Parameters:
opcode - code to check
Returns:
true if the code is a branch instruction

isUnconditionalBranch

public static final boolean isUnconditionalBranch(byte opcode)
Return true if the specified code is an unconditional branch instruction.

Parameters:
opcode - code to check
Returns:
true if the code is an unconditional branch instruction

isJSR

public static final boolean isJSR(byte opcode)
Return true if the specified code is a subroutine call.

Parameters:
opcode - code to check
Returns:
true if the code is a JSR or JSR_W instruction

getBranchTargets

public static final int[] getBranchTargets(byte[] code,
                                           int pc,
                                           int paddingPC)
Returns an array of branch targets for the instruction.

Parameters:
code - byte code
pc - program counter
paddingPC -
Returns:
array of branch targets

setBranchTargets

public static final void setBranchTargets(byte[] code,
                                          int pc,
                                          int[] branchTargets)
Sets the branch targets for an instruction. NOTE: The number of branch targets has to remain unchanged.

Parameters:
code - byte code
pc - program counter
branchTargets - array of branch targets

getShortestLoadStoreInstruction

public static AInstruction getShortestLoadStoreInstruction(byte baseOpcode,
                                                           short index)
Return the shortest instruction possible that loads/stores local variable index onto the stack.

Parameters:
baseOpcode - the kind of load/store (ALOAD, ILOAD, ...)
index - local variable index
Returns:
shortest instruction to load/store