Package serp.bytecode

Interface InstructionPtr

All Known Implementing Classes:
ExceptionHandler, GotoInstruction, IfInstruction, InstructionPtrStrategy, 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.
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    Use the byte indexes read from the class file to calculate and set references to the target instruction(s) for this ptr.
  • Method Details

    • 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.