Mercurial > hg > openjdk > jdk9 > hotspot
changeset 9780:00a610f2be96
8145270: Need to eagerly initialize JVMCI compiler under -Xcomp
Reviewed-by: twisti
author | dnsimon |
---|---|
date | Sun, 13 Dec 2015 22:51:13 +0100 |
parents | 58961218c500 |
children | 3c50dbb0c7ae |
files | src/share/vm/compiler/compileBroker.cpp src/share/vm/compiler/compileBroker.hpp src/share/vm/runtime/thread.cpp |
diffstat | 3 files changed, 15 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp Mon Dec 07 15:42:47 2015 +0100 +++ b/src/share/vm/compiler/compileBroker.cpp Sun Dec 13 22:51:13 2015 +0100 @@ -56,6 +56,7 @@ #if INCLUDE_JVMCI #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" +#include "jvmci/jvmciJavaClasses.hpp" #include "runtime/vframe.hpp" #endif #ifdef COMPILER2 @@ -498,7 +499,7 @@ // CompileBroker::compilation_init // // Initialize the Compilation object -void CompileBroker::compilation_init() { +void CompileBroker::compilation_init(TRAPS) { _last_method_compiled[0] = '\0'; // No need to initialize compilation system if we do not use it. @@ -529,6 +530,17 @@ } else { c1_count = JVMCIHostThreads; } + + if (!UseInterpreter) { + // Force initialization of JVMCI compiler otherwise JVMCI + // compilations will not block until JVMCI is initialized + ResourceMark rm; + TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK); + TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK); + Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK); + JavaValue result(T_OBJECT); + JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK); + } } } #endif // INCLUDE_JVMCI
--- a/src/share/vm/compiler/compileBroker.hpp Mon Dec 07 15:42:47 2015 +0100 +++ b/src/share/vm/compiler/compileBroker.hpp Sun Dec 13 22:51:13 2015 +0100 @@ -276,7 +276,7 @@ CompileQueue *q = compile_queue(comp_level); return q != NULL ? q->size() : 0; } - static void compilation_init(); + static void compilation_init(TRAPS); static void init_compiler_thread_log(); static nmethod* compile_method(const methodHandle& method, int osr_bci,
--- a/src/share/vm/runtime/thread.cpp Mon Dec 07 15:42:47 2015 +0100 +++ b/src/share/vm/runtime/thread.cpp Sun Dec 13 22:51:13 2015 +0100 @@ -3628,7 +3628,7 @@ // initialize compiler(s) #if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI - CompileBroker::compilation_init(); + CompileBroker::compilation_init(CHECK_JNI_ERR); #endif // Pre-initialize some JSR292 core classes to avoid deadlock during class loading.