Skip to content

8364269: Simplify code cache API by storing adapter entry offsets in blob #26532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adinn
Copy link
Contributor

@adinn adinn commented Jul 29, 2025

The AOT stub blob save and restore API handles Adapter blobs differently to other single-stub blobs by passing the associated entries in a separate auxiliary array. Storing the entry offsets in the blob, as happens with other generated blobs, simplifies the current save/restore API and implementation. It also makes it easier to define and implement an API extension supporting save and restore of multi-stub (StubGen) blobs.


Progress

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

Issue

  • JDK-8364269: Simplify code cache API by storing adapter entry offsets in blob (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26532

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26532.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 29, 2025

👋 Welcome back adinn! 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

openjdk bot commented Jul 29, 2025

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 29, 2025
@openjdk
Copy link

openjdk bot commented Jul 29, 2025

@adinn The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented Jul 29, 2025

Webrevs

@shipilev
Copy link
Member

Cross-compile GHA jobs would be fixed once you pull from recent master.

@adinn
Copy link
Contributor Author

adinn commented Jul 29, 2025

Testing: tier1 + runtime/cds/appcds

@adinn
Copy link
Contributor Author

adinn commented Jul 29, 2025

@ashu-mehra @vnkozlov could you review this cleanup?

@adinn
Copy link
Contributor Author

adinn commented Jul 29, 2025

Ah, sorry, the merge appears to have caused some issues in debug builds. Will let you know when this is ready again.

@adinn adinn marked this pull request as draft July 29, 2025 15:08
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jul 29, 2025
@adinn
Copy link
Contributor Author

adinn commented Jul 30, 2025

@vnkozlov @ashu-mehra @shipilev

Ok, problem fixed, I believe, but I'm still gob-smacked that this built, ran and passed tier1 plus cds/appcds tests on Linux/aarch64 given the failure to run the exploded image on Linux/x86 and MacOS/aarch64.

The problem was with the blob layout. Adding extra fields to AdapterBlob requires propagating the adjusted blob size (i.e. header_size) up the Blob constructor chain, through BufferBlob into RuntimeBlob. Which I have now done -- previously, all subclasses were sized using sizeof(BufferBlob) as none of them had extra fields.

without that fix the content_start address for the Adpater blob was being reported in the tail of the blob proper which meant that in the broken builds data fields were being treated as code and we end up in hyperspace when we first use an i2c adapter to jump to Object.init(). Yet not on Linux/aarch64? Go figure.

Should be ready to review now.

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

Successfully merging this pull request may close these issues.

2 participants