RFR: 8285487: Do not generate trampolines for runtime calls if they are not needed [v3]

Evgeny Astigeevich duke at openjdk.java.net
Fri Apr 29 15:10:03 UTC 2022


On Fri, 29 Apr 2022 12:54:15 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move code of target_needs_trampoline inside trampoline_call
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 579:
> 
>> 577:   // when a new callee address out of 128M range.
>> 578:   bool need_trampoline = (entry.rspec().type() == relocInfo::runtime_call_type) ?
>> 579:       target_needs_far_branch(entry.target()) : far_branches();
> 
> This is all very confusing too. Can't `target_needs_far_branch()` handle all cases? So we don't need a conditional expression here.

I'll update `MacroAssembler::trampoline_call` doc when it should be used. All runtime calls into `CodeCache` must use `far_call`. `far_call` is more compact and faster vs `trampoline_call`:
far call:

adrp
add
blr

trampoline call:

bl trampoline
trampoline:
ldr [embedded]
br
embedded:
8 bytes of target address


What do you think?

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

PR: https://git.openjdk.java.net/jdk/pull/8403


More information about the hotspot-dev mailing list