Skip to content

8383912: Deduplicate klass fetching and decoding in oopDesc#31055

Open
stefank wants to merge 3 commits intoopenjdk:pr/31053from
stefank:8383912_simplify_oopDesc_klass
Open

8383912: Deduplicate klass fetching and decoding in oopDesc#31055
stefank wants to merge 3 commits intoopenjdk:pr/31053from
stefank:8383912_simplify_oopDesc_klass

Conversation

@stefank
Copy link
Copy Markdown
Member

@stefank stefank commented May 6, 2026

I've been investigating the regression reported in JDK-8382041, which is caused by JDK-8363996: "Obsolete UseCompressedClassPointers". While doing that I've found that calls to oopDesc::klass() bloat the code and that affects inilining, which cause performance regressions in the GC.

A localized fix for JDK-8382041, is to deduplicate multiple calls to klass() into fewer calls. That fixes the imminent performance issue. However, while looking into klass() I see that there's opportunity to somewhat simplify the implementation, and that seems to have almost the same level of performance improvements. I propose that we make that change because it both makes the code smaller, cleaner, and faster.

The performance was measured with the org.openjdk.bench.vm.gc.systemgc.AllLive.gc microbenchmark + UseZGC.

I will run tier1-tier3



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)

Integration blocker

 ⚠️ Dependency #31053 must be integrated first

Issue

  • JDK-8383912: Deduplicate klass fetching and decoding in oopDesc (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31055

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 6, 2026

👋 Welcome back stefank! A progress list of the required criteria for merging this PR into pr/31053 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 6, 2026

❗ 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 May 6, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

@stefank 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
Copy link
Copy Markdown

openjdk Bot commented May 6, 2026

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 May 6, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 6, 2026

Webrevs

Copy link
Copy Markdown
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Looks reasonable, but:

Comment thread src/hotspot/share/oops/oop.inline.hpp Outdated
Copy link
Copy Markdown
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Right, this makes sense. Kim would probably crash into this PR and say _compressed_klass should probably be Atomic in itself then :)

@stefank
Copy link
Copy Markdown
Member Author

stefank commented May 6, 2026

Right, this makes sense. Kim would probably crash into this PR and say _compressed_klass should probably be Atomic in itself then :)

Probably. :) I used AtomicAccess here because that is what is used inside oopDesc::release_set_klass.

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.

3 participants