Persistent bitmap for region space

Fix bug where region space was not safely walkable due to holes
in the unevac regions possibly having dangling class pointers.

No preformance change, RAM overhead 1.1-1.2% .Heap (non LOS).

Test: test-art-host
Test: https://android-review.googlesource.com/#/c/288907/

Bug: 31522820

Change-Id: Ic4f8b7175e117689cb1ce3e28b082cf63f1f7b5a
diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index 1931caf..13af67e 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -170,10 +170,10 @@
       CHECK(space->IsZygoteSpace() || space->IsImageSpace());
       immune_spaces_.AddSpace(space);
     } else if (space == region_space_) {
-      accounting::ContinuousSpaceBitmap* bitmap =
-          accounting::ContinuousSpaceBitmap::Create("cc region space bitmap",
-                                                    space->Begin(), space->Capacity());
-      region_space_bitmap_ = bitmap;
+      // It is OK to clear the bitmap with mutators running since the only place it is read is
+      // VisitObjects which has exclusion with CC.
+      region_space_bitmap_ = region_space_->GetMarkBitmap();
+      region_space_bitmap_->Clear();
     }
   }
 }
@@ -1601,9 +1601,8 @@
     SwapBitmaps();
     heap_->UnBindBitmaps();
 
-    // Delete the region bitmap.
+    // The bitmap was cleared at the start of the GC, there is nothing we need to do here.
     DCHECK(region_space_bitmap_ != nullptr);
-    delete region_space_bitmap_;
     region_space_bitmap_ = nullptr;
   }