JDK-8345067 : C2: enable implicit null checks for ZGC reads
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-11-26
  • Updated: 2025-09-10
  • Resolved: 2025-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b02Fixed
Related Reports
Relates :  
Relates :  
Description
Currently, C2 cannot implement implicit null checks using memory accesses with late-expanded barriers [1], as in G1 and ZGC (see parent issue JDK-8344627).

This RFE proposes extending C2's implicit null check analysis to exploit memory accesses with late-expanded barriers but no inner exceptions (i.e. where the potentially exception-triggering memory access instruction is the first instruction emitted). The extension includes handling the hoisting of associated MachTemp nodes and discarding other memory accesses that might expand into instruction sequences with inner exception-triggering memory access instructions.

The extension would make it possible in practice to exploit ZGC reads with late-expanded GC barriers for implicit null checking.
Comments
Changeset: 91f12600 Branch: master Author: Roberto CastaƱeda Lozano <rcastanedalo@openjdk.org> Date: 2025-06-09 06:23:17 +0000 URL: https://git.openjdk.org/jdk/commit/91f12600d2b188ca98c5c575a34b85f5835399a0
09-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25066 Date: 2025-05-06 13:28:28 +0000
06-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22678 Date: 2024-12-11 09:59:44 +0000
11-12-2024