RFR: 8355646: Optimize ObjectMonitor::exit [v2]

Fredrik Bredberg fbredberg at openjdk.org
Wed May 7 12:13:55 UTC 2025


On Tue, 6 May 2025 19:33:21 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Updated after review
>>  - Merge branch 'master' into 8355646_optimize_objectmonitor_exit
>>  - 8355646: Optimize ObjectMonitor::exit
>
> src/hotspot/share/runtime/objectMonitor.cpp line 1510:
> 
>> 1508: 
>> 1509:   for (;;) {
>> 1510:     assert(has_owner(current), "invariant");
> 
> Preexisting, but since we're touching this code, this assert seems redundant. We have already checked for this at the beginning of `exit()` and we check again at the end of the loop in case of reacquiring the lock.

I agree. Removed the `assert()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24927#discussion_r2077483245


More information about the hotspot-runtime-dev mailing list