src/share/vm/opto/phaseX.cpp

Print this page




1757           Node* m = n->out(i);
1758           if( m->is_Phi() ) {
1759             assert(type(m) == Type::TOP, "Unreachable region should not have live phis.");
1760             replace_node(m, nn);
1761             --i; // deleted this phi; rescan starting with next position
1762           }
1763         }
1764       }
1765       replace_node(n,nn);       // Update DefUse edges for new constant
1766     }
1767     return nn;
1768   }
1769 
1770   // If x is a TypeNode, capture any more-precise type permanently into Node
1771   if (t != n->bottom_type()) {
1772     hash_delete(n);             // changing bottom type may force a rehash
1773     n->raise_bottom_type(t);
1774     _worklist.push(n);          // n re-enters the hash table via the worklist
1775   }
1776 
1777   // Idealize graph using DU info.  Must clone() into new-space.
1778   // DU info is generally used to show profitability, progress or safety
1779   // (but generally not needed for correctness).
1780   Node *nn = n->Ideal_DU_postCCP(this);
1781 
1782   // TEMPORARY fix to ensure that 2nd GVN pass eliminates NULL checks
1783   switch( n->Opcode() ) {
1784   case Op_FastLock:      // Revisit FastLocks for lock coarsening
1785   case Op_If:
1786   case Op_CountedLoopEnd:
1787   case Op_Region:
1788   case Op_Loop:
1789   case Op_CountedLoop:
1790   case Op_Conv2B:
1791   case Op_Opaque1:
1792   case Op_Opaque2:
1793     _worklist.push(n);
1794     break;
1795   default:
1796     break;
1797   }
1798   if( nn ) {
1799     _worklist.push(n);
1800     // Put users of 'n' onto worklist for second igvn transform
1801     add_users_to_worklist(n);
1802     return nn;
1803   }
1804 
1805   return  n;
1806 }
1807 
1808 //---------------------------------saturate------------------------------------
1809 const Type* PhaseCCP::saturate(const Type* new_type, const Type* old_type,
1810                                const Type* limit_type) const {
1811   const Type* wide_type = new_type->widen(old_type, limit_type);
1812   if (wide_type != new_type) {          // did we widen?
1813     // If so, we may have widened beyond the limit type.  Clip it back down.
1814     new_type = wide_type->filter(limit_type);
1815   }
1816   return new_type;
1817 }
1818 
1819 //------------------------------print_statistics-------------------------------
1820 #ifndef PRODUCT
1821 void PhaseCCP::print_statistics() {
1822   tty->print_cr("CCP: %d  constants found: %d", _total_invokes, _total_constants);
1823 }
1824 #endif




1757           Node* m = n->out(i);
1758           if( m->is_Phi() ) {
1759             assert(type(m) == Type::TOP, "Unreachable region should not have live phis.");
1760             replace_node(m, nn);
1761             --i; // deleted this phi; rescan starting with next position
1762           }
1763         }
1764       }
1765       replace_node(n,nn);       // Update DefUse edges for new constant
1766     }
1767     return nn;
1768   }
1769 
1770   // If x is a TypeNode, capture any more-precise type permanently into Node
1771   if (t != n->bottom_type()) {
1772     hash_delete(n);             // changing bottom type may force a rehash
1773     n->raise_bottom_type(t);
1774     _worklist.push(n);          // n re-enters the hash table via the worklist
1775   }
1776 





1777   // TEMPORARY fix to ensure that 2nd GVN pass eliminates NULL checks
1778   switch( n->Opcode() ) {
1779   case Op_FastLock:      // Revisit FastLocks for lock coarsening
1780   case Op_If:
1781   case Op_CountedLoopEnd:
1782   case Op_Region:
1783   case Op_Loop:
1784   case Op_CountedLoop:
1785   case Op_Conv2B:
1786   case Op_Opaque1:
1787   case Op_Opaque2:
1788     _worklist.push(n);
1789     break;
1790   default:
1791     break;
1792   }







1793   return  n;
1794 }
1795 
1796 //---------------------------------saturate------------------------------------
1797 const Type* PhaseCCP::saturate(const Type* new_type, const Type* old_type,
1798                                const Type* limit_type) const {
1799   const Type* wide_type = new_type->widen(old_type, limit_type);
1800   if (wide_type != new_type) {          // did we widen?
1801     // If so, we may have widened beyond the limit type.  Clip it back down.
1802     new_type = wide_type->filter(limit_type);
1803   }
1804   return new_type;
1805 }
1806 
1807 //------------------------------print_statistics-------------------------------
1808 #ifndef PRODUCT
1809 void PhaseCCP::print_statistics() {
1810   tty->print_cr("CCP: %d  constants found: %d", _total_invokes, _total_constants);
1811 }
1812 #endif