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

Unified Diff: src/objects.h

Issue 1409073005: [runtime] use std::vector in KeyAccumulator (Closed)
Patch Set: typo 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') | no next file with comments »
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 dc503e96ed5e69705492fa097f533da5d6025515..b454e4cd15e566fd903153988877841261acc013 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -10801,7 +10801,7 @@ class KeyAccumulator final BASE_EMBEDDED {
public:
explicit KeyAccumulator(Isolate* isolate,
KeyFilter filter = KeyFilter::SKIP_SYMBOLS)
- : isolate_(isolate), filter_(filter), length_(0), levelLength_(0) {}
+ : isolate_(isolate), filter_(filter) {}
~KeyAccumulator();
bool AddKey(uint32_t key);
@@ -10812,11 +10812,13 @@ class KeyAccumulator final BASE_EMBEDDED {
void AddKeys(Handle<JSObject> array,
AddKeyConversion convert = DO_NOT_CONVERT);
void AddKeysFromProxy(Handle<JSObject> array);
+ void AddElementKeysFromInterceptor(Handle<JSObject> array);
// Jump to the next level, pushing the current |levelLength_| to
// |levelLengths_| and adding a new list to |elements_|.
void NextPrototype();
// Sort the integer indices in the last list in |elements_|
void SortCurrentElementsList();
+ void SortCurrentElementsListRemoveDuplicates();
Handle<FixedArray> GetKeys(GetKeysConversion convert = KEEP_NUMBERS);
@@ -10824,17 +10826,17 @@ 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_;
// |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.
- int length_;
+ int length_ = 0;
// |levelLength_| keeps track of the total number of keys
// (elements + properties) in the current level.
- int levelLength_;
+ int levelLength_ = 0;
DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
};
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698