On Sat, 25 Mar 2023 08:55:25 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:

> I have another question about the asymmetric unlocking code in 
> `InterpreterMacroAssembler::unlock_object`.
> 
> We go through here for both fast-locked and fat OM locks, right? If so, 
> shouldn't we do the asymmetric lock check only for the fast locked case? 
> Otherwise Lockstack may be empty, so we compare the word preceding the first 
> slot, which would cause us to always break into the slow case?
> 
> Sorry if I miss something here.

Uh, yes, indeed. It works by accident, I suppose, because we don't segfault on 
the word preceding the lock-stack, and monitor-locking takes the slow-case in 
interpreter, anyway. But yeah, it's better to check for it.

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

PR Comment: https://git.openjdk.org/jdk/pull/10907#issuecomment-1490163377

Reply via email to