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 |