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);
| Modifier and Type | Field and Description |
|---|---|
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final Instruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final ReturnInstruction | |
| public static final Instruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final Instruction | |
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ReturnInstruction | |
| public static final ArithmeticInstruction | |
| public static final StackInstruction | |
| public static final StackInstruction | |
| public static final StackInstruction | |
| public static final StackInstruction | |
| public static final StackInstruction | |
| public static final StackInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ReturnInstruction | |
| public static final ArithmeticInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArrayInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArrayInstruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final ArithmeticInstruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| pack-priv static final Instruction[] | INSTRUCTIONS
Gets object via its opcode, for immutable instructions like branch instructions entries are set to null. |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ReturnInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final LocalVariableInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ConversionInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArrayInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArrayInstruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ReturnInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final ArithmeticInstruction | |
| public static final Instruction | |
| public static final Instruction | |
| public static final Instruction | NOP
Predefined instruction objects. |
| public static final StackInstruction | |
| public static final StackInstruction | |
| public static final ReturnInstruction | |
| public static final ArrayInstruction | |
| public static final ArrayInstruction | |
| public static final StackInstruction | |
| 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(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Instruction | Returns: the entry from the private INSTRUCTIONS tablethe index, e.g. index)Const#RETURNGets the Instruction. |
| AALOAD | back to summary |
|---|---|
| public static final ArrayInstruction AALOAD | |
| AASTORE | back to summary |
|---|---|
| public static final ArrayInstruction AASTORE | |
| ACONST_NULL | back to summary |
|---|---|
| public static final Instruction ACONST_NULL | |
| ALOAD_0 | back to summary |
|---|---|
| public static final LocalVariableInstruction ALOAD_0 | |
| ALOAD_1 | back to summary |
|---|---|
| public static final LocalVariableInstruction ALOAD_1 | |
| ALOAD_2 | back to summary |
|---|---|
| public static final LocalVariableInstruction ALOAD_2 | |
| ARETURN | back to summary |
|---|---|
| public static final ReturnInstruction ARETURN | |
| ARRAYLENGTH | back to summary |
|---|---|
| public static final Instruction ARRAYLENGTH | |
| ASTORE_0 | back to summary |
|---|---|
| public static final LocalVariableInstruction ASTORE_0 | |
| ASTORE_1 | back to summary |
|---|---|
| public static final LocalVariableInstruction ASTORE_1 | |
| ASTORE_2 | back to summary |
|---|---|
| public static final LocalVariableInstruction ASTORE_2 | |
| ATHROW | back to summary |
|---|---|
| public static final Instruction ATHROW | |
| BALOAD | back to summary |
|---|---|
| public static final ArrayInstruction BALOAD | |
| BASTORE | back to summary |
|---|---|
| public static final ArrayInstruction BASTORE | |
| CALOAD | back to summary |
|---|---|
| public static final ArrayInstruction CALOAD | |
| CASTORE | back to summary |
|---|---|
| public static final ArrayInstruction CASTORE | |
| D2F | back to summary |
|---|---|
| public static final ConversionInstruction D2F | |
| D2I | back to summary |
|---|---|
| public static final ConversionInstruction D2I | |
| D2L | back to summary |
|---|---|
| public static final ConversionInstruction D2L | |
| DADD | back to summary |
|---|---|
| public static final ArithmeticInstruction DADD | |
| DALOAD | back to summary |
|---|---|
| public static final ArrayInstruction DALOAD | |
| DASTORE | back to summary |
|---|---|
| public static final ArrayInstruction DASTORE | |
| DCMPG | back to summary |
|---|---|
| public static final Instruction DCMPG | |
| DCMPL | back to summary |
|---|---|
| public static final Instruction DCMPL | |
| DCONST_0 | back to summary |
|---|---|
| public static final Instruction DCONST_0 | |
| DCONST_1 | back to summary |
|---|---|
| public static final Instruction DCONST_1 | |
| DDIV | back to summary |
|---|---|
| public static final ArithmeticInstruction DDIV | |
| DMUL | back to summary |
|---|---|
| public static final ArithmeticInstruction DMUL | |
| DNEG | back to summary |
|---|---|
| public static final ArithmeticInstruction DNEG | |
| DREM | back to summary |
|---|---|
| public static final ArithmeticInstruction DREM | |
| DRETURN | back to summary |
|---|---|
| public static final ReturnInstruction DRETURN | |
| DSUB | back to summary |
|---|---|
| public static final ArithmeticInstruction DSUB | |
| DUP | back to summary |
|---|---|
| public static final StackInstruction DUP | |
| DUP2 | back to summary |
|---|---|
| public static final StackInstruction DUP2 | |
| DUP2_X1 | back to summary |
|---|---|
| public static final StackInstruction DUP2_X1 | |
| DUP2_X2 | back to summary |
|---|---|
| public static final StackInstruction DUP2_X2 | |
| DUP_X1 | back to summary |
|---|---|
| public static final StackInstruction DUP_X1 | |
| DUP_X2 | back to summary |
|---|---|
| public static final StackInstruction DUP_X2 | |
| F2D | back to summary |
|---|---|
| public static final ConversionInstruction F2D | |
| F2I | back to summary |
|---|---|
| public static final ConversionInstruction F2I | |
| F2L | back to summary |
|---|---|
| public static final ConversionInstruction F2L | |
| FADD | back to summary |
|---|---|
| public static final ArithmeticInstruction FADD | |
| FALOAD | back to summary |
|---|---|
| public static final ArrayInstruction FALOAD | |
| FASTORE | back to summary |
|---|---|
| public static final ArrayInstruction FASTORE | |
| FCMPG | back to summary |
|---|---|
| public static final Instruction FCMPG | |
| FCMPL | back to summary |
|---|---|
| public static final Instruction FCMPL | |
| FCONST_0 | back to summary |
|---|---|
| public static final Instruction FCONST_0 | |
| FCONST_1 | back to summary |
|---|---|
| public static final Instruction FCONST_1 | |
| FCONST_2 | back to summary |
|---|---|
| public static final Instruction FCONST_2 | |
| FDIV | back to summary |
|---|---|
| public static final ArithmeticInstruction FDIV | |
| FMUL | back to summary |
|---|---|
| public static final ArithmeticInstruction FMUL | |
| FNEG | back to summary |
|---|---|
| public static final ArithmeticInstruction FNEG | |
| FREM | back to summary |
|---|---|
| public static final ArithmeticInstruction FREM | |
| FRETURN | back to summary |
|---|---|
| public static final ReturnInstruction FRETURN | |
| FSUB | back to summary |
|---|---|
| public static final ArithmeticInstruction FSUB | |
| I2B | back to summary |
|---|---|
| public static final ConversionInstruction I2B | |
| I2C | back to summary |
|---|---|
| public static final ConversionInstruction I2C | |
| I2D | back to summary |
|---|---|
| public static final ConversionInstruction I2D | |
| I2F | back to summary |
|---|---|
| public static final ConversionInstruction I2F | |
| I2L | back to summary |
|---|---|
| public static final ConversionInstruction I2L | |
| I2S | back to summary |
|---|---|
| public static final ConversionInstruction I2S | |
| IADD | back to summary |
|---|---|
| public static final ArithmeticInstruction IADD | |
| IALOAD | back to summary |
|---|---|
| public static final ArrayInstruction IALOAD | |
| IAND | back to summary |
|---|---|
| public static final ArithmeticInstruction IAND | |
| IASTORE | back to summary |
|---|---|
| public static final ArrayInstruction IASTORE | |
| ICONST_0 | back to summary |
|---|---|
| public static final Instruction ICONST_0 | |
| ICONST_1 | back to summary |
|---|---|
| public static final Instruction ICONST_1 | |
| ICONST_2 | back to summary |
|---|---|
| public static final Instruction ICONST_2 | |
| ICONST_3 | back to summary |
|---|---|
| public static final Instruction ICONST_3 | |
| ICONST_4 | back to summary |
|---|---|
| public static final Instruction ICONST_4 | |
| ICONST_5 | back to summary |
|---|---|
| public static final Instruction ICONST_5 | |
| ICONST_M1 | back to summary |
|---|---|
| public static final Instruction ICONST_M1 | |
| IDIV | back to summary |
|---|---|
| public static final ArithmeticInstruction IDIV | |
| ILOAD_0 | back to summary |
|---|---|
| public static final LocalVariableInstruction ILOAD_0 | |
| ILOAD_1 | back to summary |
|---|---|
| public static final LocalVariableInstruction ILOAD_1 | |
| ILOAD_2 | back to summary |
|---|---|
| public static final LocalVariableInstruction ILOAD_2 | |
| IMUL | back to summary |
|---|---|
| public static final ArithmeticInstruction IMUL | |
| INEG | back to summary |
|---|---|
| public static final ArithmeticInstruction INEG | |
| INSTRUCTIONS | back to summary |
|---|---|
| pack-priv static final Instruction[] INSTRUCTIONS Gets object via its opcode, for immutable instructions like branch instructions entries are set to null. | |
| IOR | back to summary |
|---|---|
| public static final ArithmeticInstruction IOR | |
| IREM | back to summary |
|---|---|
| public static final ArithmeticInstruction IREM | |
| IRETURN | back to summary |
|---|---|
| public static final ReturnInstruction IRETURN | |
| ISHL | back to summary |
|---|---|
| public static final ArithmeticInstruction ISHL | |
| ISHR | back to summary |
|---|---|
| public static final ArithmeticInstruction ISHR | |
| ISTORE_0 | back to summary |
|---|---|
| public static final LocalVariableInstruction ISTORE_0 | |
| ISTORE_1 | back to summary |
|---|---|
| public static final LocalVariableInstruction ISTORE_1 | |
| ISTORE_2 | back to summary |
|---|---|
| public static final LocalVariableInstruction ISTORE_2 | |
| ISUB | back to summary |
|---|---|
| public static final ArithmeticInstruction ISUB | |
| IUSHR | back to summary |
|---|---|
| public static final ArithmeticInstruction IUSHR | |
| IXOR | back to summary |
|---|---|
| public static final ArithmeticInstruction IXOR | |
| L2D | back to summary |
|---|---|
| public static final ConversionInstruction L2D | |
| L2F | back to summary |
|---|---|
| public static final ConversionInstruction L2F | |
| L2I | back to summary |
|---|---|
| public static final ConversionInstruction L2I | |
| LADD | back to summary |
|---|---|
| public static final ArithmeticInstruction LADD | |
| LALOAD | back to summary |
|---|---|
| public static final ArrayInstruction LALOAD | |
| LAND | back to summary |
|---|---|
| public static final ArithmeticInstruction LAND | |
| LASTORE | back to summary |
|---|---|
| public static final ArrayInstruction LASTORE | |
| LCMP | back to summary |
|---|---|
| public static final Instruction LCMP | |
| LCONST_0 | back to summary |
|---|---|
| public static final Instruction LCONST_0 | |
| LCONST_1 | back to summary |
|---|---|
| public static final Instruction LCONST_1 | |
| LDIV | back to summary |
|---|---|
| public static final ArithmeticInstruction LDIV | |
| LMUL | back to summary |
|---|---|
| public static final ArithmeticInstruction LMUL | |
| LNEG | back to summary |
|---|---|
| public static final ArithmeticInstruction LNEG | |
| LOR | back to summary |
|---|---|
| public static final ArithmeticInstruction LOR | |
| LREM | back to summary |
|---|---|
| public static final ArithmeticInstruction LREM | |
| LRETURN | back to summary |
|---|---|
| public static final ReturnInstruction LRETURN | |
| LSHL | back to summary |
|---|---|
| public static final ArithmeticInstruction LSHL | |
| LSHR | back to summary |
|---|---|
| public static final ArithmeticInstruction LSHR | |
| LSUB | back to summary |
|---|---|
| public static final ArithmeticInstruction LSUB | |
| LUSHR | back to summary |
|---|---|
| public static final ArithmeticInstruction LUSHR | |
| LXOR | back to summary |
|---|---|
| public static final ArithmeticInstruction LXOR | |
| MONITORENTER | back to summary |
|---|---|
| public static final Instruction MONITORENTER | |
| MONITOREXIT | back to summary |
|---|---|
| public static final Instruction MONITOREXIT | |
| NOP | back to summary |
|---|---|
| public static final Instruction NOP Predefined instruction objects. NOTE these are not currently immutable, because Instruction has mutable protected fields opcode and length. | |
| POP | back to summary |
|---|---|
| public static final StackInstruction POP | |
| POP2 | back to summary |
|---|---|
| public static final StackInstruction POP2 | |
| RETURN | back to summary |
|---|---|
| public static final ReturnInstruction RETURN | |
| SALOAD | back to summary |
|---|---|
| public static final ArrayInstruction SALOAD | |
| SASTORE | back to summary |
|---|---|
| public static final ArrayInstruction SASTORE | |
| SWAP | back to summary |
|---|---|
| public static final StackInstruction SWAP | |
| THIS | back to summary |
|---|---|
| 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(). | |
| InstructionConst | back to summary |
|---|---|
| private InstructionConst() | |
| getInstruction | back to summary |
|---|---|
| public static Instruction getInstruction(final int index) Gets the Instruction.
| |