mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8200230: [Graal] Compilations should not be enqueued before Graal is initialized
Split compiler initialization into two phases to avoid compilations being enqueued before Graal is initialized. Reviewed-by: kvn, dnsimon
This commit is contained in:
parent
32668d954e
commit
c530e2724d
3 changed files with 33 additions and 21 deletions
|
@ -3835,7 +3835,28 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
|
||||
// initialize compiler(s)
|
||||
#if defined(COMPILER1) || COMPILER2_OR_JVMCI
|
||||
CompileBroker::compilation_init(CHECK_JNI_ERR);
|
||||
#if INCLUDE_JVMCI
|
||||
bool force_JVMCI_intialization = false;
|
||||
if (EnableJVMCI) {
|
||||
// Initialize JVMCI eagerly when it is explicitly requested.
|
||||
// Or when JVMCIPrintProperties is enabled.
|
||||
// The JVMCI Java initialization code will read this flag and
|
||||
// do the printing if it's set.
|
||||
force_JVMCI_intialization = EagerJVMCI || JVMCIPrintProperties;
|
||||
|
||||
if (!force_JVMCI_intialization) {
|
||||
// 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
|
||||
// compilations via JVMCI will not actually block until JVMCI is initialized.
|
||||
force_JVMCI_intialization = UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
CompileBroker::compilation_init_phase1(CHECK_JNI_ERR);
|
||||
// Postpone completion of compiler initialization to after JVMCI
|
||||
// is initialized to avoid timeouts of blocking compilations.
|
||||
if (JVMCI_ONLY(!force_JVMCI_intialization) NOT_JVMCI(true)) {
|
||||
CompileBroker::compilation_init_phase2();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
|
||||
|
@ -3862,22 +3883,9 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
SystemDictionary::compute_java_loaders(CHECK_JNI_ERR);
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI) {
|
||||
// Initialize JVMCI eagerly when it is explicitly requested.
|
||||
// Or when JVMCIPrintProperties is enabled.
|
||||
// The JVMCI Java initialization code will read this flag and
|
||||
// do the printing if it's set.
|
||||
bool init = EagerJVMCI || JVMCIPrintProperties;
|
||||
|
||||
if (!init) {
|
||||
// 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
|
||||
// compilations via JVMCI will not actually block until JVMCI is initialized.
|
||||
init = UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation);
|
||||
}
|
||||
|
||||
if (init) {
|
||||
JVMCIRuntime::force_initialization(CHECK_JNI_ERR);
|
||||
}
|
||||
if (force_JVMCI_intialization) {
|
||||
JVMCIRuntime::force_initialization(CHECK_JNI_ERR);
|
||||
CompileBroker::compilation_init_phase2();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue