Package jminusminus
Class CLFlowControlInstruction
java.lang.Object
jminusminus.CLInstruction
jminusminus.CLFlowControlInstruction
Representation for FLOW_CONTROL1, FLOW_CONTROL2, FLOW_CONTROL3 and FLOW_CONTROL4 instructions.
- 
Field SummaryFields inherited from class jminusminus.CLInstructioninstructionInfo, localVariableIndex, mnemonic, opcode, operandCount, pc, stackUnits
- 
Constructor SummaryConstructorsConstructorDescriptionCLFlowControlInstruction(int pc, int index, boolean isWidened) Constructs a CLFlowControlInstruction object for RET instruction.CLFlowControlInstruction(int opcode, int pc, String jumpToLabel) Constructs a CLFlowControlInstruction object for FLOW_CONTROL1 instructions.CLFlowControlInstruction(int opcode, int pc, String defaultLabel, int low, int high, ArrayList<String> labels) Constructs a CLFlowControlInstruction object for TABLESWITCH instruction.CLFlowControlInstruction(int opcode, int pc, String defaultLabel, int numPairs, TreeMap<Integer, String> matchLabelPairs) Constructs a CLFlowControlInstruction object for LOOKUPSWITCH instruction.
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the pc of instruction to jump to.booleanresolveLabels(Hashtable<String, Integer> labelToPC) Resolves the jump labels to the corresponding offset values using the given label to pc mapping.toBytes()Returns the bytecode for this instruction.Methods inherited from class jminusminus.CLInstructionbyteAt, isValid, localVariableIndex, mnemonic, opcode, operandCount, pc, stackUnits
- 
Constructor Details- 
CLFlowControlInstructionConstructs a CLFlowControlInstruction object for FLOW_CONTROL1 instructions.- Parameters:
- opcode- the opcode for this instruction.
- pc- index of this instruction within the code array of a method.
- jumpToLabel- the label to jump to.
 
- 
CLFlowControlInstructionpublic CLFlowControlInstruction(int pc, int index, boolean isWidened) Constructs a CLFlowControlInstruction object for RET instruction.- Parameters:
- pc- index of this instruction within the code array of a method.
- index- index of the local variable containing the return address.
- isWidened- whether this instruction is preceeded by the WIDE (widening) instruction.
 
- 
CLFlowControlInstructionpublic CLFlowControlInstruction(int opcode, int pc, String defaultLabel, int low, int high, ArrayList<String> labels) Constructs a CLFlowControlInstruction object for TABLESWITCH instruction.- Parameters:
- opcode- the opcode for this instruction.
- pc- index of this instruction within the code array of a method.
- defaultLabel- jump label for default value.
- low- smallest value of index.
- high- highest value of index.
- labels- list of jump labels for each index value from low to high, end values included.
 
- 
CLFlowControlInstructionpublic CLFlowControlInstruction(int opcode, int pc, String defaultLabel, int numPairs, TreeMap<Integer, String> matchLabelPairs) Constructs a CLFlowControlInstruction object for LOOKUPSWITCH instruction.- Parameters:
- opcode- the opcode for this instruction.
- pc- index of this instruction within the code array of a method.
- defaultLabel- jump label for default value.
- numPairs- number of pairs in the match table.
- matchLabelPairs- key match table.
 
 
- 
- 
Method Details- 
resolveLabelsResolves the jump labels to the corresponding offset values using the given label to pc mapping. If unable to resolve a label, the offset is set such that the next instruction will be executed.- Parameters:
- labelToPC- label to pc mapping.
- Returns:
- true if all labels were resolved successfully, and false otherwise.
 
- 
jumpToOffsetpublic int jumpToOffset()Returns the pc of instruction to jump to.- Returns:
- pc to jump to.
 
- 
toBytesReturns the bytecode for this instruction.- Specified by:
- toBytesin class- CLInstruction
- Returns:
- the bytecode for this instruction.
 
 
-