RFR: 8345067: C2: enable implicit null checks for ZGC reads [v2]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue May 13 17:24:59 UTC 2025
On Tue, 13 May 2025 16:24:25 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Roberto Castañeda Lozano has updated the pull request incrementally with nine additional commits since the last revision:
>>
>> - Generalize tests by removing requires annotation and adding local applyIf rules
>> - Assert that we do not move control nodes
>> - Extend comment about hoisting DecodeN inputs
>> - Apply Emanuels suggestions to ensure_node_is_at_block_or_above
>> - Rename auxiliary functions
>> - Rename auxiliary functions
>> - Clarify scope of move_into
>> - Extend comment about MachTemp nodes
>> - Extract and reuse legitimize_address test
>
> src/hotspot/share/opto/output.cpp line 2020:
>
>> 2018: assert(access->barrier_data() == 0 ||
>> 2019: access->is_late_expanded_null_check_candidate(),
>> 2020: "Implicit null checks on memory accesses with barriers are only supported on nodes explicitly marked as null-check candidates");
>
> I assume this is why you want the SIGSEGV instruction to be the first one. Do you think it is better if we mark the whole region and any SIGSEGV from any instruction inside the region will be mapped to this handler. Another way is to make the `MachNode` set the SIGSEGV point themselves.
Thanks, both could be done, but require non-trivial changes to the exception table building logic for no apparent benefit. I actually prototyped your second suggestion [here](https://github.com/openjdk/jdk/compare/master...robcasloz:jdk:JDK-implicit-null-checks) some time ago so that I could also use ZGC and G1 writes as implicit null checks, but the experiments did not show any performance benefit that could justify the additional complexity.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25066#discussion_r2087316762
More information about the hotspot-gc-dev
mailing list