Package com.oracle.truffle.api
Class TruffleStackTraceElement
java.lang.Object
com.oracle.truffle.api.TruffleStackTraceElement
Represents a guest stack trace element.
- Since:
- 0.27
-
Method Summary
Modifier and TypeMethodDescriptionstatic TruffleStackTraceElement
create
(Node location, RootCallTarget target, Frame frame) Create a new stack trace element.static TruffleStackTraceElement
create
(Node location, RootCallTarget target, Frame frame, int bytecodeIndex) Create a new stack trace element.int
Returns the bytecode index at the time when this frame was created.getFrame()
Returns the read-only frame.Returns an interop object representing this TruffleStackTraceElement supporting thehasExecutableName
and potentiallyhasDeclaringMetaObject
andhasSourceLocation
messages.Returns a node representing the callsite on the stack.Returns the call target on the stack.boolean
Returnstrue
if the stack trace element contains a valid bytecode index, elsefalse
.toString()
-
Method Details
-
create
Create a new stack trace element.- Parameters:
location
- SeegetLocation()
target
- SeegetTarget()
frame
- SeegetFrame()
- Since:
- 20.1.0
-
create
public static TruffleStackTraceElement create(Node location, RootCallTarget target, Frame frame, int bytecodeIndex) Create a new stack trace element.- Parameters:
location
- SeegetLocation()
target
- SeegetTarget()
frame
- SeegetFrame()
bytecodeIndex
- SeegetBytecodeIndex()
- Since:
- 24.1
-
getLocation
Returns a node representing the callsite on the stack.Returns
null
if no detailed callsite information is available. This is the case whenCallTarget.call(Object...)
is used or for the top-of-the-stack element or if the exception is an internal exception or theAbstractTruffleException.getLocation()
returnednull
.See
FrameInstance.getCallNode()
for the relation between callsite and CallTarget.- Since:
- 0.27
-
getTarget
Returns the call target on the stack. Never returnsnull
.See
FrameInstance.getCallNode()
for the relation between callsite and CallTarget.- Since:
- 0.27
-
getFrame
Returns the read-only frame. Returnsnull
if the initialRootNode
that filled in the stack trace did not request frames to be captured by overridingRootNode.isCaptureFramesForTrace(Node)
.- Since:
- 0.31
-
hasBytecodeIndex
public boolean hasBytecodeIndex()Returnstrue
if the stack trace element contains a valid bytecode index, elsefalse
. If this method returnsfalse
thengetBytecodeIndex()
will return a negativeint
value.- Since:
- 24.1
-
getBytecodeIndex
public int getBytecodeIndex()Returns the bytecode index at the time when this frame was created. If no bytecode index was captured then a negativeint
value is returned. When the stack trace element is capturedRootNode.findBytecodeIndex(com.oracle.truffle.api.nodes.Node, com.oracle.truffle.api.frame.Frame)
is invoked to resolve the byte code index returned by this method.- Since:
- 24.1
- See Also:
-
getGuestObject
Returns an interop object representing this TruffleStackTraceElement supporting thehasExecutableName
and potentiallyhasDeclaringMetaObject
andhasSourceLocation
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
-
toString
-