# HG changeset patch # User jiangli # Date 1510098497 18000 # Node ID 506775a4f446202e30ce35aabed55ee66fcb492c # Parent fa06ab2a057014584515b9d7897cb875a6860a6f 8189840: CheckCachedResolvedReferencesApp has no cached resolved references Summary: Add WhiteBox.areOpenArchiveHeapObjectsMapped() for CheckCachedResolvedReferencesApp to check and skip test when open archive heap objects are not mapped. Reviewed-by: iklam, ccheung diff -r fa06ab2a0570 -r 506775a4f446 src/hotspot/share/prims/whitebox.cpp --- a/src/hotspot/share/prims/whitebox.cpp Tue Nov 07 14:13:18 2017 -0800 +++ b/src/hotspot/share/prims/whitebox.cpp Tue Nov 07 18:48:17 2017 -0500 @@ -1715,6 +1715,10 @@ } WB_END +WB_ENTRY(jboolean, WB_AreOpenArchiveHeapObjectsMapped(JNIEnv* env)) + return MetaspaceShared::open_archive_heap_region_mapped(); +WB_END + WB_ENTRY(jboolean, WB_IsCDSIncludedInVmBuild(JNIEnv* env)) #if INCLUDE_CDS return true; @@ -2031,6 +2035,7 @@ {CC"isSharedClass", CC"(Ljava/lang/Class;)Z", (void*)&WB_IsSharedClass }, {CC"areSharedStringsIgnored", CC"()Z", (void*)&WB_AreSharedStringsIgnored }, {CC"getResolvedReferences", CC"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)&WB_GetResolvedReferences}, + {CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped}, {CC"isCDSIncludedInVmBuild", CC"()Z", (void*)&WB_IsCDSIncludedInVmBuild }, {CC"clearInlineCaches0", CC"(Z)V", (void*)&WB_ClearInlineCaches }, {CC"addCompilerDirective", CC"(Ljava/lang/String;)I", diff -r fa06ab2a0570 -r 506775a4f446 test/lib/sun/hotspot/WhiteBox.java --- a/test/lib/sun/hotspot/WhiteBox.java Tue Nov 07 14:13:18 2017 -0800 +++ b/test/lib/sun/hotspot/WhiteBox.java Tue Nov 07 18:48:17 2017 -0500 @@ -525,6 +525,7 @@ public native boolean areSharedStringsIgnored(); public native boolean isCDSIncludedInVmBuild(); public native Object getResolvedReferences(Class c); + public native boolean areOpenArchiveHeapObjectsMapped(); // Compiler Directive public native int addCompilerDirective(String compDirect);