use of com.oracle.svm.core.annotate.NeverInline 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);
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class SubstrateUtil method dumpVMThreads.
@NeverInline("catch implicit exceptions")
private static void dumpVMThreads(Log log) {
log.string("VMThreads info:").newline();
log.indent(true);
for (IsolateThread vmThread = VMThreads.firstThread(); vmThread != VMThreads.nullThread(); vmThread = VMThreads.nextThread(vmThread)) {
log.string("VMThread ").zhex(vmThread.rawValue()).spaces(2).string(VMThreads.StatusSupport.getStatusString(vmThread)).newline();
}
log.indent(false);
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class Deoptimizer method rewriteStackAndJumpToTarget.
/**
* Performs the actual stack rewriting. When this method is called the sp is already at the
* bottom of the deopt target method.
*
* @param newSp Points to the bottom of the deopt target method (but above the return address
* slot).
* @param frame The deopt frame handle.
* @return The epilog of this method restores the return value registers from the returned frame
* handle. The instructions for restoring the return value registers must be generated
* in this method's epilog by a backend-specific FrameContext class.
*/
@DeoptStub(stubType = StubType.ExitStub)
@NeverInline("don't provoke the writeStackPointer devil with a non-trivial method")
@Uninterruptible(reason = "Frame holds Objects in unmanaged storage.")
private static DeoptimizedFrame rewriteStackAndJumpToTarget(Pointer newSp, DeoptimizedFrame frame) {
/*
* The first word of the new stack content is already the return address into the caller of
* deoptimizeInRange(). So when this method returns we are inside the caller of
* deoptimizeInRange().
*/
Pointer bottomSp = newSp.subtract(FrameAccess.returnAddressSize());
frame.getTargetContent().copyToPointer(bottomSp);
if (DeoptimizationCounters.Options.ProfileDeoptimization.getValue()) {
DeoptimizationCounters.counters().timeSpentInDeopt.add(System.nanoTime() - DeoptimizationCounters.startTime.get());
}
return frame;
}
use of com.oracle.svm.core.annotate.NeverInline in project graal by oracle.
the class DeoptTester method deoptTest.
/**
* Scans the stack frames and if there are some new (= so far not seen) PCs inside deoptimizable
* methods, a deopt is done.
*
* Foreign call: {@link SnippetRuntime#DEOPTTEST}.
*/
@NeverInline("deoptTest must have a separate stack frame")
@SubstrateForeignCallTarget
public static void deoptTest() {
if (inDeoptTest > 0) {
return;
}
inDeoptTest++;
try {
if (Heap.getHeap().isAllocationDisallowed()) {
return;
}
if (VMOperationControl.TestingBackdoor.isLocked()) {
return;
}
if (VMOperation.isInProgress()) {
return;
}
Pointer startSp = KnownIntrinsics.readCallerStackPointer();
CodePointer startIp = KnownIntrinsics.readReturnAddress();
int numHandledPCs = handledPCs.size();
JavaStackWalker.walkCurrentThread(startSp, startIp, collectPcVisitor);
if (handledPCs.size() > numHandledPCs) {
Deoptimizer.deoptimizeAll();
}
} finally {
inDeoptTest--;
}
}
Aggregations