182 // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine. 183 // May help big-app startup time. 184 _compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1); 185 } else { 186 _compiler_count = CICompilerCount; 187 } 188 } 189 190 // Note: this policy is used ONLY if TieredCompilation is off. 191 // compiler_count() behaves the following way: 192 // - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return 193 // zero for the c1 compilation levels, hence the particular ordering of the 194 // statements. 195 // - the same should happen when COMPILER2 is defined and COMPILER1 is not 196 // (server build without TIERED defined). 197 // - if only COMPILER1 is defined (client build), zero should be returned for 198 // the c2 level. 199 // - if neither is defined - always return zero. 200 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { 201 assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); 202 #ifdef COMPILER2 203 if (is_c2_compile(comp_level)) { 204 return _compiler_count; 205 } else { 206 return 0; 207 } 208 #endif 209 210 #ifdef COMPILER1 211 if (is_c1_compile(comp_level)) { 212 return _compiler_count; 213 } else { 214 return 0; 215 } 216 #endif 217 218 return 0; 219 } 220 221 void NonTieredCompPolicy::reset_counter_for_invocation_event(methodHandle m) { | 182 // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine. 183 // May help big-app startup time. 184 _compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1); 185 } else { 186 _compiler_count = CICompilerCount; 187 } 188 } 189 190 // Note: this policy is used ONLY if TieredCompilation is off. 191 // compiler_count() behaves the following way: 192 // - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return 193 // zero for the c1 compilation levels, hence the particular ordering of the 194 // statements. 195 // - the same should happen when COMPILER2 is defined and COMPILER1 is not 196 // (server build without TIERED defined). 197 // - if only COMPILER1 is defined (client build), zero should be returned for 198 // the c2 level. 199 // - if neither is defined - always return zero. 200 int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { 201 assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); 202 // No need for compiler threads if the VM is started with -Xint 203 if (Arguments::mode() == Arguments::_int) { 204 return 0; 205 } 206 207 #ifdef COMPILER2 208 if (is_c2_compile(comp_level)) { 209 return _compiler_count; 210 } else { 211 return 0; 212 } 213 #endif 214 215 #ifdef COMPILER1 216 if (is_c1_compile(comp_level)) { 217 return _compiler_count; 218 } else { 219 return 0; 220 } 221 #endif 222 223 return 0; 224 } 225 226 void NonTieredCompPolicy::reset_counter_for_invocation_event(methodHandle m) { |