use of org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode in project graal by oracle.
the class WordOperationPlugin method casOp.
protected AbstractCompareAndSwapNode casOp(JavaKind writeKind, JavaKind returnKind, AddressNode address, LocationIdentity location, ValueNode expectedValue, ValueNode newValue) {
boolean isLogic = returnKind == JavaKind.Boolean;
assert isLogic || writeKind == returnKind : writeKind + " != " + returnKind;
AbstractCompareAndSwapNode cas;
if (isLogic) {
cas = new LogicCompareAndSwapNode(address, expectedValue, newValue, location);
} else {
cas = new ValueCompareAndSwapNode(address, expectedValue, newValue, location);
}
return cas;
}
use of org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode in project graal by oracle.
the class WriteBarrierAdditionPhase method run.
@SuppressWarnings("try")
@Override
protected void run(StructuredGraph graph) {
for (Node n : graph.getNodes()) {
try (DebugCloseable scope = n.graph().withNodeSourcePosition(n)) {
if (n instanceof ReadNode) {
addReadNodeBarriers((ReadNode) n, graph);
} else if (n instanceof WriteNode) {
addWriteNodeBarriers((WriteNode) n, graph);
} else if (n instanceof LoweredAtomicReadAndWriteNode) {
LoweredAtomicReadAndWriteNode loweredAtomicReadAndWriteNode = (LoweredAtomicReadAndWriteNode) n;
addAtomicReadWriteNodeBarriers(loweredAtomicReadAndWriteNode, graph);
} else if (n instanceof AbstractCompareAndSwapNode) {
addCASBarriers((AbstractCompareAndSwapNode) n, graph);
} else if (n instanceof ArrayRangeWrite) {
ArrayRangeWrite node = (ArrayRangeWrite) n;
if (node.writesObjectArray()) {
addArrayRangeBarriers(node, graph);
}
}
}
}
}
Aggregations