public final class TruffleStackTrace extends Exception
Throwablepasses through a
PolyglotExceptiondo not get a TruffleStackTrace. Other
Throwableare added a TruffleStackTrace, as long as there is a
causeavailable to insert the TruffleStackTrace.
A guest language stack trace element is automatically added by the Truffle runtime every time the
Throwable passes through a
call target. This is incremental and
therefore efficient if the exception is later caught in the same compilation unit.
Note that if the Throwable is caught, its stack trace should be filled eagerly with
TruffleStackTrace.fillIn(Throwable), unless it can be guaranteed to be re-thrown in the same
call target, or that the stack trace will not be used.
|Modifier and Type||Method and Description|
Fills in the guest language stack frames from the current frames on the stack.
Returns the guest language frames that are stored in this throwable or
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public Throwable fillInStackTrace()
public static List<TruffleStackTraceElement> getStackTrace(Throwable throwable)
nullif no guest language frames can ever be stored in this throwable. This method fills in the stacktrace by calling
TruffleStackTrace.fillIn(Throwable), so it is not necessary to call
TruffleStackTrace.fillIn(Throwable)before. The returned list is not modifiable. The number of stack trace elements that are filled in can be customized by implementing
throwable- the throwable instance to look for guest language frames
public static TruffleStackTrace fillIn(Throwable throwable)
causechain of the exception. The number stack trace elements that are filled in can be customized by implementing
throwable- the Throwable to fill