hotspot/src/share/vm/opto/cfgnode.cpp
changeset 25913 81dbc151e91c
parent 24923 9631f7d691dc
child 25930 eae8b7490d2c
equal deleted inserted replaced
25742:07bedc8d1893 25913:81dbc151e91c
   106         //  }
   106         //  }
   107         //}
   107         //}
   108 
   108 
   109         rreq++;                 // One more input to Region
   109         rreq++;                 // One more input to Region
   110       } // Found a region to merge into Region
   110       } // Found a region to merge into Region
       
   111       igvn->_worklist.push(r);
   111       // Clobber pointer to the now dead 'r'
   112       // Clobber pointer to the now dead 'r'
   112       region->set_req(i, phase->C->top());
   113       region->set_req(i, phase->C->top());
   113     }
   114     }
   114   }
   115   }
   115 
   116 
   447   }
   448   }
   448 
   449 
   449   // Remove TOP or NULL input paths. If only 1 input path remains, this Region
   450   // Remove TOP or NULL input paths. If only 1 input path remains, this Region
   450   // degrades to a copy.
   451   // degrades to a copy.
   451   bool add_to_worklist = false;
   452   bool add_to_worklist = false;
       
   453   bool modified = false;
   452   int cnt = 0;                  // Count of values merging
   454   int cnt = 0;                  // Count of values merging
   453   DEBUG_ONLY( int cnt_orig = req(); ) // Save original inputs count
   455   DEBUG_ONLY( int cnt_orig = req(); ) // Save original inputs count
   454   int del_it = 0;               // The last input path we delete
   456   int del_it = 0;               // The last input path we delete
   455   // For all inputs...
   457   // For all inputs...
   456   for( uint i=1; i<req(); ++i ){// For all paths in
   458   for( uint i=1; i<req(); ++i ){// For all paths in
   457     Node *n = in(i);            // Get the input
   459     Node *n = in(i);            // Get the input
   458     if( n != NULL ) {
   460     if( n != NULL ) {
   459       // Remove useless control copy inputs
   461       // Remove useless control copy inputs
   460       if( n->is_Region() && n->as_Region()->is_copy() ) {
   462       if( n->is_Region() && n->as_Region()->is_copy() ) {
   461         set_req(i, n->nonnull_req());
   463         set_req(i, n->nonnull_req());
       
   464         modified = true;
   462         i--;
   465         i--;
   463         continue;
   466         continue;
   464       }
   467       }
   465       if( n->is_Proj() ) {      // Remove useless rethrows
   468       if( n->is_Proj() ) {      // Remove useless rethrows
   466         Node *call = n->in(0);
   469         Node *call = n->in(0);
   467         if (call->is_Call() && call->as_Call()->entry_point() == OptoRuntime::rethrow_stub()) {
   470         if (call->is_Call() && call->as_Call()->entry_point() == OptoRuntime::rethrow_stub()) {
   468           set_req(i, call->in(0));
   471           set_req(i, call->in(0));
       
   472           modified = true;
   469           i--;
   473           i--;
   470           continue;
   474           continue;
   471         }
   475         }
   472       }
   476       }
   473       if( phase->type(n) == Type::TOP ) {
   477       if( phase->type(n) == Type::TOP ) {
   474         set_req(i, NULL);       // Ignore TOP inputs
   478         set_req(i, NULL);       // Ignore TOP inputs
       
   479         modified = true;
   475         i--;
   480         i--;
   476         continue;
   481         continue;
   477       }
   482       }
   478       cnt++;                    // One more value merging
   483       cnt++;                    // One more value merging
   479 
   484 
   689         }
   694         }
   690       }
   695       }
   691     }
   696     }
   692   }
   697   }
   693 
   698 
   694   return NULL;
   699   return modified ? this : NULL;
   695 }
   700 }
   696 
   701 
   697 
   702 
   698 
   703 
   699 const RegMask &RegionNode::out_RegMask() const {
   704 const RegMask &RegionNode::out_RegMask() const {