[9] RFR (XS): 8138922: StubCodeDesc constructor publishes partially-constructed objects on StubCodeDesc::_list
Andrew Haley
aph at redhat.com
Thu Feb 11 10:56:47 UTC 2016
On 10/02/16 18:13, Vladimir Ivanov wrote:
> The fix is to insert a StoreStore barrier before registering an object
> on the list.
1. There's not usually any point having a StoreStore without a
corresponding load barrier on the reader side: there's nothing for the
StoreStore to synchronize with. Having said that, you could argue
that because there's an address dependency from the list pointer to
all the instances of StubCodeDesc we should be safe.
2. StoreStore is arguably wrong for everything except an object
initialized with pure constants. However, given that a StubCodeDesc
is immutable I guess it's safe, as Hans observes in [1].
Acquire/release is much easier to reason about because you don't have
to make these fine judgements, so I'd just use acquire/release
everywhere in order to keep my sanity.
Andrew.
[1] http://www.hboehm.info/c++mm/no_write_fences.html
More information about the hotspot-dev
mailing list