RFR: 8345067: C2: enable implicit null checks for ZGC reads [v5]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue May 27 08:18:57 UTC 2025
On Sat, 17 May 2025 09:04:28 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> 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.
>
> I don't think you have to do that. I think you only have to mark both the lea and the memory access with an exception table entry. The segfault handler sees the two entries, deduces that this access is split into two instructions, and does the right thing.
@theRealAph is it OK to proceed with this PR as it is, or do you still think it would be better to extend C2 with multiple implicit null exception table entries per Mach node?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25066#discussion_r2108544177
More information about the hotspot-compiler-dev
mailing list