From ea25b10279ef102e7c6786e1c04d44f950f0a7d8 Mon Sep 17 00:00:00 2001 From: "maoliang.ml" Date: Fri, 4 Aug 2023 10:54:49 +0800 Subject: [PATCH] [Backport] 8246689: Enable independent compressed oops/class ptrs on Aarch64 Summary: Make UseCompressedOops and UseCompressedClassPointers independent on Aarch64 Test Plan: CICD Reviewed-by: kuaiwei, yulei Issue: https://github.com/dragonwell-project/dragonwell11/issues/677 --- .../cpu/aarch64/globalDefinitions_aarch64.hpp | 6 +++++- .../CompressedOops/CompressedClassPointers.java | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp b/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp index a53cde94b3f..63f5f41cc0d 100644 --- a/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp @@ -62,6 +62,10 @@ const bool CCallingConventionRequiresIntsAsLongs = false; #define NOT_R18_RESERVED(code) code #endif -#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS true +#if INCLUDE_JVMCI +#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS (EnableJVMCI || UseAOT) +#else +#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS false +#endif #endif // CPU_AARCH64_VM_GLOBALDEFINITIONS_AARCH64_HPP diff --git a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java index 9b5d5a40208..f671530d1c6 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java @@ -170,7 +170,10 @@ public static void smallHeapTestWith1GNoCoop() throws Exception { "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base: 0x0000000000000000"); - output.shouldContain("Narrow klass shift: 0"); + if (!Platform.isAArch64()) { + // Currently relax this test for Aarch64. + output.shouldContain("Narrow klass shift: 0"); + } output.shouldHaveExitValue(0); } @@ -188,7 +191,10 @@ public static void largeHeapTestNoCoop() throws Exception { "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base: 0x0000000000000000"); - output.shouldContain("Narrow klass shift: 0"); + if (!Platform.isAArch64()) { + // Currently relax this test for Aarch64. + output.shouldContain("Narrow klass shift: 0"); + } output.shouldHaveExitValue(0); } @@ -272,7 +278,7 @@ public static void main(String[] args) throws Exception { heapBaseMinAddressTest(); sharingTest(); - boolean ccpRequiresCoop = Platform.isAArch64() || Platform.isSparc(); + boolean ccpRequiresCoop = Platform.isSparc(); if (!ccpRequiresCoop && !Platform.isOSX()) { // Testing compressed class pointers without compressed oops.