Fri, 01 Feb 2013 03:02:01 -0800
8005439: no message about inline method if it specifed by CompileCommand
Reviewed-by: kvn, vlivanov
Contributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
1.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp Fri Feb 01 02:50:23 2013 -0800 1.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Fri Feb 01 03:02:01 2013 -0800 1.3 @@ -3667,11 +3667,12 @@ 1.4 } 1.5 1.6 // now perform tests that are based on flag settings 1.7 - if (callee->force_inline() || callee->should_inline()) { 1.8 - // ignore heuristic controls on inlining 1.9 - if (callee->force_inline()) 1.10 - print_inlining(callee, "force inline by annotation"); 1.11 + if (callee->force_inline()) { 1.12 + print_inlining(callee, "force inline by annotation"); 1.13 + } else if (callee->should_inline()) { 1.14 + print_inlining(callee, "force inline by CompileOracle"); 1.15 } else { 1.16 + // use heuristic controls on inlining 1.17 if (inline_level() > MaxInlineLevel ) INLINE_BAILOUT("inlining too deep"); 1.18 if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep"); 1.19 if (callee->code_size_for_inlining() > max_inline_size() ) INLINE_BAILOUT("callee is too large");
2.1 --- a/src/share/vm/opto/bytecodeInfo.cpp Fri Feb 01 02:50:23 2013 -0800 2.2 +++ b/src/share/vm/opto/bytecodeInfo.cpp Fri Feb 01 03:02:01 2013 -0800 2.3 @@ -420,14 +420,24 @@ 2.4 } 2.5 2.6 //------------------------------print_inlining--------------------------------- 2.7 -// Really, the failure_msg can be a success message also. 2.8 -void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const { 2.9 - C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline"); 2.10 - if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); 2.11 - if (Verbose && callee_method) { 2.12 - const InlineTree *top = this; 2.13 - while( top->caller_tree() != NULL ) { top = top->caller_tree(); } 2.14 - //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); 2.15 +void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, 2.16 + const char* msg, bool success) const { 2.17 + assert(msg != NULL, "just checking"); 2.18 + if (C->log() != NULL) { 2.19 + if (success) { 2.20 + C->log()->inline_success(msg); 2.21 + } else { 2.22 + C->log()->inline_fail(msg); 2.23 + } 2.24 + } 2.25 + if (PrintInlining) { 2.26 + C->print_inlining(callee_method, inline_level(), caller_bci, msg); 2.27 + if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); 2.28 + if (Verbose && callee_method) { 2.29 + const InlineTree *top = this; 2.30 + while( top->caller_tree() != NULL ) { top = top->caller_tree(); } 2.31 + //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); 2.32 + } 2.33 } 2.34 } 2.35 2.36 @@ -451,23 +461,23 @@ 2.37 2.38 // Do some initial checks. 2.39 if (!pass_initial_checks(caller_method, caller_bci, callee_method)) { 2.40 - if (PrintInlining) print_inlining(callee_method, caller_bci, "failed initial checks"); 2.41 + print_inlining(callee_method, caller_bci, "failed initial checks", 2.42 + false /* !success */); 2.43 return NULL; 2.44 } 2.45 2.46 // Do some parse checks. 2.47 failure_msg = check_can_parse(callee_method); 2.48 if (failure_msg != NULL) { 2.49 - if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); 2.50 + print_inlining(callee_method, caller_bci, failure_msg, 2.51 + false /* !success */); 2.52 return NULL; 2.53 } 2.54 2.55 // Check if inlining policy says no. 2.56 WarmCallInfo wci = *(initial_wci); 2.57 - failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, &wci, should_delay); 2.58 - if (failure_msg != NULL && C->log() != NULL) { 2.59 - C->log()->inline_fail(failure_msg); 2.60 - } 2.61 + failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, 2.62 + &wci, should_delay); 2.63 2.64 #ifndef PRODUCT 2.65 if (UseOldInlining && InlineWarmCalls 2.66 @@ -487,7 +497,7 @@ 2.67 wci = *(WarmCallInfo::always_hot()); 2.68 else 2.69 wci = *(WarmCallInfo::always_cold()); 2.70 - } 2.71 + } 2.72 if (!InlineWarmCalls) { 2.73 if (!wci.is_cold() && !wci.is_hot()) { 2.74 // Do not inline the warm calls. 2.75 @@ -496,11 +506,10 @@ 2.76 } 2.77 2.78 if (!wci.is_cold()) { 2.79 - // In -UseOldInlining, the failure_msg may also be a success message. 2.80 - if (failure_msg == NULL) failure_msg = "inline (hot)"; 2.81 - 2.82 // Inline! 2.83 - if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); 2.84 + print_inlining(callee_method, caller_bci, 2.85 + failure_msg ? failure_msg : "inline (hot)", 2.86 + true /* success */); 2.87 if (UseOldInlining) 2.88 build_inline_tree_for_callee(callee_method, jvms, caller_bci); 2.89 if (InlineWarmCalls && !wci.is_hot()) 2.90 @@ -509,8 +518,9 @@ 2.91 } 2.92 2.93 // Do not inline 2.94 - if (failure_msg == NULL) failure_msg = "too cold to inline"; 2.95 - if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); 2.96 + print_inlining(callee_method, caller_bci, 2.97 + failure_msg ? failure_msg : "too cold to inline", 2.98 + false /* !success */ ); 2.99 return NULL; 2.100 } 2.101
3.1 --- a/src/share/vm/opto/parse.hpp Fri Feb 01 02:50:23 2013 -0800 3.2 +++ b/src/share/vm/opto/parse.hpp Fri Feb 01 03:02:01 2013 -0800 3.3 @@ -73,7 +73,8 @@ 3.4 const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result, bool& should_delay); 3.5 const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const; 3.6 const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const; 3.7 - void print_inlining(ciMethod *callee_method, int caller_bci, const char *failure_msg) const; 3.8 + void print_inlining(ciMethod* callee_method, int caller_bci, 3.9 + const char* msg, bool success) const; 3.10 3.11 InlineTree *caller_tree() const { return _caller_tree; } 3.12 InlineTree* callee_at(int bci, ciMethod* m) const;