8135018: AARCH64: Missing memory barriers for CMS collector

Add StoreStore barrier when CMS needs them

Reviewed-by: tschatzl
This commit is contained in:
Andrew Haley 2015-09-24 12:04:57 +02:00
parent 0835a6e311
commit 67af37e0b8
3 changed files with 10 additions and 0 deletions

View File

@ -3063,11 +3063,15 @@ void MacroAssembler::store_check(Register obj) {
if (UseCondCardMark) {
Label L_already_dirty;
membar(StoreLoad);
ldrb(rscratch2, Address(obj, rscratch1));
cbz(rscratch2, L_already_dirty);
strb(zr, Address(obj, rscratch1));
bind(L_already_dirty);
} else {
if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
membar(StoreStore);
}
strb(zr, Address(obj, rscratch1));
}
}

View File

@ -746,6 +746,9 @@ class StubGenerator: public StubCodeGenerator {
const Register count = end; // 'end' register contains bytes count now
__ mov(scratch, (address)ct->byte_map_base);
__ add(start, start, scratch);
if (UseConcMarkSweepGC) {
__ membar(__ StoreStore);
}
__ BIND(L_loop);
__ strb(zr, Address(start, count));
__ subs(count, count, 1);

View File

@ -1630,6 +1630,9 @@ void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc*
__ move(dirty, card_addr);
__ branch_destination(L_already_dirty->label());
} else {
if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
__ membar_storestore();
}
__ move(dirty, card_addr);
}
#endif