Skip to content

8377307: Refactor code for AOT cache pointer compression#410

Open
vaibhavchoudhary wants to merge 1 commit intoopenjdk:masterfrom
vaibhavchoudhary:8377307-backport
Open

8377307: Refactor code for AOT cache pointer compression#410
vaibhavchoudhary wants to merge 1 commit intoopenjdk:masterfrom
vaibhavchoudhary:8377307-backport

Conversation

@vaibhavchoudhary
Copy link
Copy Markdown

@vaibhavchoudhary vaibhavchoudhary commented Mar 27, 2026

Backport of JDK-8377307 from mainline to 25u.

Changes:

  • Introduced AOTCompressedPointers class for unified pointer compression API
  • Refactored scattered offset calculations into encode/decode methods
  • Updated archive format version from 19 to 20
  • Adapted for 25u: metaspaceShared.cpp instead of aotMetaspace.cpp

Testing:

  • Tier1: 10,263/10,266 tests passed (99.97%)
  • All CDS and AOT cache tests passed
  • 3 THP test 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

Error

 ⚠️ Pull request body is missing required line: - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).

Issue

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

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 410

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Reviewed-by: TBD
Backport-of: 0867f9b1b4bfa090cce1403cdbcce56a2e91127c
@bridgekeeper bridgekeeper Bot added the oca Needs verification of OCA signatory status label Mar 27, 2026
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Mar 27, 2026

Hi @vaibhavchoudhary, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user vaibhavchoudhary" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 27, 2026

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

@vaibhavchoudhary
Copy link
Copy Markdown
Author

/covered

@vaibhavchoudhary vaibhavchoudhary changed the title 8377307: Refactor code for AOT cache pointer compression Backport 0867f9b1b4bfa090cce1403cdbcce56a2e91127c Mar 27, 2026
@bridgekeeper bridgekeeper Bot removed the oca Needs verification of OCA signatory status label Mar 27, 2026
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Mar 27, 2026

You are already a known contributor!

@openjdk openjdk Bot changed the title Backport 0867f9b1b4bfa090cce1403cdbcce56a2e91127c 8377307: Refactor code for AOT cache pointer compression Mar 27, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 27, 2026

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

@openjdk openjdk Bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Mar 27, 2026
@vaibhavchoudhary
Copy link
Copy Markdown
Author

Key Differences Between Original Patch and JDK25u Application:

  1. Missing File: aotMetaspace.cpp

The original patch modifies src/hotspot/share/cds/aotMetaspace.cpp:

  • ReadClosure rc(&array, (intptr_t)mapped_base_address);
  • ReadClosure rc(&array, (address)mapped_base_address);

In JDK25u: This file doesn't exist! The equivalent changes needed to be made
in metaspaceShared.cpp instead.

  1. 3 instances in metaspaceShared.cpp that needed (address) casts instead of
    (intptr_t) - these corresponded to the aotMetaspace.cpp changes in the
    original patch
  • The ReadClosure constructor signature change
  • Removal of obsolete archived_address_* helper functions

@vaibhavchoudhary
Copy link
Copy Markdown
Author

Build Verification:

  • JDK built successfully at: build/linux-x86_64-server-release/
  • New object file created: aotCompressedPointers.o (201K)
  • libjvm.so updated with changes (28M)
  • Java binary runs: OpenJDK 25.0.3-internal
  • Testing locally: Tier1: 10,263/10,266 tests passed (99.97%) - 3 test failed because of my system limitation to run THP tests.

@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Mar 27, 2026

Webrevs

@vaibhavchoudhary
Copy link
Copy Markdown
Author

vaibhavchoudhary commented Mar 27, 2026

/reviewer credit @iklam @jianglizhou

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 27, 2026

@vaibhavchoudhary Syntax: /reviewer (credit|remove) [@user | openjdk-user]+. For example:

  • /reviewer credit @openjdk-bot
  • /reviewer credit duke
  • /reviewer credit @user1 @user2

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 27, 2026

@vaibhavchoudhary Syntax: /reviewer (credit|remove) [@user | openjdk-user]+. For example:

  • /reviewer credit @openjdk-bot
  • /reviewer credit duke
  • /reviewer credit @user1 @user2

@jianglizhou
Copy link
Copy Markdown
Contributor

@GoeLin
Copy link
Copy Markdown
Member

GoeLin commented Apr 1, 2026

Hi @vaibhavchoudhary
Welcome to OpenJDK!
You need to backport to jdk25u-dev. jdk25u is closed for normal backports, it is used for ramp down and releasing.
Also, you should not add reviewers of the original commit to the backport issue. You can ask them with an @... comment to help out for the review of the backport, but in general it is not their task.
You might want to have a look at https://wiki.openjdk.org/spaces/JDKUpdates/pages/42598906/How+to+contribute+or+backport+a+fix
Thanks.

@openjdk openjdk Bot removed the rfr Pull request is ready for review label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base

Development

Successfully merging this pull request may close these issues.

3 participants