< prev index next >

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

Print this page
rev 52719 : [mq]: 8159440-marking-of-promoted-objects-to-concurrent


  67 
  68   // We will discard the current GC alloc region if:
  69   // a) it's in the collection set (it can happen!),
  70   // b) it's already full (no point in using it),
  71   // c) it's empty (this means that it was emptied during
  72   // a cleanup and it should be on the free list now), or
  73   // d) it's humongous (this means that it was emptied
  74   // during a cleanup and was added to the free list, but
  75   // has been subsequently used to allocate a humongous
  76   // object that may be less than the region size).
  77   if (retained_region != NULL &&
  78       !retained_region->in_collection_set() &&
  79       !(retained_region->top() == retained_region->end()) &&
  80       !retained_region->is_empty() &&
  81       !retained_region->is_humongous()) {
  82     // The retained region was added to the old region set when it was
  83     // retired. We have to remove it now, since we don't allow regions
  84     // we allocate to in the region sets. We'll re-add it later, when
  85     // it's retired again.
  86     _g1h->old_set_remove(retained_region);
  87     bool during_im = _g1h->collector_state()->in_initial_mark_gc();
  88     retained_region->note_start_of_copying(during_im);
  89     old->set(retained_region);
  90     _g1h->hr_printer()->reuse(retained_region);
  91     evacuation_info.set_alloc_regions_used_before(retained_region->used());
  92   }
  93 }
  94 
  95 void G1Allocator::init_gc_alloc_regions(EvacuationInfo& evacuation_info) {
  96   assert_at_safepoint_on_vm_thread();
  97 
  98   _survivor_is_full = false;
  99   _old_is_full = false;
 100 
 101   _survivor_gc_alloc_region.init();
 102   _old_gc_alloc_region.init();
 103   reuse_retained_old_region(evacuation_info,
 104                             &_old_gc_alloc_region,
 105                             &_retained_old_gc_alloc_region);
 106 }
 107 
 108 void G1Allocator::release_gc_alloc_regions(EvacuationInfo& evacuation_info) {




  67 
  68   // We will discard the current GC alloc region if:
  69   // a) it's in the collection set (it can happen!),
  70   // b) it's already full (no point in using it),
  71   // c) it's empty (this means that it was emptied during
  72   // a cleanup and it should be on the free list now), or
  73   // d) it's humongous (this means that it was emptied
  74   // during a cleanup and was added to the free list, but
  75   // has been subsequently used to allocate a humongous
  76   // object that may be less than the region size).
  77   if (retained_region != NULL &&
  78       !retained_region->in_collection_set() &&
  79       !(retained_region->top() == retained_region->end()) &&
  80       !retained_region->is_empty() &&
  81       !retained_region->is_humongous()) {
  82     // The retained region was added to the old region set when it was
  83     // retired. We have to remove it now, since we don't allow regions
  84     // we allocate to in the region sets. We'll re-add it later, when
  85     // it's retired again.
  86     _g1h->old_set_remove(retained_region);


  87     old->set(retained_region);
  88     _g1h->hr_printer()->reuse(retained_region);
  89     evacuation_info.set_alloc_regions_used_before(retained_region->used());
  90   }
  91 }
  92 
  93 void G1Allocator::init_gc_alloc_regions(EvacuationInfo& evacuation_info) {
  94   assert_at_safepoint_on_vm_thread();
  95 
  96   _survivor_is_full = false;
  97   _old_is_full = false;
  98 
  99   _survivor_gc_alloc_region.init();
 100   _old_gc_alloc_region.init();
 101   reuse_retained_old_region(evacuation_info,
 102                             &_old_gc_alloc_region,
 103                             &_retained_old_gc_alloc_region);
 104 }
 105 
 106 void G1Allocator::release_gc_alloc_regions(EvacuationInfo& evacuation_info) {


< prev index next >