On Fri, 28 Aug 2026 11:39:54 GMT, Fredrik Bredberg <[email protected]> wrote:
> Since [JDK-8389325](https://bugs.openjdk.org/browse/JDK-8389325) > `ObjectMonitor::_metadata` only contains a copy of the object’s hash code. > But: > > 1. A `ObjectMonitorTable` lookup get the hash directly from the object’s mark > word, and ... > 2. ... no synchronization code uses the copy stored in the monitor. > > Therefore this PR removes the redundant `_metadata` field and its related > metadata/hash accessors, diagnostics, and serviceability support. > > Passes tier1-5 tests successfully on supported platforms. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Seems a reasonable cleanup but some queries around the false-sharing/padding changes. src/hotspot/share/runtime/objectMonitor.hpp line 100: > 98: // > 99: // - The _object and _owner fields should be separated by enough space > 100: // to avoid false sharing due to parallel access by different threads. Not sure this is really true and this now suggests we've seen a false sharing problem, which we haven't. So probably better to delete the comment. src/hotspot/share/runtime/objectMonitor.hpp line 157: > 155: // put it on a different cache line than the _object field. The > 156: // _object does not change, but it's frequently read during > 157: // ObjectMonitorTable lookups. Again this seems not be be actually known. If _object and _owner were an issue then the existing padding would not have worked. src/hotspot/share/runtime/objectMonitorTable.cpp line 571: > 569: Table* curr = _curr.load_acquire(); > 570: > 571: assert(hash != 0, "must be"); Seems unrelated to the cleanup. Why must it be? ------------- PR Review: https://git.openjdk.org/jdk/pull/32573#pullrequestreview-5062990360 PR Review Comment: https://git.openjdk.org/jdk/pull/32573#discussion_r3891595005 PR Review Comment: https://git.openjdk.org/jdk/pull/32573#discussion_r3891602693 PR Review Comment: https://git.openjdk.org/jdk/pull/32573#discussion_r3891608011
