use of org.graalvm.compiler.truffle.runtime.TruffleInlining.CallTreeNodeVisitor in project graal by oracle.
the class TraceCallTreeListener method logTruffleCallTree.
private void logTruffleCallTree(OptimizedCallTarget compilable, TruffleInlining inliningDecision) {
CallTreeNodeVisitor visitor = new CallTreeNodeVisitor() {
@Override
public boolean visit(List<TruffleInlining> decisionStack, Node node) {
if (node instanceof OptimizedDirectCallNode) {
OptimizedDirectCallNode callNode = ((OptimizedDirectCallNode) node);
int depth = decisionStack == null ? 0 : decisionStack.size() - 1;
TruffleInliningDecision inlining = CallTreeNodeVisitor.getCurrentInliningDecision(decisionStack);
String dispatched = "<dispatched>";
if (inlining != null && inlining.shouldInline()) {
dispatched = "";
}
Map<String, Object> properties = new LinkedHashMap<>();
GraalTruffleRuntimeListener.addASTSizeProperty(callNode.getCurrentCallTarget(), inliningDecision, properties);
properties.putAll(callNode.getCurrentCallTarget().getDebugProperties(inliningDecision));
runtime.logEvent(depth, "opt call tree", callNode.getCurrentCallTarget().toString() + dispatched, properties);
} else if (node instanceof OptimizedIndirectCallNode) {
int depth = decisionStack == null ? 0 : decisionStack.size() - 1;
runtime.logEvent(depth, "opt call tree", "<indirect>", new LinkedHashMap<>());
}
return true;
}
};
compilable.accept(visitor, inliningDecision);
}
Aggregations