comparison src/share/vm/prims/whitebox.cpp @ 12118:5fd8e2fbafd4

8020829: JT_HS: 2 runtime NMT tests fail on platforms if NMT detail is not supported Summary: Make tests query a new WhiteBox API to see if NMT detail is supported, and behave properly if it is not supported. Reviewed-by: dholmes, coleenp
author cjplummer
date Fri, 23 Aug 2013 12:36:32 -0700
parents f99558245e5c
children 40136aa2cdb1
comparison
equal deleted inserted replaced
12117:f92b82d454fa 12118:5fd8e2fbafd4
126 WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o)) 126 WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
127 return (jint)HeapRegion::GrainBytes; 127 return (jint)HeapRegion::GrainBytes;
128 WB_END 128 WB_END
129 #endif // INCLUDE_ALL_GCS 129 #endif // INCLUDE_ALL_GCS
130 130
131 #ifdef INCLUDE_NMT 131 #if INCLUDE_NMT
132 // Alloc memory using the test memory type so that we can use that to see if 132 // Alloc memory using the test memory type so that we can use that to see if
133 // NMT picks it up correctly 133 // NMT picks it up correctly
134 WB_ENTRY(jlong, WB_NMTMalloc(JNIEnv* env, jobject o, jlong size)) 134 WB_ENTRY(jlong, WB_NMTMalloc(JNIEnv* env, jobject o, jlong size))
135 jlong addr = 0; 135 jlong addr = 0;
136 136
177 if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) { 177 if (!MemTracker::is_on() || MemTracker::shutdown_in_progress()) {
178 return false; 178 return false;
179 } 179 }
180 180
181 return MemTracker::wbtest_wait_for_data_merge(); 181 return MemTracker::wbtest_wait_for_data_merge();
182 WB_END
183
184 WB_ENTRY(jboolean, WB_NMTIsDetailSupported(JNIEnv* env))
185 return MemTracker::tracking_level() == MemTracker::NMT_detail;
182 WB_END 186 WB_END
183 187
184 #endif // INCLUDE_NMT 188 #endif // INCLUDE_NMT
185 189
186 static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobject method) { 190 static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobject method) {
437 {CC"g1InConcurrentMark", CC"()Z", (void*)&WB_G1InConcurrentMark}, 441 {CC"g1InConcurrentMark", CC"()Z", (void*)&WB_G1InConcurrentMark},
438 {CC"g1IsHumongous", CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous }, 442 {CC"g1IsHumongous", CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous },
439 {CC"g1NumFreeRegions", CC"()J", (void*)&WB_G1NumFreeRegions }, 443 {CC"g1NumFreeRegions", CC"()J", (void*)&WB_G1NumFreeRegions },
440 {CC"g1RegionSize", CC"()I", (void*)&WB_G1RegionSize }, 444 {CC"g1RegionSize", CC"()I", (void*)&WB_G1RegionSize },
441 #endif // INCLUDE_ALL_GCS 445 #endif // INCLUDE_ALL_GCS
442 #ifdef INCLUDE_NMT 446 #if INCLUDE_NMT
443 {CC"NMTMalloc", CC"(J)J", (void*)&WB_NMTMalloc }, 447 {CC"NMTMalloc", CC"(J)J", (void*)&WB_NMTMalloc },
444 {CC"NMTFree", CC"(J)V", (void*)&WB_NMTFree }, 448 {CC"NMTFree", CC"(J)V", (void*)&WB_NMTFree },
445 {CC"NMTReserveMemory", CC"(J)J", (void*)&WB_NMTReserveMemory }, 449 {CC"NMTReserveMemory", CC"(J)J", (void*)&WB_NMTReserveMemory },
446 {CC"NMTCommitMemory", CC"(JJ)V", (void*)&WB_NMTCommitMemory }, 450 {CC"NMTCommitMemory", CC"(JJ)V", (void*)&WB_NMTCommitMemory },
447 {CC"NMTUncommitMemory", CC"(JJ)V", (void*)&WB_NMTUncommitMemory }, 451 {CC"NMTUncommitMemory", CC"(JJ)V", (void*)&WB_NMTUncommitMemory },
448 {CC"NMTReleaseMemory", CC"(JJ)V", (void*)&WB_NMTReleaseMemory }, 452 {CC"NMTReleaseMemory", CC"(JJ)V", (void*)&WB_NMTReleaseMemory },
449 {CC"NMTWaitForDataMerge", CC"()Z", (void*)&WB_NMTWaitForDataMerge}, 453 {CC"NMTWaitForDataMerge", CC"()Z", (void*)&WB_NMTWaitForDataMerge},
454 {CC"NMTIsDetailSupported",CC"()Z", (void*)&WB_NMTIsDetailSupported},
450 #endif // INCLUDE_NMT 455 #endif // INCLUDE_NMT
451 {CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll }, 456 {CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll },
452 {CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Executable;Z)I", 457 {CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Executable;Z)I",
453 (void*)&WB_DeoptimizeMethod }, 458 (void*)&WB_DeoptimizeMethod },
454 {CC"isMethodCompiled", CC"(Ljava/lang/reflect/Executable;Z)Z", 459 {CC"isMethodCompiled", CC"(Ljava/lang/reflect/Executable;Z)Z",