RFR: 8351655: Optimize ObjectMonitor::unlink_after_acquire() [v2]
David Holmes
dholmes at openjdk.org
Fri Mar 21 05:53:10 UTC 2025
On Thu, 20 Mar 2025 14:57:38 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:
>> src/hotspot/share/runtime/objectMonitor.cpp line 1264:
>>
>>> 1262: // Number four is because new threads has pushed themself to the
>>> 1263: // entry_list head after the entry_list was last converted into a
>>> 1264: // doubly linked list.
>>
>> I suggest deleting this as we already know it from the description of how things work.
>
> I like to add comments locally that helps the reader to understand things without having to seek out a "how things work" section. If you feel strongly that it should be removed, I'll do it, but if not I'd rather keep it.
Local comments where the code is not obvious sure. But we have over 100 lines of commentary describing the operations of this list including that it can be singly or doubly linked, so I really don't think we need this level of detail again at this point in the code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24078#discussion_r2006871558
More information about the hotspot-runtime-dev
mailing list