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

Unified Diff: src/objects.h

Issue 1409073005: [runtime] use std::vector in KeyAccumulator (Closed)
Patch Set: only check all levels when adding elements from iterceptors Created 5 years, 2 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') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 2f529a730eb1c8151ca4ddd236b7bafd1209b7ca..1e0fb942f4e62e5f57bb9809ec3ff12a0ad29405 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -10754,6 +10754,8 @@ class KeyAccumulator final BASE_EMBEDDED {
: isolate_(isolate), filter_(filter), length_(0), levelLength_(0) {}
~KeyAccumulator();
+ enum ElementKeyAddCheckLimit { EXCLUDE_CURRENT_LEVEL, INCLUDE_CURRENT_LEVEL };
+
bool AddKey(uint32_t key);
bool AddKey(Object* key, AddKeyConversion convert = DO_NOT_CONVERT);
bool AddKey(Handle<Object> key, AddKeyConversion convert = DO_NOT_CONVERT);
@@ -10762,6 +10764,7 @@ class KeyAccumulator final BASE_EMBEDDED {
void AddKeys(Handle<JSObject> array,
AddKeyConversion convert = DO_NOT_CONVERT);
void AddKeysFromProxy(Handle<JSObject> array);
+ void AddKeysFromInterceptor(Handle<JSObject> array);
// Jump to the next level, pushing the current |levelLength_| to
// |levelLengths_| and adding a new list to |elements_|.
void NextPrototype();
@@ -10774,10 +10777,10 @@ class KeyAccumulator final BASE_EMBEDDED {
Isolate* isolate_;
KeyFilter filter_;
// |elements_| contains the sorted element keys (indices) per level.
- List<List<uint32_t>*> elements_;
+ std::vector<std::vector<uint32_t>*> elements_;
Igor Sheludko 2015/10/22 21:42:57 Suggestion: use std::unique_ptr: std::vector<std
Camillo Bruni 2015/10/23 08:56:35 I think I prefer not using smart pointers since we
// |protoLengths_| contains the total number of keys (elements + properties)
// per level. Negative values mark counts for a level with keys from a proxy.
- List<int> levelLengths_;
+ std::vector<int> levelLengths_;
// |properties_| contains the property keys per level in insertion order.
Handle<OrderedHashSet> properties_;
// |length_| keeps track of the total number of all element and property keys.
@@ -10785,6 +10788,8 @@ class KeyAccumulator final BASE_EMBEDDED {
// |levelLength_| keeps track of the total number of keys
// (elements + properties) in the current level.
int levelLength_;
+ // Indicate where to stop looking for duplicates when adding new element keys.
+ ElementKeyAddCheckLimit elementKeysAddCheckLimit_ = EXCLUDE_CURRENT_LEVEL;
Igor Sheludko 2015/10/22 21:42:57 Nice! What about initializing lengths fields this
Camillo Bruni 2015/10/23 08:56:35 done
DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
};
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698