Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 84d383bfa2cc056611f40382f43cc64131fd5d2e..cf23b1bf066e75f21f9fb42f20a56ed4d1408d9f 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -141,7 +141,8 @@ Heap::Heap() |
chunks_queued_for_free_(NULL), |
gc_callbacks_depth_(0), |
deserialization_complete_(false), |
- concurrent_sweeping_enabled_(false) { |
+ concurrent_sweeping_enabled_(false), |
+ strong_roots_list_(NULL) { |
// Allow build-time customization of the max semispace size. Building |
// V8 with snapshots and a non-default max semispace size is much |
// easier if you can define it as part of the build environment. |
@@ -4998,6 +4999,9 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) { |
// output a flag to the snapshot. However at this point the serializer and |
// deserializer are deliberately a little unsynchronized (see above) so the |
// checking of the sync flag in the snapshot would fail. |
+ for (StrongRootsList* list = strong_roots_list_; list; list = list->next_) { |
+ v->VisitPointers(list->start_, list->end_); |
+ } |
} |
@@ -5488,6 +5492,13 @@ void Heap::TearDown() { |
store_buffer()->TearDown(); |
isolate_->memory_allocator()->TearDown(); |
+ |
+ StrongRootsList* next = NULL; |
+ for (StrongRootsList* list = strong_roots_list_; list; list = next) { |
+ next = list->next_; |
+ delete list; |
+ } |
+ strong_roots_list_ = NULL; |
} |