Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects-inl.h

Issue 329253004: Optimize Map/Set.prototype.forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Unhandlify Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 6939 matching lines...) Expand 10 before | Expand all | Expand 10 after
6950 6950
6951 template<int start_offset> 6951 template<int start_offset>
6952 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj, 6952 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj,
6953 int object_size, 6953 int object_size,
6954 ObjectVisitor* v) { 6954 ObjectVisitor* v) {
6955 v->VisitPointers(HeapObject::RawField(obj, start_offset), 6955 v->VisitPointers(HeapObject::RawField(obj, start_offset),
6956 HeapObject::RawField(obj, object_size)); 6956 HeapObject::RawField(obj, object_size));
6957 } 6957 }
6958 6958
6959 6959
6960 template<class Derived, class TableType>
6961 Object* OrderedHashTableIterator<Derived, TableType>::CurrentKey() {
6962 TableType* table(TableType::cast(this->table()));
6963 int index = Smi::cast(this->index())->value();
6964 Object* key = table->KeyAt(index);
6965 ASSERT(!key->IsTheHole());
6966 return key;
6967 }
6968
6969
6970 Object* JSMapIterator::CurrentValue() {
6971 OrderedHashMap* table(OrderedHashMap::cast(this->table()));
6972 int index = Smi::cast(this->index())->value();
6973 Object* value = table->ValueAt(index);
6974 ASSERT(!value->IsTheHole());
6975 return value;
6976 }
6977
6978
6960 #undef TYPE_CHECKER 6979 #undef TYPE_CHECKER
6961 #undef CAST_ACCESSOR 6980 #undef CAST_ACCESSOR
6962 #undef INT_ACCESSORS 6981 #undef INT_ACCESSORS
6963 #undef ACCESSORS 6982 #undef ACCESSORS
6964 #undef ACCESSORS_TO_SMI 6983 #undef ACCESSORS_TO_SMI
6965 #undef SMI_ACCESSORS 6984 #undef SMI_ACCESSORS
6966 #undef SYNCHRONIZED_SMI_ACCESSORS 6985 #undef SYNCHRONIZED_SMI_ACCESSORS
6967 #undef NOBARRIER_SMI_ACCESSORS 6986 #undef NOBARRIER_SMI_ACCESSORS
6968 #undef BOOL_GETTER 6987 #undef BOOL_GETTER
6969 #undef BOOL_ACCESSORS 6988 #undef BOOL_ACCESSORS
(...skipping 15 matching lines...) Expand all
6985 #undef READ_SHORT_FIELD 7004 #undef READ_SHORT_FIELD
6986 #undef WRITE_SHORT_FIELD 7005 #undef WRITE_SHORT_FIELD
6987 #undef READ_BYTE_FIELD 7006 #undef READ_BYTE_FIELD
6988 #undef WRITE_BYTE_FIELD 7007 #undef WRITE_BYTE_FIELD
6989 #undef NOBARRIER_READ_BYTE_FIELD 7008 #undef NOBARRIER_READ_BYTE_FIELD
6990 #undef NOBARRIER_WRITE_BYTE_FIELD 7009 #undef NOBARRIER_WRITE_BYTE_FIELD
6991 7010
6992 } } // namespace v8::internal 7011 } } // namespace v8::internal
6993 7012
6994 #endif // V8_OBJECTS_INL_H_ 7013 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698