Each space has its own bitmap(s)
Each alloc space now has One mark+live bitmap. Each image space has only one live bitmap.
Change-Id: I2e919d1bd7d9f4d35d0e95ed83a58df6f754df6e
diff --git a/src/mark_sweep.h b/src/mark_sweep.h
index 00fdcfb..28a5523 100644
--- a/src/mark_sweep.h
+++ b/src/mark_sweep.h
@@ -83,7 +83,10 @@
private:
// Returns true if the object has its bit set in the mark bitmap.
bool IsMarked(const Object* object) const {
- return mark_bitmap_->Test(object);
+ if (current_mark_bitmap_->HasAddress(object)) {
+ return current_mark_bitmap_->Test(object);
+ }
+ return heap_->GetMarkBitmap()->Test(object);
}
static bool IsMarked(const Object* object, void* arg) {
@@ -246,11 +249,12 @@
void SweepSystemWeaks();
void SweepJniWeakGlobals();
+ // Current space, we check this space first to avoid searching for the appropriate space for an object.
+ SpaceBitmap* current_mark_bitmap_;
+
MarkStack* mark_stack_;
Heap* heap_;
- HeapBitmap* mark_bitmap_;
- HeapBitmap* live_bitmap_;
Object* finger_;