From 131e47b026f88ef5cb3443459388b5e9577eaa9c Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 24 Apr 2024 04:23:55 +0000 Subject: [PATCH] Fix CompressedClassPointersEncodingScheme for aarch64 with -UseCOH Reviewed-by: stefank, rkennke --- .../CompressedClassPointersEncodingScheme.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java index 269ef74813e..b84a16d6a26 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointersEncodingScheme.java @@ -83,8 +83,10 @@ public static void main(String[] args) throws Exception { // - non-aarch64: base=0, shift=3 // - aarch64: base to start of class range, shift 0 if (Platform.isAArch64()) { - long forceAddress = 0x70000000; // make sure we have a valid EOR immediate - test(forceAddress, false, G, forceAddress, 0); + // The best we can do on aarch64 is to be *near* the end of the 32g range, since a valid encoding base + // on aarch64 must be 4G aligned, and the max. class space size is 3G. + long forceAddress = 0x7_0000_0000L; // 28g, and also a valid EOR immediate + test(forceAddress, false, 3 * G, forceAddress, 0); } else { test(32 * G - 128 * M, false, 128 * M, 0, 3); } @@ -92,7 +94,7 @@ public static void main(String[] args) throws Exception { // Test ccs starting *below* 4G, but extending upwards beyond 4G. All platforms except aarch64 should pick // zero based encoding. if (Platform.isAArch64()) { - long forceAddress = 0xc0000000; // make sure we have a valid EOR immediate + long forceAddress = 0xC000_0000L; // make sure we have a valid EOR immediate test(forceAddress, false, G + (128 * M), forceAddress, 0); } else { test(4 * G - 128 * M, false, 2 * 128 * M, 0, 3);