On Wed, 18 Feb 2026 08:48:08 GMT, Xue-Lei Andrew Fan <[email protected]> wrote:
>> src/hotspot/share/cds/aotCompressedPointers.hpp line 44: >> >>> 42: // >>> 43: // Note: This encoding is ONLY for compact hashtable values. General >>> pointer serialization >>> 44: // (WriteClosure/ReadClosure::do_ptr) uses raw byte offsets without >>> scaling. >> >> We actually use `narrowPtr` in many other places, such as in >> [RunTimeLambdaProxyClassKey](https://github.com/openjdk/jdk/blob/03703f347df7d3507ffeaf45e32be8bec6403b7d/src/hotspot/share/cds/lambdaProxyClassDictionary.hpp#L135-L142). >> Usually we do that to reduce footprint and reduce runtime pointer patching. >> >> I think when storing an offset into the AOT cache, we should always use >> `narrowPtr` for uniformity. The "raw" offset such as >> `ArchiveBuilder::any_to_offset()` should be only used for internal >> operations while building the AOT cache. >> >> I have a >> [patch](https://github.com/iklam/jdk/commit/6d6b9332a5d7c18374d2d13f72a4cc00479afafd) >> that fixes two places (that I missed in >> https://github.com/openjdk/jdk/pull/29590): >> - Make sure `CompactHashtableWriter::_compact_buckets` is 8-byte aligned on >> x64. >> - Fixed the decoding of vtable decoding in serviceability agent. > >> I have a >> [patch](https://github.com/iklam/jdk/commit/6d6b9332a5d7c18374d2d13f72a4cc00479afafd) >> that fixes two places > > @iklam This is a cleaner design. The patch looks good to me, and passed my > test cases. Thank you for the suggestion. May I merge the patch into this > pull request? Yes, please feel free to merge it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29494#discussion_r2821139473
