RFR: 8326306: RISC-V: Re-structure MASM calls and jumps [v2]

Robbin Ehn rehn at openjdk.org
Fri Apr 26 09:42:38 UTC 2024


On Fri, 26 Apr 2024 09:38:50 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> I found some other places which uses plain calls to leaf, instead of call_VM_leaf.
>> It seems like it's a guess that registers don't need push/pop, I don't think such speculation is good.
>> If it must be there we should have a argument to call_VM_leaf saying we don't want to push/pop.
>> 
>> x86 is this case uses the correct:
>> ` __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), c_rarg0, c_rarg1);`
>> 
>> rt_call for non-code-cache do not need relocation, i.e. movptr.
>> So rt_call and call is not simply interchangeable, i.e. you now need relocation (pc relative calls). 
>> 
>> Yes, we can probably do better here, but as the change is mv/li + jalr to movptr + jalr, there is no regression.
>> So improvement should be done outside of this PR.
>
> Another difference is that `rt_call` calls `relocate()` which is similar with aarch64's version of `rt_call` which delegates work to `lea` or `adrp` which does similar things [1][2]. I think we should check whether this will make a difference if we want to remove `rt_call`.
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/assembler_aarch64.cpp#L141
> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L5398

Yes!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18942#discussion_r1580762539


More information about the hotspot-dev mailing list