use of org.graalvm.compiler.graph.NodeSuccessorList in project graal by oracle.
the class LoopDetector method makeSuccessorStubs.
/**
* Process successor edges of a node. We create the successor nodes so that we can fill the
* successor list, but no properties or edges are loaded yet. That is done when the successor is
* on top of the worklist in {@link #processNextNode}.
*/
protected void makeSuccessorStubs(MethodScope methodScope, LoopScope loopScope, Node node, boolean updatePredecessors) {
Edges edges = node.getNodeClass().getSuccessorEdges();
for (int index = 0; index < edges.getDirectCount(); index++) {
if (skipDirectEdge(node, edges, index)) {
continue;
}
int orderId = readOrderId(methodScope);
Node value = makeStubNode(methodScope, loopScope, orderId);
edges.initializeNode(node, index, value);
if (updatePredecessors && value != null) {
edges.update(node, null, value);
}
}
for (int index = edges.getDirectCount(); index < edges.getCount(); index++) {
int size = methodScope.reader.getSVInt();
if (size != -1) {
NodeList<Node> nodeList = new NodeSuccessorList<>(node, size);
edges.initializeList(node, index, nodeList);
for (int idx = 0; idx < size; idx++) {
int orderId = readOrderId(methodScope);
Node value = makeStubNode(methodScope, loopScope, orderId);
nodeList.initialize(idx, value);
if (updatePredecessors && value != null) {
edges.update(node, null, value);
}
}
}
}
}
Aggregations