Package org.apache.bcel.generic
Class InstructionConst
- java.lang.Object
-
- org.apache.bcel.generic.InstructionConst
-
public final class InstructionConst extends Object
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);
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Instruction
getInstruction(int index)
Gets the Instruction.
-
-
-
Field Detail
-
NOP
public static final Instruction NOP
Predefined instruction objects
-
ACONST_NULL
public static final Instruction ACONST_NULL
-
ICONST_M1
public static final Instruction ICONST_M1
-
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
-
LCONST_0
public static final Instruction LCONST_0
-
LCONST_1
public static final Instruction LCONST_1
-
FCONST_0
public static final Instruction FCONST_0
-
FCONST_1
public static final Instruction FCONST_1
-
FCONST_2
public static final Instruction FCONST_2
-
DCONST_0
public static final Instruction DCONST_0
-
DCONST_1
public static final Instruction DCONST_1
-
IALOAD
public static final ArrayInstruction IALOAD
-
LALOAD
public static final ArrayInstruction LALOAD
-
FALOAD
public static final ArrayInstruction FALOAD
-
DALOAD
public static final ArrayInstruction DALOAD
-
AALOAD
public static final ArrayInstruction AALOAD
-
BALOAD
public static final ArrayInstruction BALOAD
-
CALOAD
public static final ArrayInstruction CALOAD
-
SALOAD
public static final ArrayInstruction SALOAD
-
IASTORE
public static final ArrayInstruction IASTORE
-
LASTORE
public static final ArrayInstruction LASTORE
-
FASTORE
public static final ArrayInstruction FASTORE
-
DASTORE
public static final ArrayInstruction DASTORE
-
AASTORE
public static final ArrayInstruction AASTORE
-
BASTORE
public static final ArrayInstruction BASTORE
-
CASTORE
public static final ArrayInstruction CASTORE
-
SASTORE
public static final ArrayInstruction SASTORE
-
POP
public static final StackInstruction POP
-
POP2
public static final StackInstruction POP2
-
DUP
public static final StackInstruction DUP
-
DUP_X1
public static final StackInstruction DUP_X1
-
DUP_X2
public static final StackInstruction DUP_X2
-
DUP2
public static final StackInstruction DUP2
-
DUP2_X1
public static final StackInstruction DUP2_X1
-
DUP2_X2
public static final StackInstruction DUP2_X2
-
SWAP
public static final StackInstruction SWAP
-
IADD
public static final ArithmeticInstruction IADD
-
LADD
public static final ArithmeticInstruction LADD
-
FADD
public static final ArithmeticInstruction FADD
-
DADD
public static final ArithmeticInstruction DADD
-
ISUB
public static final ArithmeticInstruction ISUB
-
LSUB
public static final ArithmeticInstruction LSUB
-
FSUB
public static final ArithmeticInstruction FSUB
-
DSUB
public static final ArithmeticInstruction DSUB
-
IMUL
public static final ArithmeticInstruction IMUL
-
LMUL
public static final ArithmeticInstruction LMUL
-
FMUL
public static final ArithmeticInstruction FMUL
-
DMUL
public static final ArithmeticInstruction DMUL
-
IDIV
public static final ArithmeticInstruction IDIV
-
LDIV
public static final ArithmeticInstruction LDIV
-
FDIV
public static final ArithmeticInstruction FDIV
-
DDIV
public static final ArithmeticInstruction DDIV
-
IREM
public static final ArithmeticInstruction IREM
-
LREM
public static final ArithmeticInstruction LREM
-
FREM
public static final ArithmeticInstruction FREM
-
DREM
public static final ArithmeticInstruction DREM
-
INEG
public static final ArithmeticInstruction INEG
-
LNEG
public static final ArithmeticInstruction LNEG
-
FNEG
public static final ArithmeticInstruction FNEG
-
DNEG
public static final ArithmeticInstruction DNEG
-
ISHL
public static final ArithmeticInstruction ISHL
-
LSHL
public static final ArithmeticInstruction LSHL
-
ISHR
public static final ArithmeticInstruction ISHR
-
LSHR
public static final ArithmeticInstruction LSHR
-
IUSHR
public static final ArithmeticInstruction IUSHR
-
LUSHR
public static final ArithmeticInstruction LUSHR
-
IAND
public static final ArithmeticInstruction IAND
-
LAND
public static final ArithmeticInstruction LAND
-
IOR
public static final ArithmeticInstruction IOR
-
LOR
public static final ArithmeticInstruction LOR
-
IXOR
public static final ArithmeticInstruction IXOR
-
LXOR
public static final ArithmeticInstruction LXOR
-
I2L
public static final ConversionInstruction I2L
-
I2F
public static final ConversionInstruction I2F
-
I2D
public static final ConversionInstruction I2D
-
L2I
public static final ConversionInstruction L2I
-
L2F
public static final ConversionInstruction L2F
-
L2D
public static final ConversionInstruction L2D
-
F2I
public static final ConversionInstruction F2I
-
F2L
public static final ConversionInstruction F2L
-
F2D
public static final ConversionInstruction F2D
-
D2I
public static final ConversionInstruction D2I
-
D2L
public static final ConversionInstruction D2L
-
D2F
public static final ConversionInstruction D2F
-
I2B
public static final ConversionInstruction I2B
-
I2C
public static final ConversionInstruction I2C
-
I2S
public static final ConversionInstruction I2S
-
LCMP
public static final Instruction LCMP
-
FCMPL
public static final Instruction FCMPL
-
FCMPG
public static final Instruction FCMPG
-
DCMPL
public static final Instruction DCMPL
-
DCMPG
public static final Instruction DCMPG
-
IRETURN
public static final ReturnInstruction IRETURN
-
LRETURN
public static final ReturnInstruction LRETURN
-
FRETURN
public static final ReturnInstruction FRETURN
-
DRETURN
public static final ReturnInstruction DRETURN
-
ARETURN
public static final ReturnInstruction ARETURN
-
RETURN
public static final ReturnInstruction RETURN
-
ARRAYLENGTH
public static final Instruction ARRAYLENGTH
-
ATHROW
public static final Instruction ATHROW
-
MONITORENTER
public static final Instruction MONITORENTER
-
MONITOREXIT
public static final Instruction MONITOREXIT
-
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().
-
ALOAD_0
public static final LocalVariableInstruction ALOAD_0
-
ALOAD_1
public static final LocalVariableInstruction ALOAD_1
-
ALOAD_2
public static final LocalVariableInstruction ALOAD_2
-
ILOAD_0
public static final LocalVariableInstruction ILOAD_0
-
ILOAD_1
public static final LocalVariableInstruction ILOAD_1
-
ILOAD_2
public static final LocalVariableInstruction ILOAD_2
-
ASTORE_0
public static final LocalVariableInstruction ASTORE_0
-
ASTORE_1
public static final LocalVariableInstruction ASTORE_1
-
ASTORE_2
public static final LocalVariableInstruction ASTORE_2
-
ISTORE_0
public static final LocalVariableInstruction ISTORE_0
-
ISTORE_1
public static final LocalVariableInstruction ISTORE_1
-
ISTORE_2
public static final LocalVariableInstruction ISTORE_2
-
-
Method Detail
-
getInstruction
public static Instruction getInstruction(int index)
Gets the Instruction.- Parameters:
index
- the index, e.g.Const.RETURN
- Returns:
- the entry from the private INSTRUCTIONS table
-
-