< prev index next >

src/share/vm/opto/chaitin.cpp

Print this page




1716       // Add the projection nodes to the CFG
1717       for (DUIterator_Fast imax, i = base->fast_outs(imax); i < imax; i++) {
1718         Node* use = base->fast_out(i);
1719         if (use->is_MachProj()) {
1720           startb->insert_node(use, ++node_pos);
1721           _cfg.map_node_to_block(use, startb);
1722           new_lrg(use, maxlrg++);
1723         }
1724       }
1725     }
1726     if (_lrg_map.live_range_id(base) == 0) {
1727       new_lrg(base, maxlrg++);
1728     }
1729     assert(base->in(0) == _cfg.get_root_node() && _cfg.get_block_for_node(base) == _cfg.get_block_for_node(C->top()), "base NULL should be shared");
1730     derived_base_map[derived->_idx] = base;
1731     return base;
1732   }
1733 
1734   // Check for AddP-related opcodes
1735   if (!derived->is_Phi()) {
1736     assert(derived->as_Mach()->ideal_Opcode() == Op_AddP, err_msg_res("but is: %s", derived->Name()));
1737     Node *base = derived->in(AddPNode::Base);
1738     derived_base_map[derived->_idx] = base;
1739     return base;
1740   }
1741 
1742   // Recursively find bases for Phis.
1743   // First check to see if we can avoid a base Phi here.
1744   Node *base = find_base_for_derived( derived_base_map, derived->in(1),maxlrg);
1745   uint i;
1746   for( i = 2; i < derived->req(); i++ )
1747     if( base != find_base_for_derived( derived_base_map,derived->in(i),maxlrg))
1748       break;
1749   // Went to the end without finding any different bases?
1750   if( i == derived->req() ) {   // No need for a base Phi here
1751     derived_base_map[derived->_idx] = base;
1752     return base;
1753   }
1754 
1755   // Now we see we need a base-Phi here to merge the bases
1756   const Type *t = base->bottom_type();




1716       // Add the projection nodes to the CFG
1717       for (DUIterator_Fast imax, i = base->fast_outs(imax); i < imax; i++) {
1718         Node* use = base->fast_out(i);
1719         if (use->is_MachProj()) {
1720           startb->insert_node(use, ++node_pos);
1721           _cfg.map_node_to_block(use, startb);
1722           new_lrg(use, maxlrg++);
1723         }
1724       }
1725     }
1726     if (_lrg_map.live_range_id(base) == 0) {
1727       new_lrg(base, maxlrg++);
1728     }
1729     assert(base->in(0) == _cfg.get_root_node() && _cfg.get_block_for_node(base) == _cfg.get_block_for_node(C->top()), "base NULL should be shared");
1730     derived_base_map[derived->_idx] = base;
1731     return base;
1732   }
1733 
1734   // Check for AddP-related opcodes
1735   if (!derived->is_Phi()) {
1736     assert(derived->as_Mach()->ideal_Opcode() == Op_AddP, "but is: %s", derived->Name());
1737     Node *base = derived->in(AddPNode::Base);
1738     derived_base_map[derived->_idx] = base;
1739     return base;
1740   }
1741 
1742   // Recursively find bases for Phis.
1743   // First check to see if we can avoid a base Phi here.
1744   Node *base = find_base_for_derived( derived_base_map, derived->in(1),maxlrg);
1745   uint i;
1746   for( i = 2; i < derived->req(); i++ )
1747     if( base != find_base_for_derived( derived_base_map,derived->in(i),maxlrg))
1748       break;
1749   // Went to the end without finding any different bases?
1750   if( i == derived->req() ) {   // No need for a base Phi here
1751     derived_base_map[derived->_idx] = base;
1752     return base;
1753   }
1754 
1755   // Now we see we need a base-Phi here to merge the bases
1756   const Type *t = base->bottom_type();


< prev index next >