public final class TruffleStackTraceElement extends Object
Modifier and Type | Method and Description |
---|---|
static TruffleStackTraceElement |
create(Node location,
RootCallTarget target,
Frame frame)
Create a new stack trace element.
|
Frame |
getFrame()
Returns the read-only frame.
|
Object |
getGuestObject()
Returns an interop object representing this TruffleStackTraceElement supporting
the
hasExecutableName and potentially hasDeclaringMetaObject and
hasSourceLocation messages. |
Node |
getLocation()
Returns a node representing the callsite on the stack.
|
RootCallTarget |
getTarget()
Returns the call target on the stack.
|
public static TruffleStackTraceElement create(Node location, RootCallTarget target, Frame frame)
location
- See TruffleStackTraceElement.getLocation()
target
- See TruffleStackTraceElement.getTarget()
frame
- See TruffleStackTraceElement.getFrame()
public Node getLocation()
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.
public RootCallTarget getTarget()
null
.
See FrameInstance.getCallNode()
for the relation between callsite and CallTarget.
public Frame getFrame()
null
if the initial RootNode
that
filled in the stack trace did not request frames to be captured by overriding
RootNode.isCaptureFramesForTrace()
.public Object getGuestObject()
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.