RFR: 8256011: Shenandoah: Don't resurrect finalizably reachable objects [v3]

Roman Kennke rkennke at openjdk.java.net
Tue Nov 10 11:25:57 UTC 2020


On Tue, 10 Nov 2020 11:08:52 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> No. ON_UNKNOWN_OOP_REF *might* access the referent field by reflection. We must do the correct thing in this situation. Normally, ON_UNKNOWN_OOP_REF is indeed called on normal/strong references, though, however we do the correct thing in this case too, because the referent would be marked and thus go through regular LRB. It doesn't hurt to call into weak for unknown oop refs.
>
>> No. ON_UNKNOWN_OOP_REF _might_ access the referent field by reflection. 
> 
> Ew. This just goes against my intuition about the default strongness. For example, `Unsafe_GetReference` calls with `ON_UNKNOWN_OOP_REF` -- does that mean we would treat that access as weak? I don't think we should.

Yes that is the idea. Note, as explained above, it does not hurt. The alternative would be to generate code that figures out the strength *at runtime* and calls into the correct LRB. This would be complex, though. We already do it for SATB-barriers, but there it is necessary, while here it is harmless to call the weak-LRB for non-weak references.

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

PR: https://git.openjdk.java.net/jdk/pull/1109


More information about the shenandoah-dev mailing list