< prev index next > test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java
Print this page
public class CompressedClassPointers {
static final String logging_option = "-Xlog:gc+metaspace=trace,metaspace=info,cds=trace";
static final String reserveCCSAnywhere = "Reserving compressed class space anywhere";
+ static final String usesCompactObjectHeadersPat = "UseCompactObjectHeaders 1";
// Returns true if we are to test the narrow klass base; we only do this on
// platforms where we can be reasonably shure that we get reproducable placement).
static boolean testNarrowKlassBase() {
if (Platform.isWindows()) {
}
return true;
}
+ // Returns true if the output indicates that the VM uses compact object headers
+ static boolean usesCompactObjectHeaders(OutputAnalyzer output) {
+ return output.getOutput().contains(usesCompactObjectHeadersPat);
+ }
+
// Returns true if the output indicates that the ccs is reserved anywhere.
static boolean isCCSReservedAnywhere(OutputAnalyzer output) {
if (output.getOutput().contains(reserveCCSAnywhere)) {
return true;
} else {
"-Xlog:gc+metaspace=trace",
"-Xshare:off",
"-Xlog:cds=trace",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! if (!isCCSReservedAnywhere(output)) {
output.shouldContain("Narrow klass base: 0x0000000000000000");
}
output.shouldHaveExitValue(0);
}
"-Xlog:gc+metaspace=trace",
"-Xshare:off",
"-Xlog:cds=trace",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! if (!isCCSReservedAnywhere(output) && !usesCompactObjectHeaders(output)) {
output.shouldContain("Narrow klass base: 0x0000000000000000");
}
output.shouldHaveExitValue(0);
}
"-Xlog:gc+metaspace=trace",
"-Xshare:off",
"-Xlog:cds=trace",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! if (!isCCSReservedAnywhere(output)) {
output.shouldContain("Narrow klass base: 0x0000000000000000");
}
! if (!Platform.isAArch64() && !Platform.isPPC()) {
// Currently relax this test for Aarch64 and ppc.
output.shouldContain("Narrow klass shift: 0");
}
output.shouldHaveExitValue(0);
}
"-Xlog:gc+metaspace=trace",
"-Xshare:off",
"-Xlog:cds=trace",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! if (!isCCSReservedAnywhere(output) && !usesCompactObjectHeaders(output)) {
output.shouldContain("Narrow klass base: 0x0000000000000000");
}
! if (!Platform.isAArch64() && !usesCompactObjectHeaders(output) && !Platform.isPPC()) {
// Currently relax this test for Aarch64 and ppc.
output.shouldContain("Narrow klass shift: 0");
}
output.shouldHaveExitValue(0);
}
"-Xlog:gc+metaspace=trace",
"-Xshare:off",
"-Xlog:cds=trace",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! if (!isCCSReservedAnywhere(output)) {
output.shouldContain("Narrow klass base: 0x0000000000000000");
}
! if (!Platform.isAArch64() && !Platform.isPPC()) {
// Currently relax this test for Aarch64 and ppc.
output.shouldContain("Narrow klass shift: 0");
}
output.shouldHaveExitValue(0);
}
"-Xlog:gc+metaspace=trace",
"-Xshare:off",
"-Xlog:cds=trace",
"-XX:+VerifyBeforeGC", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
! if (!isCCSReservedAnywhere(output) && !usesCompactObjectHeaders(output)) {
output.shouldContain("Narrow klass base: 0x0000000000000000");
}
! if (!Platform.isAArch64() && !usesCompactObjectHeaders(output) && !Platform.isPPC()) {
// Currently relax this test for Aarch64 and ppc.
output.shouldContain("Narrow klass shift: 0");
}
output.shouldHaveExitValue(0);
}
< prev index next >