diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index c81d282556275..02ee8bd9179d4 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -110,7 +110,6 @@ applications/jcstress/copy.java 8229852 linux-all containers/docker/TestJcmd.java 8278102 linux-all containers/docker/TestMemoryAwareness.java 8303470 linux-all -runtime/CompressedOops/CompressedClassPointers.java 8317610 linux-x64,windows-x64 ############################################################################# diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java index 6b41a7461d159..8aeda423b9ae6 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java @@ -227,6 +227,20 @@ public static void smallHeapTestNoCoop() throws Exception { output.shouldHaveExitValue(0); } + static final long unscaledClassSpaceMax = Long.decode("0x100000000"); + + private static void checkNarrowKlassShift(OutputAnalyzer output) throws Exception { + String s = output.firstMatch("Narrow klass base: .*"); + int startIdx = s.indexOf("range:") + 7; + String longString = s.substring(startIdx); + long narrowKlassRange = Long.decode(longString); + if (narrowKlassRange < unscaledClassSpaceMax) { + output.shouldContain("Narrow klass shift: 0"); + } else { + output.shouldContain("Narrow klass shift: 3"); + } + } + public static void smallHeapTestWith1GNoCoop() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:-UseCompressedOops", @@ -244,7 +258,7 @@ public static void smallHeapTestWith1GNoCoop() throws Exception { } if (!Platform.isAArch64() && !Platform.isPPC()) { // Currently relax this test for Aarch64 and ppc. - output.shouldContain("Narrow klass shift: 0"); + checkNarrowKlassShift(output); } output.shouldHaveExitValue(0); } @@ -266,7 +280,7 @@ public static void largeHeapTestNoCoop() throws Exception { } if (!Platform.isAArch64() && !Platform.isPPC()) { // Currently relax this test for Aarch64 and ppc. - output.shouldContain("Narrow klass shift: 0"); + checkNarrowKlassShift(output); } output.shouldHaveExitValue(0); }