comparison src/share/vm/opto/bytecodeInfo.cpp @ 20468:1de115720e74

8049528: Method marked w/ @ForceInline isn't inlined with "executed < MinInliningThreshold times" message Reviewed-by: roland, jrose
author vlivanov
date Mon, 14 Jul 2014 03:24:35 -0700
parents 73c839dda17e
children 7848fc12602b
comparison
equal deleted inserted replaced
20467:134f18d0174b 20468:1de115720e74
105 // positive filter: should callee be inlined? 105 // positive filter: should callee be inlined?
106 bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, 106 bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
107 int caller_bci, ciCallProfile& profile, 107 int caller_bci, ciCallProfile& profile,
108 WarmCallInfo* wci_result) { 108 WarmCallInfo* wci_result) {
109 // Allows targeted inlining 109 // Allows targeted inlining
110 if(callee_method->should_inline()) { 110 if (callee_method->should_inline()) {
111 *wci_result = *(WarmCallInfo::always_hot()); 111 *wci_result = *(WarmCallInfo::always_hot());
112 if (C->print_inlining() && Verbose) { 112 if (C->print_inlining() && Verbose) {
113 CompileTask::print_inline_indent(inline_level()); 113 CompileTask::print_inline_indent(inline_level());
114 tty->print_cr("Inlined method is hot: "); 114 tty->print_cr("Inlined method is hot: ");
115 } 115 }
116 set_msg("force inline by CompilerOracle"); 116 set_msg("force inline by CompilerOracle");
117 _forced_inline = true; 117 _forced_inline = true;
118 return true; 118 return true;
119 }
120
121 if (callee_method->force_inline()) {
122 set_msg("force inline by annotation");
123 _forced_inline = true;
124 return true;
119 } 125 }
120 126
121 #ifndef PRODUCT 127 #ifndef PRODUCT
122 int inline_depth = inline_level()+1; 128 int inline_depth = inline_level()+1;
123 if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { 129 if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) {
242 set_msg("disallowed by ciReplay"); 248 set_msg("disallowed by ciReplay");
243 return true; 249 return true;
244 } 250 }
245 #endif 251 #endif
246 252
253 if (callee_method->force_inline()) {
254 set_msg("force inline by annotation");
255 return false;
256 }
257
247 // Now perform checks which are heuristic 258 // Now perform checks which are heuristic
248 259
249 if (is_unboxing_method(callee_method, C)) { 260 if (is_unboxing_method(callee_method, C)) {
250 // Inline unboxing methods. 261 // Inline unboxing methods.
251 return false; 262 return false;
252 } 263 }
253 264
254 if (!callee_method->force_inline()) { 265 if (callee_method->has_compiled_code() &&
255 if (callee_method->has_compiled_code() && 266 callee_method->instructions_size() > InlineSmallCode) {
256 callee_method->instructions_size() > InlineSmallCode) { 267 set_msg("already compiled into a big method");
257 set_msg("already compiled into a big method"); 268 return true;
258 return true;
259 }
260 } 269 }
261 270
262 // don't inline exception code unless the top method belongs to an 271 // don't inline exception code unless the top method belongs to an
263 // exception class 272 // exception class
264 if (caller_tree() != NULL && 273 if (caller_tree() != NULL &&
347 if ((!UseInterpreter || CompileTheWorld) && 356 if ((!UseInterpreter || CompileTheWorld) &&
348 is_init_with_ea(callee_method, caller_method, C)) { 357 is_init_with_ea(callee_method, caller_method, C)) {
349 // Escape Analysis stress testing when running Xcomp or CTW: 358 // Escape Analysis stress testing when running Xcomp or CTW:
350 // inline constructors even if they are not reached. 359 // inline constructors even if they are not reached.
351 } else if (forced_inline()) { 360 } else if (forced_inline()) {
352 // Inlining was forced by CompilerOracle or ciReplay 361 // Inlining was forced by CompilerOracle, ciReplay or annotation
353 } else if (profile.count() == 0) { 362 } else if (profile.count() == 0) {
354 // don't inline unreached call sites 363 // don't inline unreached call sites
355 set_msg("call site not reached"); 364 set_msg("call site not reached");
356 return false; 365 return false;
357 } 366 }