Integrated: 8320280: RISC-V: Avoid passing t0 as temp register to MacroAssembler::lightweight_lock/unlock

Gui Cao gcao at openjdk.org
Mon Nov 20 14:44:29 UTC 2023


On Fri, 17 Nov 2023 02:32:16 GMT, Gui Cao <gcao at openjdk.org> wrote:

> This is inspired by https://bugs.openjdk.org/browse/JDK-8316880.
> MacroAssembler::lightweight_lock/unlock is non-trivial on linux-riscv64 platform. Passing t0(aka x5) as temporary register to these two assember functions can also be error prone. As a reserved scratch register, t0 is implicitly clobberred by various assembler functions. This fixes the issue by finding and passing a different register, which is similar with https://bugs.openjdk.org/browse/JDK-8316880.
> 
> ### Testing:
> - [x]  Run tier1-3 tests with qemu 8.1.50 (default locking mode) (release)
> - [x]  Run non-trivial benchmark workloads (specjbb2005, dacapo, renaissance) with -XX:LockingMode=2 (fastdebug & release)
> - [x] hotspot:tier4 on hifive unmatched (release)

This pull request has now been integrated.

Changeset: a6098e43
Author:    Gui Cao <gcao at openjdk.org>
Committer: Fei Yang <fyang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/a6098e438d7c5aa458b37bf94a9cfe706da35d52
Stats:     52 lines in 10 files changed: 9 ins; 0 del; 43 mod

8320280: RISC-V: Avoid passing t0 as temp register to MacroAssembler::lightweight_lock/unlock

Reviewed-by: fyang, rehn

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

PR: https://git.openjdk.org/jdk/pull/16703


More information about the hotspot-compiler-dev mailing list