On Tue, 23 Jul 2024 14:27:34 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
>> src/hotspot/share/runtime/lightweightSynchronizer.cpp line 105: >> >>> 103: }; >>> 104: >>> 105: class LookupMonitor : public StackObj { >> >> I'm not understanding why we need this little wrapper class. > > It's a two way lookup. The plain Lookup class is used to lookup the Monitor > given the object. This LookupMonitor class is used to lookup the object > given the Monitor. The CHT takes these wrapper classes. Maybe we should > rename LookupObject to be more clear? As @coleenp said there are two lookups. One when you have the object and want to get or insert a new ObjectMonitor. Or the second when the deflator has an ObjectMonitor and wants to deflate and remove that object - ObjectMonitor association. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20067#discussion_r1715356203