Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index a672108bdded874f05d431961bbcdaf5677ffc30..431db46b25b16a789337dab9880ab7c7b24ba52e 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -2267,6 +2267,8 @@ class JSObject: public JSReceiver { |
// index. Returns the number of properties added. |
int GetOwnPropertyNames(FixedArray* storage, int index, |
PropertyAttributes filter = NONE); |
+ int CollectOwnPropertyNames(KeyAccumulator* keys, |
+ PropertyAttributes filter = NONE); |
// Returns the number of properties on this object filtering out properties |
// with the specified attributes (ignoring interceptors). |
@@ -3416,6 +3418,8 @@ class Dictionary: public HashTable<Derived, Shape, Key> { |
// Returns the number of properties added. |
int CopyKeysTo(FixedArray* storage, int index, PropertyAttributes filter, |
SortMode sort_mode); |
+ // Collect the unsorted keys into the given KeyAccumulator. |
+ int CollectKeysTo(KeyAccumulator* keys, PropertyAttributes filter); |
// Copies enumerable keys to preallocated fixed array. |
void CopyEnumKeysTo(FixedArray* storage); |
@@ -10770,6 +10774,8 @@ class KeyAccumulator final BASE_EMBEDDED { |
bool AddKey(uint32_t key); |
Jakob Kummerow
2015/11/03 15:39:59
nit: most of these methods can probably be private
|
bool AddKey(Object* key, AddKeyConversion convert = DO_NOT_CONVERT); |
bool AddKey(Handle<Object> key, AddKeyConversion convert = DO_NOT_CONVERT); |
+ bool AddStringKey(Handle<Object> key, AddKeyConversion convert); |
+ bool AddSymbolKey(Handle<Object> array); |
void AddKeys(Handle<FixedArray> array, |
AddKeyConversion convert = DO_NOT_CONVERT); |
void AddKeys(Handle<JSObject> array, |
@@ -10783,6 +10789,7 @@ class KeyAccumulator final BASE_EMBEDDED { |
void SortCurrentElementsList(); |
void SortCurrentElementsListRemoveDuplicates(); |
Handle<FixedArray> GetKeys(GetKeysConversion convert = KEEP_NUMBERS); |
+ int GetLength(); |
Jakob Kummerow
2015/11/03 15:33:37
nit: one empty line is enough
|
private: |
@@ -10792,14 +10799,20 @@ class KeyAccumulator final BASE_EMBEDDED { |
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. |
- std::vector<int> levelLengths_; |
+ std::vector<int> level_lengths_; |
// |properties_| contains the property keys per level in insertion order. |
- Handle<OrderedHashSet> properties_; |
+ Handle<OrderedHashSet> string_properties_; |
+ // |properties_| contains the symbol property keys per level in |
+ // insertion order. |
+ Handle<OrderedHashSet> symbol_properties_; |
// |length_| keeps track of the total number of all element and property keys. |
int length_ = 0; |
// |levelLength_| keeps track of the total number of keys |
// (elements + properties) in the current level. |
- int levelLength_ = 0; |
+ int level_string_length_ = 0; |
+ // |levelSymbolLength_| keeps track of the total number of symbol keys |
+ // (elements + properties) in the current level. |
+ int level_symbol_length_ = 0; |
DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
}; |