< prev index next >

src/hotspot/share/opto/phaseX.cpp

Print this page




1358             if (in->outcnt() == 0) { // Made input go dead?
1359               _stack.push(in, PROCESS_INPUTS); // Recursively remove
1360               recurse = true;
1361             } else if (in->outcnt() == 1 &&
1362                        in->has_special_unique_user()) {
1363               _worklist.push(in->unique_out());
1364             } else if (in->outcnt() <= 2 && dead->is_Phi()) {
1365               if (in->Opcode() == Op_Region) {
1366                 _worklist.push(in);
1367               } else if (in->is_Store()) {
1368                 DUIterator_Fast imax, i = in->fast_outs(imax);
1369                 _worklist.push(in->fast_out(i));
1370                 i++;
1371                 if (in->outcnt() == 2) {
1372                   _worklist.push(in->fast_out(i));
1373                   i++;
1374                 }
1375                 assert(!(i < imax), "sanity");
1376               }
1377             } else {
1378               BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(_worklist, in);
1379             }
1380             if (ReduceFieldZeroing && dead->is_Load() && i == MemNode::Memory &&
1381                 in->is_Proj() && in->in(0) != NULL && in->in(0)->is_Initialize()) {
1382               // A Load that directly follows an InitializeNode is
1383               // going away. The Stores that follow are candidates
1384               // again to be captured by the InitializeNode.
1385               for (DUIterator_Fast jmax, j = in->fast_outs(jmax); j < jmax; j++) {
1386                 Node *n = in->fast_out(j);
1387                 if (n->is_Store()) {
1388                   _worklist.push(n);
1389                 }
1390               }
1391             }
1392           } // if (in != NULL && in != C->top())
1393         } // for (uint i = 0; i < dead->req(); i++)
1394         if (recurse) {
1395           continue;
1396         }
1397       } // if (!dead->is_Con())
1398     } // if (progress_state == PROCESS_INPUTS)


2072       break;
2073     case 1:
2074       if( old->is_Store() || old->has_special_unique_user() )
2075         igvn->add_users_to_worklist( old );
2076       break;
2077     case 2:
2078       if( old->is_Store() )
2079         igvn->add_users_to_worklist( old );
2080       if( old->Opcode() == Op_Region )
2081         igvn->_worklist.push(old);
2082       break;
2083     case 3:
2084       if( old->Opcode() == Op_Region ) {
2085         igvn->_worklist.push(old);
2086         igvn->add_users_to_worklist( old );
2087       }
2088       break;
2089     default:
2090       break;
2091     }


2092   }
2093 
2094 }
2095 
2096 //-------------------------------replace_by-----------------------------------
2097 // Using def-use info, replace one node for another.  Follow the def-use info
2098 // to all users of the OLD node.  Then make all uses point to the NEW node.
2099 void Node::replace_by(Node *new_node) {
2100   assert(!is_top(), "top node has no DU info");
2101   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; ) {
2102     Node* use = last_out(i);
2103     uint uses_found = 0;
2104     for (uint j = 0; j < use->len(); j++) {
2105       if (use->in(j) == this) {
2106         if (j < use->req())
2107               use->set_req(j, new_node);
2108         else  use->set_prec(j, new_node);
2109         uses_found++;
2110       }
2111     }




1358             if (in->outcnt() == 0) { // Made input go dead?
1359               _stack.push(in, PROCESS_INPUTS); // Recursively remove
1360               recurse = true;
1361             } else if (in->outcnt() == 1 &&
1362                        in->has_special_unique_user()) {
1363               _worklist.push(in->unique_out());
1364             } else if (in->outcnt() <= 2 && dead->is_Phi()) {
1365               if (in->Opcode() == Op_Region) {
1366                 _worklist.push(in);
1367               } else if (in->is_Store()) {
1368                 DUIterator_Fast imax, i = in->fast_outs(imax);
1369                 _worklist.push(in->fast_out(i));
1370                 i++;
1371                 if (in->outcnt() == 2) {
1372                   _worklist.push(in->fast_out(i));
1373                   i++;
1374                 }
1375                 assert(!(i < imax), "sanity");
1376               }
1377             } else {
1378               BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(this, in);
1379             }
1380             if (ReduceFieldZeroing && dead->is_Load() && i == MemNode::Memory &&
1381                 in->is_Proj() && in->in(0) != NULL && in->in(0)->is_Initialize()) {
1382               // A Load that directly follows an InitializeNode is
1383               // going away. The Stores that follow are candidates
1384               // again to be captured by the InitializeNode.
1385               for (DUIterator_Fast jmax, j = in->fast_outs(jmax); j < jmax; j++) {
1386                 Node *n = in->fast_out(j);
1387                 if (n->is_Store()) {
1388                   _worklist.push(n);
1389                 }
1390               }
1391             }
1392           } // if (in != NULL && in != C->top())
1393         } // for (uint i = 0; i < dead->req(); i++)
1394         if (recurse) {
1395           continue;
1396         }
1397       } // if (!dead->is_Con())
1398     } // if (progress_state == PROCESS_INPUTS)


2072       break;
2073     case 1:
2074       if( old->is_Store() || old->has_special_unique_user() )
2075         igvn->add_users_to_worklist( old );
2076       break;
2077     case 2:
2078       if( old->is_Store() )
2079         igvn->add_users_to_worklist( old );
2080       if( old->Opcode() == Op_Region )
2081         igvn->_worklist.push(old);
2082       break;
2083     case 3:
2084       if( old->Opcode() == Op_Region ) {
2085         igvn->_worklist.push(old);
2086         igvn->add_users_to_worklist( old );
2087       }
2088       break;
2089     default:
2090       break;
2091     }
2092 
2093     BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn, old);
2094   }
2095 
2096 }
2097 
2098 //-------------------------------replace_by-----------------------------------
2099 // Using def-use info, replace one node for another.  Follow the def-use info
2100 // to all users of the OLD node.  Then make all uses point to the NEW node.
2101 void Node::replace_by(Node *new_node) {
2102   assert(!is_top(), "top node has no DU info");
2103   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; ) {
2104     Node* use = last_out(i);
2105     uint uses_found = 0;
2106     for (uint j = 0; j < use->len(); j++) {
2107       if (use->in(j) == this) {
2108         if (j < use->req())
2109               use->set_req(j, new_node);
2110         else  use->set_prec(j, new_node);
2111         uses_found++;
2112       }
2113     }


< prev index next >