Skip to content

8388361: [lworld] C2 hits node limit during scalarization in safepoints - #32127

Open
TobiHartmann wants to merge 1 commit into
openjdk:masterfrom
TobiHartmann:8388361
Open

8388361: [lworld] C2 hits node limit during scalarization in safepoints#32127
TobiHartmann wants to merge 1 commit into
openjdk:masterfrom
TobiHartmann:8388361

Conversation

@TobiHartmann

@TobiHartmann TobiHartmann commented Jul 31, 2026

Copy link
Copy Markdown
Member

This PR replaces the Valhalla draft PR 2652, which was already reviewed by @marc-chevalier and @fparain but was not integrated due to the code freeze immediately before the Valhalla mainline integration.


During scalarization of an inline type in a large number of safepoints, we hit the node limit. This only happens in extreme cases where the test generates a large number of live locals and safepoints + -XX:+DeoptimizeALot which marks every local live at every safepoint. In the regression test, we have 60 safepoints, each one with 100 live Integers, and end up creating 6000 new SafePointScalarObjectNode.

The fix is to check the node budget and bail out from compilation if it's exceeded. Alternatively, we could fall back to use_oop = true if allow_oop is set and the inline type is allocated. However, I don't think that's worth it for this edge case.

Thanks,
Tobias



Progress

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

Issue

  • JDK-8388361: [lworld] C2 hits node limit during scalarization in safepoints (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32127

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

openjdk Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

@openjdk openjdk Bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jul 31, 2026
@openjdk

openjdk Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

  • hotspot-compiler

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.

@openjdk

openjdk Bot commented Jul 31, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-compiler. This can be overridden with the /reviewers command.

@TobiHartmann
TobiHartmann marked this pull request as ready for review July 31, 2026 08:44
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 31, 2026
@mlbridge

mlbridge Bot commented Jul 31, 2026

Copy link
Copy Markdown

Webrevs

@TobiHartmann

Copy link
Copy Markdown
Member Author

Thanks again for the review Marc!

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

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants