8388712: [s390x, ppc] runtime/CompressedOops/CompressedClassPointersEncodingScheme.java fails since JDK-8387652

Reviewed-by: amitkumar, mbaesken
This commit is contained in:
Thomas Stuefe 2026-07-24 08:11:59 +00:00
parent 8f8c73302e
commit 62cc4efba2
2 changed files with 14 additions and 14 deletions

View File

@ -241,12 +241,9 @@ void CompressedKlassPointers::initialize(address addr, size_t len) {
// a cacheline size.
_base = addr;
const int log2_len_to_cover = log2i_ceil(len);
const int log_cacheline = exact_log2(DEFAULT_CACHE_LINE_SIZE);
int s = max_shift();
while (s > log_cacheline && ((size_t)nth_bit(narrow_klass_pointer_bits() + s - 1) > len)) {
s--;
}
_shift = s;
_shift = MAX2(log_cacheline, log2_len_to_cover - narrow_klass_pointer_bits());
} else {

View File

@ -36,7 +36,6 @@
import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jtreg.SkippedException;
import java.io.IOException;
@ -102,14 +101,18 @@ public class CompressedClassPointersEncodingScheme {
// Compact Object Header Mode:
// We expect the VM to chose the smallest possible shift value needed to cover the encoding range.
// We expect the encoding Base to start at the class space start - but to enforce that,
// we choose unsuited to even shift-extended zero-based mode.
// we choose a base unsuited to even shift-extended zero-based mode.
forceAddress = 32 * G;
int minShift = 6;
if (Platform.isPPC()) minShift = 7;
if (Platform.isS390x()) minShift = 8;
test(forceAddress, true, 128 * M, forceAddress, 6);
test(forceAddress, true, 256 * M, forceAddress, 7);
test(forceAddress, true, 512 * M, forceAddress, 8);
test(forceAddress, true, G, forceAddress, 9);
test(forceAddress, true, 3 * G, forceAddress, 10);
test(forceAddress, true, 128 * M, forceAddress, Math.max(minShift, 5));
test(forceAddress, true, 256 * M, forceAddress, Math.max(minShift, 6));
test(forceAddress, true, 512 * M, forceAddress, Math.max(minShift, 7));
test(forceAddress, true, G, forceAddress, Math.max(minShift, 8));
test(forceAddress, true, 2 * G, forceAddress, Math.max(minShift, 9));
test(forceAddress, true, 4 * G, forceAddress, 10);
// Test a "crooked" base address:
// - just aligned enough to pass metaspace reserve alignment test of 16MB.
@ -118,8 +121,8 @@ public class CompressedClassPointersEncodingScheme {
// - small enough to not cause test errors on small devices (e.g. arm64 39bit address space)
// - large enough to not end up with zero-based encoding
forceAddress = 0x0000000d55000000L;
test(forceAddress, true, 32 * M, forceAddress, 6);
test(forceAddress, false, 32 * M, forceAddress, 0);
test(forceAddress, true, 4 * G, forceAddress, 10);
test(forceAddress, false, 4 * G, forceAddress, 0);
}
}