We've had a few occasions where the ZGC C2 code generated on_weak barriers instead of on_strong. Usually, those bugs goes unnoticed. The problem arise when a load barrier is applied to a reference with the finalizable bit set (reachable through finalizer), during the resurrection window.
I propose that we add some verification to ensure that on_weak barriers are only applied to java.lang.ref.Reference.referents.
This verification code catches the bugs inJDK-8225770 and JDK-8227083.
I propose that we add some verification to ensure that on_weak barriers are only applied to java.lang.ref.Reference.referents.
This verification code catches the bugs in