@Override protected void onEnter(VirtualFrame frame) { if (CompilerDirectives.inCompiledCode() && ignoreInlinedRoots && isAttachedToRootTag && !CompilerDirectives.inCompilationRoot()) { return; } doOnEnter(); }
private void doOnEnter() { StackTraceEntry location = CompilerDirectives.inInterpreter() ? interpretedLocation : (CompilerDirectives.inCompilationRoot() ? compiledLocation : compilationRootLocation); if (seenOtherThreads) { pushSlow(location); } else if (cachedThread == Thread.currentThread()) { cachedStack.push(location); } else { CompilerDirectives.transferToInterpreterAndInvalidate(); seenOtherThreads = true; pushSlow(location); } }
@Override protected void onReturnValue(VirtualFrame frame, Object result) { if (ignoreInlinedRoots) { if (CompilerDirectives.inCompiledCode()) { if (isAttachedToRootTag && !CompilerDirectives.inCompilationRoot()) { return; } } else { // This is needed to control for the case that an invalidation happened in an // inlined root. // Than there should be no stack pop until we exit the original compilation // root. // Not needed if stack overflowed final ThreadLocalStack stack = getStack(); if (!stack.hasStackOverflowed() && stack.top().getInstrumentedNode() != interpretedLocation.getInstrumentedNode()) { return; } } } if (seenOtherThreads) { popSlow(compiledLocation); } else if (cachedThread == Thread.currentThread()) { cachedStack.pop(compiledLocation); } else { CompilerDirectives.transferToInterpreterAndInvalidate(); seenOtherThreads = true; popSlow(compiledLocation); } }
protected final Object callProxy(VirtualFrame frame) { final boolean inCompiled = CompilerDirectives.inCompilationRoot(); try { return getRootNode().execute(frame); } catch (ControlFlowException t) { throw rethrow(getCompilationProfile().profileExceptionType(t)); } catch (Throwable t) { Throwable profiledT = getCompilationProfile().profileExceptionType(t); runtime().getTvmci().onThrowable(null, this, profiledT, frame); throw rethrow(profiledT); } finally { // this assertion is needed to keep the values from being cleared as non-live locals assert frame != null && this != null; if (CompilerDirectives.inInterpreter() && inCompiled) { notifyDeoptimized(frame); } } }