use of org.graalvm.compiler.nodes.extended.ArrayRangeWrite in project graal by oracle.
the class WriteBarrierVerificationPhase method hasAttachedBarrier.
private boolean hasAttachedBarrier(FixedWithNextNode node) {
final Node next = node.next();
final Node previous = node.predecessor();
boolean validatePreBarrier = useG1GC() && (isObjectWrite(node) || !((ArrayRangeWrite) node).isInitialization());
if (node instanceof WriteNode) {
WriteNode writeNode = (WriteNode) node;
if (writeNode.getLocationIdentity().isInit()) {
validatePreBarrier = false;
}
}
if (isObjectWrite(node)) {
return (isObjectBarrier(node, next) || StampTool.isPointerAlwaysNull(getValueWritten(node))) && (!validatePreBarrier || isObjectBarrier(node, previous));
} else if (isObjectArrayRangeWrite(node)) {
return (isArrayBarrier(node, next) || StampTool.isPointerAlwaysNull(getValueWritten(node))) && (!validatePreBarrier || isArrayBarrier(node, previous));
} else {
return true;
}
}
use of org.graalvm.compiler.nodes.extended.ArrayRangeWrite 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