RFR: 8351655: Optimize ObjectMonitor::unlink_after_acquire() [v2]
Fredrik Bredberg
fbredberg at openjdk.org
Thu Mar 20 14:56:28 UTC 2025
On Thu, 20 Mar 2025 03:48:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update after review
>
> src/hotspot/share/runtime/objectMonitor.cpp line 1256:
>
>> 1254: // pointers and the entry_list_tail pointer. Within the entry_list the
>> 1255: // next pointers always form a consistent singly linked list. The
>> 1256: // entry_list can be in either of these forms:
>
> Suggestion:
>
> // entry_list can be in any of these forms:
>
> "either" implies two choices
Fixed
> src/hotspot/share/runtime/objectMonitor.cpp line 1273:
>
>> 1271: while (w != nullptr) {
>> 1272: assert(w->TState == ObjectWaiter::TS_ENTER, "invariant");
>> 1273: assert(w->prev() == nullptr || w->prev() == prev, "should be");
>
> Suggestion s/should be/invariant/ for all these assertions
Fixed
> src/hotspot/share/runtime/objectMonitor.cpp line 1297:
>
>> 1295: // and we don't have the tail pointer, something is broken.
>> 1296: assert(_entry_list_tail != nullptr, "should be");
>> 1297: #ifdef ASSERT
>
> I would move this `#ifdef ASSERT` to before the comment to make it clear the comment pertains to debug code.
Fixed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24078#discussion_r2005831461
PR Review Comment: https://git.openjdk.org/jdk/pull/24078#discussion_r2005832339
PR Review Comment: https://git.openjdk.org/jdk/pull/24078#discussion_r2005831909
More information about the hotspot-runtime-dev
mailing list