8049528: Method marked w/ @ForceInline isn't inlined with "executed < MinInliningThreshold times" message
Reviewed-by: roland, jrose
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp Mon Jul 14 18:24:08 2014 +0000
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp Mon Jul 14 03:24:35 2014 -0700
@@ -107,7 +107,7 @@
int caller_bci, ciCallProfile& profile,
WarmCallInfo* wci_result) {
// Allows targeted inlining
- if(callee_method->should_inline()) {
+ if (callee_method->should_inline()) {
*wci_result = *(WarmCallInfo::always_hot());
if (C->print_inlining() && Verbose) {
CompileTask::print_inline_indent(inline_level());
@@ -118,6 +118,12 @@
return true;
}
+ if (callee_method->force_inline()) {
+ set_msg("force inline by annotation");
+ _forced_inline = true;
+ return true;
+ }
+
#ifndef PRODUCT
int inline_depth = inline_level()+1;
if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) {
@@ -244,6 +250,11 @@
}
#endif
+ if (callee_method->force_inline()) {
+ set_msg("force inline by annotation");
+ return false;
+ }
+
// Now perform checks which are heuristic
if (is_unboxing_method(callee_method, C)) {
@@ -251,12 +262,10 @@
return false;
}
- if (!callee_method->force_inline()) {
- if (callee_method->has_compiled_code() &&
- callee_method->instructions_size() > InlineSmallCode) {
- set_msg("already compiled into a big method");
- return true;
- }
+ if (callee_method->has_compiled_code() &&
+ callee_method->instructions_size() > InlineSmallCode) {
+ set_msg("already compiled into a big method");
+ return true;
}
// don't inline exception code unless the top method belongs to an
@@ -349,7 +358,7 @@
// Escape Analysis stress testing when running Xcomp or CTW:
// inline constructors even if they are not reached.
} else if (forced_inline()) {
- // Inlining was forced by CompilerOracle or ciReplay
+ // Inlining was forced by CompilerOracle, ciReplay or annotation
} else if (profile.count() == 0) {
// don't inline unreached call sites
set_msg("call site not reached");
--- a/hotspot/src/share/vm/opto/parse.hpp Mon Jul 14 18:24:08 2014 +0000
+++ b/hotspot/src/share/vm/opto/parse.hpp Mon Jul 14 03:24:35 2014 -0700
@@ -142,7 +142,7 @@
void print_value_on(outputStream* st) const PRODUCT_RETURN;
- bool _forced_inline; // Inlining was forced by CompilerOracle or ciReplay
+ bool _forced_inline; // Inlining was forced by CompilerOracle, ciReplay or annotation
bool forced_inline() const { return _forced_inline; }
// Count number of nodes in this subtree
int count() const;