8231956: Remove seq_add_card/reference from PerRegionTable class
authortschatzl
Fri, 11 Oct 2019 11:21:28 +0200
changeset 58552 906a9dd5d8e8
parent 58551 85e5124b0376
child 58553 516db52daad6
8231956: Remove seq_add_card/reference from PerRegionTable class Reviewed-by: sjohanss, pliden
src/hotspot/share/gc/g1/heapRegionRemSet.hpp
src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp
--- a/src/hotspot/share/gc/g1/heapRegionRemSet.hpp	Fri Oct 11 10:16:35 2019 +0200
+++ b/src/hotspot/share/gc/g1/heapRegionRemSet.hpp	Fri Oct 11 11:21:28 2019 +0200
@@ -186,10 +186,6 @@
     _collision_list_next(NULL)
   {}
 
-  inline void add_card_work(CardIdx_t from_card, bool par);
-
-  inline void add_reference_work(OopOrNarrowOopStar from, bool par);
-
 public:
   // We need access in order to union things into the base table.
   BitMap* bm() { return &_bm; }
@@ -206,12 +202,8 @@
 
   inline void add_reference(OopOrNarrowOopStar from);
 
-  inline void seq_add_reference(OopOrNarrowOopStar from);
-
   inline void add_card(CardIdx_t from_card_index);
 
-  void seq_add_card(CardIdx_t from_card_index);
-
   // (Destructively) union the bitmap of the current table into the given
   // bitmap (which is assumed to be of the same size.)
   void union_bitmap_into(BitMap* bm) {
@@ -381,12 +373,6 @@
     _state = Complete;
   }
 
-  // Used in the sequential case.
-  void add_reference(OopOrNarrowOopStar from) {
-    add_reference(from, 0);
-  }
-
-  // Used in the parallel case.
   void add_reference(OopOrNarrowOopStar from, uint tid) {
     RemSetState state = _state;
     if (state == Untracked) {
--- a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp	Fri Oct 11 10:16:35 2019 +0200
+++ b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp	Fri Oct 11 11:21:28 2019 +0200
@@ -35,20 +35,13 @@
   _other_regions.iterate(cl);
 }
 
-inline void PerRegionTable::add_card_work(CardIdx_t from_card, bool par) {
-  if (!_bm.at(from_card)) {
-    if (par) {
-      if (_bm.par_set_bit(from_card)) {
-        Atomic::inc(&_occupied);
-      }
-    } else {
-      _bm.set_bit(from_card);
-      _occupied++;
-    }
+inline void PerRegionTable::add_card(CardIdx_t from_card_index) {
+  if (_bm.par_set_bit(from_card_index)) {
+    Atomic::inc(&_occupied);
   }
 }
 
-inline void PerRegionTable::add_reference_work(OopOrNarrowOopStar from, bool par) {
+inline void PerRegionTable::add_reference(OopOrNarrowOopStar from) {
   // Must make this robust in case "from" is not in "_hr", because of
   // concurrency.
 
@@ -58,26 +51,10 @@
   // and adding a bit to the new table is never incorrect.
   if (loc_hr->is_in_reserved(from)) {
     CardIdx_t from_card = OtherRegionsTable::card_within_region(from, loc_hr);
-    add_card_work(from_card, par);
+    add_card(from_card);
   }
 }
 
-inline void PerRegionTable::add_card(CardIdx_t from_card_index) {
-  add_card_work(from_card_index, /*parallel*/ true);
-}
-
-inline void PerRegionTable::seq_add_card(CardIdx_t from_card_index) {
-  add_card_work(from_card_index, /*parallel*/ false);
-}
-
-inline void PerRegionTable::add_reference(OopOrNarrowOopStar from) {
-  add_reference_work(from, /*parallel*/ true);
-}
-
-inline void PerRegionTable::seq_add_reference(OopOrNarrowOopStar from) {
-  add_reference_work(from, /*parallel*/ false);
-}
-
 inline void PerRegionTable::init(HeapRegion* hr, bool clear_links_to_all_list) {
   if (clear_links_to_all_list) {
     set_next(NULL);