Skip to content

8377307: Refactor code for AOT cache pointer compression#464

Open
vaibhavchoudhary wants to merge 1 commit intoopenjdk:masterfrom
vaibhavchoudhary:8377307-aot-compressed-pointers
Open

8377307: Refactor code for AOT cache pointer compression#464
vaibhavchoudhary wants to merge 1 commit intoopenjdk:masterfrom
vaibhavchoudhary:8377307-aot-compressed-pointers

Conversation

@vaibhavchoudhary
Copy link
Copy Markdown

@vaibhavchoudhary vaibhavchoudhary commented Apr 15, 2026

Backport of JDK-8377307 from mainline to JDK 25u.

This change introduces the AOTCompressedPointers class to provide a unified,
type-safe API for compressing metadata pointers in CDS archives.

Key Changes

  • New AOTCompressedPointers class with narrowPtr type for encoding/decoding
  • Refactored ArchiveBuilder offset methods from uintx to size_t
  • Removed scattered encoding utilities from ArchiveUtils
  • Updated FileMapHeader to use narrowPtr instead of size_t offsets
  • Converted all CDS subsystems: RunTimeClassInfo, LambdaFormInvokers, LambdaProxyClassDictionary, CompactHashtable writers, TrainingData
  • Archive format version bumped from 19 to 20 (incompatible change)
  • Maximum metadata offset: 2GB (AOTCompressedPointers::MaxMetadataOffsetBytes)

Adapted for 25u

  • Uses metaspaceShared.cpp (aotMetaspace.cpp doesn't exist in 25u)
  • Maintains compatibility with 25u code structure

Testing Results

  • Tier1: 9,951/9,954 tests passed (99.97%)
  • CDS tests: 52/52 passed
  • GTest: All tests passed
  • 3 THP failures are environmental (platform-specific address range limitation)

Backport-of: 0867f9b1b4bfa090cce1403cdbcce56a2e91127c



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • JDK-8377307 needs maintainer approval
  • Commit message must refer to an issue

Issue

  • JDK-8377307: Refactor code for AOT cache pointer compression (Enhancement - P4 - Requested)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/464/head:pull/464
$ git checkout pull/464

Update a local copy of the PR:
$ git checkout pull/464
$ git pull https://git.openjdk.org/jdk25u-dev.git pull/464/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 464

View PR using the GUI difftool:
$ git pr show -t 464

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/464.diff

Using Webrev

Link to Webrev Comment

…er compression

Backport of JDK-8377307 from mainline to JDK 25u.

This change introduces the AOTCompressedPointers class to provide a unified,
type-safe API for compressing metadata pointers in CDS archives. The new
narrowPtr enum class (enum class : u4) replaces raw u4 offsets throughout
the CDS subsystem, improving type safety and code clarity.

Key changes:
- New AOTCompressedPointers class with narrowPtr type for encoding/decoding
- Refactored ArchiveBuilder offset methods from uintx to size_t
- Removed scattered encoding utilities from ArchiveUtils
- Updated FileMapHeader to use narrowPtr instead of size_t offsets
- Converted all CDS subsystems: RunTimeClassInfo, LambdaFormInvokers,
  LambdaProxyClassDictionary, CompactHashtable writers, TrainingData
- Archive format version bumped from 19 to 20 (incompatible change)
- Maximum metadata offset: 2GB (AOTCompressedPointers::MaxMetadataOffsetBytes)

Adapted for 25u:
- Uses metaspaceShared.cpp (aotMetaspace.cpp doesn't exist in 25u)
- Maintains compatibility with 25u code structure

Testing:
- Tier1: 9,951/9,954 tests passed (99.97%)
- All CDS and AOT cache tests passed (52/52)
- All GTest tests passed with proper configuration
- 3 THP test failures are environmental (platform-specific address range limitation)
- Identical pass rate to previous successful backport validation

Backport-of: 0867f9b1b4bfa090cce1403cdbcce56a2e91127c
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Apr 15, 2026

👋 Welcome back vaibhav! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 15, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@vaibhavchoudhary vaibhavchoudhary changed the title 8377307: Introduce AOTCompressedPointers for type-safe metadata pointer compression Backport 0867f9b1b4bfa090cce1403cdbcce56a2e91127c Apr 15, 2026
@openjdk openjdk Bot changed the title Backport 0867f9b1b4bfa090cce1403cdbcce56a2e91127c 8377307: Refactor code for AOT cache pointer compression Apr 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 15, 2026

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added the backport Port of a pull request already in a different code base label Apr 15, 2026
@vaibhavchoudhary
Copy link
Copy Markdown
Author

vaibhavchoudhary commented Apr 15, 2026

/approval request

Reason for backport to JDK 25u:

This backport introduces the AOTCompressedPointers class for type-safe metadata pointer compression in CDS archives, replacing scattered raw u4 offset encodings throughout the CDS subsystem with a unified, strongly-typed API.

Why backport:

  • Improves type safety and code maintainability in CDS subsystem
  • Eliminates potential bugs from manual offset calculations
  • Required for future CDS enhancements that depend on this infrastructure
  • Clean, well-contained refactoring with clear boundaries

Risk assessment: LOW

  • Changes are isolated to CDS subsystem only
  • No user-visible behavior changes
  • Archive format version bump (19→20) ensures clean separation
  • Well-tested refactoring from mainline (already in production)

Dependencies:

  • No dependencies on other backports
  • Self-contained change

Testing:

  • Tier1: 9,951/9,954 tests passed (99.97%)
  • All 52 CDS and AOT cache tests passed
  • All GTest tests passed
  • Only 3 environmental THP failures (platform-specific, unrelated to changes)

Adaptation for 25u:

  • Uses metaspaceShared.cpp (aotMetaspace.cpp doesn't exist in 25u)
  • All other changes apply cleanly

The backport has been thoroughly tested.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Apr 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 15, 2026

@vaibhavchoudhary
8377307: The approval request has been created successfully.

@openjdk openjdk Bot added the approval Requires approval; will be removed when approval is received label Apr 15, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Apr 15, 2026

Webrevs

@vaibhavchoudhary
Copy link
Copy Markdown
Author

@jiangli: Please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant