8135018: AARCH64: Missing memory barriers for CMS collector
authoraph
Thu, 24 Sep 2015 12:04:57 +0200
changeset 33096 d38227d62ef4
parent 33095 e56c951d8735
child 33098 2668fb702656
8135018: AARCH64: Missing memory barriers for CMS collector Summary: Add StoreStore barrier when CMS needs them Reviewed-by: tschatzl
hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Wed Sep 23 22:04:23 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Thu Sep 24 12:04:57 2015 +0200
@@ -3063,11 +3063,15 @@
 
   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));
   }
 }
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Wed Sep 23 22:04:23 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp	Thu Sep 24 12:04:57 2015 +0200
@@ -746,6 +746,9 @@
           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);
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Sep 23 22:04:23 2015 +0300
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Thu Sep 24 12:04:57 2015 +0200
@@ -1630,6 +1630,9 @@
     __ move(dirty, card_addr);
     __ branch_destination(L_already_dirty->label());
   } else {
+    if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
+      __ membar_storestore();
+    }
     __ move(dirty, card_addr);
   }
 #endif