< prev index next >

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

Print this page
rev 58017 : [mq]: 8238854-remove-superfluous-alloc-checks


 251 
 252   add_chunk_to_free_list(cur);
 253   return true;
 254 }
 255 
 256 void G1CMMarkStack::set_empty() {
 257   _chunks_in_chunk_list = 0;
 258   _hwm = 0;
 259   _chunk_list = NULL;
 260   _free_list = NULL;
 261 }
 262 
 263 G1CMRootMemRegions::G1CMRootMemRegions(uint const max_regions) :
 264     _root_regions(NULL),
 265     _max_regions(max_regions),
 266     _num_root_regions(0),
 267     _claimed_root_regions(0),
 268     _scan_in_progress(false),
 269     _should_abort(false) {
 270   _root_regions = new MemRegion[_max_regions];
 271   if (_root_regions == NULL) {
 272     vm_exit_during_initialization("Could not allocate root MemRegion set.");
 273   }
 274 }
 275 
 276 G1CMRootMemRegions::~G1CMRootMemRegions() {
 277   delete[] _root_regions;
 278 }
 279 
 280 void G1CMRootMemRegions::reset() {
 281   _num_root_regions = 0;
 282 }
 283 
 284 void G1CMRootMemRegions::add(HeapWord* start, HeapWord* end) {
 285   assert_at_safepoint();
 286   size_t idx = Atomic::fetch_and_add(&_num_root_regions, 1u);
 287   assert(idx < _max_regions, "Trying to add more root MemRegions than there is space " SIZE_FORMAT, _max_regions);
 288   assert(start != NULL && end != NULL && start <= end, "Start (" PTR_FORMAT ") should be less or equal to "
 289          "end (" PTR_FORMAT ")", p2i(start), p2i(end));
 290   _root_regions[idx].set_start(start);
 291   _root_regions[idx].set_end(end);
 292 }
 293 




 251 
 252   add_chunk_to_free_list(cur);
 253   return true;
 254 }
 255 
 256 void G1CMMarkStack::set_empty() {
 257   _chunks_in_chunk_list = 0;
 258   _hwm = 0;
 259   _chunk_list = NULL;
 260   _free_list = NULL;
 261 }
 262 
 263 G1CMRootMemRegions::G1CMRootMemRegions(uint const max_regions) :
 264     _root_regions(NULL),
 265     _max_regions(max_regions),
 266     _num_root_regions(0),
 267     _claimed_root_regions(0),
 268     _scan_in_progress(false),
 269     _should_abort(false) {
 270   _root_regions = new MemRegion[_max_regions];



 271 }
 272 
 273 G1CMRootMemRegions::~G1CMRootMemRegions() {
 274   delete[] _root_regions;
 275 }
 276 
 277 void G1CMRootMemRegions::reset() {
 278   _num_root_regions = 0;
 279 }
 280 
 281 void G1CMRootMemRegions::add(HeapWord* start, HeapWord* end) {
 282   assert_at_safepoint();
 283   size_t idx = Atomic::fetch_and_add(&_num_root_regions, 1u);
 284   assert(idx < _max_regions, "Trying to add more root MemRegions than there is space " SIZE_FORMAT, _max_regions);
 285   assert(start != NULL && end != NULL && start <= end, "Start (" PTR_FORMAT ") should be less or equal to "
 286          "end (" PTR_FORMAT ")", p2i(start), p2i(end));
 287   _root_regions[idx].set_start(start);
 288   _root_regions[idx].set_end(end);
 289 }
 290 


< prev index next >