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

Vladimir Ivanov vlivanov at openjdk.org
Wed Sep 17 20:22:21 UTC 2025


On Mon, 15 Sep 2025 22:57:51 GMT, Dean Long <dlong at openjdk.org> wrote:

>> @eme64 I think I addressed/answered all your suggestions/questions. Please, take another look. Thanks!
>
> @iwanowww , do you have a test that shows constant oops are a problem?  My initial impression is that PreserveReachabilityFencesOnConstants shouldn't be needed, because any oops referenced during the compile should go into the ciEnv metadata[] and then into the nmethod oops.  So GC can't reclaim these oops because the nmethod keeps references to them.

@dean-long 

> because any oops referenced during the compile should go into the ciEnv metadata[] and then into the nmethod oop

That's not how it behaves in practice. OOPs observed during compilation don't necessarily end up in nmethod metadata unless there're explicit usages. 

> do you have a test that shows constant oops are a problem?

I do. Just pushed one example as `test/hotspot/jtreg/compiler/c2/TestReachabilityFenceOnConstant.java`.

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

PR Comment: https://git.openjdk.org/jdk/pull/25315#issuecomment-3304444302


More information about the hotspot-compiler-dev mailing list