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

Evgeny Astigeevich duke at openjdk.java.net
Fri May 6 09:56:48 UTC 2022


On Fri, 6 May 2022 08:05:00 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix assert message
>
> 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.

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

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


More information about the hotspot-dev mailing list