508 parse_histogram()->record_change();
509 #endif // not PRODUCT
510
511 assert(jvms == this->jvms(), "still operating on the right JVMS");
512 assert(jvms_in_sync(), "jvms must carry full info into CG");
513
514 // save across call, for a subsequent cast_not_null.
515 Node* receiver = has_receiver ? argument(0) : NULL;
516
517 // The extra CheckCastPP for speculative types mess with PhaseStringOpts
518 if (receiver != NULL && !call_does_dispatch && !cg->is_string_late_inline()) {
519 // Feed profiling data for a single receiver to the type system so
520 // it can propagate it as a speculative type
521 receiver = record_profiled_receiver_for_speculation(receiver);
522 }
523
524 // Bump method data counters (We profile *before* the call is made
525 // because exceptions don't return to the call site.)
526 profile_call(receiver);
527
528 JVMState* new_jvms = cg->generate(jvms, this);
529 if (new_jvms == NULL) {
530 // When inlining attempt fails (e.g., too many arguments),
531 // it may contaminate the current compile state, making it
532 // impossible to pull back and try again. Once we call
533 // cg->generate(), we are committed. If it fails, the whole
534 // compilation task is compromised.
535 if (failing()) return;
536
537 // This can happen if a library intrinsic is available, but refuses
538 // the call site, perhaps because it did not match a pattern the
539 // intrinsic was expecting to optimize. Should always be possible to
540 // get a normal java call that may inline in that case
541 cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), speculative_receiver_type, /* allow_intrinsics= */ false);
542 new_jvms = cg->generate(jvms, this);
543 if (new_jvms == NULL) {
544 guarantee(failing(), "call failed to generate: calls should work");
545 return;
546 }
547 }
548
549 if (cg->is_inline()) {
550 // Accumulate has_loops estimate
551 C->set_has_loops(C->has_loops() || cg->method()->has_loops());
552 C->env()->notice_inlined_method(cg->method());
553 }
554
555 // Reset parser state from [new_]jvms, which now carries results of the call.
556 // Return value (if any) is already pushed on the stack by the cg.
557 add_exception_states_from(new_jvms);
558 if (new_jvms->map()->control() == top()) {
559 stop_and_kill_map();
560 } else {
561 assert(new_jvms->same_calls_as(jvms), "method/bci left unchanged");
562 set_jvms(new_jvms);
|
508 parse_histogram()->record_change();
509 #endif // not PRODUCT
510
511 assert(jvms == this->jvms(), "still operating on the right JVMS");
512 assert(jvms_in_sync(), "jvms must carry full info into CG");
513
514 // save across call, for a subsequent cast_not_null.
515 Node* receiver = has_receiver ? argument(0) : NULL;
516
517 // The extra CheckCastPP for speculative types mess with PhaseStringOpts
518 if (receiver != NULL && !call_does_dispatch && !cg->is_string_late_inline()) {
519 // Feed profiling data for a single receiver to the type system so
520 // it can propagate it as a speculative type
521 receiver = record_profiled_receiver_for_speculation(receiver);
522 }
523
524 // Bump method data counters (We profile *before* the call is made
525 // because exceptions don't return to the call site.)
526 profile_call(receiver);
527
528 JVMState* new_jvms = cg->generate(jvms);
529 if (new_jvms == NULL) {
530 // When inlining attempt fails (e.g., too many arguments),
531 // it may contaminate the current compile state, making it
532 // impossible to pull back and try again. Once we call
533 // cg->generate(), we are committed. If it fails, the whole
534 // compilation task is compromised.
535 if (failing()) return;
536
537 // This can happen if a library intrinsic is available, but refuses
538 // the call site, perhaps because it did not match a pattern the
539 // intrinsic was expecting to optimize. Should always be possible to
540 // get a normal java call that may inline in that case
541 cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), speculative_receiver_type, /* allow_intrinsics= */ false);
542 new_jvms = cg->generate(jvms);
543 if (new_jvms == NULL) {
544 guarantee(failing(), "call failed to generate: calls should work");
545 return;
546 }
547 }
548
549 if (cg->is_inline()) {
550 // Accumulate has_loops estimate
551 C->set_has_loops(C->has_loops() || cg->method()->has_loops());
552 C->env()->notice_inlined_method(cg->method());
553 }
554
555 // Reset parser state from [new_]jvms, which now carries results of the call.
556 // Return value (if any) is already pushed on the stack by the cg.
557 add_exception_states_from(new_jvms);
558 if (new_jvms->map()->control() == top()) {
559 stop_and_kill_map();
560 } else {
561 assert(new_jvms->same_calls_as(jvms), "method/bci left unchanged");
562 set_jvms(new_jvms);
|