src/share/vm/opto/doCall.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/doCall.cpp

Print this page
rev 5411 : 8024069: replace_in_map() should operate on parent maps
Summary: type information gets lost because replace_in_map() doesn't update parent maps
Reviewed-by:


 478   round_double_arguments(cg->method());
 479 
 480 #ifndef PRODUCT
 481   // bump global counters for calls
 482   count_compiled_calls(/*at_method_entry*/ false, cg->is_inline());
 483 
 484   // Record first part of parsing work for this call
 485   parse_histogram()->record_change();
 486 #endif // not PRODUCT
 487 
 488   assert(jvms == this->jvms(), "still operating on the right JVMS");
 489   assert(jvms_in_sync(),       "jvms must carry full info into CG");
 490 
 491   // save across call, for a subsequent cast_not_null.
 492   Node* receiver = has_receiver ? argument(0) : NULL;
 493 
 494   // Bump method data counters (We profile *before* the call is made
 495   // because exceptions don't return to the call site.)
 496   profile_call(receiver);
 497 
 498   JVMState* new_jvms = cg->generate(jvms);
 499   if (new_jvms == NULL) {
 500     // When inlining attempt fails (e.g., too many arguments),
 501     // it may contaminate the current compile state, making it
 502     // impossible to pull back and try again.  Once we call
 503     // cg->generate(), we are committed.  If it fails, the whole
 504     // compilation task is compromised.
 505     if (failing())  return;
 506 
 507     // This can happen if a library intrinsic is available, but refuses
 508     // the call site, perhaps because it did not match a pattern the
 509     // intrinsic was expecting to optimize. Should always be possible to
 510     // get a normal java call that may inline in that case
 511     cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), /* allow_intrinsics= */ false);
 512     if ((new_jvms = cg->generate(jvms)) == NULL) {
 513       guarantee(failing(), "call failed to generate:  calls should work");
 514       return;
 515     }
 516   }
 517 
 518   if (cg->is_inline()) {
 519     // Accumulate has_loops estimate
 520     C->set_has_loops(C->has_loops() || cg->method()->has_loops());
 521     C->env()->notice_inlined_method(cg->method());
 522   }
 523 
 524   // Reset parser state from [new_]jvms, which now carries results of the call.
 525   // Return value (if any) is already pushed on the stack by the cg.
 526   add_exception_states_from(new_jvms);
 527   if (new_jvms->map()->control() == top()) {
 528     stop_and_kill_map();
 529   } else {
 530     assert(new_jvms->same_calls_as(jvms), "method/bci left unchanged");
 531     set_jvms(new_jvms);
 532   }




 478   round_double_arguments(cg->method());
 479 
 480 #ifndef PRODUCT
 481   // bump global counters for calls
 482   count_compiled_calls(/*at_method_entry*/ false, cg->is_inline());
 483 
 484   // Record first part of parsing work for this call
 485   parse_histogram()->record_change();
 486 #endif // not PRODUCT
 487 
 488   assert(jvms == this->jvms(), "still operating on the right JVMS");
 489   assert(jvms_in_sync(),       "jvms must carry full info into CG");
 490 
 491   // save across call, for a subsequent cast_not_null.
 492   Node* receiver = has_receiver ? argument(0) : NULL;
 493 
 494   // Bump method data counters (We profile *before* the call is made
 495   // because exceptions don't return to the call site.)
 496   profile_call(receiver);
 497 
 498   JVMState* new_jvms = cg->generate(jvms, this);
 499   if (new_jvms == NULL) {
 500     // When inlining attempt fails (e.g., too many arguments),
 501     // it may contaminate the current compile state, making it
 502     // impossible to pull back and try again.  Once we call
 503     // cg->generate(), we are committed.  If it fails, the whole
 504     // compilation task is compromised.
 505     if (failing())  return;
 506 
 507     // This can happen if a library intrinsic is available, but refuses
 508     // the call site, perhaps because it did not match a pattern the
 509     // intrinsic was expecting to optimize. Should always be possible to
 510     // get a normal java call that may inline in that case
 511     cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), /* allow_intrinsics= */ false);
 512     if ((new_jvms = cg->generate(jvms, this)) == NULL) {
 513       guarantee(failing(), "call failed to generate:  calls should work");
 514       return;
 515     }
 516   }
 517 
 518   if (cg->is_inline()) {
 519     // Accumulate has_loops estimate
 520     C->set_has_loops(C->has_loops() || cg->method()->has_loops());
 521     C->env()->notice_inlined_method(cg->method());
 522   }
 523 
 524   // Reset parser state from [new_]jvms, which now carries results of the call.
 525   // Return value (if any) is already pushed on the stack by the cg.
 526   add_exception_states_from(new_jvms);
 527   if (new_jvms->map()->control() == top()) {
 528     stop_and_kill_map();
 529   } else {
 530     assert(new_jvms->same_calls_as(jvms), "method/bci left unchanged");
 531     set_jvms(new_jvms);
 532   }


src/share/vm/opto/doCall.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File