< prev index next >

src/hotspot/share/runtime/compilationPolicy.cpp

Print this page
rev 52662 : [mq]: 8214206


 211 void CompilationPolicy::print_time() {
 212   tty->print_cr ("Accumulated compilationPolicy times:");
 213   tty->print_cr ("---------------------------");
 214   tty->print_cr ("  Total: %3.3f sec.", _accumulated_time.seconds());
 215 }
 216 
 217 void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) {
 218   if (TraceOnStackReplacement) {
 219     if (osr_nm == NULL) tty->print_cr("compilation failed");
 220     else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm));
 221   }
 222 }
 223 #endif // !PRODUCT
 224 
 225 void NonTieredCompPolicy::initialize() {
 226   // Setup the compiler thread numbers
 227   if (CICompilerCountPerCPU) {
 228     // Example: if CICompilerCountPerCPU is true, then we get
 229     // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine.
 230     // May help big-app startup time.
 231     _compiler_count = MAX2(log2_intptr(os::active_processor_count())-1,1);
 232     // Make sure there is enough space in the code cache to hold all the compiler buffers
 233     size_t buffer_size = 1;
 234 #ifdef COMPILER1
 235     buffer_size = is_client_compilation_mode_vm() ? Compiler::code_buffer_size() : buffer_size;
 236 #endif
 237 #ifdef COMPILER2
 238     buffer_size = is_server_compilation_mode_vm() ? C2Compiler::initial_code_buffer_size() : buffer_size;
 239 #endif
 240     int max_count = (ReservedCodeCacheSize - (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3))) / (int)buffer_size;
 241     if (_compiler_count > max_count) {
 242       // Lower the compiler count such that all buffers fit into the code cache
 243       _compiler_count = MAX2(max_count, 1);
 244     }
 245     FLAG_SET_ERGO(intx, CICompilerCount, _compiler_count);
 246   } else {
 247     _compiler_count = CICompilerCount;
 248   }
 249 }
 250 
 251 // Note: this policy is used ONLY if TieredCompilation is off.




 211 void CompilationPolicy::print_time() {
 212   tty->print_cr ("Accumulated compilationPolicy times:");
 213   tty->print_cr ("---------------------------");
 214   tty->print_cr ("  Total: %3.3f sec.", _accumulated_time.seconds());
 215 }
 216 
 217 void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) {
 218   if (TraceOnStackReplacement) {
 219     if (osr_nm == NULL) tty->print_cr("compilation failed");
 220     else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm));
 221   }
 222 }
 223 #endif // !PRODUCT
 224 
 225 void NonTieredCompPolicy::initialize() {
 226   // Setup the compiler thread numbers
 227   if (CICompilerCountPerCPU) {
 228     // Example: if CICompilerCountPerCPU is true, then we get
 229     // max(log2(8)-1,1) = 2 compiler threads on an 8-way machine.
 230     // May help big-app startup time.
 231     _compiler_count = MAX2(log2_int(os::active_processor_count())-1,1);
 232     // Make sure there is enough space in the code cache to hold all the compiler buffers
 233     size_t buffer_size = 1;
 234 #ifdef COMPILER1
 235     buffer_size = is_client_compilation_mode_vm() ? Compiler::code_buffer_size() : buffer_size;
 236 #endif
 237 #ifdef COMPILER2
 238     buffer_size = is_server_compilation_mode_vm() ? C2Compiler::initial_code_buffer_size() : buffer_size;
 239 #endif
 240     int max_count = (ReservedCodeCacheSize - (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3))) / (int)buffer_size;
 241     if (_compiler_count > max_count) {
 242       // Lower the compiler count such that all buffers fit into the code cache
 243       _compiler_count = MAX2(max_count, 1);
 244     }
 245     FLAG_SET_ERGO(intx, CICompilerCount, _compiler_count);
 246   } else {
 247     _compiler_count = CICompilerCount;
 248   }
 249 }
 250 
 251 // Note: this policy is used ONLY if TieredCompilation is off.


< prev index next >