--- old/src/share/vm/jvmci/jvmciCompiler.cpp 2016-05-11 09:26:18.374444775 +0200 +++ new/src/share/vm/jvmci/jvmciCompiler.cpp 2016-05-11 09:26:18.187444168 +0200 @@ -39,6 +39,7 @@ JVMCICompiler::JVMCICompiler() : AbstractCompiler(jvmci) { _bootstrapping = false; + _bootstrap_compilation_request_handled = false; _methods_compiled = 0; assert(_instance == NULL, "only one instance allowed"); _instance = this; @@ -57,7 +58,7 @@ CompilationPolicy::completed_vm_startup(); } -void JVMCICompiler::bootstrap() { +void JVMCICompiler::bootstrap(TRAPS) { if (Arguments::mode() == Arguments::_int) { // Nothing to do in -Xint mode return; @@ -68,7 +69,6 @@ FlagSetting ctwOff(CompileTheWorld, false); #endif - JavaThread* THREAD = JavaThread::current(); _bootstrapping = true; ResourceMark rm; HandleMark hm; @@ -97,7 +97,7 @@ do { os::sleep(THREAD, 100, true); qsize = CompileBroker::queue_size(CompLevel_full_optimization); - } while (first_round && qsize == 0); + } while (!_bootstrap_compilation_request_handled && first_round && qsize == 0); first_round = false; if (PrintBootstrap) { while (z < (_methods_compiled / 100)) { @@ -111,6 +111,7 @@ tty->print_cr(" in " JLONG_FORMAT " ms (compiled %d methods)", os::javaTimeMillis() - start, _methods_compiled); } _bootstrapping = false; + JVMCIRuntime::bootstrap_finished(CHECK); } #define CHECK_ABORT THREAD); \ @@ -187,6 +188,9 @@ assert(false, "JVMCICompiler.compileMethod should always return non-null"); } } + if (_bootstrapping) { + _bootstrap_compilation_request_handled = true; + } } /**