@@ -3758,7 +3758,7 @@ bool Compile::final_graph_reshaping() {
37583758 // 'fall-thru' path, so expected kids is 1 less.
37593759 if (n->is_PCTable () && n->in (0 ) && n->in (0 )->in (0 )) {
37603760 if (n->in (0 )->in (0 )->is_Call ()) {
3761- CallNode* call = n->in (0 )->in (0 )->as_Call ();
3761+ CallNode * call = n->in (0 )->in (0 )->as_Call ();
37623762 if (call->entry_point () == OptoRuntime::rethrow_stub ()) {
37633763 required_outcnt--; // Rethrow always has 1 less kid
37643764 } else if (call->req () > TypeFunc::Parms &&
@@ -3767,25 +3767,22 @@ bool Compile::final_graph_reshaping() {
37673767 // detected that the virtual call will always result in a null
37683768 // pointer exception. The fall-through projection of this CatchNode
37693769 // will not be populated.
3770- Node* arg0 = call->in (TypeFunc::Parms);
3770+ Node * arg0 = call->in (TypeFunc::Parms);
37713771 if (arg0->is_Type () &&
37723772 arg0->as_Type ()->type ()->higher_equal (TypePtr::NULL_PTR)) {
37733773 required_outcnt--;
37743774 }
3775- } else if (call->entry_point () == OptoRuntime::new_array_Java () ||
3776- call->entry_point () == OptoRuntime::new_array_nozero_Java ()) {
3775+ } else if (call->entry_point () == OptoRuntime::new_array_Java () &&
3776+ call->req () > TypeFunc::Parms+1 &&
3777+ call->is_CallStaticJava ()) {
37773778 // Check for negative array length. In such case, the optimizer has
37783779 // detected that the allocation attempt will always result in an
37793780 // exception. There is no fall-through projection of this CatchNode .
3780- assert (call->is_CallStaticJava (), " static call expected" );
3781- assert (call->len () > call->req () && call->in (call->req ()) != NULL , " no precendent edge" );
3782- Node* valid_length_test = call->in (call->req ());
3783- call->rm_prec (call->req ());
3784- if (valid_length_test->find_int_con (1 ) == 0 ) {
3781+ Node *arg1 = call->in (TypeFunc::Parms+1 );
3782+ if (arg1->is_Type () &&
3783+ arg1->as_Type ()->type ()->join (TypeInt::POS)->empty ()) {
37853784 required_outcnt--;
37863785 }
3787- assert (n->outcnt () == required_outcnt, " malformed control flow" );
3788- continue ;
37893786 }
37903787 }
37913788 }
@@ -3794,13 +3791,6 @@ bool Compile::final_graph_reshaping() {
37943791 record_method_not_compilable (" malformed control flow" );
37953792 return true ; // Not all targets reachable!
37963793 }
3797- } else if (n->is_PCTable () && n->in (0 ) && n->in (0 )->in (0 ) && n->in (0 )->in (0 )->is_Call ()) {
3798- CallNode* call = n->in (0 )->in (0 )->as_Call ();
3799- if (call->entry_point () == OptoRuntime::new_array_Java () ||
3800- call->entry_point () == OptoRuntime::new_array_nozero_Java ()) {
3801- assert (call->len () > call->req () && call->in (call->req ()) != NULL , " precedent edge expected" );
3802- call->rm_prec (call->req ());
3803- }
38043794 }
38053795 // Check that I actually visited all kids. Unreached kids
38063796 // must be infinite loops.
0 commit comments