use of org.graalvm.compiler.nodes.extended.JavaOrderedReadNode in project graal by oracle.
the class WordOperationPlugin method readVolatileOp.
protected ValueNode readVolatileOp(GraphBuilderContext b, JavaKind readKind, AddressNode address, LocationIdentity location, Opcode op) {
assert op == Opcode.READ_POINTER_VOLATILE || op == Opcode.READ_BARRIERED_VOLATILE;
final BarrierType barrier = op == Opcode.READ_BARRIERED_VOLATILE ? BarrierType.UNKNOWN : BarrierType.NONE;
final boolean compressible = op == Opcode.READ_BARRIERED_VOLATILE;
/*
* A JavaOrderedReadNode is lowered to an OrderedReadNode that will not float. This means it
* cannot float above an explicit zero check on its base address or any other test that
* ensures the read is safe.
*/
JavaReadNode read = b.add(new JavaOrderedReadNode(readKind, address, location, barrier, MemoryOrderMode.VOLATILE, compressible));
return read;
}
use of org.graalvm.compiler.nodes.extended.JavaOrderedReadNode in project graal by oracle.
the class LoadVMThreadLocalNode method lower.
@Override
public void lower(LoweringTool tool) {
assert threadLocalInfo.offset >= 0;
ConstantNode offset = ConstantNode.forLong(threadLocalInfo.offset, holder.graph());
AddressNode address = graph().unique(new OffsetAddressNode(holder, offset));
JavaReadNode read;
if (MemoryOrderMode.ordersMemoryAccesses(memoryOrder)) {
read = graph().add(new JavaOrderedReadNode(stamp, threadLocalInfo.storageKind, address, threadLocalInfo.locationIdentity, barrierType, memoryOrder, true));
} else {
read = graph().add(new JavaReadNode(stamp, threadLocalInfo.storageKind, address, threadLocalInfo.locationIdentity, barrierType, true));
if (threadLocalInfo.allowFloatingReads) {
/*
* Setting a guarding node allows a JavaReadNode to float when lowered. Otherwise
* they will be conservatively be forced at a fixed location.
*/
read.setGuard(read.graph().start());
}
}
graph().replaceFixedWithFixed(this, read);
tool.getLowerer().lower(read, tool);
}
Aggregations