Package jminusminus
Class CLMethodInstruction
java.lang.Object
jminusminus.CLInstruction
jminusminus.CLMethodInstruction
Representation for METHOD1 and METHOD2 instructions.
-
Field Summary
Fields inherited from class jminusminus.CLInstruction
instructionInfo, localVariableIndex, mnemonic, opcode, operandCount, pc, stackUnits
-
Constructor Summary
ConstructorDescriptionCLMethodInstruction
(int opcode, int pc) Constructs a CLMethodInstruction object for METHOD2 instructions.CLMethodInstruction
(int opcode, int pc, int index, int stackUnits) Constructs a CLMethodInstruction object for METHOD1 instructions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setArgumentCount
(int nArgs) Sets the number of arguments for the method for INVOKEINTERFACE instruction.toBytes()
Returns the bytecode for this instruction.Methods inherited from class jminusminus.CLInstruction
byteAt, isValid, localVariableIndex, mnemonic, opcode, operandCount, pc, stackUnits
-
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
Returns the bytecode for this instruction.- Specified by:
toBytes
in classCLInstruction
- Returns:
- the bytecode for this instruction.
-