Search in sources :

Example 1 with InliningLog

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;
    }
}
Also used : InliningLog(org.graalvm.compiler.nodes.InliningLog) MemoryNode(org.graalvm.compiler.nodes.memory.MemoryNode) MemoryAnchorNode(org.graalvm.compiler.nodes.memory.MemoryAnchorNode) LoopBeginNode(org.graalvm.compiler.nodes.LoopBeginNode) ControlSinkNode(org.graalvm.compiler.nodes.ControlSinkNode) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) MergeNode(org.graalvm.compiler.nodes.MergeNode) ExplodeLoopNode(org.graalvm.compiler.replacements.nodes.ExplodeLoopNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) LoadSnippetVarargParameterNode(org.graalvm.compiler.replacements.nodes.LoadSnippetVarargParameterNode) PhiNode(org.graalvm.compiler.nodes.PhiNode) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) LoadIndexedNode(org.graalvm.compiler.nodes.java.LoadIndexedNode) ReturnNode(org.graalvm.compiler.nodes.ReturnNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) DeoptimizingNode(org.graalvm.compiler.nodes.DeoptimizingNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) FloatingNode(org.graalvm.compiler.nodes.calc.FloatingNode) MemoryPhiNode(org.graalvm.compiler.nodes.memory.MemoryPhiNode) StartNode(org.graalvm.compiler.nodes.StartNode) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) StoreIndexedNode(org.graalvm.compiler.nodes.java.StoreIndexedNode) MemoryMapNode(org.graalvm.compiler.nodes.memory.MemoryMapNode) Node(org.graalvm.compiler.graph.Node) FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) Mark(org.graalvm.compiler.graph.Graph.Mark) NodeSourcePosition(org.graalvm.compiler.graph.NodeSourcePosition)

Aggregations

Mark (org.graalvm.compiler.graph.Graph.Mark)1 Node (org.graalvm.compiler.graph.Node)1 NodeSourcePosition (org.graalvm.compiler.graph.NodeSourcePosition)1 AbstractBeginNode (org.graalvm.compiler.nodes.AbstractBeginNode)1 AbstractMergeNode (org.graalvm.compiler.nodes.AbstractMergeNode)1 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)1 ControlSinkNode (org.graalvm.compiler.nodes.ControlSinkNode)1 DeoptimizingNode (org.graalvm.compiler.nodes.DeoptimizingNode)1 FixedNode (org.graalvm.compiler.nodes.FixedNode)1 FixedWithNextNode (org.graalvm.compiler.nodes.FixedWithNextNode)1 InliningLog (org.graalvm.compiler.nodes.InliningLog)1 LoopBeginNode (org.graalvm.compiler.nodes.LoopBeginNode)1 MergeNode (org.graalvm.compiler.nodes.MergeNode)1 ParameterNode (org.graalvm.compiler.nodes.ParameterNode)1 PhiNode (org.graalvm.compiler.nodes.PhiNode)1 ReturnNode (org.graalvm.compiler.nodes.ReturnNode)1 StartNode (org.graalvm.compiler.nodes.StartNode)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 FloatingNode (org.graalvm.compiler.nodes.calc.FloatingNode)1 LoadIndexedNode (org.graalvm.compiler.nodes.java.LoadIndexedNode)1