Index: src/heap/incremental-marking.cc |
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc |
index e5c65705c9726b7245eb3361af4566df77e68c20..abd6f7c47c2d5aa61304417e35128dc57f60e0cc 100644 |
--- a/src/heap/incremental-marking.cc |
+++ b/src/heap/incremental-marking.cc |
@@ -821,7 +821,23 @@ void IncrementalMarking::UpdateMarkingDequeAfterScavenge() { |
(obj->IsFiller() && |
ObjectMarking::IsWhite<kAtomicity>(obj, marking_state(obj)))); |
return dest; |
+ } else if (heap_->InToSpace(obj)) { |
+ // The object may be on a page that was moved in new space. |
+ DCHECK( |
+ Page::FromAddress(obj->address())->IsFlagSet(Page::SWEEP_TO_ITERATE)); |
+ return ObjectMarking::IsBlack<kAtomicity>(obj, |
+ MarkingState::External(obj)) |
+ ? obj |
+ : nullptr; |
} else { |
+ // The object may be on a page that was moved from new to old space. |
+ if (Page::FromAddress(obj->address()) |
+ ->IsFlagSet(Page::SWEEP_TO_ITERATE)) { |
+ return ObjectMarking::IsBlack<kAtomicity>(obj, |
+ MarkingState::External(obj)) |
+ ? obj |
+ : nullptr; |
+ } |
DCHECK(ObjectMarking::IsGrey<kAtomicity>(obj, marking_state(obj)) || |
(obj->IsFiller() && |
ObjectMarking::IsWhite<kAtomicity>(obj, marking_state(obj))) || |