compile.cpp verify_graph_edges uses "bool" as "int"
instead of:
void Compile::verify_graph_edges(bool no_dead_code) {
if (VerifyGraphEdges) {
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
// Call recursive graph walk to check edges
_root->verify_edges(visited);
if (no_dead_code) {
// Now make sure that no visited node is used by an unvisited node.
bool dead_nodes = 0;
Unique_Node_List checked(area);
while (visited.size() > 0) {
Node* n = visited.pop();
checked.push(n);
for (uint i = 0; i < n->outcnt(); i++) {
Node* use = n->raw_out(i);
if (checked.member(use)) continue; // already checked
if (visited.member(use)) continue; // already in the graph
if (use->is_Con()) continue; // a dead ConNode is OK
// At this point, we have found a dead node which is DU-reachable.
if (dead_nodes++ == 0)
tty->print_cr("*** Dead nodes reachable via DU edges:");
use->dump(2);
tty->print_cr("---");
checked.push(use); // No repeats; pretend it is now checked.
}
}
assert(dead_nodes == 0, "using nodes must be reachable from root");
}
}
}
should be:
void Compile::verify_graph_edges(bool no_dead_code) {
if (VerifyGraphEdges) {
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
// Call recursive graph walk to check edges
_root->verify_edges(visited);
if (no_dead_code) {
// Now make sure that no visited node is used by an unvisited node.
int dead_nodes = 0;
Unique_Node_List checked(area);
while (visited.size() > 0) {
Node* n = visited.pop();
checked.push(n);
for (uint i = 0; i < n->outcnt(); i++) {
Node* use = n->raw_out(i);
if (checked.member(use)) continue; // already checked
if (visited.member(use)) continue; // already in the graph
if (use->is_Con()) continue; // a dead ConNode is OK
// At this point, we have found a dead node which is DU-reachable.
if (dead_nodes++ == 0)
tty->print_cr("*** Dead nodes reachable via DU edges:");
use->dump(2);
tty->print_cr("---");
checked.push(use); // No repeats; pretend it is now checked.
}
}
assert(dead_nodes == 0, "using nodes must be reachable from root");
}
}
}