org.apache.bcel.generic

Interface InstructionConstants

public interface InstructionConstants

This interface contains shareable instruction objects. In order to save memory you can use some instructions multiply, since they have an immutable state and are directly derived from Instruction. I.e. they have no instance fields that could be changed. Since some of these instructions like ICONST_0 occur very frequently this can save a lot of time and space. This feature is an adaptation of the FlyWeight design pattern, we just use an array instead of a factory. The Instructions can also accessed directly under their names, so it's possible to write il.append(Instruction.ICONST_0);
Nested Class Summary
static classInstructionConstants.Clinit
Field Summary
static ArrayInstructionAALOAD
static ArrayInstructionAASTORE
static InstructionACONST_NULL
static LocalVariableInstructionALOAD_0
static LocalVariableInstructionALOAD_1
static LocalVariableInstructionALOAD_2
static ReturnInstructionARETURN
static InstructionARRAYLENGTH
static LocalVariableInstructionASTORE_0
static LocalVariableInstructionASTORE_1
static LocalVariableInstructionASTORE_2
static InstructionATHROW
static InstructionConstants.Clinitbla
Interfaces may have no static initializers, so we simulate this with an inner class.
static ArrayInstructionBALOAD
static ArrayInstructionBASTORE
static ArrayInstructionCALOAD
static ArrayInstructionCASTORE
static ConversionInstructionD2F
static ConversionInstructionD2I
static ConversionInstructionD2L
static ArithmeticInstructionDADD
static ArrayInstructionDALOAD
static ArrayInstructionDASTORE
static InstructionDCMPG
static InstructionDCMPL
static InstructionDCONST_0
static InstructionDCONST_1
static ArithmeticInstructionDDIV
static ArithmeticInstructionDMUL
static ArithmeticInstructionDNEG
static ArithmeticInstructionDREM
static ReturnInstructionDRETURN
static ArithmeticInstructionDSUB
static StackInstructionDUP
static StackInstructionDUP2
static StackInstructionDUP2_X1
static StackInstructionDUP2_X2
static StackInstructionDUP_X1
static StackInstructionDUP_X2
static ConversionInstructionF2D
static ConversionInstructionF2I
static ConversionInstructionF2L
static ArithmeticInstructionFADD
static ArrayInstructionFALOAD
static ArrayInstructionFASTORE
static InstructionFCMPG
static InstructionFCMPL
static InstructionFCONST_0
static InstructionFCONST_1
static InstructionFCONST_2
static ArithmeticInstructionFDIV
static ArithmeticInstructionFMUL
static ArithmeticInstructionFNEG
static ArithmeticInstructionFREM
static ReturnInstructionFRETURN
static ArithmeticInstructionFSUB
static ConversionInstructionI2B
static ConversionInstructionI2C
static ConversionInstructionI2D
static ConversionInstructionI2F
static ConversionInstructionI2L
static ConversionInstructionI2S
static ArithmeticInstructionIADD
static ArrayInstructionIALOAD
static ArithmeticInstructionIAND
static ArrayInstructionIASTORE
static InstructionICONST_0
static InstructionICONST_1
static InstructionICONST_2
static InstructionICONST_3
static InstructionICONST_4
static InstructionICONST_5
static InstructionICONST_M1
static ArithmeticInstructionIDIV
static LocalVariableInstructionILOAD_0
static LocalVariableInstructionILOAD_1
static LocalVariableInstructionILOAD_2
static ArithmeticInstructionIMUL
static ArithmeticInstructionINEG
static Instruction[]INSTRUCTIONS
Get object via its opcode, for immutable instructions like branch instructions entries are set to null.
static ArithmeticInstructionIOR
static ArithmeticInstructionIREM
static ReturnInstructionIRETURN
static ArithmeticInstructionISHL
static ArithmeticInstructionISHR
static LocalVariableInstructionISTORE_0
static LocalVariableInstructionISTORE_1
static LocalVariableInstructionISTORE_2
static ArithmeticInstructionISUB
static ArithmeticInstructionIUSHR
static ArithmeticInstructionIXOR
static ConversionInstructionL2D
static ConversionInstructionL2F
static ConversionInstructionL2I
static ArithmeticInstructionLADD
static ArrayInstructionLALOAD
static ArithmeticInstructionLAND
static ArrayInstructionLASTORE
static InstructionLCMP
static InstructionLCONST_0
static InstructionLCONST_1
static ArithmeticInstructionLDIV
static ArithmeticInstructionLMUL
static ArithmeticInstructionLNEG
static ArithmeticInstructionLOR
static ArithmeticInstructionLREM
static ReturnInstructionLRETURN
static ArithmeticInstructionLSHL
static ArithmeticInstructionLSHR
static ArithmeticInstructionLSUB
static ArithmeticInstructionLUSHR
static ArithmeticInstructionLXOR
static InstructionMONITORENTER
static InstructionMONITOREXIT
static InstructionNOP
Predefined instruction objects
static StackInstructionPOP
static StackInstructionPOP2
static ReturnInstructionRETURN
static ArrayInstructionSALOAD
static ArrayInstructionSASTORE
static StackInstructionSWAP
static LocalVariableInstructionTHIS
You can use these constants in multiple places safely, if you can guarantee that you will never alter their internal values, e.g. call setIndex().

Field Detail

AALOAD

public static final ArrayInstruction AALOAD

AASTORE

public static final ArrayInstruction AASTORE

ACONST_NULL

public static final Instruction ACONST_NULL

ALOAD_0

public static final LocalVariableInstruction ALOAD_0

ALOAD_1

public static final LocalVariableInstruction ALOAD_1

ALOAD_2

public static final LocalVariableInstruction ALOAD_2

ARETURN

public static final ReturnInstruction ARETURN

ARRAYLENGTH

public static final Instruction ARRAYLENGTH

ASTORE_0

public static final LocalVariableInstruction ASTORE_0

ASTORE_1

public static final LocalVariableInstruction ASTORE_1

ASTORE_2

public static final LocalVariableInstruction ASTORE_2

ATHROW

public static final Instruction ATHROW

bla

public static final InstructionConstants.Clinit bla
Interfaces may have no static initializers, so we simulate this with an inner class.

BALOAD

public static final ArrayInstruction BALOAD

BASTORE

public static final ArrayInstruction BASTORE

CALOAD

public static final ArrayInstruction CALOAD

CASTORE

public static final ArrayInstruction CASTORE

D2F

public static final ConversionInstruction D2F

D2I

public static final ConversionInstruction D2I

D2L

public static final ConversionInstruction D2L

DADD

public static final ArithmeticInstruction DADD

DALOAD

public static final ArrayInstruction DALOAD

DASTORE

public static final ArrayInstruction DASTORE

DCMPG

public static final Instruction DCMPG

DCMPL

public static final Instruction DCMPL

DCONST_0

public static final Instruction DCONST_0

DCONST_1

public static final Instruction DCONST_1

DDIV

public static final ArithmeticInstruction DDIV

DMUL

public static final ArithmeticInstruction DMUL

DNEG

public static final ArithmeticInstruction DNEG

DREM

public static final ArithmeticInstruction DREM

DRETURN

public static final ReturnInstruction DRETURN

DSUB

public static final ArithmeticInstruction DSUB

DUP

public static final StackInstruction DUP

DUP2

public static final StackInstruction DUP2

DUP2_X1

public static final StackInstruction DUP2_X1

DUP2_X2

public static final StackInstruction DUP2_X2

DUP_X1

public static final StackInstruction DUP_X1

DUP_X2

public static final StackInstruction DUP_X2

F2D

public static final ConversionInstruction F2D

F2I

public static final ConversionInstruction F2I

F2L

public static final ConversionInstruction F2L

FADD

public static final ArithmeticInstruction FADD

FALOAD

public static final ArrayInstruction FALOAD

FASTORE

public static final ArrayInstruction FASTORE

FCMPG

public static final Instruction FCMPG

FCMPL

public static final Instruction FCMPL

FCONST_0

public static final Instruction FCONST_0

FCONST_1

public static final Instruction FCONST_1

FCONST_2

public static final Instruction FCONST_2

FDIV

public static final ArithmeticInstruction FDIV

FMUL

public static final ArithmeticInstruction FMUL

FNEG

public static final ArithmeticInstruction FNEG

FREM

public static final ArithmeticInstruction FREM

FRETURN

public static final ReturnInstruction FRETURN

FSUB

public static final ArithmeticInstruction FSUB

I2B

public static final ConversionInstruction I2B

I2C

public static final ConversionInstruction I2C

I2D

public static final ConversionInstruction I2D

I2F

public static final ConversionInstruction I2F

I2L

public static final ConversionInstruction I2L

I2S

public static final ConversionInstruction I2S

IADD

public static final ArithmeticInstruction IADD

IALOAD

public static final ArrayInstruction IALOAD

IAND

public static final ArithmeticInstruction IAND

IASTORE

public static final ArrayInstruction IASTORE

ICONST_0

public static final Instruction ICONST_0

ICONST_1

public static final Instruction ICONST_1

ICONST_2

public static final Instruction ICONST_2

ICONST_3

public static final Instruction ICONST_3

ICONST_4

public static final Instruction ICONST_4

ICONST_5

public static final Instruction ICONST_5

ICONST_M1

public static final Instruction ICONST_M1

IDIV

public static final ArithmeticInstruction IDIV

ILOAD_0

public static final LocalVariableInstruction ILOAD_0

ILOAD_1

public static final LocalVariableInstruction ILOAD_1

ILOAD_2

public static final LocalVariableInstruction ILOAD_2

IMUL

public static final ArithmeticInstruction IMUL

INEG

public static final ArithmeticInstruction INEG

INSTRUCTIONS

public static final Instruction[] INSTRUCTIONS
Get object via its opcode, for immutable instructions like branch instructions entries are set to null.

IOR

public static final ArithmeticInstruction IOR

IREM

public static final ArithmeticInstruction IREM

IRETURN

public static final ReturnInstruction IRETURN

ISHL

public static final ArithmeticInstruction ISHL

ISHR

public static final ArithmeticInstruction ISHR

ISTORE_0

public static final LocalVariableInstruction ISTORE_0

ISTORE_1

public static final LocalVariableInstruction ISTORE_1

ISTORE_2

public static final LocalVariableInstruction ISTORE_2

ISUB

public static final ArithmeticInstruction ISUB

IUSHR

public static final ArithmeticInstruction IUSHR

IXOR

public static final ArithmeticInstruction IXOR

L2D

public static final ConversionInstruction L2D

L2F

public static final ConversionInstruction L2F

L2I

public static final ConversionInstruction L2I

LADD

public static final ArithmeticInstruction LADD

LALOAD

public static final ArrayInstruction LALOAD

LAND

public static final ArithmeticInstruction LAND

LASTORE

public static final ArrayInstruction LASTORE

LCMP

public static final Instruction LCMP

LCONST_0

public static final Instruction LCONST_0

LCONST_1

public static final Instruction LCONST_1

LDIV

public static final ArithmeticInstruction LDIV

LMUL

public static final ArithmeticInstruction LMUL

LNEG

public static final ArithmeticInstruction LNEG

LOR

public static final ArithmeticInstruction LOR

LREM

public static final ArithmeticInstruction LREM

LRETURN

public static final ReturnInstruction LRETURN

LSHL

public static final ArithmeticInstruction LSHL

LSHR

public static final ArithmeticInstruction LSHR

LSUB

public static final ArithmeticInstruction LSUB

LUSHR

public static final ArithmeticInstruction LUSHR

LXOR

public static final ArithmeticInstruction LXOR

MONITORENTER

public static final Instruction MONITORENTER

MONITOREXIT

public static final Instruction MONITOREXIT

NOP

public static final Instruction NOP
Predefined instruction objects

POP

public static final StackInstruction POP

POP2

public static final StackInstruction POP2

RETURN

public static final ReturnInstruction RETURN

SALOAD

public static final ArrayInstruction SALOAD

SASTORE

public static final ArrayInstruction SASTORE

SWAP

public static final StackInstruction SWAP

THIS

public static final LocalVariableInstruction THIS
You can use these constants in multiple places safely, if you can guarantee that you will never alter their internal values, e.g. call setIndex().