--- old/src/share/vm/prims/jvm.cpp 2020-01-16 16:56:32.487401513 +0300 +++ new/src/share/vm/prims/jvm.cpp 2020-01-16 16:56:32.439403063 +0300 @@ -37,7 +37,9 @@ #include "classfile/vmSymbols.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/bytecode.hpp" +#if INCLUDE_JFR #include "jfr/jfrEvents.hpp" +#endif #include "memory/oopFactory.hpp" #include "memory/referenceType.hpp" #include "memory/universe.inline.hpp" @@ -445,11 +447,13 @@ JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt()) JVMWrapper("JVM_BeforeHalt"); +#if INCLUDE_JFR EventShutdown event; if (event.should_commit()) { event.set_reason("Shutdown requested from Java"); event.commit(); } +#endif JVM_END @@ -3286,12 +3290,14 @@ } JVM_END +#if INCLUDE_JFR static void post_thread_sleep_event(EventThreadSleep* event, jlong millis) { assert(event != NULL, "invariant"); assert(event->should_commit(), "invariant"); event->set_time(millis); event->commit(); } +#endif JVM_ENTRY(void, JVM_Sleep(JNIEnv* env, jclass threadClass, jlong millis)) JVMWrapper("JVM_Sleep"); @@ -3315,7 +3321,9 @@ millis); #endif /* USDT2 */ +#if INCLUDE_JFR EventThreadSleep event; +#endif if (millis == 0) { // When ConvertSleepToYield is on, this matches the classic VM implementation of @@ -3337,9 +3345,11 @@ // An asynchronous exception (e.g., ThreadDeathException) could have been thrown on // us while we were sleeping. We do not overwrite those. if (!HAS_PENDING_EXCEPTION) { +#if INCLUDE_JFR if (event.should_commit()) { post_thread_sleep_event(&event, millis); } +#endif #ifndef USDT2 HS_DTRACE_PROBE1(hotspot, thread__sleep__end,1); #else /* USDT2 */ @@ -3353,9 +3363,11 @@ } thread->osthread()->set_state(old_state); } +#if INCLUDE_JFR if (event.should_commit()) { post_thread_sleep_event(&event, millis); } +#endif #ifndef USDT2 HS_DTRACE_PROBE1(hotspot, thread__sleep__end,0); #else /* USDT2 */