RFR: 8319799: Recursive lightweight locking: x86 implementation [v12]

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Jan 25 08:34:33 UTC 2024


On Wed, 24 Jan 2024 12:30:54 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 18 additional commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'upstream_jdk/pr/16606' into JDK-8319799
>>  - Add more expressive stub continuation names
>>  - Remove outdated anonymous owner fix in stub
>>  - Merge remote-tracking branch 'upstream_jdk/pr/16606' into JDK-8319799
>>  - Remove C2HandleAnonOMOwnerStub definitions on x86.
>>  - Add MFENCE comment
>>  - Merge remote-tracking branch 'upstream_jdk/pr/16606' into JDK-8319799
>>  - Merge remote-tracking branch 'upstream_jdk/pr/16606' into JDK-8319799
>>  - Merge remote-tracking branch 'upstream_jdk/pr/16606' into JDK-8319799
>>  - Merge remote-tracking branch 'upstream_jdk/pr/16606' into JDK-8319799
>>  - ... and 8 more: https://git.openjdk.org/jdk/compare/f3b43e70...bc214b8d
>
> src/hotspot/cpu/x86/x86_64.ad line 12438:
> 
>> 12436:   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
>> 12437:   ins_encode %{
>> 12438:     __ fast_lock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $scr$$Register, r15_thread);
> 
> It is slightly confusing that the names here don't match the naming in fast_lightweight_lock/unlock. You might want to fix that.

I'll fix that. Went down a rabbit hole trying to figure out adlc and register allocation. I do not know why they specify `rbx` for `box`. Is it because they want to use `USE_KILL` or are they using `USE_KILL` because they specify `rbx` for `box`. It feels like this specification could be improved. The only requirement is that one tmp register is `rax`.  But I will leave that to another RFE.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16607#discussion_r1466008860


More information about the hotspot-dev mailing list