comparison src/share/vm/runtime/compilationPolicy.cpp @ 1821:df015ec64052

6987115: Non-tiered compilation policy creates unnecessary C1 threads Summary: Fixed NonTieredCompPolicy::compiler_count() to return correct thread count. Reviewed-by: twisti, kvn
author iveresov
date Mon, 27 Sep 2010 15:04:40 -0700
parents d5d065957597
children f95d63e2154a
comparison
equal deleted inserted replaced
1820:861f533d12b0 1821:df015ec64052
127 } else { 127 } else {
128 _compiler_count = CICompilerCount; 128 _compiler_count = CICompilerCount;
129 } 129 }
130 } 130 }
131 131
132 // Note: this policy is used ONLY if TieredCompilation is off.
133 // compiler_count() behaves the following way:
134 // - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return
135 // zero for the c1 compilation levels, hence the particular ordering of the
136 // statements.
137 // - the same should happen when COMPILER2 is defined and COMPILER1 is not
138 // (server build without TIERED defined).
139 // - if only COMPILER1 is defined (client build), zero should be returned for
140 // the c2 level.
141 // - if neither is defined - always return zero.
132 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { 142 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) {
143 assert(!TieredCompilation, "This policy should not be used with TieredCompilation");
144 #ifdef COMPILER2
145 if (is_c2_compile(comp_level)) {
146 return _compiler_count;
147 } else {
148 return 0;
149 }
150 #endif
151
133 #ifdef COMPILER1 152 #ifdef COMPILER1
134 if (is_c1_compile(comp_level)) { 153 if (is_c1_compile(comp_level)) {
135 return _compiler_count; 154 return _compiler_count;
136 } 155 } else {
137 #endif 156 return 0;
138
139 #ifdef COMPILER2
140 if (is_c2_compile(comp_level)) {
141 return _compiler_count;
142 } 157 }
143 #endif 158 #endif
144 159
145 return 0; 160 return 0;
146 } 161 }