Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index e8c985048455e406c77c6b4c6814261f2cb7ab41..921134ffc3cc3f03956cce8da3198fae8c2bff20 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -1512,6 +1512,9 @@ class Object : public MaybeObject { |
| // Returns the permanent hash code associated with this object depending on |
| // the actual object type. Might return a failure in case no hash was |
| // created yet or GC was caused by creation. |
| + static Handle<Object> GetHash(Handle<Object> object, Isolate* isolate, |
|
Michael Starzinger
2013/11/04 10:29:11
nit: The current implementation as a wrapper requi
rafaelw
2013/11/04 15:12:01
Done (although this todo is now on GetOrCreateHash
|
| + CreationFlag flag); |
| + |
| MUST_USE_RESULT MaybeObject* GetHash(CreationFlag flag); |
| // Checks whether this object has the same value as the given one. This |
| @@ -4060,13 +4063,25 @@ class ObjectHashSet: public HashTable<ObjectHashTableShape<1>, Object*> { |
| } |
| // Looks up whether the given key is part of this hash set. |
| - bool Contains(Object* key); |
| + static bool Contains(Handle<ObjectHashSet> table, Handle<Object> key); |
|
Michael Starzinger
2013/11/04 10:29:11
The ObjectHashSet::Contains method should never ca
rafaelw
2013/11/04 15:12:01
Done.
|
| + |
| + static Handle<ObjectHashSet> EnsureSetCapacity( |
|
rafaelw
2013/10/29 19:14:51
Note that I've named this "EnsureSetCapacity" beca
Michael Starzinger
2013/11/04 10:29:11
One way to address that I can think of would be to
rafaelw
2013/11/04 15:12:01
Done. Applied to ObjectHash(Set/Table)::(EnsureCap
|
| + Handle<ObjectHashSet> table, |
| + int n, |
| + Handle<Object> key, |
| + PretenureFlag pretenure = NOT_TENURED); |
| + |
| + // Attempt to shrink hash table after removal of key. |
| + static Handle<ObjectHashSet> ShrinkSet(Handle<ObjectHashSet> table, |
| + Handle<Object> key); |
| // Adds the given key to this hash set. |
| - MUST_USE_RESULT MaybeObject* Add(Object* key); |
| + static Handle<ObjectHashSet> Add(Handle<ObjectHashSet> table, |
| + Handle<Object> key); |
| // Removes the given key from this hash set. |
| - MUST_USE_RESULT MaybeObject* Remove(Object* key); |
| + static Handle<ObjectHashSet> Remove(Handle<ObjectHashSet> table, |
| + Handle<Object> key); |
| }; |