RFR: 8359359: AArch64: share trampolines between static calls to the same method [v7]

Evgeny Astigeevich eastigeevich at openjdk.org
Thu Oct 30 17:40:46 UTC 2025


On Thu, 30 Oct 2025 15:37:14 GMT, Mikhail Ablakatov <mablakatov at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp line 1987:
>> 
>>> 1985: 
>>> 1986: void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
>>> 1987:   address call = __ trampoline_call(Address(op->addr(), rtype), op->method());
>> 
>> Here we can exclude `lir_dynamic_call` ops:
>> 
>> // Targets of dynamic calls depend on the call site info.
>> // They can be resolved to different method at the time of a call.
>> ciMethod* method = (op->code() == lir_dynamic_call) : nullptr ? op->method();
>> address call = __ trampoline_call(Address(op->addr(), rtype), method);
>
> Would it be correct to use `op->method()->can_be_statically_bound()` instead, similarly to how it's done for static call stubs in https://github.com/openjdk/jdk/blob/ed36b9bb6f3d429db6accfb3b096e50e7f2217ff/src/hotspot/share/c1/c1_LIRAssembler.cpp#L456?

`can_be_statically_bound()` should definitely work.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25954#discussion_r2478972591


More information about the hotspot-dev mailing list