comparison src/share/vm/compiler/compileBroker.cpp @ 16006:66a9286203a2

decoupled Graal runtime initialization and Graal compilation queue initialization
author Doug Simon <doug.simon@oracle.com>
date Tue, 03 Jun 2014 11:51:27 +0200
parents e20a45d17181
children 64d8c6c8a00c
comparison
equal deleted inserted replaced
16003:83433cf49019 16006:66a9286203a2
1150 // in non-tiered mode the default level should be 1150 // in non-tiered mode the default level should be
1151 // CompLevel_full_optimization which equals CompLevel_highest_tier. 1151 // CompLevel_full_optimization which equals CompLevel_highest_tier.
1152 assert(TieredCompilation || comp_level == CompLevel_full_optimization, "incorrect compile level"); 1152 assert(TieredCompilation || comp_level == CompLevel_full_optimization, "incorrect compile level");
1153 assert(CompLevel_full_optimization == CompLevel_highest_tier, "incorrect level definition"); 1153 assert(CompLevel_full_optimization == CompLevel_highest_tier, "incorrect level definition");
1154 if (comp_level == CompLevel_full_optimization) { 1154 if (comp_level == CompLevel_full_optimization) {
1155 if (!JavaThread::current()->is_graal_compiling()) { 1155 JavaThread* javaThread = JavaThread::current();
1156 if (javaThread->can_schedule_graal_compilation()) {
1156 bool blockingCompilation = is_compile_blocking(method, osr_bci); 1157 bool blockingCompilation = is_compile_blocking(method, osr_bci);
1158 NoGraalCompilationScheduling ngcs(javaThread);
1157 GraalCompiler::instance()->compile_method(method, osr_bci, NULL, blockingCompilation); 1159 GraalCompiler::instance()->compile_method(method, osr_bci, NULL, blockingCompilation);
1158 } else {
1159 // Can't enqueue this request because there would be no one to service it, so simply return.
1160 } 1160 }
1161 return; 1161 return;
1162 } 1162 }
1163 assert(TieredCompilation, "should only reach here in tiered mode"); 1163 assert(TieredCompilation, "should only reach here in tiered mode");
1164 } 1164 }
2356 } else { 2356 } else {
2357 return (comp->name()); 2357 return (comp->name());
2358 } 2358 }
2359 } 2359 }
2360 2360
2361 #ifdef GRAAL
2362 void CompileBroker::print_times(AbstractCompiler* comp) {
2363 CompilerStatistics* stats = comp->stats();
2364 tty->print_cr(" %s {speed: %d bytes/s; standard: %6.3f s, %d bytes, %d methods; osr: %6.3f s, %d bytes, %d methods; nmethods_size: %d bytes; nmethods_code_size: %d bytes}",
2365 comp->name(), stats->bytes_per_second(),
2366 stats->_standard._time.seconds(), stats->_standard._bytes, stats->_standard._count,
2367 stats->_osr._time.seconds(), stats->_osr._bytes, stats->_osr._count,
2368 stats->_nmethods_size, stats->_nmethods_code_size);
2369 }
2370 #endif
2371
2361 void CompileBroker::print_times(bool per_compiler, bool aggregate) { 2372 void CompileBroker::print_times(bool per_compiler, bool aggregate) {
2362 #ifdef GRAAL 2373 #ifdef GRAAL
2363 elapsedTimer standard_compilation; 2374 elapsedTimer standard_compilation;
2364 elapsedTimer total_compilation; 2375 elapsedTimer total_compilation;
2365 elapsedTimer osr_compilation; 2376 elapsedTimer osr_compilation;
2398 2409
2399 nmethods_size += stats->_nmethods_size; 2410 nmethods_size += stats->_nmethods_size;
2400 nmethods_code_size += stats->_nmethods_code_size; 2411 nmethods_code_size += stats->_nmethods_code_size;
2401 2412
2402 if (per_compiler) { 2413 if (per_compiler) {
2403 tty->print_cr(" %s {speed: %d bytes/s; standard: %6.3f s, %d bytes, %d methods; osr: %6.3f s, %d bytes, %d methods; nmethods_size: %d bytes; nmethods_code_size: %d bytes}", 2414 print_times(comp);
2404 comp->name(), stats->bytes_per_second(),
2405 stats->_standard._time.seconds(), stats->_standard._bytes, stats->_standard._count,
2406 stats->_osr._time.seconds(), stats->_osr._bytes, stats->_osr._count,
2407 stats->_nmethods_size, stats->_nmethods_code_size);
2408 } 2415 }
2409 } 2416 }
2410 } 2417 }
2411 total_compile_count = osr_compile_count + standard_compile_count; 2418 total_compile_count = osr_compile_count + standard_compile_count;
2412 total_compilation.add(osr_compilation); 2419 total_compilation.add(osr_compilation);