@@ -3742,7 +3742,7 @@ bool Compile::final_graph_reshaping() {
37423742 // 'fall-thru' path, so expected kids is 1 less.
37433743 if (n->is_PCTable () && n->in (0 ) && n->in (0 )->in (0 )) {
37443744 if (n->in (0 )->in (0 )->is_Call ()) {
3745- CallNode* call = n->in (0 )->in (0 )->as_Call ();
3745+ CallNode * call = n->in (0 )->in (0 )->as_Call ();
37463746 if (call->entry_point () == OptoRuntime::rethrow_stub ()) {
37473747 required_outcnt--; // Rethrow always has 1 less kid
37483748 } else if (call->req () > TypeFunc::Parms &&
@@ -3751,25 +3751,22 @@ bool Compile::final_graph_reshaping() {
37513751 // detected that the virtual call will always result in a null
37523752 // pointer exception. The fall-through projection of this CatchNode
37533753 // will not be populated.
3754- Node* arg0 = call->in (TypeFunc::Parms);
3754+ Node * arg0 = call->in (TypeFunc::Parms);
37553755 if (arg0->is_Type () &&
37563756 arg0->as_Type ()->type ()->higher_equal (TypePtr::NULL_PTR)) {
37573757 required_outcnt--;
37583758 }
3759- } else if (call->entry_point () == OptoRuntime::new_array_Java () ||
3760- call->entry_point () == OptoRuntime::new_array_nozero_Java ()) {
3759+ } else if (call->entry_point () == OptoRuntime::new_array_Java () &&
3760+ call->req () > TypeFunc::Parms+1 &&
3761+ call->is_CallStaticJava ()) {
37613762 // Check for negative array length. In such case, the optimizer has
37623763 // detected that the allocation attempt will always result in an
37633764 // exception. There is no fall-through projection of this CatchNode .
3764- assert (call->is_CallStaticJava (), " static call expected" );
3765- assert (call->len () > call->req () && call->in (call->req ()) != NULL , " no precendent edge" );
3766- Node* valid_length_test = call->in (call->req ());
3767- call->rm_prec (call->req ());
3768- if (valid_length_test->find_int_con (1 ) == 0 ) {
3765+ Node *arg1 = call->in (TypeFunc::Parms+1 );
3766+ if (arg1->is_Type () &&
3767+ arg1->as_Type ()->type ()->join (TypeInt::POS)->empty ()) {
37693768 required_outcnt--;
37703769 }
3771- assert (n->outcnt () == required_outcnt, " malformed control flow" );
3772- continue ;
37733770 }
37743771 }
37753772 }
@@ -3778,13 +3775,6 @@ bool Compile::final_graph_reshaping() {
37783775 record_method_not_compilable (" malformed control flow" );
37793776 return true ; // Not all targets reachable!
37803777 }
3781- } else if (n->is_PCTable () && n->in (0 ) && n->in (0 )->in (0 ) && n->in (0 )->in (0 )->is_Call ()) {
3782- CallNode* call = n->in (0 )->in (0 )->as_Call ();
3783- if (call->entry_point () == OptoRuntime::new_array_Java () ||
3784- call->entry_point () == OptoRuntime::new_array_nozero_Java ()) {
3785- assert (call->len () > call->req () && call->in (call->req ()) != NULL , " precedent edge expected" );
3786- call->rm_prec (call->req ());
3787- }
37883778 }
37893779 // Check that I actually visited all kids. Unreached kids
37903780 // must be infinite loops.
0 commit comments