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

Unified Diff: src/objects.cc

Issue 1877233005: Rehash and clear deleted entries in weak collections during GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 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
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 8254ee7e9efcab696058f80d976d832c5bb27f9e..80cfd03060cbf05b2ea3ca712aebdb5a00d38b0a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16857,6 +16857,16 @@ void HashTable<Derived, Shape, Key>::Rehash(Key key) {
}
}
}
+ // Wipe deleted entries.
+ Heap* heap = GetHeap();
+ Object* the_hole = heap->the_hole_value();
+ Object* undefined = heap->undefined_value();
+ for (uint32_t current = 0; current < capacity; current++) {
+ if (get(EntryToIndex(current)) == the_hole) {
+ set(EntryToIndex(current), undefined);
+ }
+ }
+ SetNumberOfDeletedElements(0);
}
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698