RFR: 8291555: Implement alternative fast-locking scheme [v29]
David Holmes
dholmes at openjdk.org
Fri Mar 24 12:12:03 UTC 2023
On Fri, 24 Mar 2023 10:10:58 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'origin/JDK-8291555-v2' into JDK-8291555-v2
>> - Set condition flags correctly after fast-lock call on aarch64
>
> src/hotspot/share/runtime/synchronizer.cpp line 923:
>
>> 921: static bool is_lock_owned(Thread* thread, oop obj) {
>> 922: assert(UseFastLocking, "only call this with fast-locking enabled");
>> 923: return thread->is_Java_thread() ? reinterpret_cast<JavaThread*>(thread)->lock_stack().contains(obj) : false;
>
> Here and later, should use `JavaThread::cast(thread)` instead of `reinterpret_cast<JavaThread*>`? It also sometimes subsumes the asserts, as `JT::cast` checks the type.
Only JavaThreads can own monitors so this function should take a JavaThread in the first place.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1147499577
More information about the hotspot-dev
mailing list