mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 05:59:52 +00:00
8294356: IGV: scheduled graphs contain duplicated elements
Reviewed-by: chagedorn, thartmann
This commit is contained in:
parent
5e05e421ed
commit
97f1321cb4
@ -731,10 +731,9 @@ Node* IdealGraphPrinter::get_load_node(const Node* node) {
|
||||
|
||||
void IdealGraphPrinter::walk_nodes(Node* start, bool edges, VectorSet* temp_set) {
|
||||
VectorSet visited;
|
||||
GrowableArray<Node *> nodeStack(Thread::current()->resource_area(), 0, 0, NULL);
|
||||
GrowableArray<Node *> nodeStack(Thread::current()->resource_area(), 0, 0, nullptr);
|
||||
nodeStack.push(start);
|
||||
visited.test_set(start->_idx);
|
||||
if (C->cfg() != NULL) {
|
||||
if (C->cfg() != nullptr) {
|
||||
// once we have a CFG there are some nodes that aren't really
|
||||
// reachable but are in the CFG so add them here.
|
||||
for (uint i = 0; i < C->cfg()->number_of_blocks(); i++) {
|
||||
@ -745,25 +744,23 @@ void IdealGraphPrinter::walk_nodes(Node* start, bool edges, VectorSet* temp_set)
|
||||
}
|
||||
}
|
||||
|
||||
while(nodeStack.length() > 0) {
|
||||
while (nodeStack.length() > 0) {
|
||||
Node* n = nodeStack.pop();
|
||||
if (visited.test_set(n->_idx)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Node *n = nodeStack.pop();
|
||||
visit_node(n, edges, temp_set);
|
||||
|
||||
if (_traverse_outs) {
|
||||
for (DUIterator i = n->outs(); n->has_out(i); i++) {
|
||||
Node* p = n->out(i);
|
||||
if (!visited.test_set(p->_idx)) {
|
||||
nodeStack.push(p);
|
||||
}
|
||||
nodeStack.push(n->out(i));
|
||||
}
|
||||
}
|
||||
|
||||
for ( uint i = 0; i < n->len(); i++ ) {
|
||||
if ( n->in(i) ) {
|
||||
if (!visited.test_set(n->in(i)->_idx)) {
|
||||
nodeStack.push(n->in(i));
|
||||
}
|
||||
for (uint i = 0; i < n->len(); i++) {
|
||||
if (n->in(i) != nullptr) {
|
||||
nodeStack.push(n->in(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user