Search in sources :

Example 1 with DeoptTestNode

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

the class CompileQueue method insertDeoptTests.

/**
 * Inserts a call to {@link DeoptTester#deoptTest} right after FixedWithNextNode StateSplits.
 *
 * @param method method that is being augmented with deopt test calls
 * @param graph The graph of a deoptimizable method or the corresponding deopt target method.
 */
private static void insertDeoptTests(HostedMethod method, StructuredGraph graph) {
    for (Node node : graph.getNodes()) {
        if (node instanceof FixedWithNextNode && node instanceof StateSplit && !(node instanceof InvokeNode) && !(node instanceof ForeignCallNode) && !(node instanceof DeoptTestNode) && !(method.isSynchronized() && node instanceof StartNode)) {
            FixedWithNextNode fixedWithNext = (FixedWithNextNode) node;
            FixedNode next = fixedWithNext.next();
            DeoptTestNode testNode = graph.add(new DeoptTestNode());
            fixedWithNext.setNext(null);
            testNode.setNext(next);
            fixedWithNext.setNext(testNode);
        }
    }
}
Also used : FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) StartNode(org.graalvm.compiler.nodes.StartNode) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) StackValueNode(com.oracle.svm.core.graal.stackvalue.StackValueNode) MethodCallTargetNode(org.graalvm.compiler.nodes.java.MethodCallTargetNode) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) DeoptTestNode(com.oracle.svm.core.graal.nodes.DeoptTestNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) DeoptEntryNode(com.oracle.svm.core.graal.nodes.DeoptEntryNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) StartNode(org.graalvm.compiler.nodes.StartNode) InvokeNode(org.graalvm.compiler.nodes.InvokeNode) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) Node(org.graalvm.compiler.graph.Node) FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) InvokeNode(org.graalvm.compiler.nodes.InvokeNode) DeoptTestNode(com.oracle.svm.core.graal.nodes.DeoptTestNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) StateSplit(org.graalvm.compiler.nodes.StateSplit)

Aggregations

DeoptEntryNode (com.oracle.svm.core.graal.nodes.DeoptEntryNode)1 DeoptTestNode (com.oracle.svm.core.graal.nodes.DeoptTestNode)1 StackValueNode (com.oracle.svm.core.graal.stackvalue.StackValueNode)1 Node (org.graalvm.compiler.graph.Node)1 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)1 FixedNode (org.graalvm.compiler.nodes.FixedNode)1 FixedWithNextNode (org.graalvm.compiler.nodes.FixedWithNextNode)1 InvokeNode (org.graalvm.compiler.nodes.InvokeNode)1 ParameterNode (org.graalvm.compiler.nodes.ParameterNode)1 StartNode (org.graalvm.compiler.nodes.StartNode)1 StateSplit (org.graalvm.compiler.nodes.StateSplit)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 ForeignCallNode (org.graalvm.compiler.nodes.extended.ForeignCallNode)1 MethodCallTargetNode (org.graalvm.compiler.nodes.java.MethodCallTargetNode)1