< prev index next >

src/hotspot/share/opto/phaseX.cpp

Print this page




1661     bool has_load_barriers = bs->has_load_barriers();
1662 
1663     if (use_op == Op_LoadP && use->bottom_type()->isa_rawptr()) {
1664       for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
1665         Node* u = use->fast_out(i2);
1666         const Type* ut = u->bottom_type();
1667         if (u->Opcode() == Op_LoadP && ut->isa_instptr()) {
1668           if (has_load_barriers) {
1669             // Search for load barriers behind the load
1670             for (DUIterator_Fast i3max, i3 = u->fast_outs(i3max); i3 < i3max; i3++) {
1671               Node* b = u->fast_out(i3);
1672               if (bs->is_gc_barrier_node(b)) {
1673                 _worklist.push(b);
1674               }
1675             }
1676           }
1677           _worklist.push(u);
1678         }
1679       }
1680     }








1681   }
1682 }
1683 
1684 /**
1685  * Remove the speculative part of all types that we know of
1686  */
1687 void PhaseIterGVN::remove_speculative_types()  {
1688   assert(UseTypeSpeculation, "speculation is off");
1689   for (uint i = 0; i < _types.Size(); i++)  {
1690     const Type* t = _types.fast_lookup(i);
1691     if (t != NULL) {
1692       _types.map(i, t->remove_speculative());
1693     }
1694   }
1695   _table.check_no_speculative_types();
1696 }
1697 
1698 //=============================================================================
1699 #ifndef PRODUCT
1700 uint PhaseCCP::_total_invokes   = 0;


2088         igvn->_worklist.push( old );
2089       break;
2090     case 1:
2091       if( old->is_Store() || old->has_special_unique_user() )
2092         igvn->add_users_to_worklist( old );
2093       break;
2094     case 2:
2095       if( old->is_Store() )
2096         igvn->add_users_to_worklist( old );
2097       if( old->Opcode() == Op_Region )
2098         igvn->_worklist.push(old);
2099       break;
2100     case 3:
2101       if( old->Opcode() == Op_Region ) {
2102         igvn->_worklist.push(old);
2103         igvn->add_users_to_worklist( old );
2104       }
2105       break;
2106     default:
2107       break;




2108     }
2109   }
2110 
2111 }
2112 
2113 //-------------------------------replace_by-----------------------------------
2114 // Using def-use info, replace one node for another.  Follow the def-use info
2115 // to all users of the OLD node.  Then make all uses point to the NEW node.
2116 void Node::replace_by(Node *new_node) {
2117   assert(!is_top(), "top node has no DU info");
2118   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; ) {
2119     Node* use = last_out(i);
2120     uint uses_found = 0;
2121     for (uint j = 0; j < use->len(); j++) {
2122       if (use->in(j) == this) {
2123         if (j < use->req())
2124               use->set_req(j, new_node);
2125         else  use->set_prec(j, new_node);
2126         uses_found++;
2127       }




1661     bool has_load_barriers = bs->has_load_barriers();
1662 
1663     if (use_op == Op_LoadP && use->bottom_type()->isa_rawptr()) {
1664       for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
1665         Node* u = use->fast_out(i2);
1666         const Type* ut = u->bottom_type();
1667         if (u->Opcode() == Op_LoadP && ut->isa_instptr()) {
1668           if (has_load_barriers) {
1669             // Search for load barriers behind the load
1670             for (DUIterator_Fast i3max, i3 = u->fast_outs(i3max); i3 < i3max; i3++) {
1671               Node* b = u->fast_out(i3);
1672               if (bs->is_gc_barrier_node(b)) {
1673                 _worklist.push(b);
1674               }
1675             }
1676           }
1677           _worklist.push(u);
1678         }
1679       }
1680     }
1681 
1682     // TODO: Needed after the block above?
1683     if (use->is_ShenandoahBarrier()) {
1684       Node* cmp = use->find_out_with(Op_CmpP);
1685       if (cmp != NULL) {
1686         _worklist.push(cmp);
1687       }
1688     }
1689   }
1690 }
1691 
1692 /**
1693  * Remove the speculative part of all types that we know of
1694  */
1695 void PhaseIterGVN::remove_speculative_types()  {
1696   assert(UseTypeSpeculation, "speculation is off");
1697   for (uint i = 0; i < _types.Size(); i++)  {
1698     const Type* t = _types.fast_lookup(i);
1699     if (t != NULL) {
1700       _types.map(i, t->remove_speculative());
1701     }
1702   }
1703   _table.check_no_speculative_types();
1704 }
1705 
1706 //=============================================================================
1707 #ifndef PRODUCT
1708 uint PhaseCCP::_total_invokes   = 0;


2096         igvn->_worklist.push( old );
2097       break;
2098     case 1:
2099       if( old->is_Store() || old->has_special_unique_user() )
2100         igvn->add_users_to_worklist( old );
2101       break;
2102     case 2:
2103       if( old->is_Store() )
2104         igvn->add_users_to_worklist( old );
2105       if( old->Opcode() == Op_Region )
2106         igvn->_worklist.push(old);
2107       break;
2108     case 3:
2109       if( old->Opcode() == Op_Region ) {
2110         igvn->_worklist.push(old);
2111         igvn->add_users_to_worklist( old );
2112       }
2113       break;
2114     default:
2115       break;
2116     }
2117     if (UseShenandoahGC) {
2118       // TODO: Should we call this for ZGC as well?
2119       BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn->_worklist, old);
2120     }
2121   }
2122 
2123 }
2124 
2125 //-------------------------------replace_by-----------------------------------
2126 // Using def-use info, replace one node for another.  Follow the def-use info
2127 // to all users of the OLD node.  Then make all uses point to the NEW node.
2128 void Node::replace_by(Node *new_node) {
2129   assert(!is_top(), "top node has no DU info");
2130   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; ) {
2131     Node* use = last_out(i);
2132     uint uses_found = 0;
2133     for (uint j = 0; j < use->len(); j++) {
2134       if (use->in(j) == this) {
2135         if (j < use->req())
2136               use->set_req(j, new_node);
2137         else  use->set_prec(j, new_node);
2138         uses_found++;
2139       }


< prev index next >