Skip to content

Commit

Permalink
8317610: runtime/CompressedOops/CompressedClassPointers.java fails af…
Browse files Browse the repository at this point in the history
…ter JDK-8305765
  • Loading branch information
calvinccheung committed Oct 18, 2023
1 parent 9843c97 commit 5023426
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 0 additions & 1 deletion test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

#############################################################################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 5023426

Please sign in to comment.