< prev index next >

hotspot/src/share/vm/opto/buildOopMap.cpp

Print this page




 598     // otherwise.  All-preds-visited order allows me to recycle OopFlow
 599     // structures rapidly and cut down on the memory footprint.
 600     // Note: not all predecessors might be visited yet (must happen for
 601     // irreducible loops).  This is OK, since every live value must have the
 602     // SAME reaching def for the block, so any reaching def is OK.
 603     uint i;
 604 
 605     Block *b = worklist.pop();
 606     // Ignore root block
 607     if (b == _cfg->get_root_block()) {
 608       continue;
 609     }
 610     // Block is already done?  Happens if block has several predecessors,
 611     // he can get on the worklist more than once.
 612     if( flows[b->_pre_order] ) continue;
 613 
 614     // If this block has a visited predecessor AND that predecessor has this
 615     // last block as his only undone child, we can move the OopFlow from the
 616     // pred to this block.  Otherwise we have to grab a new OopFlow.
 617     OopFlow *flow = NULL;       // Flag for finding optimized flow
 618     Block *pred = (Block*)0xdeadbeef;
 619     // Scan this block's preds to find a done predecessor
 620     for (uint j = 1; j < b->num_preds(); j++) {
 621       Block* p = _cfg->get_block_for_node(b->pred(j));
 622       OopFlow *p_flow = flows[p->_pre_order];
 623       if( p_flow ) {            // Predecessor is done
 624         assert( p_flow->_b == p, "cross check" );
 625         pred = p;               // Record some predecessor
 626         // If all successors of p are done except for 'b', then we can carry
 627         // p_flow forward to 'b' without copying, otherwise we have to draw
 628         // from the free_list and clone data.
 629         uint k;
 630         for( k=0; k<p->_num_succs; k++ )
 631           if( !flows[p->_succs[k]->_pre_order] &&
 632               p->_succs[k] != b )
 633             break;
 634 
 635         // Either carry-forward the now-unused OopFlow for b's use
 636         // or draw a new one from the free list
 637         if( k==p->_num_succs ) {
 638           flow = p_flow;




 598     // otherwise.  All-preds-visited order allows me to recycle OopFlow
 599     // structures rapidly and cut down on the memory footprint.
 600     // Note: not all predecessors might be visited yet (must happen for
 601     // irreducible loops).  This is OK, since every live value must have the
 602     // SAME reaching def for the block, so any reaching def is OK.
 603     uint i;
 604 
 605     Block *b = worklist.pop();
 606     // Ignore root block
 607     if (b == _cfg->get_root_block()) {
 608       continue;
 609     }
 610     // Block is already done?  Happens if block has several predecessors,
 611     // he can get on the worklist more than once.
 612     if( flows[b->_pre_order] ) continue;
 613 
 614     // If this block has a visited predecessor AND that predecessor has this
 615     // last block as his only undone child, we can move the OopFlow from the
 616     // pred to this block.  Otherwise we have to grab a new OopFlow.
 617     OopFlow *flow = NULL;       // Flag for finding optimized flow
 618     Block *pred = (Block*)(uintptr_t)0xdeadbeef;
 619     // Scan this block's preds to find a done predecessor
 620     for (uint j = 1; j < b->num_preds(); j++) {
 621       Block* p = _cfg->get_block_for_node(b->pred(j));
 622       OopFlow *p_flow = flows[p->_pre_order];
 623       if( p_flow ) {            // Predecessor is done
 624         assert( p_flow->_b == p, "cross check" );
 625         pred = p;               // Record some predecessor
 626         // If all successors of p are done except for 'b', then we can carry
 627         // p_flow forward to 'b' without copying, otherwise we have to draw
 628         // from the free_list and clone data.
 629         uint k;
 630         for( k=0; k<p->_num_succs; k++ )
 631           if( !flows[p->_succs[k]->_pre_order] &&
 632               p->_succs[k] != b )
 633             break;
 634 
 635         // Either carry-forward the now-unused OopFlow for b's use
 636         // or draw a new one from the free list
 637         if( k==p->_num_succs ) {
 638           flow = p_flow;


< prev index next >