3753 // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. 3754 // It is done after compilers are initialized, because otherwise compilations of 3755 // signature polymorphic MH intrinsics can be missed 3756 // (see SystemDictionary::find_method_handle_intrinsic). 3757 initialize_jsr292_core_classes(CHECK_JNI_ERR); 3758 3759 // This will initialize the module system. Only java.base classes can be 3760 // loaded until phase 2 completes 3761 call_initPhase2(CHECK_JNI_ERR); 3762 3763 // Always call even when there are not JVMTI environments yet, since environments 3764 // may be attached late and JVMTI must track phases of VM execution 3765 JvmtiExport::enter_start_phase(); 3766 3767 // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents. 3768 JvmtiExport::post_vm_start(); 3769 3770 // Final system initialization including security manager and system class loader 3771 call_initPhase3(CHECK_JNI_ERR); 3772 3773 // cache the system class loader 3774 SystemDictionary::compute_java_system_loader(CHECK_(JNI_ERR)); 3775 3776 // Always call even when there are not JVMTI environments yet, since environments 3777 // may be attached late and JVMTI must track phases of VM execution 3778 JvmtiExport::enter_live_phase(); 3779 3780 // Notify JVMTI agents that VM initialization is complete - nop if no agents. 3781 JvmtiExport::post_vm_initialized(); 3782 3783 if (TRACE_START() != JNI_OK) { 3784 vm_exit_during_initialization("Failed to start tracing backend."); 3785 } 3786 3787 #if INCLUDE_MANAGEMENT 3788 Management::initialize(THREAD); 3789 3790 if (HAS_PENDING_EXCEPTION) { 3791 // management agent fails to start possibly due to 3792 // configuration problem and is responsible for printing | 3753 // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. 3754 // It is done after compilers are initialized, because otherwise compilations of 3755 // signature polymorphic MH intrinsics can be missed 3756 // (see SystemDictionary::find_method_handle_intrinsic). 3757 initialize_jsr292_core_classes(CHECK_JNI_ERR); 3758 3759 // This will initialize the module system. Only java.base classes can be 3760 // loaded until phase 2 completes 3761 call_initPhase2(CHECK_JNI_ERR); 3762 3763 // Always call even when there are not JVMTI environments yet, since environments 3764 // may be attached late and JVMTI must track phases of VM execution 3765 JvmtiExport::enter_start_phase(); 3766 3767 // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents. 3768 JvmtiExport::post_vm_start(); 3769 3770 // Final system initialization including security manager and system class loader 3771 call_initPhase3(CHECK_JNI_ERR); 3772 3773 #ifdef INCLUDE_JVMCI 3774 if (EnableJVMCI && UseJVMCICompiler && (!UseInterpreter || !BackgroundCompilation)) { 3775 // 8145270: Force initialization of JVMCI runtime otherwise requests for blocking 3776 // compilations via JVMCI will not actually block until JVMCI is initialized. 3777 JVMCIRuntime::force_initialization(CHECK_JNI_ERR); 3778 } 3779 #endif 3780 // cache the system class loader 3781 SystemDictionary::compute_java_system_loader(CHECK_(JNI_ERR)); 3782 3783 // Always call even when there are not JVMTI environments yet, since environments 3784 // may be attached late and JVMTI must track phases of VM execution 3785 JvmtiExport::enter_live_phase(); 3786 3787 // Notify JVMTI agents that VM initialization is complete - nop if no agents. 3788 JvmtiExport::post_vm_initialized(); 3789 3790 if (TRACE_START() != JNI_OK) { 3791 vm_exit_during_initialization("Failed to start tracing backend."); 3792 } 3793 3794 #if INCLUDE_MANAGEMENT 3795 Management::initialize(THREAD); 3796 3797 if (HAS_PENDING_EXCEPTION) { 3798 // management agent fails to start possibly due to 3799 // configuration problem and is responsible for printing |