Class TruffleStackTraceElement

java.lang.Object
com.oracle.truffle.api.TruffleStackTraceElement

public final class TruffleStackTraceElement extends Object
Represents a guest stack trace element.
Since:
0.27
  • Method Details

    • create

      public static TruffleStackTraceElement create(Node location, RootCallTarget target, Frame frame)
      Create a new stack trace element.
      Parameters:
      location - See getLocation()
      target - See getTarget()
      frame - See getFrame()
      Since:
      20.1.0
    • getLocation

      public Node getLocation()
      Returns a node representing the callsite on the stack.

      Returns null if no detailed callsite information is available. This is the case when CallTarget.call(Object...) is used or for the top-of-the-stack element or if the exception is an internal exception or the AbstractTruffleException.getLocation() returned null.

      See FrameInstance.getCallNode() for the relation between callsite and CallTarget.

      Since:
      0.27
    • getTarget

      public RootCallTarget getTarget()
      Returns the call target on the stack. Never returns null.

      See FrameInstance.getCallNode() for the relation between callsite and CallTarget.

      Since:
      0.27
    • getFrame

      public Frame getFrame()
      Returns the read-only frame. Returns null if the initial RootNode that filled in the stack trace did not request frames to be captured by overriding RootNode.isCaptureFramesForTrace().
      Since:
      0.31
    • getGuestObject

      public Object getGuestObject()
      Returns an interop object representing this TruffleStackTraceElement supporting the hasExecutableName and potentially hasDeclaringMetaObject and hasSourceLocation messages.

      This method must only be called on an interpreter thread with a valid entered. The current entered context can be accessed through the language or instrument environment.

      Since:
      20.3