RFR: 8290892: C2: Intrinsify Reference.reachabilityFence [v2]

Vladimir Ivanov vlivanov at openjdk.org
Thu May 22 22:44:12 UTC 2025


On Thu, 22 May 2025 09:37:45 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/opto/compile.cpp line 3968:
>> 
>>> 3966:     return;
>>> 3967: 
>>> 3968:   // Go over ReachabilityFence nodes to skip DecodeN nodes for referents.
>> 
>> This is a cute optimization. Does it happen in our code anywhere? I would have expected `DecodeN` to be near the heap loads, and suppose `RF` is mostly called on locals, which are already uncompressed?
>
> Now that I read the next hunk, should `is_DecodeN` be `is_DecodeNarrowPtr` to capture class loads (however unlikely that one is)?

`ReachabilityFence` accepts only OOPs as a referent and `DecodeNKlass` produces `Klass` pointer.

I suspect it may be the case for safepoints as well (and `is_DecodeNarrowPtr()` is a a leftover from PermGen world), but I didn't check.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25315#discussion_r2103480358


More information about the hotspot-compiler-dev mailing list