hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
changeset 20403 45a89fbcd8f7
parent 19979 ebe1dbb6e1aa
child 21188 d053e4e8f901
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri Oct 04 13:33:02 2013 +0200
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Tue Oct 08 17:35:51 2013 +0200
@@ -3389,13 +3389,18 @@
   const Register card_addr = tmp;
   lea(card_addr, as_Address(ArrayAddress(cardtable, index)));
 #endif
-  cmpb(Address(card_addr, 0), 0);
+  cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
   jcc(Assembler::equal, done);
 
+  membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
+  cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
+  jcc(Assembler::equal, done);
+
+
   // storing a region crossing, non-NULL oop, card is clean.
   // dirty card and log.
 
-  movb(Address(card_addr, 0), 0);
+  movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
 
   cmpl(queue_index, 0);
   jcc(Assembler::equal, runtime);