RFR: 8310844: [AArch64] C1 compilation fails because monitor offset in OSR buffer is too large for immediate [v2]

Andrew Haley aph at openjdk.org
Thu Jan 4 16:24:25 UTC 2024


On Thu, 4 Jan 2024 14:17:25 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp line 289:
>> 
>>> 287:       __ ldr(r19, Address(OSR_buf, slot_offset + 1*BytesPerWord));
>>> 288:       __ str(r19, frame_map()->address_for_monitor_object(i));
>>> 289:     }
>> 
>> The macro assembler automagically fuses `ldr` pairs. It'd be better to fix this with:
>> 
>> 
>> --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
>> +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
>> @@ -282,7 +282,8 @@ void LIR_Assembler::osr_entry() {
>>          __ bind(L);
>>        }
>>  #endif
>> -      __ ldp(r19, r20, Address(OSR_buf, slot_offset));
>> +      __ ldr(r19, Address(OSR_buf, slot_offset));
>> +      __ ldr(r20, Address(OSR_buf, slot_offset + BytesPerWord));
>>        __ str(r19, frame_map()->address_for_monitor_lock(i));
>>        __ str(r20, frame_map()->address_for_monitor_object(i));
>>      }
>
> Thanks for the review. I adjusted the fix accordingly.

Yes, the problem @TobiHartmann is fixing is that we currently use `ldp`, but in very rare cases`ldp` can't reach, so the fix we need is to change one `ldp` to two `ldr`s. In almost all cases, macroassembler will merge the `ldr`s.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17266#discussion_r1441983810


More information about the hotspot-compiler-dev mailing list