--- old/src/share/vm/prims/whitebox.cpp 2014-12-04 16:47:28.500789000 -0500 +++ new/src/share/vm/prims/whitebox.cpp 2014-12-04 16:47:26.187417000 -0500 @@ -1036,6 +1036,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) { @@ -1228,6 +1235,7 @@ {CC"getCodeHeapEntries", CC"(I)[Ljava/lang/Object;",(void*)&WB_GetCodeHeapEntries }, {CC"getThreadStackSize", CC"()J", (void*)&WB_GetThreadStackSize }, {CC"getThreadRemainingStackSize", CC"()J", (void*)&WB_GetThreadRemainingStackSize }, + {CC"assertMatchingSafepointCalls", CC"(ZZ)V", (void*)&WB_AssertMatchingSafepointCalls }, }; #undef CC