diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index a45be186aa4..821444ea389 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -29,6 +29,7 @@ #include "cds/filemap.hpp" #include "cds/heapShared.hpp" #include "cds/metaspaceShared.hpp" +#include "classfile/classLoader.hpp" #include "classfile/classLoaderDataGraph.hpp" #include "classfile/classLoaderStats.hpp" #include "classfile/classPrinter.hpp" @@ -2115,7 +2116,10 @@ WB_END WB_ENTRY(jboolean, WB_IsCDSIncluded(JNIEnv* env)) #if INCLUDE_CDS - return true; + // An exploded build inhibits use of CDS. Therefore, for the + // purpose of testing, the JVM can be treated as not having CDS + // built in at all. + return ClassLoader::has_jrt_entry(); #else return false; #endif // INCLUDE_CDS diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java index 8a25b1eff88..f1b4c7143b4 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedCPUSpecificClassSpaceReservation.java @@ -26,6 +26,7 @@ * @summary Test the various CPU-specific reservation schemes * @requires vm.bits == 64 & !vm.graal.enabled & vm.debug == true * @requires vm.flagless + * @requires vm.cds * @requires (os.family != "windows") & (os.family != "aix") * @library /test/lib * @modules java.base/jdk.internal.misc