Package jminusminus

Class CLMethodInstruction

java.lang.Object
jminusminus.CLInstruction
jminusminus.CLMethodInstruction

class CLMethodInstruction extends CLInstruction
Representation for METHOD1 and METHOD2 instructions.
  • Constructor Details

    • CLMethodInstruction

      public CLMethodInstruction(int opcode, int pc, int index, int stackUnits)
      Constructs a CLMethodInstruction object for METHOD1 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
      index - index into the constant pool, the item at which contains the name and descriptor of the method.
      stackUnits - words produced - words consumed from the operand stack by this instruction.
    • CLMethodInstruction

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

    • setArgumentCount

      public void setArgumentCount(int nArgs)
      Sets the number of arguments for the method for INVOKEINTERFACE instruction.
      Parameters:
      nArgs - number of arguments for the method.
    • toBytes

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