aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/runtime/compilationPolicy.cpp
diff options
context:
space:
mode:
authoriveresov <none@none>2010-09-27 15:04:40 -0700
committeriveresov <none@none>2010-09-27 15:04:40 -0700
commit9795615d39e2d185e136db316237b6f6249ed179 (patch)
tree3d92bedbc5790713c893389039e74df3d1eb174d /src/share/vm/runtime/compilationPolicy.cpp
parent57a3a7639ddf1d11d572ac5d2425284b934f9a05 (diff)
6987115: Non-tiered compilation policy creates unnecessary C1 threads
Summary: Fixed NonTieredCompPolicy::compiler_count() to return correct thread count. Reviewed-by: twisti, kvn
Diffstat (limited to 'src/share/vm/runtime/compilationPolicy.cpp')
-rw-r--r--src/share/vm/runtime/compilationPolicy.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/share/vm/runtime/compilationPolicy.cpp b/src/share/vm/runtime/compilationPolicy.cpp
index 3d1ccc0a3..132a61018 100644
--- a/src/share/vm/runtime/compilationPolicy.cpp
+++ b/src/share/vm/runtime/compilationPolicy.cpp
@@ -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)) {
+ 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 COMPILER2
- if (is_c2_compile(comp_level)) {
+#ifdef COMPILER1
+ if (is_c1_compile(comp_level)) {
return _compiler_count;
+ } else {
+ return 0;
}
#endif