Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 623ec31e20fca8169ba724e5be33a5f736511a34..450c1c3e7f4540c3944f7755bf6e240aca0e2995 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -2088,10 +2088,13 @@ class ScavengingVisitor : public StaticVisitorBase { |
MaybeObject* maybe_result; |
if (object_contents == DATA_OBJECT) { |
+ // TODO(mstarzinger): Turn this check into a regular assert soon! |
+ CHECK(heap->AllowedToBeMigrated(object, OLD_DATA_SPACE)); |
maybe_result = heap->old_data_space()->AllocateRaw(allocation_size); |
} else { |
- maybe_result = |
- heap->old_pointer_space()->AllocateRaw(allocation_size); |
+ // TODO(mstarzinger): Turn this check into a regular assert soon! |
+ CHECK(heap->AllowedToBeMigrated(object, OLD_POINTER_SPACE)); |
+ maybe_result = heap->old_pointer_space()->AllocateRaw(allocation_size); |
} |
Object* result = NULL; // Initialization to please compiler. |
@@ -2121,6 +2124,8 @@ class ScavengingVisitor : public StaticVisitorBase { |
return; |
} |
} |
+ // TODO(mstarzinger): Turn this check into a regular assert soon! |
+ CHECK(heap->AllowedToBeMigrated(object, NEW_SPACE)); |
MaybeObject* allocation = heap->new_space()->AllocateRaw(allocation_size); |
heap->promotion_queue()->SetNewLimit(heap->new_space()->top()); |
Object* result = allocation->ToObjectUnchecked(); |