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

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: Add the runtime-gen files 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
« no previous file with comments | « src/objects.cc ('k') | src/runtime.h » ('j') | src/runtime.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Handle<Object> OrderedHashTableIterator<Derived, TableType>::CurrentKey(
6962 Handle<Derived> iterator) {
6963 TableType* table(TableType::cast(iterator->table()));
adamk 2014/06/16 20:37:46 The use of a raw pointer in a handlified function
arv (Not doing code reviews) 2014/06/16 21:57:21 Done.
6964 int index = Smi::cast(iterator->index())->value();
6965 Handle<Object> key(table->KeyAt(index), iterator->GetIsolate());
6966 ASSERT(!key->IsTheHole());
6967 return key;
6968 }
6969
6970
6971 Handle<Object> JSMapIterator::CurrentValue(Handle<JSMapIterator> iterator) {
adamk 2014/06/16 20:37:46 Same as above, but less scary. Seems like this cou
arv (Not doing code reviews) 2014/06/16 21:57:20 Done.
6972 OrderedHashMap* table(OrderedHashMap::cast(iterator->table()));
6973 int index = Smi::cast(iterator->index())->value();
6974 Handle<Object> value(table->ValueAt(index), iterator->GetIsolate());
6975 ASSERT(!value->IsTheHole());
6976 return value;
6977 }
6978
6979
6960 #undef TYPE_CHECKER 6980 #undef TYPE_CHECKER
6961 #undef CAST_ACCESSOR 6981 #undef CAST_ACCESSOR
6962 #undef INT_ACCESSORS 6982 #undef INT_ACCESSORS
6963 #undef ACCESSORS 6983 #undef ACCESSORS
6964 #undef ACCESSORS_TO_SMI 6984 #undef ACCESSORS_TO_SMI
6965 #undef SMI_ACCESSORS 6985 #undef SMI_ACCESSORS
6966 #undef SYNCHRONIZED_SMI_ACCESSORS 6986 #undef SYNCHRONIZED_SMI_ACCESSORS
6967 #undef NOBARRIER_SMI_ACCESSORS 6987 #undef NOBARRIER_SMI_ACCESSORS
6968 #undef BOOL_GETTER 6988 #undef BOOL_GETTER
6969 #undef BOOL_ACCESSORS 6989 #undef BOOL_ACCESSORS
(...skipping 15 matching lines...) Expand all
6985 #undef READ_SHORT_FIELD 7005 #undef READ_SHORT_FIELD
6986 #undef WRITE_SHORT_FIELD 7006 #undef WRITE_SHORT_FIELD
6987 #undef READ_BYTE_FIELD 7007 #undef READ_BYTE_FIELD
6988 #undef WRITE_BYTE_FIELD 7008 #undef WRITE_BYTE_FIELD
6989 #undef NOBARRIER_READ_BYTE_FIELD 7009 #undef NOBARRIER_READ_BYTE_FIELD
6990 #undef NOBARRIER_WRITE_BYTE_FIELD 7010 #undef NOBARRIER_WRITE_BYTE_FIELD
6991 7011
6992 } } // namespace v8::internal 7012 } } // namespace v8::internal
6993 7013
6994 #endif // V8_OBJECTS_INL_H_ 7014 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698