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