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

Unified Diff: src/objects.cc

Issue 796503002: Create optimized versions of the Map/Set clear method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/objects.h ('k') | src/runtime/runtime.h » ('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 e95ff10a4287445b8088d8fa865fa5c37ef49656..f585a469f9f8398fbfc152b4bf19357de909c2c7 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -15988,7 +15988,7 @@ Handle<Derived> OrderedHashTable<Derived, Iterator, entrysize>::Clear(
table->GetHeap()->InNewSpace(*table) ? NOT_TENURED : TENURED);
table->SetNextTable(*new_table);
- table->SetNumberOfDeletedElements(-1);
+ table->SetNumberOfDeletedElements(kClearedTableSentinel);
return new_table;
}
@@ -16233,8 +16233,7 @@ void OrderedHashTableIterator<Derived, TableType>::Transition() {
if (index > 0) {
int nod = table->NumberOfDeletedElements();
- // When we clear the table we set the number of deleted elements to -1.
- if (nod == -1) {
+ if (nod == TableType::kClearedTableSentinel) {
index = 0;
} else {
int old_index = index;
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698