< prev index next >
src/share/vm/jvmci/jvmciCompiler.cpp
Print this page
@@ -37,10 +37,11 @@
JVMCICompiler* JVMCICompiler::_instance = NULL;
elapsedTimer JVMCICompiler::_codeInstallTimer;
JVMCICompiler::JVMCICompiler() : AbstractCompiler(jvmci) {
_bootstrapping = false;
+ _bootstrap_compilation_request_handled = false;
_methods_compiled = 0;
assert(_instance == NULL, "only one instance allowed");
_instance = this;
}
@@ -55,22 +56,21 @@
// JVMCI is considered as application code so we need to
// stop the VM deferring compilation now.
CompilationPolicy::completed_vm_startup();
}
-void JVMCICompiler::bootstrap() {
+void JVMCICompiler::bootstrap(TRAPS) {
if (Arguments::mode() == Arguments::_int) {
// Nothing to do in -Xint mode
return;
}
#ifndef PRODUCT
// We turn off CompileTheWorld so that compilation requests are not
// ignored during bootstrap or that JVMCI can be compiled by C1/C2.
FlagSetting ctwOff(CompileTheWorld, false);
#endif
- JavaThread* THREAD = JavaThread::current();
_bootstrapping = true;
ResourceMark rm;
HandleMark hm;
if (PrintBootstrap) {
tty->print("Bootstrapping JVMCI");
@@ -95,11 +95,11 @@
do {
// Loop until there is something in the queue.
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)) {
++z;
tty->print_raw(".");
@@ -109,10 +109,11 @@
if (PrintBootstrap) {
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); \
if (HAS_PENDING_EXCEPTION) { \
char buf[256]; \
@@ -185,10 +186,13 @@
}
} else {
assert(false, "JVMCICompiler.compileMethod should always return non-null");
}
}
+ if (_bootstrapping) {
+ _bootstrap_compilation_request_handled = true;
+ }
}
/**
* Aborts the VM due to an unexpected exception.
*/
< prev index next >