Search in sources :

Example 1 with SideEffectFreeWrite

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

the class DefaultJavaLoweringProvider method lowerJavaWriteNode.

protected void lowerJavaWriteNode(JavaWriteNode write) {
    StructuredGraph graph = write.graph();
    ValueNode value = implicitStoreConvert(graph, write.getWriteKind(), write.value(), write.isCompressible());
    WriteNode memoryWrite;
    if (write.ordersMemoryAccesses()) {
        memoryWrite = graph.add(new OrderedWriteNode(write.getAddress(), write.getKilledLocationIdentity(), value, write.getBarrierType(), write.getMemoryOrder()));
    } else if (write.hasSideEffect()) {
        memoryWrite = graph.add(new WriteNode(write.getAddress(), write.getKilledLocationIdentity(), value, write.getBarrierType()));
    } else {
        memoryWrite = graph.add(new SideEffectFreeWrite(write.getAddress(), write.getKilledLocationIdentity(), value, write.getBarrierType()));
    }
    memoryWrite.setStateAfter(write.stateAfter());
    graph.replaceFixedWithFixed(write, memoryWrite);
    memoryWrite.setGuard(write.getGuard());
}
Also used : SideEffectFreeWrite(org.graalvm.compiler.nodes.memory.SideEffectFreeWrite) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) OrderedWriteNode(org.graalvm.compiler.nodes.memory.OrderedWriteNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) OrderedWriteNode(org.graalvm.compiler.nodes.memory.OrderedWriteNode) WriteNode(org.graalvm.compiler.nodes.memory.WriteNode) AtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode) JavaWriteNode(org.graalvm.compiler.nodes.extended.JavaWriteNode) LoweredAtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode)

Aggregations

StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 JavaWriteNode (org.graalvm.compiler.nodes.extended.JavaWriteNode)1 AtomicReadAndWriteNode (org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode)1 LoweredAtomicReadAndWriteNode (org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode)1 OrderedWriteNode (org.graalvm.compiler.nodes.memory.OrderedWriteNode)1 SideEffectFreeWrite (org.graalvm.compiler.nodes.memory.SideEffectFreeWrite)1 WriteNode (org.graalvm.compiler.nodes.memory.WriteNode)1