--- old/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp 2016-12-19 16:04:55.600790107 -0500 +++ new/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp 2016-12-19 16:04:55.540791749 -0500 @@ -3273,14 +3273,25 @@ ldr(dst, Address(dst, Klass::prototype_header_offset())); } -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. - if (UseCompressedClassPointers) { - encode_klass_not_null(src); - strw(src, Address(dst, oopDesc::klass_offset_in_bytes())); +void MacroAssembler::store_klass(Register dst, Register src, Register tmp) { + // concurrent gcs assumes klass length is valid if klass field is not null. + bool is_concurrentGC = UseG1GC || UseConcMarkSweepGC; + + if (is_concurrentGC) { + add(tmp, dst, oopDesc::klass_offset_in_bytes()); + if (UseCompressedClassPointers) { + encode_klass_not_null(src); + stlrw(src, tmp); + } else { + stlr(src, tmp); + } } else { - str(src, Address(dst, oopDesc::klass_offset_in_bytes())); + if (UseCompressedClassPointers) { + encode_klass_not_null(src); + strw(src, Address(dst, oopDesc::klass_offset_in_bytes())); + } else { + str(src, Address(dst, oopDesc::klass_offset_in_bytes())); + } } } @@ -3907,7 +3918,7 @@ } // store klass last. concurrent gcs assumes klass length is valid if // klass field is not null. - store_klass(top, t1); + store_klass(top, t1, rscratch1); mov(t1, top); ldr(rscratch1, Address(rthread, in_bytes(JavaThread::tlab_start_offset())));