166 void link_to_all(PerRegionTable * prt);
167 // unlink/remove the given fine grain remembered set into the "all" list
168 void unlink_from_all(PerRegionTable * prt);
169
170 bool contains_reference_locked(OopOrNarrowOopStar from) const;
171
172 // Clear the from_card_cache entries for this region.
173 void clear_fcc();
174 public:
175 // Create a new remembered set for the given heap region. The given mutex should
176 // be used to ensure consistency.
177 OtherRegionsTable(HeapRegion* hr, Mutex* m);
178
179 // For now. Could "expand" some tables in the future, so that this made
180 // sense.
181 void add_reference(OopOrNarrowOopStar from, uint tid);
182
183 // Returns whether the remembered set contains the given reference.
184 bool contains_reference(OopOrNarrowOopStar from) const;
185
186 // Removes any entries shown by the given bitmaps to contain only dead
187 // objects. Not thread safe.
188 // Set bits in the bitmaps indicate that the given region or card is live.
189 void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
190
191 // Returns whether this remembered set (and all sub-sets) does not contain any entry.
192 bool is_empty() const;
193
194 // Returns the number of cards contained in this remembered set.
195 size_t occupied() const;
196 size_t occ_fine() const;
197 size_t occ_coarse() const;
198 size_t occ_sparse() const;
199
200 static jint n_coarsenings() { return _n_coarsenings; }
201
202 // Returns size of the actual remembered set containers in bytes.
203 size_t mem_size() const;
204 // Returns the size of static data in bytes.
205 static size_t static_mem_size();
242 static OopOrNarrowOopStar* _recorded_oops;
243 static HeapWord** _recorded_cards;
244 static HeapRegion** _recorded_regions;
245 static int _n_recorded;
246
247 static const int MaxRecordedEvents = 1000;
248 static Event* _recorded_events;
249 static int* _recorded_event_index;
250 static int _n_recorded_events;
251
252 static void print_event(outputStream* str, Event evnt);
253
254 public:
255 HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr);
256
257 static uint num_par_rem_sets();
258 static void setup_remset_size();
259
260 bool is_empty() const {
261 return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();
262 }
263
264 size_t occupied() {
265 MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
266 return occupied_locked();
267 }
268 size_t occupied_locked() {
269 return _other_regions.occupied();
270 }
271 size_t occ_fine() const {
272 return _other_regions.occ_fine();
273 }
274 size_t occ_coarse() const {
275 return _other_regions.occ_coarse();
276 }
277 size_t occ_sparse() const {
278 return _other_regions.occ_sparse();
279 }
280
281 static jint n_coarsenings() { return OtherRegionsTable::n_coarsenings(); }
|
166 void link_to_all(PerRegionTable * prt);
167 // unlink/remove the given fine grain remembered set into the "all" list
168 void unlink_from_all(PerRegionTable * prt);
169
170 bool contains_reference_locked(OopOrNarrowOopStar from) const;
171
172 // Clear the from_card_cache entries for this region.
173 void clear_fcc();
174 public:
175 // Create a new remembered set for the given heap region. The given mutex should
176 // be used to ensure consistency.
177 OtherRegionsTable(HeapRegion* hr, Mutex* m);
178
179 // For now. Could "expand" some tables in the future, so that this made
180 // sense.
181 void add_reference(OopOrNarrowOopStar from, uint tid);
182
183 // Returns whether the remembered set contains the given reference.
184 bool contains_reference(OopOrNarrowOopStar from) const;
185
186 // Returns whether this remembered set (and all sub-sets) have an occupancy
187 // that is less or equal than the given occupancy.
188 bool occupancy_less_or_equal_than(size_t limit) const;
189
190 // Removes any entries shown by the given bitmaps to contain only dead
191 // objects. Not thread safe.
192 // Set bits in the bitmaps indicate that the given region or card is live.
193 void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
194
195 // Returns whether this remembered set (and all sub-sets) does not contain any entry.
196 bool is_empty() const;
197
198 // Returns the number of cards contained in this remembered set.
199 size_t occupied() const;
200 size_t occ_fine() const;
201 size_t occ_coarse() const;
202 size_t occ_sparse() const;
203
204 static jint n_coarsenings() { return _n_coarsenings; }
205
206 // Returns size of the actual remembered set containers in bytes.
207 size_t mem_size() const;
208 // Returns the size of static data in bytes.
209 static size_t static_mem_size();
246 static OopOrNarrowOopStar* _recorded_oops;
247 static HeapWord** _recorded_cards;
248 static HeapRegion** _recorded_regions;
249 static int _n_recorded;
250
251 static const int MaxRecordedEvents = 1000;
252 static Event* _recorded_events;
253 static int* _recorded_event_index;
254 static int _n_recorded_events;
255
256 static void print_event(outputStream* str, Event evnt);
257
258 public:
259 HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr);
260
261 static uint num_par_rem_sets();
262 static void setup_remset_size();
263
264 bool is_empty() const {
265 return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();
266 }
267
268 bool occupancy_less_or_equal_than(size_t occ) const {
269 return (strong_code_roots_list_length() == 0) && _other_regions.occupancy_less_or_equal_than(occ);
270 }
271
272 size_t occupied() {
273 MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
274 return occupied_locked();
275 }
276 size_t occupied_locked() {
277 return _other_regions.occupied();
278 }
279 size_t occ_fine() const {
280 return _other_regions.occ_fine();
281 }
282 size_t occ_coarse() const {
283 return _other_regions.occ_coarse();
284 }
285 size_t occ_sparse() const {
286 return _other_regions.occ_sparse();
287 }
288
289 static jint n_coarsenings() { return OtherRegionsTable::n_coarsenings(); }
|