RFR: 8345067: C2: enable implicit null checks for ZGC reads [v5]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Fri May 16 15:02:06 UTC 2025
On Fri, 16 May 2025 12:57:54 GMT, Andrew Haley <aph 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/gc/z/z_aarch64.ad line 131:
>
>> 129: !MacroAssembler::legitimize_address_requires_lea(ref_addr, size),
>> 130: "an instruction that can be used for implicit null checking should emit the candidate memory access first");
>> 131: ref_addr = __ legitimize_address(ref_addr, size, rscratch2);
>
> I just saw this. I think it might be simpler and better to handle this case in the segfault handler.
OK. C2 does not currently support creating exception table entries with arbitrary offsets relative to the start address of the code emitted for a Mach node, so that support would have to be added. I prototyped this support [here](https://github.com/openjdk/jdk/compare/master...robcasloz:jdk:JDK-implicit-null-checks), see calls to `record_exception_pc_offset()`. I don't think it is, overall, simpler than the approach proposed in this PR - definitely not from a `PhaseOutput`/`C2_MacroAssembler` perspective. But if you still think it is worth exploring, I will create a new prototype with the `record_exception_pc_offset()` on top of this PR to make it easier to compare.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25066#discussion_r2093219601
More information about the hotspot-gc-dev
mailing list