RFR: 8345067: C2: enable implicit null checks for ZGC reads [v5]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Tue May 27 07:46:44 UTC 2025


On Fri, 16 May 2025 08:33:38 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replace control type with PhaseCFG::is_CFG test
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 141:
> 
>> 139:   Address legitimize_address(const Address &a, int size, Register scratch) {
>> 140:     if (a.getMode() == Address::base_plus_offset) {
>> 141:       if (legitimize_address_requires_lea(a, size)) {
> 
> It is a little strange that `legitimize_address_requires_lea` is only the second condition and not 
> 
>   return a.getMode() == Address::base_plus_offset && !Address::offset_ok_for_immed(a.offset(), exact_log2(size));
> 
> 
> And have the check in `legitimize_address` simply be `if (legitimize_address_requires_lea(a, size))`
> 
> I guess we never end up calling `legitimize_address_requires_lea` with a literal address, where it would assert in `a.offset()`.  But requiring the Address parameter of legitimize_address_requires_lea to be in a specific mode as a precondition seems weird to me.

Thanks @xmas92, I fully agree, done (commit cf4f3b30).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25066#discussion_r2108444241


More information about the hotspot-compiler-dev mailing list