RFR: 8367982: Unify ObjectSynchronizer and LightweightSynchronizer [v4]
Fredrik Bredberg
fbredberg at openjdk.org
Mon Nov 3 10:05:35 UTC 2025
> This is the last PR in a series of PRs (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)) to obsolete the LockingMode flag and related code.
>
> The main focus is to to unify `ObjectSynchronizer` and `LightweightSynchronizer`.
> There used to be a number of "dispatch functions" to redirect calls depending on the setting of the `LockingMode` flag.
> Since we now only have lightweight locking, there is no longer any need for those dispatch functions, so I removed them.
> To remove the dispatch functions I renamed the corresponding lightweight functions and call them directly.
> This ultimately led me to remove "lightweight" from the function names and go back to "fast" instead, just to avoid having some with, and some without the "lightweight" part of the name.
>
> This PR also include a small simplification of `ObjectSynchronizer::FastHashCode`.
>
> Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change.
> All other platforms (`arm`, `ppc`, `riscv`, `s390`) has been sanity checked using QEMU.
Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
- Merge branch 'master' into 8367982_unify_object_and_lightweight_synchronizer
- Update two, after the review
- Update after review
- Small arm32 fix
- Small include line fix
- 8367982: Unify ObjectSynchronizer and LightweightSynchronizer
-------------
Changes: https://git.openjdk.org/jdk/pull/27915/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27915&range=03
Stats: 2972 lines in 80 files changed: 1259 ins; 1425 del; 288 mod
Patch: https://git.openjdk.org/jdk/pull/27915.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27915/head:pull/27915
PR: https://git.openjdk.org/jdk/pull/27915
More information about the serviceability-dev
mailing list