489 tdom->_dom_child = t; // Make me a child of my parent
490 } else
491 _idom[C->root()->_idx] = NULL; // Root
492 }
493 w->setdepth( C->unique()+1, _dom_depth ); // Set depth in dominator tree
494 // Pick up the 'top' node as well
495 _idom [C->top()->_idx] = C->root();
496 _dom_depth[C->top()->_idx] = 1;
497
498 // Debug Print of Dominator tree
499 if( PrintDominators ) {
500 #ifndef PRODUCT
501 w->dump(0);
502 #endif
503 }
504 }
505
506 // Perform DFS search. Setup 'vertex' as DFS to vertex mapping. Setup
507 // 'semi' as vertex to DFS mapping. Set 'parent' to DFS parent.
508 int NTarjan::DFS( NTarjan *ntarjan, VectorSet &visited, PhaseIdealLoop *pil, uint *dfsorder) {
509 // Allocate stack of size C->unique()/8 to avoid frequent realloc
510 GrowableArray <Node *> dfstack(pil->C->live_nodes() >> 3);
511 Node *b = pil->C->root();
512 int dfsnum = 1;
513 dfsorder[b->_idx] = dfsnum; // Cache parent's dfsnum for a later use
514 dfstack.push(b);
515
516 while (dfstack.is_nonempty()) {
517 b = dfstack.pop();
518 if( !visited.test_set(b->_idx) ) { // Test node and flag it as visited
519 NTarjan *w = &ntarjan[dfsnum];
520 // Only fully process control nodes
521 w->_control = b; // Save actual node
522 // Use parent's cached dfsnum to identify "Parent in DFS"
523 w->_parent = &ntarjan[dfsorder[b->_idx]];
524 dfsorder[b->_idx] = dfsnum; // Save DFS order info
525 w->_semi = dfsnum; // Node to DFS map
526 w->_label = w; // DFS to vertex map
527 w->_ancestor = NULL; // Fast LINK & EVAL setup
528 w->_child = &ntarjan[0]; // Sentinal
529 w->_size = 1;
|
489 tdom->_dom_child = t; // Make me a child of my parent
490 } else
491 _idom[C->root()->_idx] = NULL; // Root
492 }
493 w->setdepth( C->unique()+1, _dom_depth ); // Set depth in dominator tree
494 // Pick up the 'top' node as well
495 _idom [C->top()->_idx] = C->root();
496 _dom_depth[C->top()->_idx] = 1;
497
498 // Debug Print of Dominator tree
499 if( PrintDominators ) {
500 #ifndef PRODUCT
501 w->dump(0);
502 #endif
503 }
504 }
505
506 // Perform DFS search. Setup 'vertex' as DFS to vertex mapping. Setup
507 // 'semi' as vertex to DFS mapping. Set 'parent' to DFS parent.
508 int NTarjan::DFS( NTarjan *ntarjan, VectorSet &visited, PhaseIdealLoop *pil, uint *dfsorder) {
509 // Allocate stack of size C->live_nodes()/8 to avoid frequent realloc
510 GrowableArray <Node *> dfstack(pil->C->live_nodes() >> 3);
511 Node *b = pil->C->root();
512 int dfsnum = 1;
513 dfsorder[b->_idx] = dfsnum; // Cache parent's dfsnum for a later use
514 dfstack.push(b);
515
516 while (dfstack.is_nonempty()) {
517 b = dfstack.pop();
518 if( !visited.test_set(b->_idx) ) { // Test node and flag it as visited
519 NTarjan *w = &ntarjan[dfsnum];
520 // Only fully process control nodes
521 w->_control = b; // Save actual node
522 // Use parent's cached dfsnum to identify "Parent in DFS"
523 w->_parent = &ntarjan[dfsorder[b->_idx]];
524 dfsorder[b->_idx] = dfsnum; // Save DFS order info
525 w->_semi = dfsnum; // Node to DFS map
526 w->_label = w; // DFS to vertex map
527 w->_ancestor = NULL; // Fast LINK & EVAL setup
528 w->_child = &ntarjan[0]; // Sentinal
529 w->_size = 1;
|