JDK-8370129 : C2: Support ReachabilityFence with constant referent
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-10-17
  • Updated: 2025-10-20
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Due to performance considerations, JDK-8290892 eliminates ReachabilityFence (RF) nodes with constant referent. (There's PreserveReachabilityFencesOnConstants diagnostic flag to keep the RF node, but it is turned off by default).

There's a more efficient way to support RF with constant referent which relies on nmethod dependencies machinery. OOPs embedded in nmethods are treated as weak reference, so when an OOP is GCed corresponding method is invalidated and such behavior satisfies ReachabilityFence contract.