On Fri, 17 Mar 2023 06:15:28 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:
> > In my last changes I made a stupid mistake and don't set the condition > > flags correctly to force the slow-path, on aarch64. This is only relevant > > when we exceed the lock-stack capacity, that is why it's failing so rarely. > > I don't see a similar problem on x86_64 - have we observed any failures on > > x86_64? I pushed a fix for aarch64. > > > > I noticed this too for arm; I used cmp to clear EQ but using tst seems > better. I also do it inside fast_lock, to give it a defined exit state wrt > EQ|NE, since it saves me from having to think about this on every call site. > But at least the fail case may be fiddly without conditional execution. Cmp(r,r) would not clear EQ, but set it. Unless you do cmp(r,0) on a non-null register. Tst is better at least on x86 because it encodes smaller. *shrugs* You can do it in the shared fast_lock() but it's really only needed in C2, that's why I'm doing it there. Maybe I'm too perfectionist when it comes to assembly code? ------------- PR: https://git.openjdk.org/jdk/pull/10907