< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp

Print this page

 51   }
 52   delete _task_queues;
 53 }
 54 
 55 bool ShenandoahMarkingContext::is_bitmap_clear() const {
 56   ShenandoahHeap* heap = ShenandoahHeap::heap();
 57   size_t num_regions = heap->num_regions();
 58   for (size_t idx = 0; idx < num_regions; idx++) {
 59     ShenandoahHeapRegion* r = heap->get_region(idx);
 60     if (heap->is_bitmap_slice_committed(r) && !is_bitmap_clear_range(r->bottom(), r->end())) {
 61       return false;
 62     }
 63   }
 64   return true;
 65 }
 66 
 67 bool ShenandoahMarkingContext::is_bitmap_clear_range(HeapWord* start, HeapWord* end) const {
 68   return _mark_bit_map.get_next_marked_addr(start, end) == end;
 69 }
 70 




 71 void ShenandoahMarkingContext::initialize_top_at_mark_start(ShenandoahHeapRegion* r) {
 72   size_t idx = r->index();
 73   HeapWord *bottom = r->bottom();
 74   _top_at_mark_starts_base[idx] = bottom;
 75   _top_bitmaps[idx] = bottom;
 76 }
 77 
 78 void ShenandoahMarkingContext::clear_bitmap(ShenandoahHeapRegion* r) {
 79   HeapWord* bottom = r->bottom();
 80   HeapWord* top_bitmap = _top_bitmaps[r->index()];
 81   if (top_bitmap > bottom) {
 82     _mark_bit_map.clear_range_large(MemRegion(bottom, top_bitmap));
 83     _top_bitmaps[r->index()] = bottom;
 84   }
 85   assert(is_bitmap_clear_range(bottom, r->end()),
 86          "Region " SIZE_FORMAT " should have no marks in bitmap", r->index());
 87 }
 88 
 89 bool ShenandoahMarkingContext::is_complete() {
 90   return _is_complete.is_set();

 51   }
 52   delete _task_queues;
 53 }
 54 
 55 bool ShenandoahMarkingContext::is_bitmap_clear() const {
 56   ShenandoahHeap* heap = ShenandoahHeap::heap();
 57   size_t num_regions = heap->num_regions();
 58   for (size_t idx = 0; idx < num_regions; idx++) {
 59     ShenandoahHeapRegion* r = heap->get_region(idx);
 60     if (heap->is_bitmap_slice_committed(r) && !is_bitmap_clear_range(r->bottom(), r->end())) {
 61       return false;
 62     }
 63   }
 64   return true;
 65 }
 66 
 67 bool ShenandoahMarkingContext::is_bitmap_clear_range(HeapWord* start, HeapWord* end) const {
 68   return _mark_bit_map.get_next_marked_addr(start, end) == end;
 69 }
 70 
 71 size_t ShenandoahMarkingContext::count_marked(MemRegion mr) const {
 72   return _mark_bit_map.count_marked(mr);
 73 }
 74 
 75 void ShenandoahMarkingContext::initialize_top_at_mark_start(ShenandoahHeapRegion* r) {
 76   size_t idx = r->index();
 77   HeapWord *bottom = r->bottom();
 78   _top_at_mark_starts_base[idx] = bottom;
 79   _top_bitmaps[idx] = bottom;
 80 }
 81 
 82 void ShenandoahMarkingContext::clear_bitmap(ShenandoahHeapRegion* r) {
 83   HeapWord* bottom = r->bottom();
 84   HeapWord* top_bitmap = _top_bitmaps[r->index()];
 85   if (top_bitmap > bottom) {
 86     _mark_bit_map.clear_range_large(MemRegion(bottom, top_bitmap));
 87     _top_bitmaps[r->index()] = bottom;
 88   }
 89   assert(is_bitmap_clear_range(bottom, r->end()),
 90          "Region " SIZE_FORMAT " should have no marks in bitmap", r->index());
 91 }
 92 
 93 bool ShenandoahMarkingContext::is_complete() {
 94   return _is_complete.is_set();
< prev index next >