use of org.graalvm.compiler.nodes.java.LoweredAtomicReadAndAddNode in project graal by oracle.
the class DefaultJavaLoweringProvider method lowerAtomicReadAndAddNode.
protected void lowerAtomicReadAndAddNode(AtomicReadAndAddNode n) {
StructuredGraph graph = n.graph();
JavaKind valueKind = n.getValueKind();
ValueNode delta = implicitStoreConvert(graph, valueKind, n.delta());
AddressNode address = graph.unique(new OffsetAddressNode(n.object(), n.offset()));
BarrierType barrierType = barrierSet.guessStoreBarrierType(n.object(), delta);
LIRKind lirAccessKind = LIRKind.fromJavaKind(target.arch, valueKind);
LoweredAtomicReadAndAddNode memoryRead = graph.add(new LoweredAtomicReadAndAddNode(address, n.getKilledLocationIdentity(), delta, lirAccessKind, barrierType));
memoryRead.setStateAfter(n.stateAfter());
ValueNode readValue = implicitLoadConvert(graph, valueKind, memoryRead);
n.stateAfter().replaceFirstInput(n, memoryRead);
n.replaceAtUsages(readValue);
graph.replaceFixedWithFixed(n, memoryRead);
}
Aggregations