8079315: UseCondCardMark broken in conjunction with CMS precleaning on x86
authoraph
Fri, 19 Jun 2015 09:41:50 +0200
changeset 31369 0c3dcc865a1c
parent 31368 2cb1abbda511
child 31370 e27de7435453
8079315: UseCondCardMark broken in conjunction with CMS precleaning on x86 Summary: Add the necessary StoreLoad barrier in interpreter, C1 and C2 for x86 Reviewed-by: tschatzl
hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
hotspot/src/share/vm/opto/graphKit.cpp
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri Jun 19 09:41:49 2015 +0200
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri Jun 19 09:41:50 2015 +0200
@@ -4299,6 +4299,9 @@
   int dirty = CardTableModRefBS::dirty_card_val();
   if (UseCondCardMark) {
     Label L_already_dirty;
+    if (UseConcMarkSweepGC) {
+      membar(Assembler::StoreLoad);
+    }
     cmpb(card_addr, dirty);
     jcc(Assembler::equal, L_already_dirty);
     movb(card_addr, dirty);
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Jun 19 09:41:49 2015 +0200
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Jun 19 09:41:50 2015 +0200
@@ -1619,6 +1619,9 @@
   LIR_Opr dirty = LIR_OprFact::intConst(CardTableModRefBS::dirty_card_val());
   if (UseCondCardMark) {
     LIR_Opr cur_value = new_register(T_INT);
+    if (UseConcMarkSweepGC) {
+      __ membar_storeload();
+    }
     __ move(card_addr, cur_value);
 
     LabelObj* L_already_dirty = new LabelObj();
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Fri Jun 19 09:41:49 2015 +0200
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Fri Jun 19 09:41:50 2015 +0200
@@ -3803,6 +3803,11 @@
   Node*   zero = __ ConI(0); // Dirty card value
   BasicType bt = T_BYTE;
 
+  if (UseConcMarkSweepGC && UseCondCardMark) {
+    insert_mem_bar(Op_MemBarVolatile);   // StoreLoad barrier
+    __ sync_kit(this);
+  }
+
   if (UseCondCardMark) {
     // The classic GC reference write barrier is typically implemented
     // as a store into the global card mark table.  Unfortunately