RFR: 8319799: Recursive lightweight locking: x86 implementation [v13]
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Jan 25 13:34:38 UTC 2024
On Thu, 25 Jan 2024 13:18:43 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
>> The only annoying thing is that the generate native wrapper x86_32 path has a dedicated thread register. Have to either signal this to lightweight_{unlock,lock} or just reload the thread in this path.
>>
>> I will see if I can find a cleaner solution.
>
> Uh I see. This whole loading of the thread in x86_32 made me think (a while back) to not have any asm 'fast'-paths for x86_64 to begin with. IIRC, get_thread() calls into the runtime anyway, and if we do that anyway (sometimes repeatedly), we might just as well handle the whole locking there. It's annoying.
There is no clear satisfying solution for this. Either multiple function names `lightweight_{unlock,lock}_with_thread` , using an extra bool argument to signal that the thread is loaded, or overload the type one with `Register` the other with `Register*`.
I tried something like a00f2e9e7f9b4d1abdcd5931ff8ba62c1d2de868 and 8eaa53e5cd9d3b17d16516af599f451ac4531c8b
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16607#discussion_r1466384811
More information about the hotspot-dev
mailing list