src/share/vm/prims/jvm.cpp

Print this page
rev 5893 : 8034080: Remove the USDT1 dtrace code from Hotspot

*** 80,95 **** # include "jvm_bsd.h" #endif #include <errno.h> - #ifndef USDT2 - HS_DTRACE_PROBE_DECL1(hotspot, thread__sleep__begin, long long); - HS_DTRACE_PROBE_DECL1(hotspot, thread__sleep__end, int); - HS_DTRACE_PROBE_DECL0(hotspot, thread__yield); - #endif /* !USDT2 */ - /* NOTE about use of any ctor or function call that can trigger a safepoint/GC: such ctors and calls MUST NOT come between an oop declaration/init and its usage because if objects are move this may cause various memory stomps, bus errors and segfaults. Here is a cookbook for causing so called "naked oop --- 80,89 ----
*** 3000,3014 **** JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass)) JVMWrapper("JVM_Yield"); if (os::dont_yield()) return; - #ifndef USDT2 - HS_DTRACE_PROBE0(hotspot, thread__yield); - #else /* USDT2 */ HOTSPOT_THREAD_YIELD(); ! #endif /* USDT2 */ // When ConvertYieldToSleep is off (default), this matches the classic VM use of yield. // Critical for similar threading behaviour if (ConvertYieldToSleep) { os::sleep(thread, MinSleepInterval, false); } else { --- 2994,3005 ---- JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass)) JVMWrapper("JVM_Yield"); if (os::dont_yield()) return; HOTSPOT_THREAD_YIELD(); ! // When ConvertYieldToSleep is off (default), this matches the classic VM use of yield. // Critical for similar threading behaviour if (ConvertYieldToSleep) { os::sleep(thread, MinSleepInterval, false); } else {
*** 3030,3045 **** // Save current thread state and restore it at the end of this block. // And set new thread state to SLEEPING. JavaThreadSleepState jtss(thread); ! #ifndef USDT2 ! HS_DTRACE_PROBE1(hotspot, thread__sleep__begin, millis); ! #else /* USDT2 */ ! HOTSPOT_THREAD_SLEEP_BEGIN( ! millis); ! #endif /* USDT2 */ EventThreadSleep event; if (millis == 0) { // When ConvertSleepToYield is on, this matches the classic VM implementation of --- 3021,3031 ---- // Save current thread state and restore it at the end of this block. // And set new thread state to SLEEPING. JavaThreadSleepState jtss(thread); ! HOTSPOT_THREAD_SLEEP_BEGIN(millis); EventThreadSleep event; if (millis == 0) { // When ConvertSleepToYield is on, this matches the classic VM implementation of
*** 3063,3078 **** if (!HAS_PENDING_EXCEPTION) { if (event.should_commit()) { event.set_time(millis); event.commit(); } ! #ifndef USDT2 ! HS_DTRACE_PROBE1(hotspot, thread__sleep__end,1); ! #else /* USDT2 */ ! HOTSPOT_THREAD_SLEEP_END( ! 1); ! #endif /* USDT2 */ // TODO-FIXME: THROW_MSG returns which means we will not call set_state() // to properly restore the thread state. That's likely wrong. THROW_MSG(vmSymbols::java_lang_InterruptedException(), "sleep interrupted"); } } --- 3049,3060 ---- if (!HAS_PENDING_EXCEPTION) { if (event.should_commit()) { event.set_time(millis); event.commit(); } ! HOTSPOT_THREAD_SLEEP_END(1); ! // TODO-FIXME: THROW_MSG returns which means we will not call set_state() // to properly restore the thread state. That's likely wrong. THROW_MSG(vmSymbols::java_lang_InterruptedException(), "sleep interrupted"); } }
*** 3080,3095 **** } if (event.should_commit()) { event.set_time(millis); event.commit(); } ! #ifndef USDT2 ! HS_DTRACE_PROBE1(hotspot, thread__sleep__end,0); ! #else /* USDT2 */ ! HOTSPOT_THREAD_SLEEP_END( ! 0); ! #endif /* USDT2 */ JVM_END JVM_ENTRY(jobject, JVM_CurrentThread(JNIEnv* env, jclass threadClass)) JVMWrapper("JVM_CurrentThread"); oop jthread = thread->threadObj(); --- 3062,3072 ---- } if (event.should_commit()) { event.set_time(millis); event.commit(); } ! HOTSPOT_THREAD_SLEEP_END(0); JVM_END JVM_ENTRY(jobject, JVM_CurrentThread(JNIEnv* env, jclass threadClass)) JVMWrapper("JVM_CurrentThread"); oop jthread = thread->threadObj();