comparison src/cpu/x86/vm/macroAssembler_x86.cpp @ 12835:69944b868a32

8014555: G1: Memory ordering problem with Conc refinement and card marking Summary: Add a StoreLoad barrier in the G1 post-barrier to fix a race with concurrent refinement. Also-reviewed-by: martin.doerr@sap.com Reviewed-by: iveresov, tschatzl, brutisso, roland, kvn
author mgerdin
date Tue, 08 Oct 2013 17:35:51 +0200
parents 7944aba7ba41
children 209aa13ab8c0
comparison
equal deleted inserted replaced
12834:04b18a42c2f3 12835:69944b868a32
3387 3387
3388 Address index(noreg, card_index, Address::times_1); 3388 Address index(noreg, card_index, Address::times_1);
3389 const Register card_addr = tmp; 3389 const Register card_addr = tmp;
3390 lea(card_addr, as_Address(ArrayAddress(cardtable, index))); 3390 lea(card_addr, as_Address(ArrayAddress(cardtable, index)));
3391 #endif 3391 #endif
3392 cmpb(Address(card_addr, 0), 0); 3392 cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
3393 jcc(Assembler::equal, done); 3393 jcc(Assembler::equal, done);
3394
3395 membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
3396 cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
3397 jcc(Assembler::equal, done);
3398
3394 3399
3395 // storing a region crossing, non-NULL oop, card is clean. 3400 // storing a region crossing, non-NULL oop, card is clean.
3396 // dirty card and log. 3401 // dirty card and log.
3397 3402
3398 movb(Address(card_addr, 0), 0); 3403 movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
3399 3404
3400 cmpl(queue_index, 0); 3405 cmpl(queue_index, 0);
3401 jcc(Assembler::equal, runtime); 3406 jcc(Assembler::equal, runtime);
3402 subl(queue_index, wordSize); 3407 subl(queue_index, wordSize);
3403 movptr(tmp2, buffer); 3408 movptr(tmp2, buffer);