RFR: 8234508: VM_HeapWalkOperation::iterate_over_object reads non-strong fields with an on-strong load barrier

Stefan Karlsson stefan.karlsson at oracle.com
Wed Dec 4 10:15:04 UTC 2019


Hi all,

Please review this fix to ensure we use the correct barrier when 
resolving Refrence.referents in VM_HeapWalkOperation::iterate_over_object.

https://cr.openjdk.java.net/~stefank/8234508/webrev.01/
https://bugs.openjdk.java.net/browse/JDK-8234508

Before this fix, the code would use an ON_STRONG barrier and potentially 
reading a dying referent during the resurrection blocked window. By 
using ON_UNKNOWN_OOP_REF we make sure that the correct barrier is used 
on Reference.referents, and the load will return NULL instead of a dead 
object.

I'm also tagging the load as AS_NO_KEEPALIVE, since we likely don't want 
to keep all referents unnecessarily alive. This relies on the fix for 
'8235324: Dying objects are published from users of 
CollectedHeap::object_iterate'.

Thanks,
StefanK



More information about the hotspot-gc-dev mailing list