Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 3b36ef548f2c0e704639e47971d4ce95314f037b..c53c9a75ec71ee5ae6ce36e8588c9e1a2b2c5dc4 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -4208,6 +4208,8 @@ STRUCT_LIST(MAKE_CASE) |
bool Heap::IsHeapIterable() { |
+ // TODO(hpayer): This function is not correct. Allocation folding in old |
+ // space breaks the iterability. |
return (old_pointer_space()->swept_precisely() && |
old_data_space()->swept_precisely() && |
new_space_top_after_last_gc_ == new_space()->top()); |
@@ -4219,6 +4221,9 @@ void Heap::MakeHeapIterable() { |
if (!IsHeapIterable()) { |
CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable"); |
} |
+ if (mark_compact_collector()->sweeping_in_progress()) { |
+ mark_compact_collector()->EnsureSweepingCompleted(); |
+ } |
ASSERT(IsHeapIterable()); |
} |