| Index: src/heap/spaces.cc
|
| diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
|
| index 4d726eee5af31efca0749cc4207c2935cca99d4c..c8415f4c72578ce4d99b509c806bef7d381b85ec 100644
|
| --- a/src/heap/spaces.cc
|
| +++ b/src/heap/spaces.cc
|
| @@ -1144,6 +1144,16 @@ bool PagedSpace::Expand() {
|
| // Pages created during bootstrapping may contain immortal immovable objects.
|
| if (!heap()->deserialization_complete()) p->MarkNeverEvacuate();
|
|
|
| + // When incremental marking was activated, old generation pages are allocated
|
| + // black.
|
| + if (heap()->incremental_marking()->black_allocation()) {
|
| + Bitmap::SetAllBits(p);
|
| + p->SetFlag(Page::BLACK_PAGE);
|
| + if (FLAG_trace_incremental_marking) {
|
| + PrintIsolate(heap()->isolate(), "Added black page %p\n", p);
|
| + }
|
| + }
|
| +
|
| DCHECK(Capacity() <= heap()->MaxOldGenerationSize());
|
|
|
| p->InsertAfter(anchor_.prev_page());
|
| @@ -1250,7 +1260,8 @@ void PagedSpace::Verify(ObjectVisitor* visitor) {
|
| // All the interior pointers should be contained in the heap.
|
| int size = object->Size();
|
| object->IterateBody(map->instance_type(), size, visitor);
|
| - if (Marking::IsBlack(Marking::MarkBitFrom(object))) {
|
| + if (!page->IsFlagSet(Page::BLACK_PAGE) &&
|
| + Marking::IsBlack(Marking::MarkBitFrom(object))) {
|
| black_size += size;
|
| }
|
|
|
| @@ -3002,7 +3013,11 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
|
| }
|
|
|
| HeapObject* object = page->GetObject();
|
| -
|
| + if (heap()->incremental_marking()->black_allocation()) {
|
| + MarkBit mark_bit = Marking::MarkBitFrom(object);
|
| + Marking::MarkBlack(mark_bit);
|
| + page->SetFlag(Page::BLACK_PAGE);
|
| + }
|
| MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), object_size);
|
|
|
| if (Heap::ShouldZapGarbage()) {
|
|
|