Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: src/heap/heap.cc

Issue 1105693002: Implement IdentityMap<V>, a robust, GC-safe object-identity HashMap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/identity-map.h » ('j') | src/heap/identity-map.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698