--- old/src/share/vm/prims/whitebox.cpp 2014-11-06 12:39:42.512501000 -0800 +++ new/src/share/vm/prims/whitebox.cpp 2014-11-06 12:39:41.506397000 -0800 @@ -876,6 +876,13 @@ return (jlong) MetaspaceGC::capacity_until_GC(); WB_END +WB_ENTRY(void, WB_AssertMatchingSafepointCalls(JNIEnv* env, jobject o, jboolean mutexSafepointValue, jboolean attemptedNoSafepointValue)) + Monitor::SafepointCheckRequired sfpt_check_required = mutexSafepointValue ? + Monitor::_safepoint_check_always : + Monitor::_safepoint_check_never; + MutexLockerEx ml(new Mutex(Mutex::leaf, "SFPT_Test_lock", true, sfpt_check_required), + attemptedNoSafepointValue == JNI_TRUE ); +WB_END //Some convenience methods to deal with objects from java int WhiteBox::offset_for_field(const char* field_name, oop object, Symbol* signature_symbol) { @@ -1055,6 +1062,7 @@ (void*)&WB_GetNMethod }, {CC"getThreadStackSize", CC"()J", (void*)&WB_GetThreadStackSize }, {CC"getThreadRemainingStackSize", CC"()J", (void*)&WB_GetThreadRemainingStackSize }, + {CC"assertMatchingSafepointCalls", CC"(ZZ)V", (void*)&WB_AssertMatchingSafepointCalls }, }; #undef CC