On Tue, 10 Mar 2026 05:49:00 GMT, Thomas Stuefe <[email protected]> wrote:
>> This change removes the uncompressed Klass pointer mode and, with compressed >> Klass pointers remaining as the only option, the >> `UseCompressedClassPointers` switch. >> >> For motivation, please take a look at CSR associated with the deprecation >> (which we did for JDK 25) and the preparatory discussion we had at the start >> of the year around this topic [2]. >> >> This patch is quite invasive and touches many parts of the JVM, since its >> goal is to remove most traces of the uncompressed Klass path and to take >> advantage of opportunities for simplification. In some cases, I did not take >> opportunities for further simplification to keep the patch somewhat legible; >> it will be onerous enough to review. >> >> ### Implementation Notes >> >> With uncompressed Klass pointers removed, we have three modes of operation >> left (including 32-bit): >> a) 64-bit, COH off - this is the old `+UseCompressedClassPointers` mode. >> This is now the standard mode until we run with COH by default. >> b) 64-bit, COH on >> c) 32-bit - Here, we run with a "fake" narrow Klass pointer mode. We run >> with hardcoded narrowKlass base == NULL and shift = 0, so nKlass == Klass*. >> The difference to (a, b) is that we don't use a class space. Most of this >> was implemented with JDK-8363998 [3] - here, we just add a compile-time >> switch `INCLUDE_CLASSSPACE`, which is true on 32-bit, false on 64-bit. >> >> I ensured *arm32* builds and I performed some rudimentary checks (selected >> metaspace/gc tests, and a simple Spring PetClinic run). Vendors with an >> interest in arm32 will have to step up and do their own, more thorough unit >> testing. Also, I did not see anyone doing follow-up work after JDK-8363998 >> [3] - so some issues may still lurk from that patch as well (but maybe >> JDK-8363998 was just not breaking anything). >> >> I did not check *zero 32-bit*, the only other platform supporting 32-bit. >> Anyone with an interest in 32-bit zero should chip in. >> >> Pre-existing errors: While working on this patch, I stumbled over a few >> occurrences of old but benign bugs. Mostly old code assuming >> CompressedClassPointers and CompressedOops were still tied together >> (example: Arguments::set_heap_size()). These bugs are implicitly fixed with >> this patch. >> >> ### Testing >> >> - tier 1 2 3 locally on Linux x64 >> - SAP ran their whole set of tests for all the platforms they support. >> >> >> [1] https://bugs.openjdk.org/browse/JDK-8350754 >> [2] https://mail.openjdk.org/pipermail/hotspot-dev/2025-February/101023.html >> [3] https://bugs.o... > > Thomas Stuefe has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 65 commits: > > - Merge branch 'master' into JDK-8363996-Obsolete-UseCompressedClassPointers > - Replace Metaspace::using_class_space with define > - Update src/hotspot/cpu/x86/macroAssembler_x86.hpp > > Co-authored-by: David Holmes > <[email protected]> > - Replace Klass::_metadata union with narrowKlass member > - Ivan: fix various instances of ObjLayout::undefined should assert > - Ivan: Update src/hotspot/share/oops/instanceKlass.cpp > > Co-authored-by: Ivan Walulya <[email protected]> > - David: reduce diff in ObjectCountEventVerifier.java > - David: minimize change in GetObjectSizeIntrinsicsTest.java > - David: minimize diffs in TestZGCWithCDS.java > - David: minimize diffs for > runtime/ErrorHandling/TestVMConfigInHsErrFile.java > - ... and 55 more: https://git.openjdk.org/jdk/compare/9a26b4af...be3a902b I've now finished a complete pass over the changes. src/hotspot/share/oops/objLayout.hpp line 29: > 27: > 28: /* > 29: * This class helps to avoid loading more than one flag in some This whole class might not be needed anymore. The purpose of the class was to be able to avoid chains of loads of different flags like: if (UseCompactObjectHeaders) { } else if (UseCompressedClassPointers) { } else { } And replace it with a single load and switch. This made a perf difference in some critical paths. Now, with UCCP gone, those cases can simply be handled as if (UCOH) {..} else {..} again. Maybe handle it in a follow-up issue. test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java line 310: > 308: * when the default CDS archive was built. E.g. the VM was started > with > 309: * -XX:+UseZGC which implicitly disables the UseCompressedOoops > option. > 310: * UseCompressedOoops was enabled when the default CDS archive was > built. Suggestion: * UseCompressedOops was enabled when the default CDS archive was built. ------------- PR Review: https://git.openjdk.org/jdk/pull/28366#pullrequestreview-3937966592 PR Review Comment: https://git.openjdk.org/jdk/pull/28366#discussion_r2925813474 PR Review Comment: https://git.openjdk.org/jdk/pull/28366#discussion_r2925946261
