RFR: 8332689: RISC-V: Use load instead of trampolines [v4]

Robbin Ehn rehn at openjdk.org
Wed Jun 5 07:18:57 UTC 2024


On Wed, 5 Jun 2024 06:58:40 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move shart/far code to cpp
>
> src/hotspot/cpu/riscv/nativeInst_riscv.hpp line 118:
> 
>> 116:  public:
>> 117:   enum {
>> 118:     instruction_size = 3 * Assembler::instruction_size,
> 
> It looks odd for this `instruction_size` `NativeCall` to have a size of 12 here. It should depends on whether it is a `NativeShortCall` or `NativeFarCall` at the bottom, right?

The issue is that the common code access the enum directly:

src/hotspot/share/code/nmethod.inline.hpp:    || (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::instruction_size))
src/hotspot/share/code/nmethod.inline.hpp:    || (is_compiled_by_jvmci() && pc == (deopt_mh_handler_begin() + NativeCall::instruction_size))
src/hotspot/share/opto/output.cpp:  int pad_req   = NativeCall::instruction_size;



For c2 it just for an size estimate, so it's fine to give a larger value.

JVM CI is buggy (in general it's buggy all over), as we have no clue what size the unknown compiler using JVM CI generates here.
We can't use a constant for a C1/C2 call, so this code is just wrong.
Not sure what to do about, I have seen no errors for it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19453#discussion_r1627125905


More information about the hotspot-dev mailing list