Search in sources :

Example 1 with DeoptSourcePositionInfoNode

use of com.oracle.svm.core.graal.nodes.DeoptSourcePositionInfoNode in project graal by oracle.

the class CollectDeoptimizationSourcePositionsPhase method run.

@Override
protected void run(StructuredGraph graph) {
    List<NodeSourcePosition> deoptimzationSourcePositions = new ArrayList<>();
    /*
         * The debugId 0 is reserved for "unknown" to avoid any possible confusion with an
         * uninitialized debugId.
         */
    deoptimzationSourcePositions.add(null);
    for (DeoptimizeNode node : graph.getNodes(DeoptimizeNode.TYPE)) {
        node.setDebugId(deoptimzationSourcePositions.size());
        deoptimzationSourcePositions.add(node.getNodeSourcePosition());
    }
    assert graph.getNodes(DynamicDeoptimizeNode.TYPE).isEmpty() : "must collect NodeSourcePosition before DeoptimizationGroupingPhase";
    graph.addAfterFixed(graph.start(), graph.add(new DeoptSourcePositionInfoNode(deoptimzationSourcePositions)));
}
Also used : ArrayList(java.util.ArrayList) DeoptimizeNode(org.graalvm.compiler.nodes.DeoptimizeNode) DynamicDeoptimizeNode(org.graalvm.compiler.nodes.DynamicDeoptimizeNode) NodeSourcePosition(org.graalvm.compiler.graph.NodeSourcePosition) DeoptSourcePositionInfoNode(com.oracle.svm.core.graal.nodes.DeoptSourcePositionInfoNode)

Aggregations

DeoptSourcePositionInfoNode (com.oracle.svm.core.graal.nodes.DeoptSourcePositionInfoNode)1 ArrayList (java.util.ArrayList)1 NodeSourcePosition (org.graalvm.compiler.graph.NodeSourcePosition)1 DeoptimizeNode (org.graalvm.compiler.nodes.DeoptimizeNode)1 DynamicDeoptimizeNode (org.graalvm.compiler.nodes.DynamicDeoptimizeNode)1