On Fri, 12 Jul 2024 10:22:42 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:

> > The reason we did not do this before is that this is not a strong reference 
> > store. Strong reference stores with a SATB collector will keep the referent 
> > alive, which is typically the exact opposite of what a user wants when they 
> > clear a Reference.
> 
> You mean not doing this store just on the Java side? Yes, I agree, it would 
> be awkward. In intrinsic, we are storing with the same decorators that 
> `JVM_ReferenceClear` is using, which should be good with SATB collectors. 
> Perhaps I am misunderstanding the comment.

The runtime use of the Access API knows how to resolve an unknown oop ref 
strength using AccessBarrierSupport::resolve_unknown_oop_ref_strength. However, 
we do not have support for that in the C2 backend. In fact, it does not 
understand non-strong oop stores at all. Because there hasn't really been a use 
case for it, other than clearing a Reference. That's the precise reason why we 
do not have a clear intrinsic; it would have to add that infrastructure.

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

PR Comment: https://git.openjdk.org/jdk/pull/20139#issuecomment-2225430174

Reply via email to