Skip to content

8387400: Force-inline Devirtualizer methods#31710

Open
shipilev wants to merge 1 commit into
openjdk:masterfrom
shipilev:JDK-8387400-devirtualizer-force-inline
Open

8387400: Force-inline Devirtualizer methods#31710
shipilev wants to merge 1 commit into
openjdk:masterfrom
shipilev:JDK-8387400-devirtualizer-force-inline

Conversation

@shipilev

@shipilev shipilev commented Jun 29, 2026

Copy link
Copy Markdown
Member

The purpose for Devirtualizer is avoid non-inlinable virtual calls to hot GC closures. It works fairly well, but at least in Shenandoah hot loops, I am seeing that the Devirtualizer methods themselves are not inlined. This poses a problem if GC-closure-calling code forces its own inlining, the hot GC closure targets force their own inlining, but Devirtualizer that sits in the middle is not. In this case, compilers seem to use this "opportunity" to cut the aggressive inlining off in the middle. It IMO makes sense to force-inline Devirtualizer methods themselves as well.

This improves Shenandoah marking times for about +2..10% in hot benchmarks. I measured only Shenandoah, because this was a part of larger project and I had marking loop tests ready. But I suppose it will benefit things generically. I can see no ill effects on build times, the difference is a wash in the noise.

The downside is a bump in binary size. With current version, fastdebug libjvm.so size is +0.6% larger, release libjvm.so is +0.4% larger. I presume this is a fair price to pay for a palpably faster GC code.

Additional testing:

  • Ad-hoc marking time stress tests with Shenandoah
  • Eyeballing build times and libjvm.so sizes
  • GHA (checks cross-platform sanity)


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-8387400: Force-inline Devirtualizer methods (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31710

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 29, 2026

Copy link
Copy Markdown

👋 Welcome back shade! 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 Jun 29, 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 hotspot-dev@openjdk.org label Jun 29, 2026
@openjdk

openjdk Bot commented Jun 29, 2026

Copy link
Copy Markdown

@shipilev 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.

@openjdk

openjdk Bot commented Jun 29, 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. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 29, 2026
@mlbridge

mlbridge Bot commented Jun 29, 2026

Copy link
Copy Markdown

Webrevs

@shipilev

Copy link
Copy Markdown
Member Author

GHA failure is going to get resolved by #31707

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

Labels

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

Development

Successfully merging this pull request may close these issues.

1 participant