RFR: 8319773: Avoid inflating monitors when installing hash codes for LM_LIGHTWEIGHT [v4]
Daniel D. Daugherty
dcubed at openjdk.org
Thu Nov 16 19:11:52 UTC 2023
On Thu, 16 Nov 2023 13:54:31 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> Yes that comment. If we don't inflate for hashcode anymore for lightweight locking mode, why would we inflate with a non-JavaThread? Is it impossible?
>
> I see what you mean. Because we need to put the hash code in the ObjectMonitor if it already is inflated and it may be the case that the ObjectMonitor has an anonymous owner we can still call `is_lock_owned` when retrieving the monitor for FastHashCode.
>
> Technically we could condition the inflate call on if the mark word lock bits and pick out the ObjectMonitor from the mark word. It would always be installed when reaching that point in the LM_LIGHTWEIGHT mode.
Do we inflate when the VMThread is doing JVM/TI tagging?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16603#discussion_r1396205422
More information about the hotspot-dev
mailing list