diff src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp @ 50476:65b13c206495

8202418: Remove explicit CMS checks in CardTableBarrierSetAssembler: ARM32 leftovers Reviewed-by: eosterlund
author shade
date Wed, 02 May 2018 19:26:44 +0200
parents 7b916885654d
children 9375184cec98
line wrap: on
line diff
--- a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp	Wed May 02 19:26:42 2018 +0200
+++ b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp	Wed May 02 19:26:44 2018 +0200
@@ -127,6 +127,14 @@
 void CardTableBarrierSetAssembler::store_check_part2(MacroAssembler* masm, Register obj, Register card_table_base, Register tmp) {
   assert_different_registers(obj, card_table_base, tmp);
 
+  BarrierSet* bs = BarrierSet::barrier_set();
+  assert(bs->kind() == BarrierSet::CardTableBarrierSet,
+         "Wrong barrier set kind");
+
+  CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
+  CardTable* ct = ctbs->card_table();
+  assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "Adjust store check code");
+
   assert(CardTable::dirty_card_val() == 0, "Dirty card value must be 0 due to optimizations.");
 #ifdef AARCH64
   add(card_table_base, card_table_base, AsmOperand(obj, lsr, CardTable::card_shift));
@@ -136,11 +144,9 @@
 #endif
 
   if (UseCondCardMark) {
-#if INCLUDE_ALL_GCS
-    if (UseConcMarkSweepGC) {
+    if (ct->scanned_concurrently()) {
       __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad), noreg);
     }
-#endif
     Label already_dirty;
 
     __ ldrb(tmp, card_table_addr);
@@ -150,11 +156,9 @@
     __ bind(already_dirty);
 
   } else {
-#if INCLUDE_ALL_GCS
-    if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
+    if (ct->scanned_concurrently()) {
       __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreStore), noreg);
     }
-#endif
     set_card(masm, card_table_base, card_table_addr, tmp);
   }
 }