173
174 // next pointer in collision list
175 PerRegionTable * _collision_list_next;
176
177 // Global free list of PRTs
178 static PerRegionTable* volatile _free_list;
179
180 protected:
181 PerRegionTable(HeapRegion* hr) :
182 _hr(hr),
183 _bm(HeapRegion::CardsPerRegion, mtGC),
184 _occupied(0),
185 _next(NULL), _prev(NULL),
186 _collision_list_next(NULL)
187 {}
188
189 public:
190 // We need access in order to union things into the base table.
191 BitMap* bm() { return &_bm; }
192
193 HeapRegion* hr() const { return OrderAccess::load_acquire(&_hr); }
194
195 jint occupied() const {
196 // Overkill, but if we ever need it...
197 // guarantee(_occupied == _bm.count_one_bits(), "Check");
198 return _occupied;
199 }
200
201 void init(HeapRegion* hr, bool clear_links_to_all_list);
202
203 inline void add_reference(OopOrNarrowOopStar from);
204
205 inline void add_card(CardIdx_t from_card_index);
206
207 // (Destructively) union the bitmap of the current table into the given
208 // bitmap (which is assumed to be of the same size.)
209 void union_bitmap_into(BitMap* bm) {
210 bm->set_union(_bm);
211 }
212
213 // Mem size in bytes.
|
173
174 // next pointer in collision list
175 PerRegionTable * _collision_list_next;
176
177 // Global free list of PRTs
178 static PerRegionTable* volatile _free_list;
179
180 protected:
181 PerRegionTable(HeapRegion* hr) :
182 _hr(hr),
183 _bm(HeapRegion::CardsPerRegion, mtGC),
184 _occupied(0),
185 _next(NULL), _prev(NULL),
186 _collision_list_next(NULL)
187 {}
188
189 public:
190 // We need access in order to union things into the base table.
191 BitMap* bm() { return &_bm; }
192
193 HeapRegion* hr() const { return Atomic::load_acquire(&_hr); }
194
195 jint occupied() const {
196 // Overkill, but if we ever need it...
197 // guarantee(_occupied == _bm.count_one_bits(), "Check");
198 return _occupied;
199 }
200
201 void init(HeapRegion* hr, bool clear_links_to_all_list);
202
203 inline void add_reference(OopOrNarrowOopStar from);
204
205 inline void add_card(CardIdx_t from_card_index);
206
207 // (Destructively) union the bitmap of the current table into the given
208 // bitmap (which is assumed to be of the same size.)
209 void union_bitmap_into(BitMap* bm) {
210 bm->set_union(_bm);
211 }
212
213 // Mem size in bytes.
|