Skip to content

8384608: [lworld] Sync preview jimage overlay implementation with mainline 8377070#2436

Draft
xuemingshen-oracle wants to merge 2 commits into
openjdk:lworldfrom
xuemingshen-oracle:JDK-8384608
Draft

8384608: [lworld] Sync preview jimage overlay implementation with mainline 8377070#2436
xuemingshen-oracle wants to merge 2 commits into
openjdk:lworldfrom
xuemingshen-oracle:JDK-8384608

Conversation

@xuemingshen-oracle
Copy link
Copy Markdown

@xuemingshen-oracle xuemingshen-oracle commented May 15, 2026

JDK27 Mainline has integrated 8377070: Update jimage format to support classes compiled with preview feature enabled, which provides the core packaged-jimage preview overlay infrastructure: jimage format v1.1, preview flags in ImageLocation, Java ImageReader support, native libjimage support, HotSpot class loader hook points, raw ResourceEntries for jlink, and updated tests.

Valhalla lworld already contains an earlier version of this work plus additional Valhalla-specific follow-ups, including preview activation, exploded-image support, javac preview platform plumbing, and make-time staging of value-class preview resources. However, the mainline integration renamed/refined some APIs and implementation details during migration. We should sync the generic mainline changes back into lworld without regressing the Valhalla-only enablement work.

Todo List

1. Rename jdk.internal.jimage.ModuleReference to ModuleLink to match mainline.
2. Rename ImageLocation.getFlags(...) to ImageLocation.getPreviewFlags(...).
3. Update/cleanup related API doc & comment around jimage preview flags, package metadata, and entries, etc
4. Update the test naming, especially ModuleLinkTest, ref -> link
5. Add mainline test/jdk/tools/jlink/JLinkPreviewTest.java.

Non-Goals

Do not overwrite or regress Valhalla-specific preview-resource behavior. In particular, preserve Valhalla’s existing runtime preview activation, exploded-image overlay support, javac preview lookup plumbing, and make-time META-INF/preview staging for value-class variants.

  • jimage_open VM-initialization jimage check will be treated as a separate sync requirement unless the is explicitly asked to backport JDK-8374343 independently.

Testing

test/jdk/jdk/internal/jimage
test/jdk/tools/jlink/JLinkPreviewTest.java
test/jdk/tools/jlink/whitebox
test/jdk/java/lang/module/ModuleReader/ModuleReaderTest.java
test/jdk/jdk/internal/jrtfs/ClassResourcesParityTest.java
test/langtools/tools/javac/preview/PreviewJRTImage.java

# verify valhalla image still selects preview resources with --enable-preview and normal resources without it.
# any extra mach5 jobs + options to run ?


Progress

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

Issue

  • JDK-8384608: [lworld] Sync preview jimage overlay implementation with mainline 8377070 (Bug - P3) ⚠️ Issue is already resolved. Consider making this a "backport pull request" by setting the PR title to Backport <hash> with the hash of the original commit. See Backports.

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2436

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2436.diff

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 15, 2026

👋 Welcome back sherman! A progress list of the required criteria for merging this PR into lworld 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 May 15, 2026

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

@openjdk openjdk Bot changed the title 8384608: [lworld] Sync preview jimage overlay implementation with mai… 8384608: [lworld] Sync preview jimage overlay implementation with mainline 8377070 May 15, 2026
# Conflicts:
#	src/java.base/share/classes/jdk/internal/jimage/ImageReader.java
#	src/java.base/share/classes/jdk/internal/jimage/ModuleLink.java
#	src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageResourcesTree.java
#	test/jdk/jdk/internal/jimage/ImageLocationTest.java
#	test/jdk/jdk/internal/jimage/ModuleLinkTest.java
#	test/jdk/tools/jlink/whitebox/jdk.jlink/jdk/tools/jlink/internal/ImageResourcesTreeTest.java
Copy link
Copy Markdown
Member

@liach liach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks trivial

@xuemingshen-oracle
Copy link
Copy Markdown
Author

After the jdk27->lworld merge (8377070 the change appears to be trivial. It might not be worth doing in lworld, we might just make the change directly in mainline.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants