Class InstructionTracer.InstructionAccess

java.lang.Object
com.oracle.truffle.api.bytecode.InstructionTracer.InstructionAccess
Enclosing interface:
InstructionTracer

public abstract static class InstructionTracer.InstructionAccess extends Object
Accessor for properties of the instruction about to execute.

Instances of this class are provided by the generated interpreter and are scoped to a single InstructionTracer.onInstructionEnter(InstructionTracer.InstructionAccess, BytecodeNode, int, Frame) invocation. They must not be stored, shared across threads, or used after the callback returns.

Since:
25.1
  • Constructor Details

    • InstructionAccess

      protected InstructionAccess(Object token)
      Internal constructor for generated code.
      Since:
      25.1
  • Method Details

    • getTracedInstruction

      public abstract Instruction getTracedInstruction(BytecodeNode bytecode, int bytecodeIndex)
      Materializes the Instruction object for the instruction at the given bytecode index.
      Parameters:
      bytecode - the BytecodeNode currently being interpreted
      bytecodeIndex - the bytecode index (BCI) of the instruction
      Returns:
      the materialized Instruction representing the instruction at BCI
      Since:
      25.1
    • getTracedOperationCode

      public abstract int getTracedOperationCode(BytecodeNode bytecode, int bytecodeIndex)
      Returns the operation code for the instruction at the given bytecode index, without allocating an Instruction object.

      The returned value corresponds to Instruction.getOperationCode() for the same instruction.

      Parameters:
      bytecode - the BytecodeNode currently being interpreted
      bytecodeIndex - the bytecode index (BCI) of the instruction
      Returns:
      the integer operation code of the instruction at BCI
      Since:
      25.1
      See Also: