Index: src/heap/incremental-marking.cc |
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc |
index e01c50b849a0bb99053fa4f0b57f635280ae755c..b3609e4adcf7db1baa16dde096f9ee48d5290045 100644 |
--- a/src/heap/incremental-marking.cc |
+++ b/src/heap/incremental-marking.cc |
@@ -135,6 +135,16 @@ static void MarkObjectGreyDoNotEnqueue(Object* obj) { |
} |
+static inline void MarkBlackOrKeepGrey(HeapObject* heap_object, |
+ MarkBit mark_bit, int size) { |
+ DCHECK(!Marking::IsImpossible(mark_bit)); |
+ if (mark_bit.Get()) return; |
+ mark_bit.Set(); |
+ MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(), size); |
+ DCHECK(Marking::IsBlack(mark_bit)); |
+} |
+ |
+ |
static inline void MarkBlackOrKeepBlack(HeapObject* heap_object, |
MarkBit mark_bit, int size) { |
DCHECK(!Marking::IsImpossible(mark_bit)); |
@@ -346,7 +356,8 @@ void IncrementalMarking::DeactivateIncrementalWriteBarrierForSpace( |
void IncrementalMarking::DeactivateIncrementalWriteBarrier() { |
- DeactivateIncrementalWriteBarrierForSpace(heap_->old_space()); |
+ DeactivateIncrementalWriteBarrierForSpace(heap_->old_pointer_space()); |
+ DeactivateIncrementalWriteBarrierForSpace(heap_->old_data_space()); |
DeactivateIncrementalWriteBarrierForSpace(heap_->cell_space()); |
DeactivateIncrementalWriteBarrierForSpace(heap_->map_space()); |
DeactivateIncrementalWriteBarrierForSpace(heap_->code_space()); |
@@ -379,7 +390,8 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier(NewSpace* space) { |
void IncrementalMarking::ActivateIncrementalWriteBarrier() { |
- ActivateIncrementalWriteBarrier(heap_->old_space()); |
+ ActivateIncrementalWriteBarrier(heap_->old_pointer_space()); |
+ ActivateIncrementalWriteBarrier(heap_->old_data_space()); |
ActivateIncrementalWriteBarrier(heap_->cell_space()); |
ActivateIncrementalWriteBarrier(heap_->map_space()); |
ActivateIncrementalWriteBarrier(heap_->code_space()); |
@@ -642,7 +654,9 @@ void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) { |
void IncrementalMarking::MarkObject(Heap* heap, HeapObject* obj) { |
MarkBit mark_bit = Marking::MarkBitFrom(obj); |
- if (Marking::IsWhite(mark_bit)) { |
+ if (mark_bit.data_only()) { |
+ MarkBlackOrKeepGrey(obj, mark_bit, obj->Size()); |
+ } else if (Marking::IsWhite(mark_bit)) { |
heap->incremental_marking()->WhiteToGreyAndPush(obj, mark_bit); |
} |
} |