8262323: do not special case JVMCI in tiered compilation policy

Reviewed-by: kvn, never
This commit is contained in:
Doug Simon 2021-03-09 10:57:03 +00:00
parent 3022baa953
commit 4f0a12ec87
2 changed files with 21 additions and 26 deletions

View File

@ -1054,20 +1054,6 @@ CompLevel CompilationPolicy::common(const methodHandle& method, CompLevel cur_le
if (common<Predicate>(method, CompLevel_full_profile, disable_feedback) == CompLevel_full_optimization) { if (common<Predicate>(method, CompLevel_full_profile, disable_feedback) == CompLevel_full_optimization) {
next_level = CompLevel_full_optimization; next_level = CompLevel_full_optimization;
} else if (!CompilationModeFlag::disable_intermediate() && Predicate::apply(i, b, cur_level, method)) { } else if (!CompilationModeFlag::disable_intermediate() && Predicate::apply(i, b, cur_level, method)) {
#if INCLUDE_JVMCI
if (EnableJVMCI && UseJVMCICompiler) {
// Since JVMCI takes a while to warm up, its queue inevitably backs up during
// early VM execution. As of 2014-06-13, JVMCI's inliner assumes that the root
// compilation method and all potential inlinees have mature profiles (which
// includes type profiling). If it sees immature profiles, JVMCI's inliner
// can perform pathologically bad (e.g., causing OutOfMemoryErrors due to
// exploring/inlining too many graphs). Since a rewrite of the inliner is
// in progress, we simply disable the dialing back heuristic for now and will
// revisit this decision once the new inliner is completed.
next_level = CompLevel_full_profile;
} else
#endif
{
// C1-generated fully profiled code is about 30% slower than the limited profile // C1-generated fully profiled code is about 30% slower than the limited profile
// code that has only invocation and backedge counters. The observation is that // code that has only invocation and backedge counters. The observation is that
// if C2 queue is large enough we can spend too much time in the fully profiled code // if C2 queue is large enough we can spend too much time in the fully profiled code
@ -1082,7 +1068,6 @@ CompLevel CompilationPolicy::common(const methodHandle& method, CompLevel cur_le
next_level = CompLevel_full_profile; next_level = CompLevel_full_profile;
} }
} }
}
break; break;
case CompLevel_limited_profile: case CompLevel_limited_profile:
if (is_method_profiled(method)) { if (is_method_profiled(method)) {

View File

@ -451,6 +451,16 @@ void CompilerConfig::set_jvmci_specific_flags() {
if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) { if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) {
FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease)); FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease));
} }
if (FLAG_IS_DEFAULT(Tier3DelayOn)) {
// This effectively prevents the compile broker scheduling tier 2
// (i.e., limited C1 profiling) compilations instead of tier 3
// (i.e., full C1 profiling) compilations when the tier 4 queue
// backs up (which is quite likely when using a non-AOT compiled JVMCI
// compiler). The observation based on jargraal is that the downside
// of skipping full profiling is much worse for performance than the
// queue backing up.
FLAG_SET_DEFAULT(Tier3DelayOn, 100000);
}
} // !UseJVMCINativeLibrary } // !UseJVMCINativeLibrary
} // UseJVMCICompiler } // UseJVMCICompiler
} }