RFR: 8351655: Optimize ObjectMonitor::unlink_after_acquire()

David Holmes dholmes at openjdk.org
Thu Mar 20 05:57:09 UTC 2025


On Wed, 19 Mar 2025 22:24:59 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> This PR implements an optimization of `ObjectMonitor::unlink_after_acquire()`. If it's possible it only converts the first part (the singly linked part) of the `entry_list` into a doubly linked list and leave the _entry_list_tail pointer untouched. 
>> 
>> It has passed tier1-tier8 tests.
>
> src/hotspot/share/runtime/objectMonitor.cpp line 1265:
> 
>> 1263: // entry_list head after the entry_list was last converted into a
>> 1264: // doubly linked list.
>> 1265: void ObjectMonitor::entry_list_build_dll(JavaThread* current) {
> 
> We only call this from unlink_after_acquire() and exit() when we know the list is not empty, so why not assert that here and remove case 1?

I agree.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24078#discussion_r2004867732


More information about the hotspot-runtime-dev mailing list