Class BytecodeTransition

java.lang.Object
com.oracle.truffle.api.bytecode.BytecodeTransition

public abstract class BytecodeTransition extends Object
Encapsulates information about a transition of the bytecode interpreter from one bytecode node to another. Transitions can be intercepted by overriding BytecodeRootNode.traceTransition(BytecodeTransition, Frame).

Transition kinds are not mutually exclusive; for example, a single transition can simultaneously report isBytecodeUpdate() and isTransferToInterpreter().

Deoptimization transitions report precise bytecode locations for compilation roots and continuation resumes. If a Bytecode DSL root is inlined into another compiled root, a deoptimization in that inlined root may be reported at the enclosing compilation root instead of the inlined root.

Since:
25.1
  • Constructor Details

    • BytecodeTransition

      protected BytecodeTransition(Object token)
      Internal constructor for generated code. Do not use.
      Since:
      25.1
  • Method Details

    • isBytecodeUpdate

      public abstract boolean isBytecodeUpdate()
      Returns true if bytecode metadata or instructions changed for this transition, e.g. due to a tier change, instrumentation update, or tag update.
      Since:
      25.1
    • isTransferToInterpreter

      public abstract boolean isTransferToInterpreter()
      Returns true if this transition was triggered by a deoptimization from compiled code.

      A deoptimization in an inlined Bytecode DSL root may not create a separate transition for that inlined root. In such cases, the transition may instead be reported for the enclosing compilation root.

      Since:
      25.1
    • getAddedTags

      public abstract Set<Class<?>> getAddedTags()
      Returns tags that were newly added by this transition.

      This set is typically non-empty only for isBytecodeUpdate() transitions.

      Since:
      25.1
    • getAddedInstrumentations

      public abstract Set<Class<?>> getAddedInstrumentations()
      Returns instrumentations that were newly added by this transition.

      This set is typically non-empty only for isBytecodeUpdate() transitions.

      Since:
      25.1
    • getOldLocation

      public abstract BytecodeLocation getOldLocation()
      Returns the bytecode location before the transition.
      Since:
      25.1
    • getNewLocation

      public abstract BytecodeLocation getNewLocation()
      Returns the bytecode location after the transition.
      Since:
      25.1
    • toString

      public String toString()
      Overrides:
      toString in class Object