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

Unified Diff: src/heap/mark-compact.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 | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index ac595e6f5fb8d7b800dc22248d61549718e890d1..b55ed634dbb6984d88fbb93de2bad1db727bcf91 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2550,6 +2550,11 @@ void MarkCompactCollector::ClearWeakCollections() {
table->RemoveEntry(i);
}
}
+ // Rehash if more than 25% of the entries are deleted entries.
+ if ((table->NumberOfDeletedElements() << 1) > table->NumberOfElements()) {
Hannes Payer (out of office) 2016/04/15 08:20:11 Can you make that a constant?
jochen (gone - plz use gerrit) 2016/04/15 08:21:28 which one do you propose?
+ HandleScope scope(heap()->isolate());
+ table->Rehash(heap()->isolate()->factory()->undefined_value());
+ }
}
weak_collection_obj = weak_collection->next();
weak_collection->set_next(heap()->undefined_value());
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698