Package jminusminus

Class CLLoadStoreInstruction

java.lang.Object
jminusminus.CLInstruction
jminusminus.CLLoadStoreInstruction

class CLLoadStoreInstruction extends CLInstruction
Representation for LOAD_STORE1, LOAD_STORE2, LOAD_STORE3 and LOAD_STORE4 instructions.
  • Constructor Details

    • CLLoadStoreInstruction

      public CLLoadStoreInstruction(int opcode, int pc)
      Constructs a CLLoadStoreInstruction object for LOAD_STORE1 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
    • CLLoadStoreInstruction

      public CLLoadStoreInstruction(int opcode, int pc, int localVariableIndex, boolean isWidened)
      Constructs a CLLoadStoreInstruction object for LOAD_STORE2 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
      localVariableIndex - index of the local variable to increment.
      isWidened - whether this instruction is preceeded by the WIDE (widening) instruction.
    • CLLoadStoreInstruction

      public CLLoadStoreInstruction(int opcode, int pc, int constVal)
      Constructs a CLLoadStoreInstruction object for LOAD_STORE3 and LOAD_STORE4 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
      constVal - a byte (for BIPUSH), a short (for SIPUSH), or a constant pool index for LDC instructions.
  • Method Details

    • toBytes

      public ArrayList<Integer> toBytes()
      Returns the bytecode for this instruction.
      Specified by:
      toBytes in class CLInstruction
      Returns:
      the bytecode for this instruction.