[aarch64-port-dev ] RFR(s): 8171449" [aarch64] store_klass needs to use store release
Andrew Haley
aph at redhat.com
Wed Dec 28 09:54:04 UTC 2016
On 27/12/16 21:21, Kim Barrett wrote:
>> On Dec 27, 2016, at 5:40 AM, Andrew Haley <aph at redhat.com> wrote:
>> If we really did want to do this on AArch64, we could better by
>> zeroing the object first, writing the length field, then storing the
>> klass field with stlr. One fence rather than two would be better than
>> what we do at the moment, which is storing the klass field then
>> zeroing the object.
>
> I think zeroing the object is intentionally delayed.
>
> In the slow path, the allocation of a raw chunk of memory is done
> while holding the Heap_lock. That lock prevents other Java threads
> from entering the slow path.
>
> Part of that raw chunk allocation makes the chunk unavailable to other
> Java threads. But it also makes the chunk visible to a concurrent GC.
> Hence the need to first zero out what will eventually be the klass
> field.
Absolutely so. I was talking about the fast path.
Thank you for the explanation: none of what I'd heard before made any
sense!
Andrew.
More information about the aarch64-port-dev
mailing list