use of org.graalvm.compiler.nodes.InliningLog in project graal by oracle.
the class SnippetTemplate method inlineSnippet.
private UnmodifiableEconomicMap<Node, Node> inlineSnippet(Node replacee, DebugContext debug, StructuredGraph replaceeGraph, EconomicMap<Node, Node> replacements) {
Mark mark = replaceeGraph.getMark();
try (InliningLog.UpdateScope scope = replaceeGraph.getInliningLog().openUpdateScope((oldNode, newNode) -> {
InliningLog log = replaceeGraph.getInliningLog();
if (oldNode == null) {
log.trackNewCallsite(newNode);
}
})) {
UnmodifiableEconomicMap<Node, Node> duplicates = replaceeGraph.addDuplicates(nodes, snippet, snippet.getNodeCount(), replacements);
if (scope != null) {
replaceeGraph.getInliningLog().addLog(duplicates, snippet.getInliningLog());
}
NodeSourcePosition position = replacee.getNodeSourcePosition();
InliningUtil.updateSourcePosition(replaceeGraph, duplicates, mark, position, true);
debug.dump(DebugContext.DETAILED_LEVEL, replaceeGraph, "After inlining snippet %s", snippet.method());
return duplicates;
}
}
Aggregations