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

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


 678         }
 679         // Did that empty the table completely?
 680         if (cur->occupied() == 0) {
 681           *prev = nxt;
 682           cur->set_collision_list_next(NULL);
 683           _n_fine_entries--;
 684           unlink_from_all(cur);
 685           PerRegionTable::free(cur);
 686         } else {
 687           prev = cur->collision_list_next_addr();
 688         }
 689       }
 690       cur = nxt;
 691     }
 692   }
 693   // Since we may have deleted a from_card_cache entry from the RS, clear
 694   // the FCC.
 695   clear_fcc();
 696 }
 697 



 698 
 699 size_t OtherRegionsTable::occupied() const {
 700   size_t sum = occ_fine();
 701   sum += occ_sparse();
 702   sum += occ_coarse();
 703   return sum;
 704 }
 705 
 706 size_t OtherRegionsTable::occ_fine() const {
 707   size_t sum = 0;
 708 
 709   size_t num = 0;
 710   PerRegionTable * cur = _first_all_fine_prts;
 711   while (cur != NULL) {
 712     sum += cur->occupied();
 713     cur = cur->next();
 714     num++;
 715   }
 716   guarantee(num == _n_fine_entries, "just checking");
 717   return sum;




 678         }
 679         // Did that empty the table completely?
 680         if (cur->occupied() == 0) {
 681           *prev = nxt;
 682           cur->set_collision_list_next(NULL);
 683           _n_fine_entries--;
 684           unlink_from_all(cur);
 685           PerRegionTable::free(cur);
 686         } else {
 687           prev = cur->collision_list_next_addr();
 688         }
 689       }
 690       cur = nxt;
 691     }
 692   }
 693   // Since we may have deleted a from_card_cache entry from the RS, clear
 694   // the FCC.
 695   clear_fcc();
 696 }
 697 
 698 bool OtherRegionsTable::is_empty() const {
 699   return occ_sparse() == 0 && occ_coarse() == 0 && _first_all_fine_prts == NULL;
 700 }
 701 
 702 size_t OtherRegionsTable::occupied() const {
 703   size_t sum = occ_fine();
 704   sum += occ_sparse();
 705   sum += occ_coarse();
 706   return sum;
 707 }
 708 
 709 size_t OtherRegionsTable::occ_fine() const {
 710   size_t sum = 0;
 711 
 712   size_t num = 0;
 713   PerRegionTable * cur = _first_all_fine_prts;
 714   while (cur != NULL) {
 715     sum += cur->occupied();
 716     cur = cur->next();
 717     num++;
 718   }
 719   guarantee(num == _n_fine_entries, "just checking");
 720   return sum;