Package serp.bytecode
Interface InstructionPtr
-
- All Known Implementing Classes:
ExceptionHandler
,GotoInstruction
,IfInstruction
,JumpInstruction
,LineNumber
,LineNumberTable
,Local
,LocalTable
,LocalVariable
,LocalVariableTable
,LocalVariableType
,LocalVariableTypeTable
,LookupSwitchInstruction
,SwitchInstruction
,TableSwitchInstruction
public interface InstructionPtr
An entity that maintains ptrs to instructions in a code block.- Author:
- Abe White
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Code
getCode()
Returns the Code block that owns the Instruction(s) this InstructionPtr points to.void
replaceTarget(Instruction oldTarget, Instruction newTarget)
Replace the given old, likely invalid, target with a new target.void
updateTargets()
Use the byte indexes read from the class file to calculate and set references to the target instruction(s) for this ptr.
-
-
-
Method Detail
-
updateTargets
void updateTargets()
Use the byte indexes read from the class file to calculate and set references to the target instruction(s) for this ptr. This method will be called after the byte code has been read in for the first time and before it is written after modification.
-
replaceTarget
void replaceTarget(Instruction oldTarget, Instruction newTarget)
Replace the given old, likely invalid, target with a new target. The new target Instruction is guaranteed to be in the same code block as this InstructionPtr.
-
getCode
Code getCode()
Returns the Code block that owns the Instruction(s) this InstructionPtr points to.
-
-