| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 9d96b503386c840222139aeee9cca23751cc4b2f..6e4424dc5f20637808e06583281c5fbc1db9310b 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -4490,11 +4490,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;
|
| };
|
|
|
| @@ -10179,8 +10179,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|.
|
| + bool HasMore();
|
| +
|
| + // 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();
|
|
|
| @@ -10198,9 +10211,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);
|
| @@ -10217,9 +10231,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);
|
|
|