| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index c1ba60e972ab35b3c6b72e783a04cf91d099e8c3..783ce2221490fa295fc0279d285fbfaf38a95a2b 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -4509,11 +4509,11 @@ class OrderedHashMap:public OrderedHashTable<
|
| Handle<Object> key,
|
| Handle<Object> value);
|
|
|
| - private:
|
| Object* ValueAt(int entry) {
|
| return get(EntryToIndex(entry) + kValueOffset);
|
| }
|
|
|
| + private:
|
| static const int kValueOffset = 1;
|
| };
|
|
|
| @@ -10199,8 +10199,21 @@ class OrderedHashTableIterator: public JSObject {
|
| // end.
|
| static Handle<JSObject> Next(Handle<Derived> iterator);
|
|
|
| + // Whether the iterator has more elements. This needs to be called before
|
| + // calling |CurrentKey| and/or |CurrentValue|.
|
| + static bool HasMore(Handle<Derived> iterator);
|
| +
|
| + // Move the index forward one.
|
| + void MoveNext() {
|
| + set_index(Smi::FromInt(Smi::cast(index())->value() + 1));
|
| + }
|
| +
|
| + // Returns the current key of the iterator. This should only be called when
|
| + // |HasMore| returns true.
|
| + inline Object* CurrentKey();
|
| +
|
| private:
|
| - // Transitions the iterator to the non obsolote backing store. This is a NOP
|
| + // Transitions the iterator to the non obsolete backing store. This is a NOP
|
| // if the [table] is not obsolete.
|
| void Transition();
|
|
|
| @@ -10218,9 +10231,10 @@ class JSSetIterator: public OrderedHashTableIterator<JSSetIterator,
|
| // Casting.
|
| static inline JSSetIterator* cast(Object* obj);
|
|
|
| - static Handle<Object> ValueForKind(
|
| - Handle<JSSetIterator> iterator,
|
| - int entry_index);
|
| + // Returns the iterator result value at the current |index| taking the |kind|
|
| + // into account. This should only be called when |HasMore| returns true.
|
| + static Handle<Object> CurrentIteratorResultValue(
|
| + Handle<JSSetIterator> iterator);
|
|
|
| private:
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSSetIterator);
|
| @@ -10237,9 +10251,14 @@ class JSMapIterator: public OrderedHashTableIterator<JSMapIterator,
|
| // Casting.
|
| static inline JSMapIterator* cast(Object* obj);
|
|
|
| - static Handle<Object> ValueForKind(
|
| - Handle<JSMapIterator> iterator,
|
| - int entry_index);
|
| + // Returns the iterator result value at the current |index| taking the |kind|
|
| + // into account. This should only be called when |HasMore| returns true.
|
| + static Handle<Object> CurrentIteratorResultValue(
|
| + Handle<JSMapIterator> iterator);
|
| +
|
| + // Returns the current value of the iterator. This should only be called when
|
| + // |HasMore| returns true.
|
| + inline Object* CurrentValue();
|
|
|
| private:
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSMapIterator);
|
|
|