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

Unified Diff: src/elements.cc

Issue 2081733002: [keys] support shadowing keys in the KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebasing Created 4 years, 6 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/keys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index d7e49cdcb9350b6f17c28882fc6c0aa6f57d12b4..3cf8378162844a1fc00525e3ccacdb6f47406ac5 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1323,10 +1323,14 @@ class DictionaryElementsAccessor
int insertion_index = 0;
PropertyFilter filter = keys->filter();
for (int i = 0; i < capacity; i++) {
- uint32_t key = GetKeyForEntryImpl(isolate, dictionary, i, filter);
- if (key == kMaxUInt32) continue;
- Handle<Object> key_handle = isolate->factory()->NewNumberFromUint(key);
- elements->set(insertion_index, *key_handle);
+ Object* raw_key = dictionary->KeyAt(i);
+ if (!dictionary->IsKey(isolate, raw_key)) continue;
+ uint32_t key = FilterKey(dictionary, i, raw_key, filter);
+ if (key == kMaxUInt32) {
+ keys->AddShadowKey(raw_key);
+ continue;
+ }
+ elements->set(insertion_index, raw_key);
insertion_index++;
}
SortIndices(elements, insertion_index);
« no previous file with comments | « no previous file | src/keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698