src/share/vm/opto/domgraph.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8136457 Sdiff src/share/vm/opto

src/share/vm/opto/domgraph.cpp

Print this page
rev 7539 : 8011858: Use Compile::live_nodes() instead of Compile::unique() in appropriate places
Reviewed-by: kvn, vlivanov
Contributed-by: vlad.ureche@gmail.com


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




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


src/share/vm/opto/domgraph.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File