Package jminusminus

Class CLArrayInstruction

java.lang.Object
jminusminus.CLInstruction
jminusminus.CLArrayInstruction

class CLArrayInstruction extends CLInstruction
Representation for ARRAY1, ARRAY2 and ARRAY3 instructions.
  • Constructor Details

    • CLArrayInstruction

      public CLArrayInstruction(int opcode, int pc, int type)
      Constructs a CLArrayInstruction object for ARRAY1 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
      type - number identifying the type.
    • CLArrayInstruction

      public CLArrayInstruction(int opcode, int pc, int type, int dim)
      Constructs a CLArrayInstruction object for ARRAY2 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
      type - number identifying the type.
      dim - number of dimensions.
    • CLArrayInstruction

      public CLArrayInstruction(int opcode, int pc)
      Constructs a CLArrayInstruction object for ARRAY3 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
  • 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.