use of org.graalvm.compiler.hotspot.nodes.ObjectWriteBarrier in project graal by oracle.
the class WriteBarrierVerificationPhase method validateWrite.
private void validateWrite(Node write) {
/*
* The currently validated write is checked in order to discover if it has an appropriate
* attached write barrier.
*/
if (hasAttachedBarrier((FixedWithNextNode) write)) {
return;
}
NodeFlood frontier = write.graph().createNodeFlood();
expandFrontier(frontier, write);
Iterator<Node> iterator = frontier.iterator();
while (iterator.hasNext()) {
Node currentNode = iterator.next();
if (isSafepoint(currentNode)) {
throw new AssertionError("Write barrier must be present " + write.toString(Verbosity.All) + " / " + write.inputs());
}
if (useG1GC()) {
if (!(currentNode instanceof G1PostWriteBarrier) || (!validateBarrier((FixedAccessNode) write, (ObjectWriteBarrier) currentNode))) {
expandFrontier(frontier, currentNode);
}
} else {
if (!(currentNode instanceof SerialWriteBarrier) || (!validateBarrier((FixedAccessNode) write, (ObjectWriteBarrier) currentNode)) || ((currentNode instanceof SerialWriteBarrier) && !validateBarrier((FixedAccessNode) write, (ObjectWriteBarrier) currentNode))) {
expandFrontier(frontier, currentNode);
}
}
}
}
Aggregations