RFR: 8364150: RISC-V: Leftover for JDK-8343430 removing old trampoline call [v4]
Fei Yang
fyang at openjdk.org
Tue Jul 29 01:55:11 UTC 2025
On Mon, 28 Jul 2025 14:12:32 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> One suggestion: maybe we can add an additional parameter here for `NativeCall::reloc_set_destination(address dest)` like `is_stub_addr`, so on the path we're sure `dest` is the stub address rather than reloc call destination, we can pass true for `is_stub_addr`, and in other paths we can pass false.
>> And we can also add an assert in the `is_stub_addr == true` path, like `assert(CodeCache::contains(x), "must");`.
>
> I intend to think that by design we only want `NativeCall::reloc_destination` and `NativeCall::reloc_set_destination` to get and set stub address. There are other functions like `NativeCall::destination`, `NativeCall::set_destination` and `NativeCall::set_destination_mt_safe` which are supposed to deal with the real call target. So I am going to check the `CallRelocation::set_destination` cases in shared code as you mentioned.
Here is what I find. There are only two use cases of `CallRelocation::set_destination(address x)` in hotspot shared code. One is the AOT case [1] and the other is `CallRelocation::set_value(address x)` [2]. And `CallRelocation::set_value(address x)` is never used. Given that we don't have AOT support for riscv64 in JDK upstream yet, I think we are safe.
And I have added assertion in `CallRelocation::set_value(address x)` about `dest` param to make sure it's the same as the stub address. I see `hs:tier1` still test good with fastdebug build. Also I think it's better to investigate and fix the AOT use case in Leyden premain as you are currently working on if it turns out to be an issue. Does that work for you?
./relocInfo.hpp: void set_value(address x) override { set_destination(x); }
[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/code/aotCodeCache.cpp#L1111
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/code/relocInfo.hpp#L955
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26495#discussion_r2238085011
More information about the hotspot-compiler-dev
mailing list