< prev index next >

src/share/vm/gc/g1/g1AllocRegion.cpp

Print this page




 236 G1AllocRegion::G1AllocRegion(const char* name,
 237                              bool bot_updates)
 238   : _name(name), _bot_updates(bot_updates),
 239     _alloc_region(NULL), _count(0), _used_bytes_before(0),
 240     _allocation_context(AllocationContext::system()) { }
 241 
 242 
 243 HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size,
 244                                                     bool force) {
 245   return _g1h->new_mutator_alloc_region(word_size, force);
 246 }
 247 
 248 void MutatorAllocRegion::retire_region(HeapRegion* alloc_region,
 249                                        size_t allocated_bytes) {
 250   _g1h->retire_mutator_alloc_region(alloc_region, allocated_bytes);
 251 }
 252 
 253 HeapRegion* G1GCAllocRegion::allocate_new_region(size_t word_size,
 254                                                  bool force) {
 255   assert(!force, "not supported for GC alloc regions");
 256   return _g1h->new_gc_alloc_region(word_size, count(), _purpose);
 257 }
 258 
 259 void G1GCAllocRegion::retire_region(HeapRegion* alloc_region,
 260                                     size_t allocated_bytes) {
 261   _g1h->retire_gc_alloc_region(alloc_region, allocated_bytes, _purpose);
 262 }
 263 
 264 size_t G1GCAllocRegion::retire(bool fill_up) {
 265   HeapRegion* retired = get();
 266   size_t end_waste = G1AllocRegion::retire(fill_up);
 267   // Do not count retirement of the dummy allocation region.
 268   if (retired != NULL) {
 269     _stats->add_region_end_waste(end_waste / HeapWordSize);
 270   }
 271   return end_waste;
 272 }
 273 
 274 HeapRegion* OldGCAllocRegion::release() {
 275   HeapRegion* cur = get();
 276   if (cur != NULL) {




 236 G1AllocRegion::G1AllocRegion(const char* name,
 237                              bool bot_updates)
 238   : _name(name), _bot_updates(bot_updates),
 239     _alloc_region(NULL), _count(0), _used_bytes_before(0),
 240     _allocation_context(AllocationContext::system()) { }
 241 
 242 
 243 HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size,
 244                                                     bool force) {
 245   return _g1h->new_mutator_alloc_region(word_size, force);
 246 }
 247 
 248 void MutatorAllocRegion::retire_region(HeapRegion* alloc_region,
 249                                        size_t allocated_bytes) {
 250   _g1h->retire_mutator_alloc_region(alloc_region, allocated_bytes);
 251 }
 252 
 253 HeapRegion* G1GCAllocRegion::allocate_new_region(size_t word_size,
 254                                                  bool force) {
 255   assert(!force, "not supported for GC alloc regions");
 256   return _g1h->new_gc_alloc_region(word_size, _purpose);
 257 }
 258 
 259 void G1GCAllocRegion::retire_region(HeapRegion* alloc_region,
 260                                     size_t allocated_bytes) {
 261   _g1h->retire_gc_alloc_region(alloc_region, allocated_bytes, _purpose);
 262 }
 263 
 264 size_t G1GCAllocRegion::retire(bool fill_up) {
 265   HeapRegion* retired = get();
 266   size_t end_waste = G1AllocRegion::retire(fill_up);
 267   // Do not count retirement of the dummy allocation region.
 268   if (retired != NULL) {
 269     _stats->add_region_end_waste(end_waste / HeapWordSize);
 270   }
 271   return end_waste;
 272 }
 273 
 274 HeapRegion* OldGCAllocRegion::release() {
 275   HeapRegion* cur = get();
 276   if (cur != NULL) {


< prev index next >