mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
6987115: Non-tiered compilation policy creates unnecessary C1 threads
Fixed NonTieredCompPolicy::compiler_count() to return correct thread count. Reviewed-by: twisti, kvn
This commit is contained in:
parent
718b005834
commit
f5bac56265
1 changed files with 21 additions and 6 deletions
|
@ -129,16 +129,31 @@ void NonTieredCompPolicy::initialize() {
|
|||
}
|
||||
}
|
||||
|
||||
// Note: this policy is used ONLY if TieredCompilation is off.
|
||||
// compiler_count() behaves the following way:
|
||||
// - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return
|
||||
// zero for the c1 compilation levels, hence the particular ordering of the
|
||||
// statements.
|
||||
// - the same should happen when COMPILER2 is defined and COMPILER1 is not
|
||||
// (server build without TIERED defined).
|
||||
// - if only COMPILER1 is defined (client build), zero should be returned for
|
||||
// the c2 level.
|
||||
// - if neither is defined - always return zero.
|
||||
int NonTieredCompPolicy::compiler_count(CompLevel comp_level) {
|
||||
#ifdef COMPILER1
|
||||
if (is_c1_compile(comp_level)) {
|
||||
return _compiler_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(!TieredCompilation, "This policy should not be used with TieredCompilation");
|
||||
#ifdef COMPILER2
|
||||
if (is_c2_compile(comp_level)) {
|
||||
return _compiler_count;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef COMPILER1
|
||||
if (is_c1_compile(comp_level)) {
|
||||
return _compiler_count;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue