RFR: 8330161: RISC-V: Don't use C for Labels jumps
Fei Yang
fyang at openjdk.org
Mon Apr 15 07:28:45 UTC 2024
On Mon, 15 Apr 2024 07:13:11 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Note, I notice this when I enable c_jal, if we ever want c_jal we need to either eanble patching of C or turn off C when we need patching.
>
>> Then I suggest we remove jalr from the method.
>
> I think we still need the `jalr` which is emitted by the else block of the method. The reason is that we have calls to `void jal(const address dest, Register temp = t0);` where we need to check whether `dest` is far or not [1][2].
>
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp#L1815
> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L3532
> Note, I notice this when I enable c_jal, if we ever want c_jal we need to either eanble patching of C or turn off C when we need patching.
The current approach is to turn off C on sites where patching could happen. There are two `relocate` assembler functions for that purpose [1]. They will turn off C on those patching sites. We don't think it worth the complexity to enable patching of C.
[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/assembler_riscv.hpp#L2083-L2093
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18761#discussion_r1565292244
More information about the hotspot-dev
mailing list