Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index e73127f75b99907f00091eb6f9ae2a1d798dfc67..bfeeae9efc04531b39c0577fbc23d8b3cf07e81c 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -2724,7 +2724,21 @@ void MarkCompactCollector::MigrateObject(Address dst, |
HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst)); |
// TODO(hpayer): Replace that check with an assert. |
CHECK(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); |
+ // Objects in old pointer space and old data space can just be moved by |
+ // compaction to a different page in the same space. |
+ // TODO(hpayer): Replace that following checks with asserts. |
+ CHECK(!heap_->old_pointer_space()->Contains(src) || |
+ (heap_->old_pointer_space()->Contains(dst) && |
+ heap_->TargetSpace(HeapObject::FromAddress(src)) == |
+ heap_->old_pointer_space())); |
+ CHECK(!heap_->old_data_space()->Contains(src) || |
+ (heap_->old_data_space()->Contains(dst) && |
+ heap_->TargetSpace(HeapObject::FromAddress(src)) == |
+ heap_->old_data_space())); |
if (dest == OLD_POINTER_SPACE) { |
+ // TODO(hpayer): Replace this check with an assert. |
+ CHECK(heap_->TargetSpace(HeapObject::FromAddress(src)) == |
+ heap_->old_pointer_space()); |
Address src_slot = src; |
Address dst_slot = dst; |
ASSERT(IsAligned(size, kPointerSize)); |