use of org.graalvm.compiler.nodes.memory.OrderedWriteNode in project graal by oracle.
the class DefaultJavaLoweringProvider method lowerStoreFieldNode.
protected void lowerStoreFieldNode(StoreFieldNode storeField, LoweringTool tool) {
StructuredGraph graph = storeField.graph();
ResolvedJavaField field = storeField.field();
ValueNode object = storeField.isStatic() ? staticFieldBase(graph, field) : storeField.object();
object = createNullCheckedValue(object, storeField, tool);
ValueNode value = implicitStoreConvert(graph, getStorageKind(storeField.field()), storeField.value());
AddressNode address = createFieldAddress(graph, object, field);
assert address != null;
BarrierType barrierType = barrierSet.fieldStoreBarrierType(field, getStorageKind(field));
WriteNode memoryWrite;
if (storeField.ordersMemoryAccesses()) {
memoryWrite = graph.add(new OrderedWriteNode(address, fieldLocationIdentity(field), value, barrierType, storeField.getMemoryOrder()));
} else {
memoryWrite = graph.add(new WriteNode(address, fieldLocationIdentity(field), value, barrierType));
}
memoryWrite.setStateAfter(storeField.stateAfter());
graph.replaceFixedWithFixed(storeField, memoryWrite);
}
use of org.graalvm.compiler.nodes.memory.OrderedWriteNode 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());
}
use of org.graalvm.compiler.nodes.memory.OrderedWriteNode in project graal by oracle.
the class DefaultJavaLoweringProvider method lowerUnsafeStoreNode.
protected void lowerUnsafeStoreNode(RawStoreNode store) {
StructuredGraph graph = store.graph();
boolean compressible = store.value().getStackKind() == JavaKind.Object;
JavaKind valueKind = store.accessKind();
ValueNode value = implicitStoreConvert(graph, valueKind, store.value(), compressible);
AddressNode address = createUnsafeAddress(graph, store.object(), store.offset());
WriteNode write;
if (store.ordersMemoryAccesses()) {
write = new OrderedWriteNode(address, store.getLocationIdentity(), value, barrierSet.storeBarrierType(store), store.getMemoryOrder());
} else {
write = new WriteNode(address, store.getLocationIdentity(), value, barrierSet.storeBarrierType(store));
}
write = graph.add(write);
write.setStateAfter(store.stateAfter());
graph.replaceFixedWithFixed(store, write);
}
Aggregations