1.1 --- a/src/share/vm/opto/bytecodeInfo.cpp Fri Feb 01 02:50:23 2013 -0800 1.2 +++ b/src/share/vm/opto/bytecodeInfo.cpp Fri Feb 01 03:02:01 2013 -0800 1.3 @@ -420,14 +420,24 @@ 1.4 } 1.5 1.6 //------------------------------print_inlining--------------------------------- 1.7 -// Really, the failure_msg can be a success message also. 1.8 -void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const { 1.9 - C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline"); 1.10 - if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); 1.11 - if (Verbose && callee_method) { 1.12 - const InlineTree *top = this; 1.13 - while( top->caller_tree() != NULL ) { top = top->caller_tree(); } 1.14 - //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); 1.15 +void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, 1.16 + const char* msg, bool success) const { 1.17 + assert(msg != NULL, "just checking"); 1.18 + if (C->log() != NULL) { 1.19 + if (success) { 1.20 + C->log()->inline_success(msg); 1.21 + } else { 1.22 + C->log()->inline_fail(msg); 1.23 + } 1.24 + } 1.25 + if (PrintInlining) { 1.26 + C->print_inlining(callee_method, inline_level(), caller_bci, msg); 1.27 + if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); 1.28 + if (Verbose && callee_method) { 1.29 + const InlineTree *top = this; 1.30 + while( top->caller_tree() != NULL ) { top = top->caller_tree(); } 1.31 + //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); 1.32 + } 1.33 } 1.34 } 1.35 1.36 @@ -451,23 +461,23 @@ 1.37 1.38 // Do some initial checks. 1.39 if (!pass_initial_checks(caller_method, caller_bci, callee_method)) { 1.40 - if (PrintInlining) print_inlining(callee_method, caller_bci, "failed initial checks"); 1.41 + print_inlining(callee_method, caller_bci, "failed initial checks", 1.42 + false /* !success */); 1.43 return NULL; 1.44 } 1.45 1.46 // Do some parse checks. 1.47 failure_msg = check_can_parse(callee_method); 1.48 if (failure_msg != NULL) { 1.49 - if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); 1.50 + print_inlining(callee_method, caller_bci, failure_msg, 1.51 + false /* !success */); 1.52 return NULL; 1.53 } 1.54 1.55 // Check if inlining policy says no. 1.56 WarmCallInfo wci = *(initial_wci); 1.57 - failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, &wci, should_delay); 1.58 - if (failure_msg != NULL && C->log() != NULL) { 1.59 - C->log()->inline_fail(failure_msg); 1.60 - } 1.61 + failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, 1.62 + &wci, should_delay); 1.63 1.64 #ifndef PRODUCT 1.65 if (UseOldInlining && InlineWarmCalls 1.66 @@ -487,7 +497,7 @@ 1.67 wci = *(WarmCallInfo::always_hot()); 1.68 else 1.69 wci = *(WarmCallInfo::always_cold()); 1.70 - } 1.71 + } 1.72 if (!InlineWarmCalls) { 1.73 if (!wci.is_cold() && !wci.is_hot()) { 1.74 // Do not inline the warm calls. 1.75 @@ -496,11 +506,10 @@ 1.76 } 1.77 1.78 if (!wci.is_cold()) { 1.79 - // In -UseOldInlining, the failure_msg may also be a success message. 1.80 - if (failure_msg == NULL) failure_msg = "inline (hot)"; 1.81 - 1.82 // Inline! 1.83 - if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); 1.84 + print_inlining(callee_method, caller_bci, 1.85 + failure_msg ? failure_msg : "inline (hot)", 1.86 + true /* success */); 1.87 if (UseOldInlining) 1.88 build_inline_tree_for_callee(callee_method, jvms, caller_bci); 1.89 if (InlineWarmCalls && !wci.is_hot()) 1.90 @@ -509,8 +518,9 @@ 1.91 } 1.92 1.93 // Do not inline 1.94 - if (failure_msg == NULL) failure_msg = "too cold to inline"; 1.95 - if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); 1.96 + print_inlining(callee_method, caller_bci, 1.97 + failure_msg ? failure_msg : "too cold to inline", 1.98 + false /* !success */ ); 1.99 return NULL; 1.100 } 1.101