645
646 // ---------------------
647 // Round double arguments before call
648 round_double_arguments(cg->method());
649
650 // Feed profiling data for arguments to the type system so it can
651 // propagate it as speculative types
652 record_profiled_arguments_for_speculation(cg->method(), bc());
653
654 #ifndef PRODUCT
655 // bump global counters for calls
656 count_compiled_calls(/*at_method_entry*/ false, cg->is_inline());
657
658 // Record first part of parsing work for this call
659 parse_histogram()->record_change();
660 #endif // not PRODUCT
661
662 assert(jvms == this->jvms(), "still operating on the right JVMS");
663 assert(jvms_in_sync(), "jvms must carry full info into CG");
664
665 // save across call, for a subsequent cast_not_null.
666 Node* receiver = has_receiver ? argument(0) : nullptr;
667
668 // The extra CheckCastPPs for speculative types mess with PhaseStringOpts
669 if (receiver != nullptr && !call_does_dispatch && !cg->is_string_late_inline()) {
670 // Feed profiling data for a single receiver to the type system so
671 // it can propagate it as a speculative type
672 receiver = record_profiled_receiver_for_speculation(receiver);
673 }
674
675 JVMState* new_jvms = cg->generate(jvms);
676 if (new_jvms == nullptr) {
677 // When inlining attempt fails (e.g., too many arguments),
678 // it may contaminate the current compile state, making it
679 // impossible to pull back and try again. Once we call
680 // cg->generate(), we are committed. If it fails, the whole
681 // compilation task is compromised.
682 if (failing()) return;
683
684 // This can happen if a library intrinsic is available, but refuses
|
645
646 // ---------------------
647 // Round double arguments before call
648 round_double_arguments(cg->method());
649
650 // Feed profiling data for arguments to the type system so it can
651 // propagate it as speculative types
652 record_profiled_arguments_for_speculation(cg->method(), bc());
653
654 #ifndef PRODUCT
655 // bump global counters for calls
656 count_compiled_calls(/*at_method_entry*/ false, cg->is_inline());
657
658 // Record first part of parsing work for this call
659 parse_histogram()->record_change();
660 #endif // not PRODUCT
661
662 assert(jvms == this->jvms(), "still operating on the right JVMS");
663 assert(jvms_in_sync(), "jvms must carry full info into CG");
664
665 PEAState* caller_state = nullptr;
666 if (DoPartialEscapeAnalysis) {
667 // Besides outlined methods, we scan all intrinsics because C2 skips parsing bytecodes of them.
668 // Some intrinsics have side-effect of Java heap such as Unsafe.compareAndSetReference().
669 // We treat PredicatedIntrinsicGenerator as an ordinary intrinsic as well.
670 if (!cg->is_inline() || cg->is_intrinsic()) {
671 PEAState& state = jvms->alloc_state();
672 // Materialize all inputs to non-inline and late inline calls.
673 // TODO: we can support late inline calls if we can pass the right JVM
674 // state to the late inline call.
675 //
676 // TODO: Should we query BCEA to make an enger inlining decision here?
677 // Because callee require a concrete object pointer as an argument,
678 // we have nothing to do but matertialize it.
679 //
680 // BCEscapeAnalyzer* bcea = cg->method()->get_bcea();
681 uint nargs = cg->method()->arg_size();
682 for (uint i=0; i < nargs; ++i) {
683 Node* arg = argument(i);
684
685 if (state.as_virtual(PEA(), arg)) {
686 Node* objx = state.materialize(this, arg);
687 set_argument(i, objx);
688 }
689 }
690 }
691 }
692
693 // save across call, for a subsequent cast_not_null.
694 Node* receiver = has_receiver ? argument(0) : nullptr;
695
696 // The extra CheckCastPPs for speculative types mess with PhaseStringOpts
697 if (receiver != nullptr && !call_does_dispatch && !cg->is_string_late_inline()) {
698 // Feed profiling data for a single receiver to the type system so
699 // it can propagate it as a speculative type
700 receiver = record_profiled_receiver_for_speculation(receiver);
701 }
702
703 JVMState* new_jvms = cg->generate(jvms);
704 if (new_jvms == nullptr) {
705 // When inlining attempt fails (e.g., too many arguments),
706 // it may contaminate the current compile state, making it
707 // impossible to pull back and try again. Once we call
708 // cg->generate(), we are committed. If it fails, the whole
709 // compilation task is compromised.
710 if (failing()) return;
711
712 // This can happen if a library intrinsic is available, but refuses
|