@Override public boolean nodeReplaced(Node oldNode, Node newNode, CharSequence reason) { CompilerAsserts.neverPartOfCompilation(); if (isValid()) { invalidate(newNode, reason); } /* Notify compiled method that have inlined this call target that the tree changed. */ nodeRewritingAssumption.invalidate(); compilationProfile.reportNodeReplaced(); if (cancelInstalledTask(newNode, reason)) { compilationProfile.reportInvalidated(); } return false; }
@Override public Object call(Object... args) { compilationProfile.reportIndirectCall(); if (profiledArgumentTypesAssumption != null && profiledArgumentTypesAssumption.isValid()) { // Argument profiling is not possible for targets of indirect calls. CompilerDirectives.transferToInterpreterAndInvalidate(); profiledArgumentTypesAssumption.invalidate(); profiledArgumentTypes = null; } return doInvoke(args); }
private void interpreterCall() { if (isValid()) { // Stubs were deoptimized => reinstall. this.runtime.reinstallStubs(); } else { if (uninitializedRootNode == UNINITIALIZED) { ensureCloned(); } compilationProfile.reportInterpreterCall(); if (!isCompiling() && compilationPolicy.shouldCompile(compilationProfile, getCompilerOptions())) { compile(); } } }
public final Object callDirect(Object... args) { compilationProfile.reportDirectCall(); profileArguments(args); try { Object result = doInvoke(args); Class<?> klass = profiledReturnType; if (klass != null && CompilerDirectives.inCompiledCode() && profiledReturnTypeAssumption.isValid()) { result = unsafeCast(result, klass, true, true); } return result; } catch (Throwable t) { t = exceptionProfile.profile(t); if (t instanceof RuntimeException) { throw (RuntimeException) t; } else if (t instanceof Error) { throw (Error) t; } else { CompilerDirectives.transferToInterpreter(); throw new RuntimeException(t); } } }
@Override public void reportLoopCount(int count) { compilationProfile.reportLoopCount(count); }
public final Object callInlined(Object... arguments) { compilationProfile.reportInlinedCall(); VirtualFrame frame = createFrame(getRootNode().getFrameDescriptor(), arguments); return callProxy(frame); }