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

Unified Diff: src/keys.h

Issue 2169523002: [keys] Postpone shadowed key checking in the KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: typo Created 4 years, 5 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/elements.cc ('k') | src/keys.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/keys.h
diff --git a/src/keys.h b/src/keys.h
index ecd3d97c550cf5a8aa80f2aa312c18d1001115ca..045fe97536f1d58caafcb35d6ec89289ea8dce49 100644
--- a/src/keys.h
+++ b/src/keys.h
@@ -83,8 +83,8 @@ class KeyAccumulator final BASE_EMBEDDED {
}
// Shadowing keys are used to filter keys. This happens when non-enumerable
// keys appear again on the prototype chain.
- void AddShadowKey(Object* key);
- void AddShadowKey(Handle<Object> key);
+ void AddShadowingKey(Object* key);
+ void AddShadowingKey(Handle<Object> key);
private:
Maybe<bool> CollectOwnKeys(Handle<JSReceiver> receiver,
@@ -96,6 +96,7 @@ class KeyAccumulator final BASE_EMBEDDED {
Maybe<bool> AddKeysFromJSProxy(Handle<JSProxy> proxy,
Handle<FixedArray> keys);
bool IsShadowed(Handle<Object> key);
+ bool HasShadowingKeys();
Handle<OrderedHashSet> keys() { return Handle<OrderedHashSet>::cast(keys_); }
Isolate* isolate_;
@@ -104,12 +105,15 @@ class KeyAccumulator final BASE_EMBEDDED {
// result list, a FixedArray containing all collected keys.
Handle<FixedArray> keys_;
Handle<JSReceiver> last_non_empty_prototype_;
- Handle<ObjectHashSet> shadowed_keys_;
+ Handle<ObjectHashSet> shadowing_keys_;
KeyCollectionMode mode_;
PropertyFilter filter_;
bool filter_proxy_keys_ = true;
bool is_for_in_ = false;
bool skip_indices_ = false;
+ // For all the keys on the first receiver adding a shadowing key we can skip
+ // the shadow check.
+ bool skip_shadow_check_ = true;
DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
};
« no previous file with comments | « src/elements.cc ('k') | src/keys.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698