Package proguard.classfile.instruction
Class Instruction
- java.lang.Object
-
- proguard.classfile.instruction.Instruction
-
- Direct Known Subclasses:
BranchInstruction
,CodeAttributeEditor.Label
,ConstantInstruction
,InstructionSequenceReplacer.Label
,SimpleInstruction
,SwitchInstruction
,VariableInstruction
public abstract class Instruction extends java.lang.Object
Base class for representing instructions.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
ARRAY_T_BOOLEAN
static byte
ARRAY_T_BYTE
static byte
ARRAY_T_CHAR
static byte
ARRAY_T_DOUBLE
static byte
ARRAY_T_FLOAT
static byte
ARRAY_T_INT
static byte
ARRAY_T_LONG
static byte
ARRAY_T_SHORT
static java.lang.String[]
NAMES
static byte
OP_AALOAD
static byte
OP_AASTORE
static byte
OP_ACONST_NULL
static byte
OP_ALOAD
static byte
OP_ALOAD_0
static byte
OP_ALOAD_1
static byte
OP_ALOAD_2
static byte
OP_ALOAD_3
static byte
OP_ANEWARRAY
static byte
OP_ARETURN
static byte
OP_ARRAYLENGTH
static byte
OP_ASTORE
static byte
OP_ASTORE_0
static byte
OP_ASTORE_1
static byte
OP_ASTORE_2
static byte
OP_ASTORE_3
static byte
OP_ATHROW
static byte
OP_BALOAD
static byte
OP_BASTORE
static byte
OP_BIPUSH
static byte
OP_CALOAD
static byte
OP_CASTORE
static byte
OP_CHECKCAST
static byte
OP_D2F
static byte
OP_D2I
static byte
OP_D2L
static byte
OP_DADD
static byte
OP_DALOAD
static byte
OP_DASTORE
static byte
OP_DCMPG
static byte
OP_DCMPL
static byte
OP_DCONST_0
static byte
OP_DCONST_1
static byte
OP_DDIV
static byte
OP_DLOAD
static byte
OP_DLOAD_0
static byte
OP_DLOAD_1
static byte
OP_DLOAD_2
static byte
OP_DLOAD_3
static byte
OP_DMUL
static byte
OP_DNEG
static byte
OP_DREM
static byte
OP_DRETURN
static byte
OP_DSTORE
static byte
OP_DSTORE_0
static byte
OP_DSTORE_1
static byte
OP_DSTORE_2
static byte
OP_DSTORE_3
static byte
OP_DSUB
static byte
OP_DUP
static byte
OP_DUP_X1
static byte
OP_DUP_X2
static byte
OP_DUP2
static byte
OP_DUP2_X1
static byte
OP_DUP2_X2
static byte
OP_F2D
static byte
OP_F2I
static byte
OP_F2L
static byte
OP_FADD
static byte
OP_FALOAD
static byte
OP_FASTORE
static byte
OP_FCMPG
static byte
OP_FCMPL
static byte
OP_FCONST_0
static byte
OP_FCONST_1
static byte
OP_FCONST_2
static byte
OP_FDIV
static byte
OP_FLOAD
static byte
OP_FLOAD_0
static byte
OP_FLOAD_1
static byte
OP_FLOAD_2
static byte
OP_FLOAD_3
static byte
OP_FMUL
static byte
OP_FNEG
static byte
OP_FREM
static byte
OP_FRETURN
static byte
OP_FSTORE
static byte
OP_FSTORE_0
static byte
OP_FSTORE_1
static byte
OP_FSTORE_2
static byte
OP_FSTORE_3
static byte
OP_FSUB
static byte
OP_GETFIELD
static byte
OP_GETSTATIC
static byte
OP_GOTO
static byte
OP_GOTO_W
static byte
OP_I2B
static byte
OP_I2C
static byte
OP_I2D
static byte
OP_I2F
static byte
OP_I2L
static byte
OP_I2S
static byte
OP_IADD
static byte
OP_IALOAD
static byte
OP_IAND
static byte
OP_IASTORE
static byte
OP_ICONST_0
static byte
OP_ICONST_1
static byte
OP_ICONST_2
static byte
OP_ICONST_3
static byte
OP_ICONST_4
static byte
OP_ICONST_5
static byte
OP_ICONST_M1
static byte
OP_IDIV
static byte
OP_IFACMPEQ
static byte
OP_IFACMPNE
static byte
OP_IFEQ
static byte
OP_IFGE
static byte
OP_IFGT
static byte
OP_IFICMPEQ
static byte
OP_IFICMPGE
static byte
OP_IFICMPGT
static byte
OP_IFICMPLE
static byte
OP_IFICMPLT
static byte
OP_IFICMPNE
static byte
OP_IFLE
static byte
OP_IFLT
static byte
OP_IFNE
static byte
OP_IFNONNULL
static byte
OP_IFNULL
static byte
OP_IINC
static byte
OP_ILOAD
static byte
OP_ILOAD_0
static byte
OP_ILOAD_1
static byte
OP_ILOAD_2
static byte
OP_ILOAD_3
static byte
OP_IMUL
static byte
OP_INEG
static byte
OP_INSTANCEOF
static byte
OP_INVOKEDYNAMIC
static byte
OP_INVOKEINTERFACE
static byte
OP_INVOKESPECIAL
static byte
OP_INVOKESTATIC
static byte
OP_INVOKEVIRTUAL
static byte
OP_IOR
static byte
OP_IREM
static byte
OP_IRETURN
static byte
OP_ISHL
static byte
OP_ISHR
static byte
OP_ISTORE
static byte
OP_ISTORE_0
static byte
OP_ISTORE_1
static byte
OP_ISTORE_2
static byte
OP_ISTORE_3
static byte
OP_ISUB
static byte
OP_IUSHR
static byte
OP_IXOR
static byte
OP_JSR
static byte
OP_JSR_W
static byte
OP_L2D
static byte
OP_L2F
static byte
OP_L2I
static byte
OP_LADD
static byte
OP_LALOAD
static byte
OP_LAND
static byte
OP_LASTORE
static byte
OP_LCMP
static byte
OP_LCONST_0
static byte
OP_LCONST_1
static byte
OP_LDC
static byte
OP_LDC_W
static byte
OP_LDC2_W
static byte
OP_LDIV
static byte
OP_LLOAD
static byte
OP_LLOAD_0
static byte
OP_LLOAD_1
static byte
OP_LLOAD_2
static byte
OP_LLOAD_3
static byte
OP_LMUL
static byte
OP_LNEG
static byte
OP_LOOKUPSWITCH
static byte
OP_LOR
static byte
OP_LREM
static byte
OP_LRETURN
static byte
OP_LSHL
static byte
OP_LSHR
static byte
OP_LSTORE
static byte
OP_LSTORE_0
static byte
OP_LSTORE_1
static byte
OP_LSTORE_2
static byte
OP_LSTORE_3
static byte
OP_LSUB
static byte
OP_LUSHR
static byte
OP_LXOR
static byte
OP_MONITORENTER
static byte
OP_MONITOREXIT
static byte
OP_MULTIANEWARRAY
static byte
OP_NEW
static byte
OP_NEWARRAY
static byte
OP_NOP
static byte
OP_POP
static byte
OP_POP2
static byte
OP_PUTFIELD
static byte
OP_PUTSTATIC
static byte
OP_RET
static byte
OP_RETURN
static byte
OP_SALOAD
static byte
OP_SASTORE
static byte
OP_SIPUSH
static byte
OP_SWAP
static byte
OP_TABLESWITCH
static byte
OP_WIDE
byte
opcode
-
Constructor Summary
Constructors Constructor Description Instruction()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)
Accepts the given visitor.byte
actualOpcode()
Returns the actual opcode of this instruction, i.e.byte
canonicalOpcode()
Returns the canonical opcode of this instruction, i.e.abstract boolean
equals(java.lang.Object o)
java.lang.String
getName()
Returns the name of the instruction.abstract int
hashCode()
boolean
isCategory2()
Returns whether the instruction is a Category 2 instruction.protected boolean
isWide()
Returns whether the instruction is wide, i.e.abstract int
length(int offset)
Returns the length in bytes of the instruction.boolean
mayInstanceThrowExceptions(Clazz clazz)
Returns whether a particular instance of an instruction may throw exceptions.boolean
mayThrowExceptions()
Returns whether the instruction may conservatively throw exceptions.protected static int
readByte(byte[] code, int offset)
protected abstract void
readInfo(byte[] code, int offset)
Reads the data following the instruction opcode.protected static int
readInt(byte[] code, int offset)
protected static int
readShort(byte[] code, int offset)
protected static int
readSignedByte(byte[] code, int offset)
protected static int
readSignedShort(byte[] code, int offset)
protected static int
readSignedValue(byte[] code, int offset, int valueSize)
protected static int
readValue(byte[] code, int offset, int valueSize)
abstract Instruction
shrink()
Shrinks this instruction to its shortest possible form.int
stackEntryIndexBefore(Clazz clazz, int stackEntryIndexAfter)
Returns the stack entry index from which the specified stack entry is copied by a dup/swap/checkcast instruction, or -1 otherwise.int
stackPopCount(Clazz clazz)
Returns the number of entries popped from the stack during the execution of the instruction.int
stackPushCount(Clazz clazz)
Returns the number of entries pushed onto the stack during the execution of the instruction.java.lang.String
toString(int offset)
Returns a description of the instruction, at the given offset.java.lang.String
toString(Clazz clazz, int offset)
Returns a description of the instruction, at the given offset.void
write(byte[] code, int offset)
Writes the Instruction at the given offset in the given code array.void
write(CodeAttribute codeAttribute, int offset)
Writes the Instruction at the given offset in the given code attribute.protected static void
writeByte(byte[] code, int offset, int value)
protected abstract void
writeInfo(byte[] code, int offset)
Writes data following the instruction opcode.protected static void
writeInt(byte[] code, int offset, int value)
protected static void
writeShort(byte[] code, int offset, int value)
protected static void
writeSignedByte(byte[] code, int offset, int value)
protected static void
writeSignedShort(byte[] code, int offset, int value)
protected static void
writeSignedValue(byte[] code, int offset, int value, int valueSize)
protected static void
writeValue(byte[] code, int offset, int value, int valueSize)
-
-
-
Field Detail
-
OP_NOP
public static final byte OP_NOP
- See Also:
- Constant Field Values
-
OP_ACONST_NULL
public static final byte OP_ACONST_NULL
- See Also:
- Constant Field Values
-
OP_ICONST_M1
public static final byte OP_ICONST_M1
- See Also:
- Constant Field Values
-
OP_ICONST_0
public static final byte OP_ICONST_0
- See Also:
- Constant Field Values
-
OP_ICONST_1
public static final byte OP_ICONST_1
- See Also:
- Constant Field Values
-
OP_ICONST_2
public static final byte OP_ICONST_2
- See Also:
- Constant Field Values
-
OP_ICONST_3
public static final byte OP_ICONST_3
- See Also:
- Constant Field Values
-
OP_ICONST_4
public static final byte OP_ICONST_4
- See Also:
- Constant Field Values
-
OP_ICONST_5
public static final byte OP_ICONST_5
- See Also:
- Constant Field Values
-
OP_LCONST_0
public static final byte OP_LCONST_0
- See Also:
- Constant Field Values
-
OP_LCONST_1
public static final byte OP_LCONST_1
- See Also:
- Constant Field Values
-
OP_FCONST_0
public static final byte OP_FCONST_0
- See Also:
- Constant Field Values
-
OP_FCONST_1
public static final byte OP_FCONST_1
- See Also:
- Constant Field Values
-
OP_FCONST_2
public static final byte OP_FCONST_2
- See Also:
- Constant Field Values
-
OP_DCONST_0
public static final byte OP_DCONST_0
- See Also:
- Constant Field Values
-
OP_DCONST_1
public static final byte OP_DCONST_1
- See Also:
- Constant Field Values
-
OP_BIPUSH
public static final byte OP_BIPUSH
- See Also:
- Constant Field Values
-
OP_SIPUSH
public static final byte OP_SIPUSH
- See Also:
- Constant Field Values
-
OP_LDC
public static final byte OP_LDC
- See Also:
- Constant Field Values
-
OP_LDC_W
public static final byte OP_LDC_W
- See Also:
- Constant Field Values
-
OP_LDC2_W
public static final byte OP_LDC2_W
- See Also:
- Constant Field Values
-
OP_ILOAD
public static final byte OP_ILOAD
- See Also:
- Constant Field Values
-
OP_LLOAD
public static final byte OP_LLOAD
- See Also:
- Constant Field Values
-
OP_FLOAD
public static final byte OP_FLOAD
- See Also:
- Constant Field Values
-
OP_DLOAD
public static final byte OP_DLOAD
- See Also:
- Constant Field Values
-
OP_ALOAD
public static final byte OP_ALOAD
- See Also:
- Constant Field Values
-
OP_ILOAD_0
public static final byte OP_ILOAD_0
- See Also:
- Constant Field Values
-
OP_ILOAD_1
public static final byte OP_ILOAD_1
- See Also:
- Constant Field Values
-
OP_ILOAD_2
public static final byte OP_ILOAD_2
- See Also:
- Constant Field Values
-
OP_ILOAD_3
public static final byte OP_ILOAD_3
- See Also:
- Constant Field Values
-
OP_LLOAD_0
public static final byte OP_LLOAD_0
- See Also:
- Constant Field Values
-
OP_LLOAD_1
public static final byte OP_LLOAD_1
- See Also:
- Constant Field Values
-
OP_LLOAD_2
public static final byte OP_LLOAD_2
- See Also:
- Constant Field Values
-
OP_LLOAD_3
public static final byte OP_LLOAD_3
- See Also:
- Constant Field Values
-
OP_FLOAD_0
public static final byte OP_FLOAD_0
- See Also:
- Constant Field Values
-
OP_FLOAD_1
public static final byte OP_FLOAD_1
- See Also:
- Constant Field Values
-
OP_FLOAD_2
public static final byte OP_FLOAD_2
- See Also:
- Constant Field Values
-
OP_FLOAD_3
public static final byte OP_FLOAD_3
- See Also:
- Constant Field Values
-
OP_DLOAD_0
public static final byte OP_DLOAD_0
- See Also:
- Constant Field Values
-
OP_DLOAD_1
public static final byte OP_DLOAD_1
- See Also:
- Constant Field Values
-
OP_DLOAD_2
public static final byte OP_DLOAD_2
- See Also:
- Constant Field Values
-
OP_DLOAD_3
public static final byte OP_DLOAD_3
- See Also:
- Constant Field Values
-
OP_ALOAD_0
public static final byte OP_ALOAD_0
- See Also:
- Constant Field Values
-
OP_ALOAD_1
public static final byte OP_ALOAD_1
- See Also:
- Constant Field Values
-
OP_ALOAD_2
public static final byte OP_ALOAD_2
- See Also:
- Constant Field Values
-
OP_ALOAD_3
public static final byte OP_ALOAD_3
- See Also:
- Constant Field Values
-
OP_IALOAD
public static final byte OP_IALOAD
- See Also:
- Constant Field Values
-
OP_LALOAD
public static final byte OP_LALOAD
- See Also:
- Constant Field Values
-
OP_FALOAD
public static final byte OP_FALOAD
- See Also:
- Constant Field Values
-
OP_DALOAD
public static final byte OP_DALOAD
- See Also:
- Constant Field Values
-
OP_AALOAD
public static final byte OP_AALOAD
- See Also:
- Constant Field Values
-
OP_BALOAD
public static final byte OP_BALOAD
- See Also:
- Constant Field Values
-
OP_CALOAD
public static final byte OP_CALOAD
- See Also:
- Constant Field Values
-
OP_SALOAD
public static final byte OP_SALOAD
- See Also:
- Constant Field Values
-
OP_ISTORE
public static final byte OP_ISTORE
- See Also:
- Constant Field Values
-
OP_LSTORE
public static final byte OP_LSTORE
- See Also:
- Constant Field Values
-
OP_FSTORE
public static final byte OP_FSTORE
- See Also:
- Constant Field Values
-
OP_DSTORE
public static final byte OP_DSTORE
- See Also:
- Constant Field Values
-
OP_ASTORE
public static final byte OP_ASTORE
- See Also:
- Constant Field Values
-
OP_ISTORE_0
public static final byte OP_ISTORE_0
- See Also:
- Constant Field Values
-
OP_ISTORE_1
public static final byte OP_ISTORE_1
- See Also:
- Constant Field Values
-
OP_ISTORE_2
public static final byte OP_ISTORE_2
- See Also:
- Constant Field Values
-
OP_ISTORE_3
public static final byte OP_ISTORE_3
- See Also:
- Constant Field Values
-
OP_LSTORE_0
public static final byte OP_LSTORE_0
- See Also:
- Constant Field Values
-
OP_LSTORE_1
public static final byte OP_LSTORE_1
- See Also:
- Constant Field Values
-
OP_LSTORE_2
public static final byte OP_LSTORE_2
- See Also:
- Constant Field Values
-
OP_LSTORE_3
public static final byte OP_LSTORE_3
- See Also:
- Constant Field Values
-
OP_FSTORE_0
public static final byte OP_FSTORE_0
- See Also:
- Constant Field Values
-
OP_FSTORE_1
public static final byte OP_FSTORE_1
- See Also:
- Constant Field Values
-
OP_FSTORE_2
public static final byte OP_FSTORE_2
- See Also:
- Constant Field Values
-
OP_FSTORE_3
public static final byte OP_FSTORE_3
- See Also:
- Constant Field Values
-
OP_DSTORE_0
public static final byte OP_DSTORE_0
- See Also:
- Constant Field Values
-
OP_DSTORE_1
public static final byte OP_DSTORE_1
- See Also:
- Constant Field Values
-
OP_DSTORE_2
public static final byte OP_DSTORE_2
- See Also:
- Constant Field Values
-
OP_DSTORE_3
public static final byte OP_DSTORE_3
- See Also:
- Constant Field Values
-
OP_ASTORE_0
public static final byte OP_ASTORE_0
- See Also:
- Constant Field Values
-
OP_ASTORE_1
public static final byte OP_ASTORE_1
- See Also:
- Constant Field Values
-
OP_ASTORE_2
public static final byte OP_ASTORE_2
- See Also:
- Constant Field Values
-
OP_ASTORE_3
public static final byte OP_ASTORE_3
- See Also:
- Constant Field Values
-
OP_IASTORE
public static final byte OP_IASTORE
- See Also:
- Constant Field Values
-
OP_LASTORE
public static final byte OP_LASTORE
- See Also:
- Constant Field Values
-
OP_FASTORE
public static final byte OP_FASTORE
- See Also:
- Constant Field Values
-
OP_DASTORE
public static final byte OP_DASTORE
- See Also:
- Constant Field Values
-
OP_AASTORE
public static final byte OP_AASTORE
- See Also:
- Constant Field Values
-
OP_BASTORE
public static final byte OP_BASTORE
- See Also:
- Constant Field Values
-
OP_CASTORE
public static final byte OP_CASTORE
- See Also:
- Constant Field Values
-
OP_SASTORE
public static final byte OP_SASTORE
- See Also:
- Constant Field Values
-
OP_POP
public static final byte OP_POP
- See Also:
- Constant Field Values
-
OP_POP2
public static final byte OP_POP2
- See Also:
- Constant Field Values
-
OP_DUP
public static final byte OP_DUP
- See Also:
- Constant Field Values
-
OP_DUP_X1
public static final byte OP_DUP_X1
- See Also:
- Constant Field Values
-
OP_DUP_X2
public static final byte OP_DUP_X2
- See Also:
- Constant Field Values
-
OP_DUP2
public static final byte OP_DUP2
- See Also:
- Constant Field Values
-
OP_DUP2_X1
public static final byte OP_DUP2_X1
- See Also:
- Constant Field Values
-
OP_DUP2_X2
public static final byte OP_DUP2_X2
- See Also:
- Constant Field Values
-
OP_SWAP
public static final byte OP_SWAP
- See Also:
- Constant Field Values
-
OP_IADD
public static final byte OP_IADD
- See Also:
- Constant Field Values
-
OP_LADD
public static final byte OP_LADD
- See Also:
- Constant Field Values
-
OP_FADD
public static final byte OP_FADD
- See Also:
- Constant Field Values
-
OP_DADD
public static final byte OP_DADD
- See Also:
- Constant Field Values
-
OP_ISUB
public static final byte OP_ISUB
- See Also:
- Constant Field Values
-
OP_LSUB
public static final byte OP_LSUB
- See Also:
- Constant Field Values
-
OP_FSUB
public static final byte OP_FSUB
- See Also:
- Constant Field Values
-
OP_DSUB
public static final byte OP_DSUB
- See Also:
- Constant Field Values
-
OP_IMUL
public static final byte OP_IMUL
- See Also:
- Constant Field Values
-
OP_LMUL
public static final byte OP_LMUL
- See Also:
- Constant Field Values
-
OP_FMUL
public static final byte OP_FMUL
- See Also:
- Constant Field Values
-
OP_DMUL
public static final byte OP_DMUL
- See Also:
- Constant Field Values
-
OP_IDIV
public static final byte OP_IDIV
- See Also:
- Constant Field Values
-
OP_LDIV
public static final byte OP_LDIV
- See Also:
- Constant Field Values
-
OP_FDIV
public static final byte OP_FDIV
- See Also:
- Constant Field Values
-
OP_DDIV
public static final byte OP_DDIV
- See Also:
- Constant Field Values
-
OP_IREM
public static final byte OP_IREM
- See Also:
- Constant Field Values
-
OP_LREM
public static final byte OP_LREM
- See Also:
- Constant Field Values
-
OP_FREM
public static final byte OP_FREM
- See Also:
- Constant Field Values
-
OP_DREM
public static final byte OP_DREM
- See Also:
- Constant Field Values
-
OP_INEG
public static final byte OP_INEG
- See Also:
- Constant Field Values
-
OP_LNEG
public static final byte OP_LNEG
- See Also:
- Constant Field Values
-
OP_FNEG
public static final byte OP_FNEG
- See Also:
- Constant Field Values
-
OP_DNEG
public static final byte OP_DNEG
- See Also:
- Constant Field Values
-
OP_ISHL
public static final byte OP_ISHL
- See Also:
- Constant Field Values
-
OP_LSHL
public static final byte OP_LSHL
- See Also:
- Constant Field Values
-
OP_ISHR
public static final byte OP_ISHR
- See Also:
- Constant Field Values
-
OP_LSHR
public static final byte OP_LSHR
- See Also:
- Constant Field Values
-
OP_IUSHR
public static final byte OP_IUSHR
- See Also:
- Constant Field Values
-
OP_LUSHR
public static final byte OP_LUSHR
- See Also:
- Constant Field Values
-
OP_IAND
public static final byte OP_IAND
- See Also:
- Constant Field Values
-
OP_LAND
public static final byte OP_LAND
- See Also:
- Constant Field Values
-
OP_IOR
public static final byte OP_IOR
- See Also:
- Constant Field Values
-
OP_LOR
public static final byte OP_LOR
- See Also:
- Constant Field Values
-
OP_IXOR
public static final byte OP_IXOR
- See Also:
- Constant Field Values
-
OP_LXOR
public static final byte OP_LXOR
- See Also:
- Constant Field Values
-
OP_IINC
public static final byte OP_IINC
- See Also:
- Constant Field Values
-
OP_I2L
public static final byte OP_I2L
- See Also:
- Constant Field Values
-
OP_I2F
public static final byte OP_I2F
- See Also:
- Constant Field Values
-
OP_I2D
public static final byte OP_I2D
- See Also:
- Constant Field Values
-
OP_L2I
public static final byte OP_L2I
- See Also:
- Constant Field Values
-
OP_L2F
public static final byte OP_L2F
- See Also:
- Constant Field Values
-
OP_L2D
public static final byte OP_L2D
- See Also:
- Constant Field Values
-
OP_F2I
public static final byte OP_F2I
- See Also:
- Constant Field Values
-
OP_F2L
public static final byte OP_F2L
- See Also:
- Constant Field Values
-
OP_F2D
public static final byte OP_F2D
- See Also:
- Constant Field Values
-
OP_D2I
public static final byte OP_D2I
- See Also:
- Constant Field Values
-
OP_D2L
public static final byte OP_D2L
- See Also:
- Constant Field Values
-
OP_D2F
public static final byte OP_D2F
- See Also:
- Constant Field Values
-
OP_I2B
public static final byte OP_I2B
- See Also:
- Constant Field Values
-
OP_I2C
public static final byte OP_I2C
- See Also:
- Constant Field Values
-
OP_I2S
public static final byte OP_I2S
- See Also:
- Constant Field Values
-
OP_LCMP
public static final byte OP_LCMP
- See Also:
- Constant Field Values
-
OP_FCMPL
public static final byte OP_FCMPL
- See Also:
- Constant Field Values
-
OP_FCMPG
public static final byte OP_FCMPG
- See Also:
- Constant Field Values
-
OP_DCMPL
public static final byte OP_DCMPL
- See Also:
- Constant Field Values
-
OP_DCMPG
public static final byte OP_DCMPG
- See Also:
- Constant Field Values
-
OP_IFEQ
public static final byte OP_IFEQ
- See Also:
- Constant Field Values
-
OP_IFNE
public static final byte OP_IFNE
- See Also:
- Constant Field Values
-
OP_IFLT
public static final byte OP_IFLT
- See Also:
- Constant Field Values
-
OP_IFGE
public static final byte OP_IFGE
- See Also:
- Constant Field Values
-
OP_IFGT
public static final byte OP_IFGT
- See Also:
- Constant Field Values
-
OP_IFLE
public static final byte OP_IFLE
- See Also:
- Constant Field Values
-
OP_IFICMPEQ
public static final byte OP_IFICMPEQ
- See Also:
- Constant Field Values
-
OP_IFICMPNE
public static final byte OP_IFICMPNE
- See Also:
- Constant Field Values
-
OP_IFICMPLT
public static final byte OP_IFICMPLT
- See Also:
- Constant Field Values
-
OP_IFICMPGE
public static final byte OP_IFICMPGE
- See Also:
- Constant Field Values
-
OP_IFICMPGT
public static final byte OP_IFICMPGT
- See Also:
- Constant Field Values
-
OP_IFICMPLE
public static final byte OP_IFICMPLE
- See Also:
- Constant Field Values
-
OP_IFACMPEQ
public static final byte OP_IFACMPEQ
- See Also:
- Constant Field Values
-
OP_IFACMPNE
public static final byte OP_IFACMPNE
- See Also:
- Constant Field Values
-
OP_GOTO
public static final byte OP_GOTO
- See Also:
- Constant Field Values
-
OP_JSR
public static final byte OP_JSR
- See Also:
- Constant Field Values
-
OP_RET
public static final byte OP_RET
- See Also:
- Constant Field Values
-
OP_TABLESWITCH
public static final byte OP_TABLESWITCH
- See Also:
- Constant Field Values
-
OP_LOOKUPSWITCH
public static final byte OP_LOOKUPSWITCH
- See Also:
- Constant Field Values
-
OP_IRETURN
public static final byte OP_IRETURN
- See Also:
- Constant Field Values
-
OP_LRETURN
public static final byte OP_LRETURN
- See Also:
- Constant Field Values
-
OP_FRETURN
public static final byte OP_FRETURN
- See Also:
- Constant Field Values
-
OP_DRETURN
public static final byte OP_DRETURN
- See Also:
- Constant Field Values
-
OP_ARETURN
public static final byte OP_ARETURN
- See Also:
- Constant Field Values
-
OP_RETURN
public static final byte OP_RETURN
- See Also:
- Constant Field Values
-
OP_GETSTATIC
public static final byte OP_GETSTATIC
- See Also:
- Constant Field Values
-
OP_PUTSTATIC
public static final byte OP_PUTSTATIC
- See Also:
- Constant Field Values
-
OP_GETFIELD
public static final byte OP_GETFIELD
- See Also:
- Constant Field Values
-
OP_PUTFIELD
public static final byte OP_PUTFIELD
- See Also:
- Constant Field Values
-
OP_INVOKEVIRTUAL
public static final byte OP_INVOKEVIRTUAL
- See Also:
- Constant Field Values
-
OP_INVOKESPECIAL
public static final byte OP_INVOKESPECIAL
- See Also:
- Constant Field Values
-
OP_INVOKESTATIC
public static final byte OP_INVOKESTATIC
- See Also:
- Constant Field Values
-
OP_INVOKEINTERFACE
public static final byte OP_INVOKEINTERFACE
- See Also:
- Constant Field Values
-
OP_INVOKEDYNAMIC
public static final byte OP_INVOKEDYNAMIC
- See Also:
- Constant Field Values
-
OP_NEW
public static final byte OP_NEW
- See Also:
- Constant Field Values
-
OP_NEWARRAY
public static final byte OP_NEWARRAY
- See Also:
- Constant Field Values
-
OP_ANEWARRAY
public static final byte OP_ANEWARRAY
- See Also:
- Constant Field Values
-
OP_ARRAYLENGTH
public static final byte OP_ARRAYLENGTH
- See Also:
- Constant Field Values
-
OP_ATHROW
public static final byte OP_ATHROW
- See Also:
- Constant Field Values
-
OP_CHECKCAST
public static final byte OP_CHECKCAST
- See Also:
- Constant Field Values
-
OP_INSTANCEOF
public static final byte OP_INSTANCEOF
- See Also:
- Constant Field Values
-
OP_MONITORENTER
public static final byte OP_MONITORENTER
- See Also:
- Constant Field Values
-
OP_MONITOREXIT
public static final byte OP_MONITOREXIT
- See Also:
- Constant Field Values
-
OP_WIDE
public static final byte OP_WIDE
- See Also:
- Constant Field Values
-
OP_MULTIANEWARRAY
public static final byte OP_MULTIANEWARRAY
- See Also:
- Constant Field Values
-
OP_IFNULL
public static final byte OP_IFNULL
- See Also:
- Constant Field Values
-
OP_IFNONNULL
public static final byte OP_IFNONNULL
- See Also:
- Constant Field Values
-
OP_GOTO_W
public static final byte OP_GOTO_W
- See Also:
- Constant Field Values
-
OP_JSR_W
public static final byte OP_JSR_W
- See Also:
- Constant Field Values
-
NAMES
public static final java.lang.String[] NAMES
-
ARRAY_T_BOOLEAN
public static final byte ARRAY_T_BOOLEAN
- See Also:
- Constant Field Values
-
ARRAY_T_CHAR
public static final byte ARRAY_T_CHAR
- See Also:
- Constant Field Values
-
ARRAY_T_FLOAT
public static final byte ARRAY_T_FLOAT
- See Also:
- Constant Field Values
-
ARRAY_T_DOUBLE
public static final byte ARRAY_T_DOUBLE
- See Also:
- Constant Field Values
-
ARRAY_T_BYTE
public static final byte ARRAY_T_BYTE
- See Also:
- Constant Field Values
-
ARRAY_T_SHORT
public static final byte ARRAY_T_SHORT
- See Also:
- Constant Field Values
-
ARRAY_T_INT
public static final byte ARRAY_T_INT
- See Also:
- Constant Field Values
-
ARRAY_T_LONG
public static final byte ARRAY_T_LONG
- See Also:
- Constant Field Values
-
opcode
public byte opcode
-
-
Method Detail
-
equals
public abstract boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
canonicalOpcode
public byte canonicalOpcode()
Returns the canonical opcode of this instruction, i.e. typically the opcode whose extension has been removed.
-
actualOpcode
public byte actualOpcode()
Returns the actual opcode of this instruction, i.e. the opcode that is stored in the bytecode.
-
shrink
public abstract Instruction shrink()
Shrinks this instruction to its shortest possible form.- Returns:
- this instruction.
-
write
public final void write(CodeAttribute codeAttribute, int offset)
Writes the Instruction at the given offset in the given code attribute.
-
write
public void write(byte[] code, int offset)
Writes the Instruction at the given offset in the given code array.
-
isWide
protected boolean isWide()
Returns whether the instruction is wide, i.e. preceded by a wide opcode. With the current specifications, only variable instructions can be wide.
-
readInfo
protected abstract void readInfo(byte[] code, int offset)
Reads the data following the instruction opcode.
-
writeInfo
protected abstract void writeInfo(byte[] code, int offset)
Writes data following the instruction opcode.
-
length
public abstract int length(int offset)
Returns the length in bytes of the instruction.
-
accept
public abstract void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)
Accepts the given visitor.
-
toString
public java.lang.String toString(Clazz clazz, int offset)
Returns a description of the instruction, at the given offset.
-
toString
public java.lang.String toString(int offset)
Returns a description of the instruction, at the given offset.
-
getName
public java.lang.String getName()
Returns the name of the instruction.
-
mayThrowExceptions
public boolean mayThrowExceptions()
Returns whether the instruction may conservatively throw exceptions.
-
mayInstanceThrowExceptions
public boolean mayInstanceThrowExceptions(Clazz clazz)
Returns whether a particular instance of an instruction may throw exceptions.
-
isCategory2
public boolean isCategory2()
Returns whether the instruction is a Category 2 instruction. This means that it operates on long or double arguments.
-
stackPopCount
public int stackPopCount(Clazz clazz)
Returns the number of entries popped from the stack during the execution of the instruction.
-
stackPushCount
public int stackPushCount(Clazz clazz)
Returns the number of entries pushed onto the stack during the execution of the instruction.
-
stackEntryIndexBefore
public int stackEntryIndexBefore(Clazz clazz, int stackEntryIndexAfter)
Returns the stack entry index from which the specified stack entry is copied by a dup/swap/checkcast instruction, or -1 otherwise. Stack entry indices are counted from the top of the stack.- checkcast: after: 0 (before: 0 ) -- not anymore
- dup: after: 0 0 (before: 0 )
- dup_x1: after: 0 1 0 (before: 1 0 )
- dup_x2: after: 0 2 1 0 (before: 2 1 0 )
- dup2: after: 1 0 1 0 (before: 1 0 )
- dup2_x1: after: 1 0 2 1 0 (before: 2 1 0 )
- dup2_x2: after: 1 0 3 2 1 0 (before: 3 2 1 0)
-
readByte
protected static int readByte(byte[] code, int offset)
-
readShort
protected static int readShort(byte[] code, int offset)
-
readInt
protected static int readInt(byte[] code, int offset)
-
readValue
protected static int readValue(byte[] code, int offset, int valueSize)
-
readSignedByte
protected static int readSignedByte(byte[] code, int offset)
-
readSignedShort
protected static int readSignedShort(byte[] code, int offset)
-
readSignedValue
protected static int readSignedValue(byte[] code, int offset, int valueSize)
-
writeByte
protected static void writeByte(byte[] code, int offset, int value)
-
writeShort
protected static void writeShort(byte[] code, int offset, int value)
-
writeInt
protected static void writeInt(byte[] code, int offset, int value)
-
writeValue
protected static void writeValue(byte[] code, int offset, int value, int valueSize)
-
writeSignedByte
protected static void writeSignedByte(byte[] code, int offset, int value)
-
writeSignedShort
protected static void writeSignedShort(byte[] code, int offset, int value)
-
writeSignedValue
protected static void writeSignedValue(byte[] code, int offset, int value, int valueSize)
-
-