Skip to content

8388261: [lworld] javac creates early_larval_frame and ACC_STRICT_INIT in record non-preview class files#2643

Closed
liach wants to merge 6 commits into
openjdk:lworldfrom
liach:fix/lw-record-strict
Closed

8388261: [lworld] javac creates early_larval_frame and ACC_STRICT_INIT in record non-preview class files#2643
liach wants to merge 6 commits into
openjdk:lworldfrom
liach:fix/lw-record-strict

Conversation

@liach

@liach liach commented Jul 14, 2026

Copy link
Copy Markdown
Member

We should mark record classes as using preview VM features if they use strictly-initialized fields or early larval frames.

Maurizio considered this to be P2 given the spec violations, especially with the spurious early larval frames in the class files.



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-8388261: [lworld] javac creates early_larval_frame and ACC_STRICT_INIT in record non-preview class files (Bug - P2)

Reviewers

Contributors

  • Vicente Romero <vromero@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2643

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

openjdk Bot commented Jul 14, 2026

Copy link
Copy Markdown

@liach This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8388261: [lworld] javac creates early_larval_frame and ACC_STRICT_INIT in record non-preview class files

Co-authored-by: Vicente Romero <vromero@openjdk.org>
Reviewed-by: vromero, mcimadamore

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the lworld branch:

  • dd75299: 8387749: [lworld] ValueBased.html should be reevaluated for its specification of value class constructors

Please see this link for an up-to-date comparison between the source branch of this pull request and the lworld branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@openjdk openjdk Bot changed the title 8388261 8388261: [lworld] Compiled code failing with verifier error Jul 14, 2026
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 14, 2026
@mlbridge

mlbridge Bot commented Jul 14, 2026

Copy link
Copy Markdown

Webrevs

@liach

liach commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

/contributor add @vicente-romero-oracle

@openjdk

openjdk Bot commented Jul 14, 2026

Copy link
Copy Markdown

@liach
Contributor Vicente Romero <vromero@openjdk.org> successfully added.

@vicente-romero-oracle vicente-romero-oracle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jul 14, 2026
@liach liach changed the title 8388261: [lworld] Compiled code failing with verifier error 8388261 Jul 14, 2026
@openjdk openjdk Bot changed the title 8388261 8388261: [lworld] javac creates early_larval_frame and ACC_STRICT_INIT in record non-preview class files Jul 14, 2026
boolean isRecordField = isInstanceField && (sym.owner.flags_field & RECORD) != 0;
if (allowValueClasses && (isInstanceFieldOfValueClass || isRecordField)) {
implicit |= FINAL | STRICT;
preview.markUsesPreview(pos); // STRICT_INIT is a preview VM feature

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok -- this also means that if a record has no component, no pollution occurs, which I suppose it's ok.

@liach

liach commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

Note: this is blocked by #2645 and requires openjdk/jdk#31916 to be merged into lworld.

@dcubed-ojdk

Copy link
Copy Markdown
Member

@liach - Your testing is showing 8 failures of:

  • java/foreign/enablenativeaccess/TestEnableNativeAccessJarManifest.java

Is this because of what you mention about TestEnableNativeAccessJarManifest.java above?

@liach

liach commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@dcubed-ojdk Yes. It's already fixed in mainline, we can wait for a later merge before integrating this.

@dcubed-ojdk

Copy link
Copy Markdown
Member

@liach - I'm cherry-picking this fix from main-line:

  • JDK-8388347 Remove enablePreview from TestEnableNativeAccessJarManifest

to clear the runway for this fix.

@dcubed-ojdk

Copy link
Copy Markdown
Member

Since this fix is also blocked by this Valhalla fix:

  • JDK-8388343 [lworld] Reevaluate the enable-preview in memory compilation from VM arguments

I presume you will be integrating JDK-8388343 and this fix together after getting approvals.

@liach

liach commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

I don't think I need JDK-8388343 any more - I am fixing the BadCanonicalCtrTest (Maurizio says this will be broken when value objects become permanent feature anyways) in this patch instead.

@mcimadamore mcimadamore left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. Please make sure we get a clean test run

@liach

liach commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Ran tier 1-6 on Oracle's CI, no related failure. Thanks for all the reviews for this last-minute spec issue!

/integrate

@openjdk

openjdk Bot commented Jul 17, 2026

Copy link
Copy Markdown

Going to push as commit 53b4a9e.
Since your change was applied there have been 2 commits pushed to the lworld branch:

  • d53418d: 8388177: [lworld] Remove "statewise equivalent" terminology from APIs
  • dd75299: 8387749: [lworld] ValueBased.html should be reevaluated for its specification of value class constructors

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jul 17, 2026
@openjdk openjdk Bot closed this Jul 17, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 17, 2026
@openjdk

openjdk Bot commented Jul 17, 2026

Copy link
Copy Markdown

@liach Pushed as commit 53b4a9e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

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

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants