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

Unified Diff: src/key-accumulator.h

Issue 1608523002: [runtime] Do not use the enum-cache for non-prototype objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: signed unsigned missmatch Created 4 years, 11 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/key-accumulator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/key-accumulator.h
diff --git a/src/key-accumulator.h b/src/key-accumulator.h
index 8a4d886f515db441e1a8346daf4f0442e1a1dc03..fa39c1996dd803580ffbfa7ccd81d6e7ac6a8702 100644
--- a/src/key-accumulator.h
+++ b/src/key-accumulator.h
@@ -5,6 +5,8 @@
#ifndef V8_KEY_ACCUMULATOR_H_
#define V8_KEY_ACCUMULATOR_H_
+#include <set>
+
#include "src/isolate.h"
#include "src/objects.h"
@@ -45,6 +47,10 @@ class KeyAccumulator final BASE_EMBEDDED {
void AddKeysFromProxy(Handle<JSObject> array);
Maybe<bool> AddKeysFromProxy(Handle<JSProxy> proxy, Handle<FixedArray> keys);
void AddElementKeysFromInterceptor(Handle<JSObject> array);
+ void HideKey(uint32_t key);
+ void HideKey(Object* key);
+ void HideKey(Handle<Object> key);
+ void Prepare();
// Jump to the next level, pushing the current |levelLength_| to
// |levelLengths_| and adding a new list to |elements_|.
void NextPrototype();
@@ -59,6 +65,8 @@ class KeyAccumulator final BASE_EMBEDDED {
bool AddStringKey(Handle<Object> key, AddKeyConversion convert);
bool AddSymbolKey(Handle<Object> array);
void SortCurrentElementsListRemoveDuplicates();
+ bool IsKeyHidden(Handle<Object> key);
+ bool IsKeyHidden(uint32_t key);
Isolate* isolate_;
PropertyFilter filter_;
@@ -73,6 +81,11 @@ class KeyAccumulator final BASE_EMBEDDED {
// |symbol_properties_| contains the unique Symbol property keys for all
// levels in insertion order per level.
Handle<OrderedHashSet> symbol_properties_;
+ // |hidden_keys_| keeps track of the non-enumerable property keys to prevent
+ // them from being added to the accumulator if they reappear higher up in the
+ // prototype-chain.
+ Handle<OrderedHashSet> hidden_keys_;
+ std::set<uint32_t> hidden_element_keys_;
// |length_| keeps track of the total number of all element and property keys.
int length_ = 0;
// |levelLength_| keeps track of the number of String keys in the current
« no previous file with comments | « src/elements.cc ('k') | src/key-accumulator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698