RFR: 8290892: C2: Intrinsify Reference.reachabilityFence [v3]
Emanuel Peter
epeter at openjdk.org
Mon Sep 8 14:52:19 UTC 2025
On Wed, 3 Sep 2025 20:14:56 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> src/hotspot/share/opto/reachability.cpp line 51:
>>
>>> 49: *
>>> 50: * It looks attractive to get rid of RF nodes early and transfer to safepoint-attached representation,
>>> 51: * but it is not correct until loop opts are done.
>>
>> Why is it not correct? What could go wrong? Why is it safe to do it after loop opts?
>
> Live ranges of values are routinely extended during loop opts. And it can break the invariant that all interfering safepoints contain the referent in their oop map. (If an interfering safepoint doesn't keep the referent alive, then it becomes possible for the referent to be prematurely GCed.)
>
> After loop opts are over, it becomes possible to reliably enumerate all interfering safe points and ensure the referent present in their oop maps.
Can you make sure this explanation is in the comment ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25315#discussion_r2330449580
More information about the hotspot-compiler-dev
mailing list