8189840: CheckCachedResolvedReferencesApp has no cached resolved references
authorjiangli
Tue, 07 Nov 2017 18:48:17 -0500
changeset 47805 506775a4f446
parent 47804 fa06ab2a0570
child 47806 b6c19518372e
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
src/hotspot/share/prims/whitebox.cpp
test/lib/sun/hotspot/WhiteBox.java
--- 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",
--- 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);