Index: src/incremental-marking.cc |
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc |
index f4ea1005796f301d1a71ece00e86b1032e5e3d99..d9725244a804aa3c1f6881ed5e2e1b39199a6f66 100644 |
--- a/src/incremental-marking.cc |
+++ b/src/incremental-marking.cc |
@@ -453,6 +453,19 @@ void IncrementalMarking::StartMarking() { |
MarkObjectGreyDoNotEnqueue(heap_->polymorphic_code_cache()); |
} |
+ if (is_compacting_) { |
+ // It's difficult to filter out slots recorded for large objects. |
+ LargeObjectIterator it(heap_->lo_space()); |
+ for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { |
+ if (obj->IsFixedArray() || obj->IsCode()) { |
+ Page* p = Page::FromAddress(obj->address()); |
+ if (p->size() > static_cast<size_t>(Page::kPageSize)) { |
+ p->SetFlag(Page::RESCAN_ON_EVACUATION); |
+ } |
+ } |
+ } |
+ } |
+ |
// Mark strong roots grey. |
IncrementalMarkingRootMarkingVisitor visitor(heap_, this); |
heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); |
@@ -605,6 +618,16 @@ void IncrementalMarking::Abort() { |
PatchIncrementalMarkingRecordWriteStubs(heap_, |
RecordWriteStub::STORE_BUFFER_ONLY); |
DeactivateIncrementalWriteBarrier(); |
+ |
+ if (is_compacting_) { |
+ LargeObjectIterator it(heap_->lo_space()); |
+ for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { |
+ Page* p = Page::FromAddress(obj->address()); |
+ if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION)) { |
+ p->ClearFlag(Page::RESCAN_ON_EVACUATION); |
+ } |
+ } |
+ } |
} |
heap_->isolate()->stack_guard()->Continue(GC_REQUEST); |
state_ = STOPPED; |