Search in sources :

Example 6 with SafepointNode

use of org.graalvm.compiler.nodes.SafepointNode in project graal by oracle.

the class LoopSafepointInsertionPhase method run.

@Override
protected void run(StructuredGraph graph) {
    if (GenLoopSafepoints.getValue(graph.getOptions())) {
        for (LoopBeginNode loopBeginNode : graph.getNodes(LoopBeginNode.TYPE)) {
            for (LoopEndNode loopEndNode : loopBeginNode.loopEnds()) {
                if (loopEndNode.canSafepoint()) {
                    SafepointNode safepointNode = graph.add(new SafepointNode());
                    graph.addBeforeFixed(loopEndNode, safepointNode);
                }
            }
        }
    }
}
Also used : LoopBeginNode(org.graalvm.compiler.nodes.LoopBeginNode) SafepointNode(org.graalvm.compiler.nodes.SafepointNode) LoopEndNode(org.graalvm.compiler.nodes.LoopEndNode)

Aggregations

SafepointNode (org.graalvm.compiler.nodes.SafepointNode)6 LoopBeginNode (org.graalvm.compiler.nodes.LoopBeginNode)3 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)3 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)2 PhiNode (org.graalvm.compiler.nodes.PhiNode)2 ValueNode (org.graalvm.compiler.nodes.ValueNode)2 Uninterruptible (com.oracle.svm.core.annotate.Uninterruptible)1 SharedMethod (com.oracle.svm.core.meta.SharedMethod)1 ArrayList (java.util.ArrayList)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 ComputeObjectAddressNode (org.graalvm.compiler.hotspot.nodes.ComputeObjectAddressNode)1 G1ArrayRangePostWriteBarrier (org.graalvm.compiler.hotspot.nodes.G1ArrayRangePostWriteBarrier)1 G1ArrayRangePreWriteBarrier (org.graalvm.compiler.hotspot.nodes.G1ArrayRangePreWriteBarrier)1 G1PostWriteBarrier (org.graalvm.compiler.hotspot.nodes.G1PostWriteBarrier)1 G1PreWriteBarrier (org.graalvm.compiler.hotspot.nodes.G1PreWriteBarrier)1 G1ReferentFieldReadBarrier (org.graalvm.compiler.hotspot.nodes.G1ReferentFieldReadBarrier)1 SerialArrayRangeWriteBarrier (org.graalvm.compiler.hotspot.nodes.SerialArrayRangeWriteBarrier)1 SerialWriteBarrier (org.graalvm.compiler.hotspot.nodes.SerialWriteBarrier)1 InitializeKlassNode (org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode)1