Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index a56792c5f517c0c5b729c5fa7e47acc2cf50c559..cfbbb54f1fa17b6785ce51f3d784d4e75efebac8 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -6966,6 +6966,38 @@ void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj, |
} |
+template<class Derived, class TableType> |
+Object* OrderedHashTableIterator<Derived, TableType>::CurrentKey() { |
+ TableType* table(TableType::cast(this->table())); |
+ int index = Smi::cast(this->index())->value(); |
+ Object* key = table->KeyAt(index); |
+ ASSERT(!key->IsTheHole()); |
+ return key; |
+} |
+ |
+ |
+void JSSetIterator::PopulateValueArray(FixedArray* array) { |
+ DisallowHeapAllocation no_allocation; |
+ array->set(0, CurrentKey()); |
+} |
+ |
+ |
+void JSMapIterator::PopulateValueArray(FixedArray* array) { |
+ DisallowHeapAllocation no_allocation; |
+ array->set(0, CurrentKey()); |
+ array->set(1, CurrentValue()); |
+} |
+ |
+ |
+Object* JSMapIterator::CurrentValue() { |
+ OrderedHashMap* table(OrderedHashMap::cast(this->table())); |
+ int index = Smi::cast(this->index())->value(); |
+ Object* value = table->ValueAt(index); |
+ ASSERT(!value->IsTheHole()); |
+ return value; |
+} |
+ |
+ |
#undef TYPE_CHECKER |
#undef CAST_ACCESSOR |
#undef INT_ACCESSORS |