/** * Reports the execution count of a loop that is a child of this node. The optimization * heuristics can use the loop count to guide compilation and inlining. */ public final void reportLoopCount(int count) { if (getCallTarget() instanceof LoopCountReceiver) { ((LoopCountReceiver) getCallTarget()).reportLoopCount(count); } }
public String displayMethodName(Node node) { if (node == null) { return null; } RootNode root = node.getRootNode(); if (root == null) { return "unknown"; } return root.getCallTarget().toString(); }
@SuppressWarnings("deprecation") protected void onLoopCount(Node source, int iterations) { if (SUPPORT != null) { SUPPORT.onLoopCount(source, iterations); } else { // needs an additional compatibility check so older graal runtimes // still run with newer truffle versions RootNode root = source.getRootNode(); if (root != null) { RootCallTarget target = root.getCallTarget(); if (target instanceof com.oracle.truffle.api.LoopCountReceiver) { ((com.oracle.truffle.api.LoopCountReceiver) target).reportLoopCount(iterations); } } } }
protected void onLoopCount(Node source, int iterations) { if (SUPPORT != null) { SUPPORT.onLoopCount(source, iterations); } else { // needs an additional compatibility check so older graal runtimes // still run with newer truffle versions RootNode root = source.getRootNode(); if (root != null) { RootCallTarget target = root.getCallTarget(); if (target instanceof com.oracle.truffle.api.LoopCountReceiver) { ((com.oracle.truffle.api.LoopCountReceiver) target).reportLoopCount(iterations); } } } }
@Override protected void reportPolymorphicSpecialize(Node source) { if (TruffleRuntimeOptions.getValue(SharedTruffleRuntimeOptions.TruffleExperimentalSplitting)) { TruffleSplittingStrategy.newPolymorphicSpecialize(source); final RootNode rootNode = source.getRootNode(); final OptimizedCallTarget callTarget = rootNode == null ? null : (OptimizedCallTarget) rootNode.getCallTarget(); if (callTarget != null) { callTarget.polymorphicSpecialize(source); } } } }
return false; OptimizedCallTarget callRootTarget = (OptimizedCallTarget) rootNode.getCallTarget(); OptimizedCallTarget callSourceTarget = callRootTarget.getSourceCallTarget(); int depth = 0; break; callRootTarget = (OptimizedCallTarget) splitCallSiteRootNode.getCallTarget(); if (callRootTarget == null) { break;
@Override public void onLoopCount(Node source, int count) { Node node = source; Node parentNode = source != null ? source.getParent() : null; while (node != null) { if (node instanceof OptimizedOSRLoopNode) { ((OptimizedOSRLoopNode) node).reportChildLoopCount(count); } parentNode = node; node = node.getParent(); } if (parentNode != null && parentNode instanceof RootNode) { CallTarget target = ((RootNode) parentNode).getCallTarget(); if (target instanceof OptimizedCallTarget) { ((OptimizedCallTarget) target).onLoopCount(count); } } }
private void reportReplace(Node oldNode, Node newNode, CharSequence reason) { Node node = this; while (node != null) { if (node instanceof ReplaceObserver) { ((ReplaceObserver) node).nodeReplaced(oldNode, newNode, reason); } else if (node instanceof RootNode) { CallTarget target = ((RootNode) node).getCallTarget(); if (target instanceof ReplaceObserver) { ((ReplaceObserver) target).nodeReplaced(oldNode, newNode, reason); } } node = node.getParent(); } if (TruffleOptions.TraceRewrites) { NodeUtil.traceRewrite(this, newNode, reason); } if (TruffleOptions.TraceASTJSON) { JSONHelper.dumpReplaceChild(this, newNode, reason); } }
if (onlyCaller != null) { final RootNode callerRootNode = onlyCaller.getRootNode(); if (callerRootNode != null && callerRootNode.getCallTarget() != null) { final OptimizedCallTarget callerTarget = (OptimizedCallTarget) callerRootNode.getCallTarget(); if (RuntimeOptionsCache.isExperimentalSplittingDumpDecisions()) { pullOutParentChain(onlyCaller, toDump);
private void reportReplace(Node oldNode, Node newNode, CharSequence reason) { Node node = this; while (node != null) { boolean consumed = false; if (node instanceof ReplaceObserver) { consumed = ((ReplaceObserver) node).nodeReplaced(oldNode, newNode, reason); } else if (node instanceof RootNode) { CallTarget target = ((RootNode) node).getCallTarget(); if (target instanceof ReplaceObserver) { consumed = ((ReplaceObserver) target).nodeReplaced(oldNode, newNode, reason); } } if (consumed) { break; } node = node.getParent(); } if (TruffleOptions.TraceRewrites) { NodeUtil.traceRewrite(this, newNode, reason); } if (TruffleOptions.TraceASTJSON) { dump(this, newNode, reason); } }
@SuppressWarnings("deprecation") private void reportReplace(Node oldNode, Node newNode, CharSequence reason) { Node node = this; while (node != null) { boolean consumed = false; if (node instanceof ReplaceObserver) { consumed = ((ReplaceObserver) node).nodeReplaced(oldNode, newNode, reason); } else if (node instanceof RootNode) { CallTarget target = ((RootNode) node).getCallTarget(); if (target instanceof ReplaceObserver) { consumed = ((ReplaceObserver) target).nodeReplaced(oldNode, newNode, reason); } } if (consumed) { break; } node = node.getParent(); } if (TruffleOptions.TraceRewrites) { NodeUtil.traceRewrite(this, newNode, reason); } if (TruffleOptions.TraceASTJSON) { dump(this, newNode, reason); } }
OptimizedCallTarget root = (OptimizedCallTarget) rootNode.getCallTarget(); if (root == callTarget || root.getSourceCallTarget() == callTarget) {