690 address* signature_handler = signature_handler_addr(); |
690 address* signature_handler = signature_handler_addr(); |
691 *signature_handler = handler; |
691 *signature_handler = handler; |
692 } |
692 } |
693 |
693 |
694 |
694 |
695 bool Method::is_not_compilable(int comp_level) const { |
695 void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report) { |
696 if (number_of_breakpoints() > 0) { |
|
697 return true; |
|
698 } |
|
699 if (is_method_handle_intrinsic()) { |
|
700 return !is_synthetic(); // the generated adapters must be compiled |
|
701 } |
|
702 if (comp_level == CompLevel_any) { |
|
703 return is_not_c1_compilable() || is_not_c2_compilable(); |
|
704 } |
|
705 if (is_c1_compile(comp_level)) { |
|
706 return is_not_c1_compilable(); |
|
707 } |
|
708 if (is_c2_compile(comp_level)) { |
|
709 return is_not_c2_compilable(); |
|
710 } |
|
711 return false; |
|
712 } |
|
713 |
|
714 // call this when compiler finds that this method is not compilable |
|
715 void Method::set_not_compilable(int comp_level, bool report) { |
|
716 if (PrintCompilation && report) { |
696 if (PrintCompilation && report) { |
717 ttyLocker ttyl; |
697 ttyLocker ttyl; |
718 tty->print("made not compilable "); |
698 tty->print("made not %scompilable on ", is_osr ? "OSR " : ""); |
|
699 if (comp_level == CompLevel_all) { |
|
700 tty->print("all levels "); |
|
701 } else { |
|
702 tty->print("levels "); |
|
703 for (int i = (int)CompLevel_none; i <= comp_level; i++) { |
|
704 tty->print("%d ", i); |
|
705 } |
|
706 } |
719 this->print_short_name(tty); |
707 this->print_short_name(tty); |
720 int size = this->code_size(); |
708 int size = this->code_size(); |
721 if (size > 0) |
709 if (size > 0) |
722 tty->print(" (%d bytes)", size); |
710 tty->print(" (%d bytes)", size); |
723 tty->cr(); |
711 tty->cr(); |
724 } |
712 } |
725 if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) { |
713 if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) { |
726 ttyLocker ttyl; |
714 ttyLocker ttyl; |
727 xtty->begin_elem("make_not_compilable thread='%d'", (int) os::current_thread_id()); |
715 xtty->begin_elem("make_not_%scompilable thread='%d'", is_osr ? "osr_" : "", (int) os::current_thread_id()); |
728 xtty->method(this); |
716 xtty->method(this); |
729 xtty->stamp(); |
717 xtty->stamp(); |
730 xtty->end_elem(); |
718 xtty->end_elem(); |
731 } |
719 } |
|
720 } |
|
721 |
|
722 bool Method::is_not_compilable(int comp_level) const { |
|
723 if (number_of_breakpoints() > 0) |
|
724 return true; |
|
725 if (is_method_handle_intrinsic()) |
|
726 return !is_synthetic(); // the generated adapters must be compiled |
|
727 if (comp_level == CompLevel_any) |
|
728 return is_not_c1_compilable() || is_not_c2_compilable(); |
|
729 if (is_c1_compile(comp_level)) |
|
730 return is_not_c1_compilable(); |
|
731 if (is_c2_compile(comp_level)) |
|
732 return is_not_c2_compilable(); |
|
733 return false; |
|
734 } |
|
735 |
|
736 // call this when compiler finds that this method is not compilable |
|
737 void Method::set_not_compilable(int comp_level, bool report) { |
|
738 print_made_not_compilable(comp_level, /*is_osr*/ false, report); |
732 if (comp_level == CompLevel_all) { |
739 if (comp_level == CompLevel_all) { |
733 set_not_c1_compilable(); |
740 set_not_c1_compilable(); |
734 set_not_c2_compilable(); |
741 set_not_c2_compilable(); |
735 } else { |
742 } else { |
736 if (is_c1_compile(comp_level)) { |
743 if (is_c1_compile(comp_level)) |
737 set_not_c1_compilable(); |
744 set_not_c1_compilable(); |
738 } else |
745 if (is_c2_compile(comp_level)) |
739 if (is_c2_compile(comp_level)) { |
746 set_not_c2_compilable(); |
740 set_not_c2_compilable(); |
747 } |
741 } |
748 CompilationPolicy::policy()->disable_compilation(this); |
|
749 } |
|
750 |
|
751 bool Method::is_not_osr_compilable(int comp_level) const { |
|
752 if (is_not_compilable(comp_level)) |
|
753 return true; |
|
754 if (comp_level == CompLevel_any) |
|
755 return is_not_c1_osr_compilable() || is_not_c2_osr_compilable(); |
|
756 if (is_c1_compile(comp_level)) |
|
757 return is_not_c1_osr_compilable(); |
|
758 if (is_c2_compile(comp_level)) |
|
759 return is_not_c2_osr_compilable(); |
|
760 return false; |
|
761 } |
|
762 |
|
763 void Method::set_not_osr_compilable(int comp_level, bool report) { |
|
764 print_made_not_compilable(comp_level, /*is_osr*/ true, report); |
|
765 if (comp_level == CompLevel_all) { |
|
766 set_not_c1_osr_compilable(); |
|
767 set_not_c2_osr_compilable(); |
|
768 } else { |
|
769 if (is_c1_compile(comp_level)) |
|
770 set_not_c1_osr_compilable(); |
|
771 if (is_c2_compile(comp_level)) |
|
772 set_not_c2_osr_compilable(); |
742 } |
773 } |
743 CompilationPolicy::policy()->disable_compilation(this); |
774 CompilationPolicy::policy()->disable_compilation(this); |
744 } |
775 } |
745 |
776 |
746 // Revert to using the interpreter and clear out the nmethod |
777 // Revert to using the interpreter and clear out the nmethod |