diff --git a/src/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/src/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index 32454caa89d..e0d383ce85b 100644 --- a/src/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/src/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -3135,6 +3135,10 @@ void MacroAssembler::store_check_part_2(Register obj) { // don't bother to check, but it could save an instruction. intptr_t disp = (intptr_t) ct->byte_map_base; load_byte_map_base(rscratch1); + + if (UseConcMarkSweepGC && CMSPrecleaningEnabled) { + membar(StoreStore); + } strb(zr, Address(obj, rscratch1)); } diff --git a/src/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/src/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 4423b8bc2a4..153360a13e7 100644 --- a/src/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/src/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -678,6 +678,9 @@ class StubGenerator: public StubCodeGenerator { const Register count = end; // 'end' register contains bytes count now __ load_byte_map_base(scratch); __ add(start, start, scratch); + if (UseConcMarkSweepGC) { + __ membar(__ StoreStore); + } __ BIND(L_loop); __ strb(zr, Address(start, count)); __ subs(count, count, 1); diff --git a/src/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/src/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 19ec64d8c6d..fe32e066ab5 100644 --- a/src/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1607,6 +1607,11 @@ void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* } else { __ unsigned_shift_right(addr, CardTableModRefBS::card_shift, tmp); } + + if (UseConcMarkSweepGC && CMSPrecleaningEnabled) { + __ membar_storestore(); + } + if (can_inline_as_constant(card_table_base)) { __ move(LIR_OprFact::intConst(0), new LIR_Address(tmp, card_table_base->as_jint(), T_BYTE));