< prev index next >

src/hotspot/share/opto/phaseX.cpp

Print this page
rev 52710 : Upstream/backport Shenandoah to JDK11u


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       }
2128     }




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     if (UseShenandoahGC) {
2110       // TODO: Should we call this for ZGC as well?
2111       BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn->_worklist, old);
2112     }
2113   }
2114 
2115 }
2116 
2117 //-------------------------------replace_by-----------------------------------
2118 // Using def-use info, replace one node for another.  Follow the def-use info
2119 // to all users of the OLD node.  Then make all uses point to the NEW node.
2120 void Node::replace_by(Node *new_node) {
2121   assert(!is_top(), "top node has no DU info");
2122   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; ) {
2123     Node* use = last_out(i);
2124     uint uses_found = 0;
2125     for (uint j = 0; j < use->len(); j++) {
2126       if (use->in(j) == this) {
2127         if (j < use->req())
2128               use->set_req(j, new_node);
2129         else  use->set_prec(j, new_node);
2130         uses_found++;
2131       }
2132     }


< prev index next >