changeset 47986:506775a4f446

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
author jiangli
date Tue, 07 Nov 2017 18:48:17 -0500
parents fa06ab2a0570
children b6c19518372e
files src/hotspot/share/prims/whitebox.cpp test/lib/sun/hotspot/WhiteBox.java
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);