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

Unified Diff: src/objects.h

Issue 1425403002: [runtime] Support Symbols in KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing raw pointer issue Created 5 years, 1 month 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 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);
};
« 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