8202418: Remove explicit CMS checks in CardTableBarrierSetAssembler: ARM32 leftovers
authorshade
Wed, 02 May 2018 19:26:44 +0200
changeset 49951 65b13c206495
parent 49950 7b916885654d
child 49952 a6224ea48b66
8202418: Remove explicit CMS checks in CardTableBarrierSetAssembler: ARM32 leftovers Reviewed-by: eosterlund
src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp
src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp
--- a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp	Wed May 02 19:26:42 2018 +0200
+++ b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp	Wed May 02 19:26:44 2018 +0200
@@ -486,6 +486,9 @@
 void LIRGenerator::CardTableBarrierSet_post_barrier_helper(LIR_OprDesc* addr, LIR_Const* card_table_base) {
   assert(addr->is_register(), "must be a register at this point");
 
+  CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(BarrierSet::barrier_set());
+  CardTable* ct = ctbs->card_table();
+
   LIR_Opr tmp = FrameMap::LR_ptr_opr;
 
   // TODO-AARCH64: check performance
@@ -507,7 +510,7 @@
   LIR_Address* card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTable::card_shift, 0, T_BOOLEAN);
 #endif
   if (UseCondCardMark) {
-    if (UseConcMarkSweepGC) {
+    if (ct->scanned_concurrently()) {
       __ membar_storeload();
     }
     LIR_Opr cur_value = new_register(T_INT);
@@ -519,11 +522,9 @@
     set_card(tmp, card_addr);
     __ branch_destination(L_already_dirty->label());
   } else {
-#if INCLUDE_ALL_GCS
-    if (UseConcMarkSweepGC && CMSPrecleaningEnabled) {
+    if (ct->scanned_concurrently()) {
       __ membar_storestore();
     }
-#endif
     set_card(tmp, card_addr);
   }
 }
--- 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);
   }
 }