|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.rice.cs.cunit.classFile.code.Opcode
public abstract class Opcode
Java opcode class.
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 |
---|
public static final byte NOP
public static final byte ACONST_NULL
public static final byte ICONST_M1
public static final byte ICONST_0
public static final byte ICONST_1
public static final byte ICONST_2
public static final byte ICONST_3
public static final byte ICONST_4
public static final byte ICONST_5
public static final byte LCONST_0
public static final byte LCONST_1
public static final byte FCONST_0
public static final byte FCONST_1
public static final byte FCONST_2
public static final byte DCONST_0
public static final byte DCONST_1
public static final byte BIPUSH
public static final byte SIPUSH
public static final byte LDC
public static final byte LDC_W
public static final byte LDC2_W
public static final byte ILOAD
public static final byte LLOAD
public static final byte FLOAD
public static final byte DLOAD
public static final byte ALOAD
public static final byte ILOAD_0
public static final byte ILOAD_1
public static final byte ILOAD_2
public static final byte ILOAD_3
public static final byte LLOAD_0
public static final byte LLOAD_1
public static final byte LLOAD_2
public static final byte LLOAD_3
public static final byte FLOAD_0
public static final byte FLOAD_1
public static final byte FLOAD_2
public static final byte FLOAD_3
public static final byte DLOAD_0
public static final byte DLOAD_1
public static final byte DLOAD_2
public static final byte DLOAD_3
public static final byte ALOAD_0
public static final byte ALOAD_1
public static final byte ALOAD_2
public static final byte ALOAD_3
public static final byte IALOAD
public static final byte LALOAD
public static final byte FALOAD
public static final byte DALOAD
public static final byte AALOAD
public static final byte BALOAD
public static final byte CALOAD
public static final byte SALOAD
public static final byte ISTORE
public static final byte LSTORE
public static final byte FSTORE
public static final byte DSTORE
public static final byte ASTORE
public static final byte ISTORE_0
public static final byte ISTORE_1
public static final byte ISTORE_2
public static final byte ISTORE_3
public static final byte LSTORE_0
public static final byte LSTORE_1
public static final byte LSTORE_2
public static final byte LSTORE_3
public static final byte FSTORE_0
public static final byte FSTORE_1
public static final byte FSTORE_2
public static final byte FSTORE_3
public static final byte DSTORE_0
public static final byte DSTORE_1
public static final byte DSTORE_2
public static final byte DSTORE_3
public static final byte ASTORE_0
public static final byte ASTORE_1
public static final byte ASTORE_2
public static final byte ASTORE_3
public static final byte IASTORE
public static final byte LASTORE
public static final byte FASTORE
public static final byte DASTORE
public static final byte AASTORE
public static final byte BASTORE
public static final byte CASTORE
public static final byte SASTORE
public static final byte POP
public static final byte POP2
public static final byte DUP
public static final byte DUP_X1
public static final byte DUP_X2
public static final byte DUP2
public static final byte DUP2_X1
public static final byte DUP2_X2
public static final byte SWAP
public static final byte IADD
public static final byte LADD
public static final byte FADD
public static final byte DADD
public static final byte ISUB
public static final byte LSUB
public static final byte FSUB
public static final byte DSUB
public static final byte IMUL
public static final byte LMUL
public static final byte FMUL
public static final byte DMUL
public static final byte IDIV
public static final byte LDIV
public static final byte FDIV
public static final byte DDIV
public static final byte IREM
public static final byte LREM
public static final byte FREM
public static final byte DREM
public static final byte INEG
public static final byte LNEG
public static final byte FNEG
public static final byte DNEG
public static final byte ISHL
public static final byte LSHL
public static final byte ISHR
public static final byte LSHR
public static final byte IUSHR
public static final byte LUSHR
public static final byte IAND
public static final byte LAND
public static final byte IOR
public static final byte LOR
public static final byte IXOR
public static final byte LXOR
public static final byte IINC
public static final byte I2L
public static final byte I2F
public static final byte I2D
public static final byte L2I
public static final byte L2F
public static final byte L2D
public static final byte F2I
public static final byte F2L
public static final byte F2D
public static final byte D2I
public static final byte D2L
public static final byte D2F
public static final byte I2B
public static final byte I2C
public static final byte I2S
public static final byte LCMP
public static final byte FCMPL
public static final byte FCMPG
public static final byte DCMPL
public static final byte DCMPG
public static final byte IFEQ
public static final byte IFNE
public static final byte IFLT
public static final byte IFGE
public static final byte IFGT
public static final byte IFLE
public static final byte IF_ICMPEQ
public static final byte IF_ICMPNE
public static final byte IF_ICMPLT
public static final byte IF_ICMPGE
public static final byte IF_ICMPGT
public static final byte IF_ICMPLE
public static final byte IF_ACMPEQ
public static final byte IF_ACMPNE
public static final byte GOTO
public static final byte JSR
public static final byte RET
public static final byte TABLESWITCH
public static final byte LOOKUPSWITCH
public static final byte IRETURN
public static final byte LRETURN
public static final byte FRETURN
public static final byte DRETURN
public static final byte ARETURN
public static final byte RETURN
public static final byte GETSTATIC
public static final byte PUTSTATIC
public static final byte GETFIELD
public static final byte PUTFIELD
public static final byte INVOKEVIRTUAL
public static final byte INVOKESPECIAL
public static final byte INVOKESTATIC
public static final byte INVOKEINTERFACE
public static final byte XXXUNUSEDXXX
public static final byte NEW
public static final byte NEWARRAY
public static final byte ANEWARRAY
public static final byte ARRAYLENGTH
public static final byte ATHROW
public static final byte CHECKCAST
public static final byte INSTANCEOF
public static final byte MONITORENTER
public static final byte MONITOREXIT
public static final byte WIDE
public static final byte MULTIANEWARRAY
public static final byte IFNULL
public static final byte IFNONNULL
public static final byte GOTO_W
public static final byte JSR_W
public static final byte BREAKPOINT
public static final byte LDC_QUICK
public static final byte LDC_W_QUICK
public static final byte LDC2_W_QUICK
public static final byte GETFIELD_QUICK
public static final byte PUTFIELD_QUICK
public static final byte GETFIELD2_QUICK
public static final byte PUTFIELD2_QUICK
public static final byte GETSTATIC_QUICK
public static final byte PUTSTATIC_QUICK
public static final byte GETSTATIC2_QUICK
public static final byte PUTSTATIC2_QUICK
public static final byte INVOKEVIRTUAL_QUICK
public static final byte INVOKENONVIRTUAL_QUICK
public static final byte INVOKESUPER_QUICK
public static final byte INVOKESTATIC_QUICK
public static final byte INVOKEINTERFACE_QUICK
public static final byte INVOKEVIRTUALOBJECT_QUICK
public static final byte UNKNOWN_DC
public static final byte NEW_QUICK
public static final byte ANEWARRAY_QUICK
public static final byte MULTIANEWARRAY_QUICK
public static final byte CHECKCAST_QUICK
public static final byte INSTANCEOF_QUICK
public static final byte INVOKEVIRTUAL_QUICK_W
public static final byte GETFIELD_QUICK_W
public static final byte PUTFIELD_QUICK_W
public static final byte UNKNOWN_E5
public static final byte UNKNOWN_E6
public static final byte UNKNOWN_E7
public static final byte UNKNOWN_E8
public static final byte UNKNOWN_E9
public static final byte UNKNOWN_EA
public static final byte UNKNOWN_EB
public static final byte UNKNOWN_EC
public static final byte UNKNOWN_ED
public static final byte UNKNOWN_EE
public static final byte UNKNOWN_EF
public static final byte UNKNOWN_F0
public static final byte UNKNOWN_F1
public static final byte UNKNOWN_F2
public static final byte UNKNOWN_F3
public static final byte UNKNOWN_F4
public static final byte UNKNOWN_F5
public static final byte UNKNOWN_F6
public static final byte UNKNOWN_F7
public static final byte UNKNOWN_F8
public static final byte UNKNOWN_F9
public static final byte UNKNOWN_FA
public static final byte UNKNOWN_FB
public static final byte UNKNOWN_FC
public static final byte UNKNOWN_FD
public static final byte IMPDEP1
public static final byte IMPDEP2
private static final java.lang.String[] NAMES
private static final byte[] OFFSET
private static final boolean[] isBranch
Constructor Detail |
---|
public Opcode()
Method Detail |
---|
public static final java.lang.String getOpcodeName(byte opcode)
opcode
- code
public static final int getInstrSize(byte[] code, int pc)
code
- the bytecode array.pc
- offset
public static final int getInstrSize(byte[] code, int pc, int paddingPC)
code
- the bytecode array.pc
- offsetpaddingPC
- offset for calculating padding
public static final byte[] repadInstr(byte[] code, int pc, int paddingPC, int newPC)
code
- bytecodepc
- start of instruction in bytecode arraypaddingPC
- old PC used for paddingnewPC
- new PC used for padding
public static final boolean isReturn(byte opcode)
opcode
- code to check
public static final boolean isBranch(byte opcode)
opcode
- code to check
public static final boolean isUnconditionalBranch(byte opcode)
opcode
- code to check
public static final boolean isJSR(byte opcode)
opcode
- code to check
public static final int[] getBranchTargets(byte[] code, int pc, int paddingPC)
code
- byte codepc
- program counterpaddingPC
-
public static final void setBranchTargets(byte[] code, int pc, int[] branchTargets)
code
- byte codepc
- program counterbranchTargets
- array of branch targetspublic static AInstruction getShortestLoadStoreInstruction(byte baseOpcode, short index)
baseOpcode
- the kind of load/store (ALOAD, ILOAD, ...)index
- local variable index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |