RFR: 8286058: AArch64: clarify uses of MacroAssembler::trampoline_call [v2]

Andrew Haley aph at openjdk.java.net
Thu May 12 07:57:47 UTC 2022


On Fri, 6 May 2022 09:53:10 GMT, Evgeny Astigeevich <duke at openjdk.java.net> wrote:

>> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1113:
>> 
>>> 1111:   // If a mark of the generated call BL is needed, a pointer to CodeBuffer keeping the generated code
>>> 1112:   // must be provided.
>>> 1113:   //
>> 
>> What does "If a mark of the generated call BL is needed" mean?
>
> This is what is done in the function: 
> 
> address MacroAssembler::trampoline_call(Address entry, CodeBuffer* cbuf = NULL) {
> ...
>   if (cbuf) cbuf->set_insts_mark();
>   relocate(entry.rspec());
>   if (!far_branches()) {
>     bl(entry.target());
>   } else {
>     bl(pc());
>   }
> 
> 
> And most of the time NULL is passed.
> I don't know how this code  passed review. It smells badly.
> What written is based on what I see: how the function is used. For example, can `cbuf` be any `CodeBuffer`? If not, how is it connected to the current CodeBuffer? If it is the same, why we pass a pointer but not a flag.

Sorry, I didn't realize what "mark of the generated call" meant.

Good point. I think it is likely that the `inst_mark` is no longer needed by the AArch64 back end. When we were experimenting with trampoline calls we did a lot of experiments, and I believe that `inst_mark` was needed at one time. However, I do not think that any current user of `trampoline_call()` uses the insts_mark for anything, and it could usefully be removed as part of a cleanup.

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

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


More information about the hotspot-dev mailing list