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

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: Update count to fix merge issue 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 6943 matching lines...) Expand 10 before | Expand all | Expand 10 after
6954 6954
6955 template<int start_offset> 6955 template<int start_offset>
6956 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj, 6956 void FlexibleBodyDescriptor<start_offset>::IterateBody(HeapObject* obj,
6957 int object_size, 6957 int object_size,
6958 ObjectVisitor* v) { 6958 ObjectVisitor* v) {
6959 v->VisitPointers(HeapObject::RawField(obj, start_offset), 6959 v->VisitPointers(HeapObject::RawField(obj, start_offset),
6960 HeapObject::RawField(obj, object_size)); 6960 HeapObject::RawField(obj, object_size));
6961 } 6961 }
6962 6962
6963 6963
6964 template<class Derived, class TableType>
6965 Object* OrderedHashTableIterator<Derived, TableType>::CurrentKey() {
6966 TableType* table(TableType::cast(this->table()));
6967 int index = Smi::cast(this->index())->value();
6968 Object* key = table->KeyAt(index);
6969 ASSERT(!key->IsTheHole());
6970 return key;
6971 }
6972
6973
6974 Object* JSMapIterator::CurrentValue() {
6975 OrderedHashMap* table(OrderedHashMap::cast(this->table()));
6976 int index = Smi::cast(this->index())->value();
6977 Object* value = table->ValueAt(index);
6978 ASSERT(!value->IsTheHole());
6979 return value;
6980 }
6981
6982
6964 #undef TYPE_CHECKER 6983 #undef TYPE_CHECKER
6965 #undef CAST_ACCESSOR 6984 #undef CAST_ACCESSOR
6966 #undef INT_ACCESSORS 6985 #undef INT_ACCESSORS
6967 #undef ACCESSORS 6986 #undef ACCESSORS
6968 #undef ACCESSORS_TO_SMI 6987 #undef ACCESSORS_TO_SMI
6969 #undef SMI_ACCESSORS 6988 #undef SMI_ACCESSORS
6970 #undef SYNCHRONIZED_SMI_ACCESSORS 6989 #undef SYNCHRONIZED_SMI_ACCESSORS
6971 #undef NOBARRIER_SMI_ACCESSORS 6990 #undef NOBARRIER_SMI_ACCESSORS
6972 #undef BOOL_GETTER 6991 #undef BOOL_GETTER
6973 #undef BOOL_ACCESSORS 6992 #undef BOOL_ACCESSORS
(...skipping 15 matching lines...) Expand all
6989 #undef READ_SHORT_FIELD 7008 #undef READ_SHORT_FIELD
6990 #undef WRITE_SHORT_FIELD 7009 #undef WRITE_SHORT_FIELD
6991 #undef READ_BYTE_FIELD 7010 #undef READ_BYTE_FIELD
6992 #undef WRITE_BYTE_FIELD 7011 #undef WRITE_BYTE_FIELD
6993 #undef NOBARRIER_READ_BYTE_FIELD 7012 #undef NOBARRIER_READ_BYTE_FIELD
6994 #undef NOBARRIER_WRITE_BYTE_FIELD 7013 #undef NOBARRIER_WRITE_BYTE_FIELD
6995 7014
6996 } } // namespace v8::internal 7015 } } // namespace v8::internal
6997 7016
6998 #endif // V8_OBJECTS_INL_H_ 7017 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/collection.js ('K') | « src/objects.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698