Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 812fec127ad34973d6d2a0115fc51e98a9cbab72..fb0a7bba652fe3523e8b8f8f0526a9bb5586bdc6 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -1950,6 +1950,19 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* source, |
HeapObject* target, |
int size)) { |
+ // If we migrate into to-space, then the to-space top pointer should be |
+ // right after the target object. Incorporate double alignment |
+ // over-allocation. |
+ ASSERT(!heap->InToSpace(target) || |
+ target->address() + size == heap->new_space()->top() || |
+ target->address() + size + kPointerSize == heap->new_space()->top()); |
+ |
+ // Make sure that we do not overwrite the promotion queue which is at |
+ // the end of to-space. |
+ ASSERT(!heap->InToSpace(target) || |
+ heap->promotion_queue()->IsBelowPromotionQueue( |
+ heap->new_space()->top())); |
+ |
// Copy the content of source to target. |
heap->CopyBlock(target->address(), source->address(), size); |