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

Unified Diff: src/objects.h

Issue 2081733002: [keys] support shadowing keys in the KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebasing Created 4 years, 6 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/messages.cc ('k') | 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 b6931e0eef59dbaba496698a2915531654acd3e2..c52a17bef6192a1203d7d6acfc388ae03b538d34 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1002,6 +1002,7 @@ template <class C> inline bool Is(Object* obj);
V(PropertyCell) \
V(WeakCell) \
V(ObjectHashTable) \
+ V(ObjectHashSet) \
V(WeakHashTable) \
V(OrderedHashTable)
@@ -3230,6 +3231,8 @@ class HashTable : public HashTableBase {
inline int FindEntry(Key key);
inline int FindEntry(Isolate* isolate, Key key, int32_t hash);
int FindEntry(Isolate* isolate, Key key);
+ inline bool Has(Isolate* isolate, Key key);
+ inline bool Has(Key key);
// Rehashes the table in-place.
void Rehash(Key key);
@@ -3456,11 +3459,13 @@ class Dictionary: public HashTable<Derived, Shape, Key> {
// Collect the keys into the given KeyAccumulator, in ascending chronological
// order of property creation.
- static void CollectKeysTo(Handle<Dictionary<Derived, Shape, Key> > dictionary,
- KeyAccumulator* keys, PropertyFilter filter);
+ static void CollectKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary,
+ KeyAccumulator* keys);
// Copies enumerable keys to preallocated fixed array.
- void CopyEnumKeysTo(FixedArray* storage);
+ static void CopyEnumKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary,
+ Handle<FixedArray> storage, KeyCollectionMode mode,
+ KeyAccumulator* accumulator);
// Accessors for next enumeration index.
void SetNextEnumerationIndex(int index) {
@@ -3806,6 +3811,23 @@ class ObjectHashTable: public HashTable<ObjectHashTable,
}
};
+class ObjectHashSetShape : public ObjectHashTableShape {
+ public:
+ static const int kPrefixSize = 0;
+ static const int kEntrySize = 1;
+};
+
+class ObjectHashSet
+ : public HashTable<ObjectHashSet, ObjectHashSetShape, Handle<Object>> {
+ public:
+ static Handle<ObjectHashSet> Add(Handle<ObjectHashSet> set,
+ Handle<Object> key);
+
+ inline bool Has(Isolate* isolate, Handle<Object> key, int32_t hash);
+ inline bool Has(Isolate* isolate, Handle<Object> key);
+
+ DECLARE_CAST(ObjectHashSet)
+};
// OrderedHashTable is a HashTable with Object keys that preserves
// insertion order. There are Map and Set interfaces (OrderedHashMap
« no previous file with comments | « src/messages.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698