Skip to content

Conversation

@stefank
Copy link
Member

@stefank stefank commented Dec 19, 2025

There's a bunch of unused code in markWord that used to be used by the removed legacy locking. I propose that we remove it.

There's a Shenandoah change that should be checked closer. My thinking is:
is_being_inflated: always returns false
has_displaced_mark_helper: Only returns true if both these are true:

  • !UseCompactObjectTable - there's an early return for this earlier in the function.
  • lockbits == monitor_value - checked in the if-statement above

Progress

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

Issue

  • JDK-8374145: Remove legacy locking remnants from markWord (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28927

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Copy link
Member

@xmas92 xmas92 left a comment

Choose a reason for hiding this comment

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

Looks good. Just one thought.

Comment on lines -347 to -349
} else if (w.is_being_inflated() || w.has_displaced_mark_helper()) {
// Informs caller that we aren't able to determine the age
return markWord::max_age + 1; // sentinel
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if we want an !w.has_displaced_mark_helper() assert. Even if we already check for (and handled) the exact conditions (in the current implementation) for has_displaced_mark_helper().

Copy link
Member Author

Choose a reason for hiding this comment

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

That would work for me. I'll wait for input from the Shenandoah devs.

Copy link
Member Author

Choose a reason for hiding this comment

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

In the interest to get this integrated I've created an Enh for this:
https://bugs.openjdk.org/browse/JDK-8374191

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 19, 2025

👋 Welcome back stefank! 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
Copy link

openjdk bot commented Dec 19, 2025

@stefank 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:

8374145: Remove legacy locking remnants from markWord

Reviewed-by: aboldtch, kbarrett, coleenp

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 31 new commits pushed to the master 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 master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Dec 19, 2025

@stefank The following labels will be automatically applied to this pull request:

  • hotspot
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 19, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 19, 2025

Webrevs

Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

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

Looks good. No opinion about @xmas92 suggestion in the shenandoah change.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

Thanks for finding these.

Copy link
Member Author

@stefank stefank left a comment

Choose a reason for hiding this comment

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

Thanks for the reviews!

Comment on lines -347 to -349
} else if (w.is_being_inflated() || w.has_displaced_mark_helper()) {
// Informs caller that we aren't able to determine the age
return markWord::max_age + 1; // sentinel
Copy link
Member Author

Choose a reason for hiding this comment

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

In the interest to get this integrated I've created an Enh for this:
https://bugs.openjdk.org/browse/JDK-8374191

@stefank
Copy link
Member Author

stefank commented Dec 22, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Dec 22, 2025

Going to push as commit e6c3ebe.
Since your change was applied there have been 38 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 22, 2025
@openjdk openjdk bot closed this Dec 22, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 22, 2025
@openjdk
Copy link

openjdk bot commented Dec 22, 2025

@stefank Pushed as commit e6c3ebe.

💡 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

Development

Successfully merging this pull request may close these issues.

4 participants