Tue, 05 Feb 2013 08:25:51 -0800
8006613: adding reason to made_not_compilable
Reviewed-by: kvn, vlivanov
Contributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
1.1 --- a/src/share/vm/ci/ciMethod.cpp Mon Feb 04 11:30:37 2013 +0100 1.2 +++ b/src/share/vm/ci/ciMethod.cpp Tue Feb 05 08:25:51 2013 -0800 1.3 @@ -977,7 +977,7 @@ 1.4 // ciMethod::set_not_compilable 1.5 // 1.6 // Tell the VM that this method cannot be compiled at all. 1.7 -void ciMethod::set_not_compilable() { 1.8 +void ciMethod::set_not_compilable(const char* reason) { 1.9 check_is_loaded(); 1.10 VM_ENTRY_MARK; 1.11 ciEnv* env = CURRENT_ENV; 1.12 @@ -986,7 +986,7 @@ 1.13 } else { 1.14 _is_c2_compilable = false; 1.15 } 1.16 - get_Method()->set_not_compilable(env->comp_level()); 1.17 + get_Method()->set_not_compilable(env->comp_level(), true, reason); 1.18 } 1.19 1.20 // ------------------------------------------------------------------
2.1 --- a/src/share/vm/ci/ciMethod.hpp Mon Feb 04 11:30:37 2013 +0100 2.2 +++ b/src/share/vm/ci/ciMethod.hpp Tue Feb 05 08:25:51 2013 -0800 2.3 @@ -252,7 +252,7 @@ 2.4 bool has_option(const char *option); 2.5 bool can_be_compiled(); 2.6 bool can_be_osr_compiled(int entry_bci); 2.7 - void set_not_compilable(); 2.8 + void set_not_compilable(const char* reason = NULL); 2.9 bool has_compiled_code(); 2.10 void log_nmethod_identity(xmlStream* log); 2.11 bool is_not_reached(int bci);
3.1 --- a/src/share/vm/compiler/compileBroker.cpp Mon Feb 04 11:30:37 2013 +0100 3.2 +++ b/src/share/vm/compiler/compileBroker.cpp Tue Feb 05 08:25:51 2013 -0800 3.3 @@ -1398,7 +1398,7 @@ 3.4 method->print_short_name(tty); 3.5 tty->cr(); 3.6 } 3.7 - method->set_not_compilable_quietly(); 3.8 + method->set_not_compilable(CompLevel_all, !quietly, "excluded by CompilerOracle"); 3.9 } 3.10 3.11 return false;
4.1 --- a/src/share/vm/oops/method.cpp Mon Feb 04 11:30:37 2013 +0100 4.2 +++ b/src/share/vm/oops/method.cpp Tue Feb 05 08:25:51 2013 -0800 4.3 @@ -699,7 +699,7 @@ 4.4 } 4.5 4.6 4.7 -void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report) { 4.8 +void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason) { 4.9 if (PrintCompilation && report) { 4.10 ttyLocker ttyl; 4.11 tty->print("made not %scompilable on ", is_osr ? "OSR " : ""); 4.12 @@ -713,14 +713,21 @@ 4.13 } 4.14 this->print_short_name(tty); 4.15 int size = this->code_size(); 4.16 - if (size > 0) 4.17 + if (size > 0) { 4.18 tty->print(" (%d bytes)", size); 4.19 + } 4.20 + if (reason != NULL) { 4.21 + tty->print(" %s", reason); 4.22 + } 4.23 tty->cr(); 4.24 } 4.25 if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) { 4.26 ttyLocker ttyl; 4.27 xtty->begin_elem("make_not_%scompilable thread='" UINTX_FORMAT "'", 4.28 is_osr ? "osr_" : "", os::current_thread_id()); 4.29 + if (reason != NULL) { 4.30 + xtty->print(" reason=\'%s\'", reason); 4.31 + } 4.32 xtty->method(this); 4.33 xtty->stamp(); 4.34 xtty->end_elem(); 4.35 @@ -742,8 +749,8 @@ 4.36 } 4.37 4.38 // call this when compiler finds that this method is not compilable 4.39 -void Method::set_not_compilable(int comp_level, bool report) { 4.40 - print_made_not_compilable(comp_level, /*is_osr*/ false, report); 4.41 +void Method::set_not_compilable(int comp_level, bool report, const char* reason) { 4.42 + print_made_not_compilable(comp_level, /*is_osr*/ false, report, reason); 4.43 if (comp_level == CompLevel_all) { 4.44 set_not_c1_compilable(); 4.45 set_not_c2_compilable(); 4.46 @@ -768,8 +775,8 @@ 4.47 return false; 4.48 } 4.49 4.50 -void Method::set_not_osr_compilable(int comp_level, bool report) { 4.51 - print_made_not_compilable(comp_level, /*is_osr*/ true, report); 4.52 +void Method::set_not_osr_compilable(int comp_level, bool report, const char* reason) { 4.53 + print_made_not_compilable(comp_level, /*is_osr*/ true, report, reason); 4.54 if (comp_level == CompLevel_all) { 4.55 set_not_c1_osr_compilable(); 4.56 set_not_c2_osr_compilable();
5.1 --- a/src/share/vm/oops/method.hpp Mon Feb 04 11:30:37 2013 +0100 5.2 +++ b/src/share/vm/oops/method.hpp Tue Feb 05 08:25:51 2013 -0800 5.3 @@ -760,18 +760,18 @@ 5.4 // whether it is not compilable for another reason like having a 5.5 // breakpoint set in it. 5.6 bool is_not_compilable(int comp_level = CompLevel_any) const; 5.7 - void set_not_compilable(int comp_level = CompLevel_all, bool report = true); 5.8 + void set_not_compilable(int comp_level = CompLevel_all, bool report = true, const char* reason = NULL); 5.9 void set_not_compilable_quietly(int comp_level = CompLevel_all) { 5.10 set_not_compilable(comp_level, false); 5.11 } 5.12 bool is_not_osr_compilable(int comp_level = CompLevel_any) const; 5.13 - void set_not_osr_compilable(int comp_level = CompLevel_all, bool report = true); 5.14 + void set_not_osr_compilable(int comp_level = CompLevel_all, bool report = true, const char* reason = NULL); 5.15 void set_not_osr_compilable_quietly(int comp_level = CompLevel_all) { 5.16 set_not_osr_compilable(comp_level, false); 5.17 } 5.18 5.19 private: 5.20 - void print_made_not_compilable(int comp_level, bool is_osr, bool report); 5.21 + void print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason); 5.22 5.23 public: 5.24 bool is_not_c1_compilable() const { return access_flags().is_not_c1_compilable(); }
6.1 --- a/src/share/vm/oops/methodData.hpp Mon Feb 04 11:30:37 2013 +0100 6.2 +++ b/src/share/vm/oops/methodData.hpp Tue Feb 05 08:25:51 2013 -0800 6.3 @@ -1465,7 +1465,7 @@ 6.4 void inc_decompile_count() { 6.5 _nof_decompiles += 1; 6.6 if (decompile_count() > (uint)PerMethodRecompilationCutoff) { 6.7 - method()->set_not_compilable(CompLevel_full_optimization); 6.8 + method()->set_not_compilable(CompLevel_full_optimization, true, "decompile_count > PerMethodRecompilationCutoff"); 6.9 } 6.10 } 6.11
7.1 --- a/src/share/vm/runtime/deoptimization.cpp Mon Feb 04 11:30:37 2013 +0100 7.2 +++ b/src/share/vm/runtime/deoptimization.cpp Tue Feb 05 08:25:51 2013 -0800 7.3 @@ -1559,7 +1559,7 @@ 7.4 if (trap_method() == nm->method()) { 7.5 make_not_compilable = true; 7.6 } else { 7.7 - trap_method->set_not_compilable(CompLevel_full_optimization); 7.8 + trap_method->set_not_compilable(CompLevel_full_optimization, true, "overflow_recompile_count > PerBytecodeRecompilationCutoff"); 7.9 // But give grace to the enclosing nm->method(). 7.10 } 7.11 }