1.1 --- a/src/share/vm/runtime/thread.cpp Sun Jun 07 18:57:54 2020 +0100 1.2 +++ b/src/share/vm/runtime/thread.cpp Fri Jun 12 02:59:56 2020 +0100 1.3 @@ -3440,7 +3440,7 @@ 1.4 return status; 1.5 } 1.6 1.7 - JFR_ONLY(Jfr::on_vm_init();) 1.8 + JFR_ONLY(Jfr::on_create_vm_1();) 1.9 1.10 // Should be done after the heap is fully created 1.11 main_thread->cache_global_variables(); 1.12 @@ -3491,12 +3491,16 @@ 1.13 ShouldNotReachHere(); 1.14 } 1.15 1.16 +#if !INCLUDE_JFR 1.17 + // if JFR is not enabled at the build time keep the original JvmtiExport location 1.18 + 1.19 // Always call even when there are not JVMTI environments yet, since environments 1.20 // may be attached late and JVMTI must track phases of VM execution 1.21 JvmtiExport::enter_start_phase(); 1.22 1.23 // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents. 1.24 JvmtiExport::post_vm_start(); 1.25 +#endif 1.26 1.27 { 1.28 TraceTime timer("Initialize java.lang classes", TraceStartupTime); 1.29 @@ -3543,6 +3547,19 @@ 1.30 initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK_0); 1.31 } 1.32 1.33 + JFR_ONLY( 1.34 + Jfr::on_create_vm_2(); 1.35 + 1.36 + // if JFR is enabled at build time the JVMTI needs to be handled only after on_create_vm_2() call 1.37 + 1.38 + // Always call even when there are not JVMTI environments yet, since environments 1.39 + // may be attached late and JVMTI must track phases of VM execution 1.40 + JvmtiExport::enter_start_phase(); 1.41 + 1.42 + // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents. 1.43 + JvmtiExport::post_vm_start(); 1.44 + ) 1.45 + 1.46 // See : bugid 4211085. 1.47 // Background : the static initializer of java.lang.Compiler tries to read 1.48 // property"java.compiler" and read & write property "java.vm.info". 1.49 @@ -3637,7 +3654,7 @@ 1.50 // Notify JVMTI agents that VM initialization is complete - nop if no agents. 1.51 JvmtiExport::post_vm_initialized(); 1.52 1.53 - JFR_ONLY(Jfr::on_vm_start();) 1.54 + JFR_ONLY(Jfr::on_create_vm_3();) 1.55 1.56 if (CleanChunkPoolAsync) { 1.57 Chunk::start_chunk_pool_cleaner_task();