Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index f547c8388cf9df637a2436ba64c4bd3342cbef7a..d81693d50c25f404386ebad0b4b6bdeddf7ca24f 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -2468,17 +2468,6 @@ class FixedArray: public FixedArrayBase { |
enum KeyFilter { ALL_KEYS, NON_SYMBOL_KEYS }; |
- // Add the elements of a JSArray to this FixedArray. |
- MUST_USE_RESULT static MaybeHandle<FixedArray> AddKeysFromArrayLike( |
- Handle<FixedArray> content, Handle<JSObject> array, |
- KeyFilter filter = ALL_KEYS); |
- |
- // Computes the union of keys and return the result. |
- // Used for implementing "for (n in object) { }" |
- MUST_USE_RESULT static MaybeHandle<FixedArray> UnionOfKeys( |
- Handle<FixedArray> first, |
- Handle<FixedArray> second); |
- |
// Copy a sub array from the receiver to dest. |
void CopyTo(int pos, FixedArray* dest, int dest_pos, int len); |
@@ -3572,6 +3561,7 @@ class ObjectHashTable: public HashTable<ObjectHashTable, |
Object* Lookup(Handle<Object> key); |
Object* Lookup(Handle<Object> key, int32_t hash); |
Object* Lookup(Isolate* isolate, Handle<Object> key, int32_t hash); |
+ bool HasKey(Isolate* isolate, Handle<Object> key); |
// Adds (or overwrites) the value associated with the given key. |
static Handle<ObjectHashTable> Put(Handle<ObjectHashTable> table, |
@@ -3580,6 +3570,13 @@ class ObjectHashTable: public HashTable<ObjectHashTable, |
static Handle<ObjectHashTable> Put(Handle<ObjectHashTable> table, |
Handle<Object> key, Handle<Object> value, |
int32_t hash); |
+ static Handle<ObjectHashTable> Put(Isolate* isolate, |
+ Handle<ObjectHashTable> table, |
+ Handle<Object> key, Handle<Object> value); |
+ static Handle<ObjectHashTable> Put(Isolate* isolate, |
+ Handle<ObjectHashTable> table, |
+ Handle<Object> key, Handle<Object> value, |
+ int32_t hash); |
// Returns an ObjectHashTable (possibly |table|) where |key| has been removed. |
static Handle<ObjectHashTable> Remove(Handle<ObjectHashTable> table, |
@@ -10470,6 +10467,30 @@ class BooleanBit : public AllStatic { |
} |
}; |
+ |
+class KeyAccumulator final BASE_EMBEDDED { |
Camillo Bruni
2015/09/14 07:45:40
I wasn't really sure where to put the class declar
|
+ public: |
+ explicit KeyAccumulator(Isolate* isolate) |
+ : isolate_(isolate), keys_(), set_(), length_(0) {} |
Igor Sheludko
2015/09/17 09:55:11
keys_() and set_() are not really necessary here.
|
+ |
+ void AddKeys(Handle<FixedArray> array, FixedArray::KeyFilter filter); |
+ void AddKeys(Handle<JSObject> array, FixedArray::KeyFilter filter); |
+ Handle<FixedArray> GetKeys(); |
+ int GetLength(); |
+ bool HasKey(Handle<Object> key, int limit); |
+ void AddKey(Handle<Object> key); |
+ void PrepareForComparisons(int count); |
+ |
+ private: |
+ void EnsureCapacity(int capacity); |
+ void Grow(); |
+ |
+ Isolate* isolate_; |
+ Handle<FixedArray> keys_; |
+ Handle<ObjectHashTable> set_; |
+ int length_; |
+ DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
+}; |
} } // namespace v8::internal |
#endif // V8_OBJECTS_H_ |