< prev index next >

src/hotspot/share/gc/g1/sparsePRT.cpp

Print this page
rev 51979 : imported patch 8071913-almost-done
rev 51980 : imported patch 8071913-alternate
rev 51982 : [mq]: 8211388-make-otherregionstable-unaware-of-to-region


 344 
 345 bool SparsePRT::should_be_on_expanded_list() {
 346   if (_expanded) {
 347     assert(_cur != _next, "if _expanded is true, cur should be != _next");
 348   } else {
 349     assert(_cur == _next, "if _expanded is false, cur should be == _next");
 350   }
 351   return expanded();
 352 }
 353 
 354 void SparsePRT::cleanup_all() {
 355   // First clean up all expanded tables so they agree on next and cur.
 356   SparsePRT* sprt = get_from_expanded_list();
 357   while (sprt != NULL) {
 358     sprt->cleanup();
 359     sprt = get_from_expanded_list();
 360   }
 361 }
 362 
 363 
 364 SparsePRT::SparsePRT(HeapRegion* hr) :
 365   _hr(hr), _expanded(false), _next_expanded(NULL)
 366 {
 367   _cur = new RSHashTable(InitialCapacity);
 368   _next = _cur;
 369 }
 370 
 371 
 372 SparsePRT::~SparsePRT() {
 373   assert(_next != NULL && _cur != NULL, "Inv");
 374   if (_cur != _next) { delete _cur; }
 375   delete _next;
 376 }
 377 
 378 
 379 size_t SparsePRT::mem_size() const {
 380   // We ignore "_cur" here, because it either = _next, or else it is
 381   // on the deleted list.
 382   return sizeof(SparsePRT) + _next->mem_size();
 383 }
 384 
 385 bool SparsePRT::add_card(RegionIdx_t region_id, CardIdx_t card_index) {




 344 
 345 bool SparsePRT::should_be_on_expanded_list() {
 346   if (_expanded) {
 347     assert(_cur != _next, "if _expanded is true, cur should be != _next");
 348   } else {
 349     assert(_cur == _next, "if _expanded is false, cur should be == _next");
 350   }
 351   return expanded();
 352 }
 353 
 354 void SparsePRT::cleanup_all() {
 355   // First clean up all expanded tables so they agree on next and cur.
 356   SparsePRT* sprt = get_from_expanded_list();
 357   while (sprt != NULL) {
 358     sprt->cleanup();
 359     sprt = get_from_expanded_list();
 360   }
 361 }
 362 
 363 
 364 SparsePRT::SparsePRT() :
 365   _expanded(false), _next_expanded(NULL)
 366 {
 367   _cur = new RSHashTable(InitialCapacity);
 368   _next = _cur;
 369 }
 370 
 371 
 372 SparsePRT::~SparsePRT() {
 373   assert(_next != NULL && _cur != NULL, "Inv");
 374   if (_cur != _next) { delete _cur; }
 375   delete _next;
 376 }
 377 
 378 
 379 size_t SparsePRT::mem_size() const {
 380   // We ignore "_cur" here, because it either = _next, or else it is
 381   // on the deleted list.
 382   return sizeof(SparsePRT) + _next->mem_size();
 383 }
 384 
 385 bool SparsePRT::add_card(RegionIdx_t region_id, CardIdx_t card_index) {


< prev index next >