use of com.oracle.svm.core.stack.JavaFrameAnchor in project graal by oracle.
the class CFunctionSnippets method prologueSnippet.
@Snippet
private static void prologueSnippet() {
// Push a Java frame anchor.
JavaFrameAnchor anchor = (JavaFrameAnchor) StackValueNode.stackValue(1, SizeOf.get(JavaFrameAnchor.class), frameAnchorIdentity);
anchor.setLastJavaSP(KnownIntrinsics.readStackPointer());
JavaFrameAnchors.pushFrameAnchor(anchor);
if (SubstrateOptions.MultiThreaded.getValue()) {
// Change the VMThread status from Java to native.
VMThreads.StatusSupport.setStatusNative();
}
}
use of com.oracle.svm.core.stack.JavaFrameAnchor 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.stack.JavaFrameAnchor in project graal by oracle.
the class SubstrateUtil method dumpTopFrame.
@NeverInline("catch implicit exceptions")
private static void dumpTopFrame(Log log, Pointer sp, CodePointer ip) {
log.string("TopFrame info:").newline();
log.indent(true);
if (sp.isNonNull() && ip.isNonNull()) {
long totalFrameSize;
DeoptimizedFrame deoptFrame = Deoptimizer.checkDeoptimized(sp);
if (deoptFrame != null) {
log.string("RSP ").zhex(sp.rawValue()).string(" frame was deoptimized:").newline();
log.string("SourcePC ").zhex(deoptFrame.getSourcePC().rawValue()).newline();
totalFrameSize = deoptFrame.getSourceTotalFrameSize();
} else {
log.string("Lookup TotalFrameSize in CodeInfoTable:").newline();
totalFrameSize = CodeInfoTable.lookupTotalFrameSize(ip);
}
log.string("SourceTotalFrameSize ").signed(totalFrameSize).newline();
if (totalFrameSize == -1) {
log.string("Does not look like a Java Frame. Use JavaFrameAnchors to find LastJavaSP:").newline();
JavaFrameAnchor anchor = JavaFrameAnchors.getFrameAnchor();
while (anchor.isNonNull() && anchor.getLastJavaSP().belowOrEqual(sp)) {
anchor = anchor.getPreviousAnchor();
}
if (anchor.isNonNull()) {
log.string("Found matching Anchor:").zhex(anchor.rawValue()).newline();
Pointer lastSp = anchor.getLastJavaSP();
log.string("LastJavaSP ").zhex(lastSp.rawValue()).newline();
CodePointer lastIp = FrameAccess.readReturnAddress(lastSp);
log.string("LastJavaIP ").zhex(lastIp.rawValue()).newline();
}
}
}
log.indent(false);
}
Aggregations