src/hotspot/share/runtime/thread.cpp
changeset 49618 c5b066caefba
parent 49592 77fb0be7d19f
child 49636 6d5bd76650df
equal deleted inserted replaced
49617:82634a458dc8 49618:c5b066caefba
  3833     Chunk::start_chunk_pool_cleaner_task();
  3833     Chunk::start_chunk_pool_cleaner_task();
  3834   }
  3834   }
  3835 
  3835 
  3836   // initialize compiler(s)
  3836   // initialize compiler(s)
  3837 #if defined(COMPILER1) || COMPILER2_OR_JVMCI
  3837 #if defined(COMPILER1) || COMPILER2_OR_JVMCI
  3838   CompileBroker::compilation_init(CHECK_JNI_ERR);
  3838 #if INCLUDE_JVMCI
       
  3839   bool force_JVMCI_intialization = false;
       
  3840   if (EnableJVMCI) {
       
  3841     // Initialize JVMCI eagerly when it is explicitly requested.
       
  3842     // Or when JVMCIPrintProperties is enabled.
       
  3843     // The JVMCI Java initialization code will read this flag and
       
  3844     // do the printing if it's set.
       
  3845     force_JVMCI_intialization = EagerJVMCI || JVMCIPrintProperties;
       
  3846 
       
  3847     if (!force_JVMCI_intialization) {
       
  3848       // 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
       
  3849       // compilations via JVMCI will not actually block until JVMCI is initialized.
       
  3850       force_JVMCI_intialization = UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation);
       
  3851     }
       
  3852   }
       
  3853 #endif
       
  3854   CompileBroker::compilation_init_phase1(CHECK_JNI_ERR);
       
  3855   // Postpone completion of compiler initialization to after JVMCI
       
  3856   // is initialized to avoid timeouts of blocking compilations.
       
  3857   if (JVMCI_ONLY(!force_JVMCI_intialization) NOT_JVMCI(true)) {
       
  3858     CompileBroker::compilation_init_phase2();
       
  3859   }
  3839 #endif
  3860 #endif
  3840 
  3861 
  3841   // Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
  3862   // Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
  3842   // It is done after compilers are initialized, because otherwise compilations of
  3863   // It is done after compilers are initialized, because otherwise compilations of
  3843   // signature polymorphic MH intrinsics can be missed
  3864   // signature polymorphic MH intrinsics can be missed
  3860 
  3881 
  3861   // cache the system and platform class loaders
  3882   // cache the system and platform class loaders
  3862   SystemDictionary::compute_java_loaders(CHECK_JNI_ERR);
  3883   SystemDictionary::compute_java_loaders(CHECK_JNI_ERR);
  3863 
  3884 
  3864 #if INCLUDE_JVMCI
  3885 #if INCLUDE_JVMCI
  3865   if (EnableJVMCI) {
  3886   if (force_JVMCI_intialization) {
  3866     // Initialize JVMCI eagerly when it is explicitly requested.
  3887     JVMCIRuntime::force_initialization(CHECK_JNI_ERR);
  3867     // Or when JVMCIPrintProperties is enabled.
  3888     CompileBroker::compilation_init_phase2();
  3868     // The JVMCI Java initialization code will read this flag and
       
  3869     // do the printing if it's set.
       
  3870     bool init = EagerJVMCI || JVMCIPrintProperties;
       
  3871 
       
  3872     if (!init) {
       
  3873       // 8145270: Force initialization of JVMCI runtime otherwise requests for blocking
       
  3874       // compilations via JVMCI will not actually block until JVMCI is initialized.
       
  3875       init = UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation);
       
  3876     }
       
  3877 
       
  3878     if (init) {
       
  3879       JVMCIRuntime::force_initialization(CHECK_JNI_ERR);
       
  3880     }
       
  3881   }
  3889   }
  3882 #endif
  3890 #endif
  3883 
  3891 
  3884   // Always call even when there are not JVMTI environments yet, since environments
  3892   // Always call even when there are not JVMTI environments yet, since environments
  3885   // may be attached late and JVMTI must track phases of VM execution
  3893   // may be attached late and JVMTI must track phases of VM execution