RFR: 8345067: C2: enable implicit null checks for ZGC reads [v5]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Mon May 19 12:53:56 UTC 2025
On Sat, 17 May 2025 09:04:28 GMT, Andrew Haley <aph at openjdk.org> wrote:
> I think you only have to mark both the lea and the memory access with an exception table entry.
Could you elaborate a bit more on this part of your suggestion? My understanding is that [C2's `PhaseOutput`](https://github.com/openjdk/jdk/blob/3acfa9e4e7be2f37ac55f97348aad4f74ba802a0/src/hotspot/share/opto/output.hpp#L72) (the component responsible for populating the [implicit null exception table](https://github.com/openjdk/jdk/blob/3acfa9e4e7be2f37ac55f97348aad4f74ba802a0/src/hotspot/share/opto/output.cpp#L3451)) can at most add one entry per Mach node (in this case `zLoadP`), where [the entry key is the address of the first emitted machine instruction](https://github.com/openjdk/jdk/blob/3acfa9e4e7be2f37ac55f97348aad4f74ba802a0/src/hotspot/share/opto/output.cpp#L1611-L1614). Therefore if we want to mark both the lea and the memory access as you suggest, we would need to extend `C2_MacroAssembler` to express which instructions we want to mark and extend C2's `PhaseOutput` to add entries for each of the marked instructions. Is there a simpler way I have missed to achieve this?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25066#discussion_r2095643031
More information about the hotspot-gc-dev
mailing list