744
745 // Put top into the hash table ASAP.
746 initial_gvn()->transform_no_reclaim(top());
747
748 // Set up tf(), start(), and find a CallGenerator.
749 CallGenerator* cg = NULL;
750 if (is_osr_compilation()) {
751 const TypeTuple *domain = StartOSRNode::osr_domain();
752 const TypeTuple *range = TypeTuple::make_range(method()->signature());
753 init_tf(TypeFunc::make(domain, range));
754 StartNode* s = new StartOSRNode(root(), domain);
755 initial_gvn()->set_type_bottom(s);
756 init_start(s);
757 cg = CallGenerator::for_osr(method(), entry_bci());
758 } else {
759 // Normal case.
760 init_tf(TypeFunc::make(method()));
761 StartNode* s = new StartNode(root(), tf()->domain());
762 initial_gvn()->set_type_bottom(s);
763 init_start(s);
764 if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) {
765 // With java.lang.ref.reference.get() we must go through the
766 // intrinsic when G1 is enabled - even when get() is the root
767 // method of the compile - so that, if necessary, the value in
768 // the referent field of the reference object gets recorded by
769 // the pre-barrier code.
770 // Specifically, if G1 is enabled, the value in the referent
771 // field is recorded by the G1 SATB pre barrier. This will
772 // result in the referent being marked live and the reference
773 // object removed from the list of discovered references during
774 // reference processing.
775 cg = find_intrinsic(method(), false);
776 }
777 if (cg == NULL) {
778 float past_uses = method()->interpreter_invocation_count();
779 float expected_uses = past_uses;
780 cg = CallGenerator::for_inline(method(), expected_uses);
781 }
782 }
783 if (failing()) return;
784 if (cg == NULL) {
785 record_method_not_compilable("cannot parse method");
786 return;
787 }
788 JVMState* jvms = build_start_state(start(), tf());
789 if ((jvms = cg->generate(jvms)) == NULL) {
790 if (!failure_reason_is(C2Compiler::retry_class_loading_during_parsing())) {
791 record_method_not_compilable("method parse failed");
792 }
793 return;
794 }
|
744
745 // Put top into the hash table ASAP.
746 initial_gvn()->transform_no_reclaim(top());
747
748 // Set up tf(), start(), and find a CallGenerator.
749 CallGenerator* cg = NULL;
750 if (is_osr_compilation()) {
751 const TypeTuple *domain = StartOSRNode::osr_domain();
752 const TypeTuple *range = TypeTuple::make_range(method()->signature());
753 init_tf(TypeFunc::make(domain, range));
754 StartNode* s = new StartOSRNode(root(), domain);
755 initial_gvn()->set_type_bottom(s);
756 init_start(s);
757 cg = CallGenerator::for_osr(method(), entry_bci());
758 } else {
759 // Normal case.
760 init_tf(TypeFunc::make(method()));
761 StartNode* s = new StartNode(root(), tf()->domain());
762 initial_gvn()->set_type_bottom(s);
763 init_start(s);
764 if (method()->intrinsic_id() == vmIntrinsics::_Reference_get) {
765 // With java.lang.ref.reference.get() we must go through the
766 // intrinsic - even when get() is the root
767 // method of the compile - so that, if necessary, the value in
768 // the referent field of the reference object gets recorded by
769 // the pre-barrier code.
770 cg = find_intrinsic(method(), false);
771 }
772 if (cg == NULL) {
773 float past_uses = method()->interpreter_invocation_count();
774 float expected_uses = past_uses;
775 cg = CallGenerator::for_inline(method(), expected_uses);
776 }
777 }
778 if (failing()) return;
779 if (cg == NULL) {
780 record_method_not_compilable("cannot parse method");
781 return;
782 }
783 JVMState* jvms = build_start_state(start(), tf());
784 if ((jvms = cg->generate(jvms)) == NULL) {
785 if (!failure_reason_is(C2Compiler::retry_class_loading_during_parsing())) {
786 record_method_not_compilable("method parse failed");
787 }
788 return;
789 }
|