< prev index next >

src/share/vm/gc/shenandoah/shenandoahMarkCompact.cpp

Print this page
rev 14453 : Remove secondary marking bitmap.

@@ -76,11 +76,11 @@
 
 public:
   ShenandoahClearRegionStatusClosure() : _heap(ShenandoahHeap::heap()) {}
 
   bool heap_region_do(ShenandoahHeapRegion *r) {
-    _heap->set_next_top_at_mark_start(r->bottom(), r->top());
+    _heap->set_top_at_mark_start(r->bottom(), r->top());
     r->clear_live_data();
     r->set_concurrent_iteration_safe_limit(r->top());
     return false;
   }
 };

@@ -145,12 +145,12 @@
         heap->set_evacuation_in_progress_at_safepoint(false);
       }
       assert(!heap->is_evacuation_in_progress(), "sanity");
 
       // c. Reset the bitmaps for new marking
-      heap->reset_next_mark_bitmap(heap->workers());
-      assert(heap->is_next_bitmap_clear(), "sanity");
+      heap->reset_mark_bitmap(heap->workers());
+      assert(heap->is_bitmap_clear(), "sanity");
 
       // d. Abandon reference discovery and clear all discovered references.
       ReferenceProcessor* rp = heap->ref_processor();
       rp->disable_discovery();
       rp->abandon_partial_discovery();

@@ -183,11 +183,11 @@
 
     {
       GCTraceTime(Info, gc) time("Pause Full", _gc_timer, gc_cause, true);
 
       if (UseTLAB) {
-        heap->ensure_parsability(true);
+        heap->make_tlabs_parsable(true);
       }
 
       CodeCache::gc_prologue();
 
       // We should save the marks of the currently locked biased monitors.

@@ -293,12 +293,10 @@
 
   cm->update_roots(ShenandoahPhaseTimings::full_gc_roots);
   cm->mark_roots(ShenandoahPhaseTimings::full_gc_roots);
   cm->shared_finish_mark_from_roots(/* full_gc = */ true);
 
-  _heap->swap_mark_bitmaps();
-
   if (UseShenandoahMatrix && PrintShenandoahMatrix) {
     LogTarget(Info, gc) lt;
     LogStream ls(lt);
     _heap->connection_matrix()->print_on(&ls);
   }

@@ -316,10 +314,11 @@
     // fail. At the end of the GC, the original mark word values
     // (including hash values) are restored to the appropriate
     // objects.
     _heap->verify(VerifyOption_G1UseMarkWord);
   }
+  _heap->set_bitmap_valid(true);
 }
 
 class ShenandoahMCReclaimHumongousRegionClosure : public ShenandoahHeapRegionClosure {
 private:
   ShenandoahHeap* _heap;

@@ -328,11 +327,11 @@
   }
 
   bool heap_region_do(ShenandoahHeapRegion* r) {
     if (r->is_humongous_start()) {
       oop humongous_obj = oop(r->bottom() + BrooksPointer::word_size());
-      if (! _heap->is_marked_complete(humongous_obj)) {
+      if (! _heap->is_marked(humongous_obj)) {
         _heap->trash_humongous_region_at(r);
       }
     }
     return false;
   }

@@ -369,12 +368,12 @@
   HeapWord* compact_point() const {
     return _compact_point;
   }
   void do_object(oop p) {
     assert(_from_region != NULL, "must set before work");
-    assert(_heap->is_marked_complete(p), "must be marked");
-    assert(! _heap->allocated_after_complete_mark_start((HeapWord*) p), "must be truly marked");
+    assert(_heap->is_marked(p), "must be marked");
+    assert(! _heap->allocated_after_mark_start((HeapWord*) p), "must be truly marked");
     size_t obj_size = p->size() + BrooksPointer::word_size();
     if (_compact_point + obj_size > _to_region->end()) {
       // Object doesn't fit. Pick next to-region and start compacting there.
       _to_region->set_new_top(_compact_point);
       ShenandoahHeapRegion* new_to_region = _to_regions->current();

@@ -495,11 +494,11 @@
   template <class T>
   inline void do_oop_work(T* p) {
     T o = oopDesc::load_heap_oop(p);
     if (! oopDesc::is_null(o)) {
       oop obj = oopDesc::decode_heap_oop_not_null(o);
-      assert(_heap->is_marked_complete(obj), "must be marked");
+      assert(_heap->is_marked(obj), "must be marked");
       oop forw = oop(BrooksPointer::get_raw(obj));
       oopDesc::encode_store_heap_oop(p, forw);
       if (UseShenandoahMatrix) {
         if (_heap->is_in_reserved(p)) {
           assert(_heap->is_in_reserved(forw), "must be in heap");

@@ -534,11 +533,11 @@
 public:
   ShenandoahAdjustPointersObjectClosure() :
     _heap(ShenandoahHeap::heap()) {
   }
   void do_object(oop p) {
-    assert(_heap->is_marked_complete(p), "must be marked");
+    assert(_heap->is_marked(p), "must be marked");
     HeapWord* forw = BrooksPointer::get_raw(p);
     _cl.set_new_obj_offset(pointer_delta((HeapWord*) p, forw));
     p->oop_iterate(&_cl);
   }
 };

@@ -625,11 +624,11 @@
 public:
   ShenandoahCompactObjectsClosure(uint worker_id) : _heap(ShenandoahHeap::heap()),
     _str_dedup(ShenandoahStringDedup::is_enabled()), _worker_id(worker_id) {
   }
   void do_object(oop p) {
-    assert(_heap->is_marked_complete(p), "must be marked");
+    assert(_heap->is_marked(p), "must be marked");
     size_t size = (size_t)p->size();
     HeapWord* compact_to = BrooksPointer::get_raw(p);
     HeapWord* compact_from = (HeapWord*) p;
     if (compact_from != compact_to) {
       Copy::aligned_conjoint_words(compact_from, compact_to, size);

@@ -680,14 +679,14 @@
   ShenandoahPostCompactClosure() : _live(0), _heap(ShenandoahHeap::heap()) {
     _heap->clear_free_regions();
   }
 
   bool heap_region_do(ShenandoahHeapRegion* r) {
-    // Need to reset the complete-top-at-mark-start pointer here because
-    // the complete marking bitmap is no longer valid. This ensures
+    // Need to reset the top-at-mark-start pointer here because
+    // the marking bitmap is no longer valid. This ensures
     // size-based iteration in marked_object_iterate().
-    _heap->set_complete_top_at_mark_start(r->bottom(), r->bottom());
+    _heap->set_top_at_mark_start(r->bottom(), r->bottom());
 
     size_t live = r->used();
 
     // Turn any lingering non-empty cset regions into regular regions.
     // This must be the leftover from the cancelled concurrent GC.

@@ -728,13 +727,13 @@
   GCTraceTime(Info, gc, phases) time("Phase 4: Move objects", _gc_timer);
   ShenandoahHeap* heap = ShenandoahHeap::heap();
   ShenandoahCompactObjectsTask compact_task(copy_queues);
   heap->workers()->run_task(&compact_task);
 
-  // Reset complete bitmap. We're about to reset the complete-top-at-mark-start pointer
+  // Reset marking bitmap. We're about to reset the top-at-mark-start pointer
   // and must ensure the bitmap is in sync.
-  heap->reset_complete_mark_bitmap(heap->workers());
+  heap->reset_mark_bitmap(heap->workers());
 
   {
     ShenandoahHeapLocker lock(heap->lock());
     ShenandoahPostCompactClosure post_compact;
     heap->heap_region_iterate(&post_compact);

@@ -743,13 +742,10 @@
   }
 
   heap->collection_set()->clear();
   heap->clear_cancelled_concgc();
 
-  // Also clear the next bitmap in preparation for next marking.
-  heap->reset_next_mark_bitmap(heap->workers());
-
   for (uint i = 0; i < heap->max_workers(); i++) {
     delete copy_queues[i];
   }
 
 }
< prev index next >