Add release barriers when allocating objects with concurrent collection

Andrew Haley aph at
Thu Aug 27 09:59:18 UTC 2020

8165808 (Add release barriers when allocating objects with concurrent
collection) added release barriers to object allocation paths. But it
only added them in shared code, not in the fast-path code.

I find a comment I added to AArch64 in 2013:

 void MacroAssembler::store_klass(Register dst, Register src) {
+  // FIXME: Should this be a store release?  concurrent gcs assumes
+  // klass length is valid if klass field is not null.

PPC doesn't have release barriers here either:

void MacroAssembler::store_klass(Register dst_oop, Register klass, Register ck) {
  if (UseCompressedClassPointers) {
    encode_klass_not_null(ck, klass);
    stw(ck, oopDesc::klass_offset_in_bytes(), dst_oop);
  } else {
    std(klass, oopDesc::klass_offset_in_bytes(), dst_oop);

So what's up? What should we be doing here? Surely if the slow path
code needs the barriers, the fast path does too.

Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-gc-dev mailing list