use of com.oracle.svm.core.annotate.NeverInline 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));
}
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class Deoptimizer method deoptimizeFrame.
/**
* Deoptimizes the given frame.
*
* @param ignoreNonDeoptimizable if set to true, a frame that cannot be deoptimized is ignored
* instead of raising an error (use for deoptimzation testing only).
*/
@NeverInline("Inlining of this method would require that we have deopt targets for callees of this method (SVM internals).")
public static void deoptimizeFrame(Pointer sourceSp, boolean ignoreNonDeoptimizable, SpeculationReason speculation) {
DeoptimizedFrame deoptFrame = Deoptimizer.checkDeoptimized(sourceSp);
if (deoptFrame != null) {
/* Already deoptimized, so nothing to do. */
registerSpeculationFailure(deoptFrame.getSourceInstalledCode(), speculation);
return;
}
IsolateThread currentThread = CEntryPointContext.getCurrentIsolateThread();
VMOperation.enqueueBlockingSafepoint("DeoptimizeFrame", () -> Deoptimizer.deoptimizeFrameOperation(sourceSp, ignoreNonDeoptimizable, speculation, currentThread));
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class JavaLangSubstitutions method fillInStackTrace.
@Substitute
@NeverInline("Prevent inlining in Truffle compilations")
private Object fillInStackTrace() {
Pointer sp = KnownIntrinsics.readCallerStackPointer();
CodePointer ip = KnownIntrinsics.readReturnAddress();
StackTraceBuilder stackTraceBuilder = new StackTraceBuilder();
JavaStackWalker.walkCurrentThread(sp, ip, stackTraceBuilder);
this.stackTrace = stackTraceBuilder.getTrace();
return this;
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class SubstrateUtil method dumpJavaFrameAnchors.
@NeverInline("catch implicit exceptions")
private static void dumpJavaFrameAnchors(Log log) {
log.string("JavaFrameAnchor dump:").newline();
log.indent(true);
JavaFrameAnchor anchor = JavaFrameAnchors.getFrameAnchor();
if (anchor.isNull()) {
log.string("No anchors").newline();
}
while (anchor.isNonNull()) {
log.string("Anchor ").zhex(anchor.rawValue()).string(" LastJavaSP ").zhex(anchor.getLastJavaSP().rawValue()).newline();
anchor = anchor.getPreviousAnchor();
}
log.indent(false);
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class SubstrateInspectedFrame method iterateFrames.
@NeverInline("Stack walking starts at the physical caller frame of this method")
@Override
public <T> T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor<T> visitor) {
if (SubstrateUtil.HOSTED) {
/*
* During native-image generation we use HotSpotStackIntrospection to iterate frames.
* `initialMethods` and `matchingMethods` are hosted versions of `ResolvedJavaMethod`
* that we provide them in `SubstrateTruffleRuntime`.
*/
StackIntrospection hostedStackIntrospection = JVMCI.getRuntime().getHostJVMCIBackend().getStackIntrospection();
return hostedStackIntrospection.iterateFrames(initialMethods, matchingMethods, initialSkip, visitor);
}
/* Stack walking starts at the physical caller frame of this method. */
Pointer startSP = KnownIntrinsics.readCallerStackPointer();
CodePointer startIP = KnownIntrinsics.readReturnAddress();
PhysicalStackFrameVisitor<T> physicalFrameVisitor = new PhysicalStackFrameVisitor<>(initialMethods, matchingMethods, initialSkip, visitor);
JavaStackWalker.walkCurrentThread(startSP, startIP, physicalFrameVisitor);
return physicalFrameVisitor.result;
}
Aggregations