use of com.oracle.svm.core.jdk.StackTraceBuilder in project graal by oracle.
the class VMThreadCounterOperation method getStackTrace.
@Substitute
@NeverInline("Immediate caller must show up in stack trace and so needs its own stack frame")
private StackTraceElement[] getStackTrace() {
if (JavaThreads.fromTarget(this) == Thread.currentThread()) {
/* We can walk our own stack without a VMOperation. */
StackTraceBuilder stackTraceBuilder = new StackTraceBuilder();
JavaStackWalker.walkCurrentThread(KnownIntrinsics.readCallerStackPointer(), KnownIntrinsics.readReturnAddress(), stackTraceBuilder);
return stackTraceBuilder.getTrace();
} else {
return JavaThreads.getStackTrace(JavaThreads.fromTarget(this));
}
}
Aggregations