Mon, 14 Jul 2014 03:24:35 -0700
8049528: Method marked w/ @ForceInline isn't inlined with "executed < MinInliningThreshold times" message
Reviewed-by: roland, jrose
src/share/vm/opto/bytecodeInfo.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/parse.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/bytecodeInfo.cpp Thu May 29 09:41:07 2014 +0000 1.2 +++ b/src/share/vm/opto/bytecodeInfo.cpp Mon Jul 14 03:24:35 2014 -0700 1.3 @@ -107,7 +107,7 @@ 1.4 int caller_bci, ciCallProfile& profile, 1.5 WarmCallInfo* wci_result) { 1.6 // Allows targeted inlining 1.7 - if(callee_method->should_inline()) { 1.8 + if (callee_method->should_inline()) { 1.9 *wci_result = *(WarmCallInfo::always_hot()); 1.10 if (C->print_inlining() && Verbose) { 1.11 CompileTask::print_inline_indent(inline_level()); 1.12 @@ -118,6 +118,12 @@ 1.13 return true; 1.14 } 1.15 1.16 + if (callee_method->force_inline()) { 1.17 + set_msg("force inline by annotation"); 1.18 + _forced_inline = true; 1.19 + return true; 1.20 + } 1.21 + 1.22 #ifndef PRODUCT 1.23 int inline_depth = inline_level()+1; 1.24 if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { 1.25 @@ -244,6 +250,11 @@ 1.26 } 1.27 #endif 1.28 1.29 + if (callee_method->force_inline()) { 1.30 + set_msg("force inline by annotation"); 1.31 + return false; 1.32 + } 1.33 + 1.34 // Now perform checks which are heuristic 1.35 1.36 if (is_unboxing_method(callee_method, C)) { 1.37 @@ -251,12 +262,10 @@ 1.38 return false; 1.39 } 1.40 1.41 - if (!callee_method->force_inline()) { 1.42 - if (callee_method->has_compiled_code() && 1.43 - callee_method->instructions_size() > InlineSmallCode) { 1.44 - set_msg("already compiled into a big method"); 1.45 - return true; 1.46 - } 1.47 + if (callee_method->has_compiled_code() && 1.48 + callee_method->instructions_size() > InlineSmallCode) { 1.49 + set_msg("already compiled into a big method"); 1.50 + return true; 1.51 } 1.52 1.53 // don't inline exception code unless the top method belongs to an 1.54 @@ -349,7 +358,7 @@ 1.55 // Escape Analysis stress testing when running Xcomp or CTW: 1.56 // inline constructors even if they are not reached. 1.57 } else if (forced_inline()) { 1.58 - // Inlining was forced by CompilerOracle or ciReplay 1.59 + // Inlining was forced by CompilerOracle, ciReplay or annotation 1.60 } else if (profile.count() == 0) { 1.61 // don't inline unreached call sites 1.62 set_msg("call site not reached");
2.1 --- a/src/share/vm/opto/parse.hpp Thu May 29 09:41:07 2014 +0000 2.2 +++ b/src/share/vm/opto/parse.hpp Mon Jul 14 03:24:35 2014 -0700 2.3 @@ -142,7 +142,7 @@ 2.4 2.5 void print_value_on(outputStream* st) const PRODUCT_RETURN; 2.6 2.7 - bool _forced_inline; // Inlining was forced by CompilerOracle or ciReplay 2.8 + bool _forced_inline; // Inlining was forced by CompilerOracle, ciReplay or annotation 2.9 bool forced_inline() const { return _forced_inline; } 2.10 // Count number of nodes in this subtree 2.11 int count() const;