RFR: 8351651: Cleanup LockStack::is_owning_thread [v2]

Coleen Phillimore coleenp at openjdk.org
Tue Mar 11 13:09:52 UTC 2025


On Tue, 11 Mar 2025 12:57:52 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix PRODUCT
>
> src/hotspot/share/runtime/lockStack.hpp line 70:
> 
>> 68: 
>> 69:   // Tests if the calling thread is the thread that owns this lock-stack.
>> 70:   bool is_owning_thread(JavaThread* current) const PRODUCT_RETURN;
> 
> This will not work in product builds.
> 
> Even if this is fixed, I think it is somewhat dangerous to leave this function available in product builds if it gives the wrong answer.
> 
> I'm voting for keeping this in as a product function. Or, alternatively, compile out the entire declaration in product builds. Thought, I do prefer the former since there's no obvious (to me) need to compile this out.

The reason I was here was that I was trying to find wasted code in product mode, then I realized it's not used anywhere in product mode.  So I'd rather it not exist in product mode.

> src/hotspot/share/runtime/synchronizer.cpp line 413:
> 
>> 411:     return LightweightSynchronizer::quick_enter(obj, lock, current);
>> 412:   }
>> 413: 
> 
> This looks unrelated.

It is unrelated, but I mentioned it in the bug report.  Feels like too useless to do on it's own.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23981#discussion_r1989233462
PR Review Comment: https://git.openjdk.org/jdk/pull/23981#discussion_r1989229593


More information about the hotspot-runtime-dev mailing list