src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp

Print this page
rev 6719 : imported patch fast-reclaim-main-patch


 168   bool del_single_region_table(size_t ind, HeapRegion* hr);
 169 
 170   // link/add the given fine grain remembered set into the "all" list
 171   void link_to_all(PerRegionTable * prt);
 172   // unlink/remove the given fine grain remembered set into the "all" list
 173   void unlink_from_all(PerRegionTable * prt);
 174 
 175 public:
 176   OtherRegionsTable(HeapRegion* hr, Mutex* m);
 177 
 178   HeapRegion* hr() const { return _hr; }
 179 
 180   // For now.  Could "expand" some tables in the future, so that this made
 181   // sense.
 182   void add_reference(OopOrNarrowOopStar from, int tid);
 183 
 184   // Removes any entries shown by the given bitmaps to contain only dead
 185   // objects.
 186   void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
 187 



 188   size_t occupied() const;
 189   size_t occ_fine() const;
 190   size_t occ_coarse() const;
 191   size_t occ_sparse() const;
 192 
 193   static jint n_coarsenings() { return _n_coarsenings; }
 194 
 195   // Returns size in bytes.
 196   // Not const because it takes a lock.
 197   size_t mem_size() const;
 198   static size_t static_mem_size();
 199   static size_t fl_mem_size();
 200 
 201   bool contains_reference(OopOrNarrowOopStar from) const;
 202   bool contains_reference_locked(OopOrNarrowOopStar from) const;
 203 
 204   void clear();
 205 
 206   // Specifically clear the from_card_cache.
 207   void clear_fcc();


 252   static HeapRegion**        _recorded_regions;
 253   static int                 _n_recorded;
 254 
 255   static const int MaxRecordedEvents = 1000;
 256   static Event*       _recorded_events;
 257   static int*         _recorded_event_index;
 258   static int          _n_recorded_events;
 259 
 260   static void print_event(outputStream* str, Event evnt);
 261 
 262 public:
 263   HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr);
 264 
 265   static uint num_par_rem_sets();
 266   static void setup_remset_size();
 267 
 268   HeapRegion* hr() const {
 269     return _other_regions.hr();
 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(); }
 290 
 291   // Used in the sequential case.


 354   bool contains_reference(OopOrNarrowOopStar from) const {
 355     return _other_regions.contains_reference(from);
 356   }
 357 
 358   // Routines for managing the list of code roots that point into
 359   // the heap region that owns this RSet.
 360   void add_strong_code_root(nmethod* nm);
 361   void remove_strong_code_root(nmethod* nm);
 362 
 363   // During a collection, migrate the successfully evacuated strong
 364   // code roots that referenced into the region that owns this RSet
 365   // to the RSets of the new regions that they now point into.
 366   // Unsuccessfully evacuated code roots are not migrated.
 367   void migrate_strong_code_roots();
 368 
 369   // Applies blk->do_code_blob() to each of the entries in
 370   // the strong code roots list
 371   void strong_code_roots_do(CodeBlobClosure* blk) const;
 372 
 373   // Returns the number of elements in the strong code roots list
 374   size_t strong_code_roots_list_length() {
 375     return _code_roots.length();
 376   }
 377 
 378   // Returns true if the strong code roots contains the given
 379   // nmethod.
 380   bool strong_code_roots_list_contains(nmethod* nm) {
 381     return _code_roots.contains(nm);
 382   }
 383 
 384   // Returns the amount of memory, in bytes, currently
 385   // consumed by the strong code roots.
 386   size_t strong_code_roots_mem_size();
 387 
 388   void print() PRODUCT_RETURN;
 389 
 390   // Called during a stop-world phase to perform any deferred cleanups.
 391   static void cleanup();
 392 
 393   // Declare the heap size (in # of regions) to the HeapRegionRemSet(s).
 394   // (Uses it to initialize from_card_cache).




 168   bool del_single_region_table(size_t ind, HeapRegion* hr);
 169 
 170   // link/add the given fine grain remembered set into the "all" list
 171   void link_to_all(PerRegionTable * prt);
 172   // unlink/remove the given fine grain remembered set into the "all" list
 173   void unlink_from_all(PerRegionTable * prt);
 174 
 175 public:
 176   OtherRegionsTable(HeapRegion* hr, Mutex* m);
 177 
 178   HeapRegion* hr() const { return _hr; }
 179 
 180   // For now.  Could "expand" some tables in the future, so that this made
 181   // sense.
 182   void add_reference(OopOrNarrowOopStar from, int tid);
 183 
 184   // Removes any entries shown by the given bitmaps to contain only dead
 185   // objects.
 186   void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
 187 
 188   // Returns whether this remembered set (and all sub-sets) contain no entries.
 189   bool is_empty() const;
 190 
 191   size_t occupied() const;
 192   size_t occ_fine() const;
 193   size_t occ_coarse() const;
 194   size_t occ_sparse() const;
 195 
 196   static jint n_coarsenings() { return _n_coarsenings; }
 197 
 198   // Returns size in bytes.
 199   // Not const because it takes a lock.
 200   size_t mem_size() const;
 201   static size_t static_mem_size();
 202   static size_t fl_mem_size();
 203 
 204   bool contains_reference(OopOrNarrowOopStar from) const;
 205   bool contains_reference_locked(OopOrNarrowOopStar from) const;
 206 
 207   void clear();
 208 
 209   // Specifically clear the from_card_cache.
 210   void clear_fcc();


 255   static HeapRegion**        _recorded_regions;
 256   static int                 _n_recorded;
 257 
 258   static const int MaxRecordedEvents = 1000;
 259   static Event*       _recorded_events;
 260   static int*         _recorded_event_index;
 261   static int          _n_recorded_events;
 262 
 263   static void print_event(outputStream* str, Event evnt);
 264 
 265 public:
 266   HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr);
 267 
 268   static uint num_par_rem_sets();
 269   static void setup_remset_size();
 270 
 271   HeapRegion* hr() const {
 272     return _other_regions.hr();
 273   }
 274 
 275   bool is_empty() const {
 276     return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();
 277   }
 278 
 279   size_t occupied() {
 280     MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
 281     return occupied_locked();
 282   }
 283   size_t occupied_locked() {
 284     return _other_regions.occupied();
 285   }
 286   size_t occ_fine() const {
 287     return _other_regions.occ_fine();
 288   }
 289   size_t occ_coarse() const {
 290     return _other_regions.occ_coarse();
 291   }
 292   size_t occ_sparse() const {
 293     return _other_regions.occ_sparse();
 294   }
 295 
 296   static jint n_coarsenings() { return OtherRegionsTable::n_coarsenings(); }
 297 
 298   // Used in the sequential case.


 361   bool contains_reference(OopOrNarrowOopStar from) const {
 362     return _other_regions.contains_reference(from);
 363   }
 364 
 365   // Routines for managing the list of code roots that point into
 366   // the heap region that owns this RSet.
 367   void add_strong_code_root(nmethod* nm);
 368   void remove_strong_code_root(nmethod* nm);
 369 
 370   // During a collection, migrate the successfully evacuated strong
 371   // code roots that referenced into the region that owns this RSet
 372   // to the RSets of the new regions that they now point into.
 373   // Unsuccessfully evacuated code roots are not migrated.
 374   void migrate_strong_code_roots();
 375 
 376   // Applies blk->do_code_blob() to each of the entries in
 377   // the strong code roots list
 378   void strong_code_roots_do(CodeBlobClosure* blk) const;
 379 
 380   // Returns the number of elements in the strong code roots list
 381   size_t strong_code_roots_list_length() const {
 382     return _code_roots.length();
 383   }
 384 
 385   // Returns true if the strong code roots contains the given
 386   // nmethod.
 387   bool strong_code_roots_list_contains(nmethod* nm) {
 388     return _code_roots.contains(nm);
 389   }
 390 
 391   // Returns the amount of memory, in bytes, currently
 392   // consumed by the strong code roots.
 393   size_t strong_code_roots_mem_size();
 394 
 395   void print() PRODUCT_RETURN;
 396 
 397   // Called during a stop-world phase to perform any deferred cleanups.
 398   static void cleanup();
 399 
 400   // Declare the heap size (in # of regions) to the HeapRegionRemSet(s).
 401   // (Uses it to initialize from_card_cache).