On Wed, 17 Jul 2024 06:40:31 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> src/hotspot/share/runtime/basicLock.hpp line 46: >> >>> 44: // Used as a cache the ObjectMonitor* used when locking. Must either >>> 45: // be nullptr or the ObjectMonitor* used when locking. >>> 46: volatile uintptr_t _metadata; >> >> The displaced header/markword terminology was very well known to people, >> whereas "metadata" is really abstract - people will always need to go and >> find out what it actually refers to. Could we not define a union here to >> support the legacy and lightweight modes more explicitly and keep the >> existing terminology for the setters/getters for the code that uses it? > > I should have read ahead. I see you do keep the setters/getters. When we remove legacy locking in a couple of releases, we could rename this field cached_monitor. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20067#discussion_r1688015247