JDK-8365191 : Cleanup after removing LockingMode related code
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-08-09
  • Updated: 2025-09-25
  • Resolved: 2025-09-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 masterFixed
Description
This is a general cleanup after removing LockingMode related code.
It includes:
- Removing asserts() that are no longer necessary, since we removed legacy locking and monitor locking.
- Rewriting or deleting comments and arguments that are related to displaced headers. 
- Etc., etc.

In the review of JDK-8365190 a number of suggestions for further clean up came up. I'll list them here so we don't lose them:
1. https://github.com/openjdk/jdk/pull/27041#discussion_r2317063086 (Delete displaced_header_offset_in_bytes)
2. https://github.com/openjdk/jdk/pull/27041#discussion_r2317069783 (Can we now remove _held_monitor_count next)
3. https://github.com/openjdk/jdk/pull/27041#discussion_r2317095107 (Remove dispatch functions)
4. https://github.com/openjdk/jdk/pull/27041#discussion_r2318041555 (Simplify and unify this with FastHashCode)
5. https://github.com/openjdk/jdk/pull/27041#discussion_r2317998409 (Remove parameter from MonitorExitStub)
6. https://github.com/openjdk/jdk/pull/27041#discussion_r2320634417 (Re-type/name metadata in BasicLock)
7. https://github.com/openjdk/jdk/pull/27041#discussion_r2320643671 (Delete displaced_header_offset_in_bytes)
8. https://github.com/openjdk/jdk/pull/27041#discussion_r2317088830 (Eliminating the middle call)

Number 1, 5, 6 and 7 will be taken care of in this RFE.
Number 2 will be taken care of in JDK-8367601.
Number 3, 4 and 8 will be taken care of in JDK-8367982.
Comments
Changeset: 847b107d Branch: master Author: Fredrik Bredberg <fbredberg@openjdk.org> Date: 2025-09-25 08:15:45 +0000 URL: https://git.openjdk.org/jdk/commit/847b107df821e0c1d347383f1858d505137eb724
25-09-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27448 Date: 2025-09-23 09:29:57 +0000
23-09-2025

There are comments in the cpu specific code about displacement registers and the like. This is the pass to make these have good names. We may need another CR once we examine what is left in synchronizer.cpp. It may be that it only handles the OM lists (adding to and deflation) and that the dispatch should go directly to lightweightSynchronizer.cpp. It might need to be renamed in a further pass. I don't know if we need fast_unlock_lightweight to be renamed to fast_unlock. I don't really mind the specific names. I'm open to stronger opinions.
11-08-2025