use of org.graalvm.compiler.nodes.extended.GuardedUnsafeLoadNode in project graal by oracle.
the class DefaultJavaLoweringProvider method lowerUnsafeLoadNode.
/**
* @param tool utility for performing the lowering
*/
protected void lowerUnsafeLoadNode(RawLoadNode load, LoweringTool tool) {
StructuredGraph graph = load.graph();
if (load instanceof GuardedUnsafeLoadNode) {
GuardedUnsafeLoadNode guardedLoad = (GuardedUnsafeLoadNode) load;
GuardingNode guard = guardedLoad.getGuard();
if (guard == null) {
// can float freely if the guard folded away
ReadNode memoryRead = createUnsafeRead(graph, load, null);
memoryRead.setForceFixed(false);
graph.replaceFixedWithFixed(load, memoryRead);
} else {
// must be guarded, but flows below the guard
ReadNode memoryRead = createUnsafeRead(graph, load, guard);
graph.replaceFixedWithFixed(load, memoryRead);
}
} else {
// never had a guarding condition so it must be fixed, creation of the read will force
// it to be fixed
ReadNode memoryRead = createUnsafeRead(graph, load, null);
graph.replaceFixedWithFixed(load, memoryRead);
}
}
Aggregations