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

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

Issue 2800923004: Revert of [heap] Remove size specializations in static object visitors. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ 5 #ifndef V8_OBJECTS_BODY_DESCRIPTORS_INL_H_
6 #define V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ 6 #define V8_OBJECTS_BODY_DESCRIPTORS_INL_H_
7 7
8 #include "src/assembler-inl.h" 8 #include "src/assembler-inl.h"
9 #include "src/objects-body-descriptors.h" 9 #include "src/objects-body-descriptors.h"
10 #include "src/transitions.h" 10 #include "src/transitions.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 IterateBodyImpl(obj, kStartOffset, object_size, v); 120 IterateBodyImpl(obj, kStartOffset, object_size, v);
121 } 121 }
122 122
123 template <typename StaticVisitor> 123 template <typename StaticVisitor>
124 static inline void IterateBody(HeapObject* obj, int object_size) { 124 static inline void IterateBody(HeapObject* obj, int object_size) {
125 Heap* heap = obj->GetHeap(); 125 Heap* heap = obj->GetHeap();
126 IterateBodyImpl<StaticVisitor>(heap, obj, kStartOffset, object_size); 126 IterateBodyImpl<StaticVisitor>(heap, obj, kStartOffset, object_size);
127 } 127 }
128 128
129 static inline int SizeOf(Map* map, HeapObject* object) { 129 static inline int SizeOf(Map* map, HeapObject* object) {
130 return map->instance_size();
131 }
132 };
133
134 class JSObject::FastBodyDescriptor final : public BodyDescriptorBase {
135 public:
136 static const int kStartOffset = JSReceiver::kPropertiesOffset;
137
138 static bool IsValidSlot(HeapObject* obj, int offset) {
139 return offset >= kStartOffset;
140 }
141
142 template <typename ObjectVisitor>
143 static inline void IterateBody(HeapObject* obj, int object_size,
144 ObjectVisitor* v) {
145 IteratePointers(obj, kStartOffset, object_size, v);
146 }
147
148 template <typename StaticVisitor>
149 static inline void IterateBody(HeapObject* obj, int object_size) {
150 Heap* heap = obj->GetHeap();
151 IteratePointers<StaticVisitor>(heap, obj, kStartOffset, object_size);
152 }
153
154 static inline int SizeOf(Map* map, HeapObject* object) {
155 return map->instance_size(); 130 return map->instance_size();
156 } 131 }
157 }; 132 };
158 133
159 // Iterates the function object according to the visiting policy. 134 // Iterates the function object according to the visiting policy.
160 template <JSFunction::BodyVisitingPolicy body_visiting_policy> 135 template <JSFunction::BodyVisitingPolicy body_visiting_policy>
161 class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase { 136 class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase {
162 public: 137 public:
163 STATIC_ASSERT(kNonWeakFieldsEndOffset == kCodeEntryOffset); 138 STATIC_ASSERT(kNonWeakFieldsEndOffset == kCodeEntryOffset);
164 STATIC_ASSERT(kCodeEntryOffset + kPointerSize == kNextFunctionLinkOffset); 139 STATIC_ASSERT(kCodeEntryOffset + kPointerSize == kNextFunctionLinkOffset);
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 625
651 template <typename ObjectVisitor> 626 template <typename ObjectVisitor>
652 void HeapObject::IterateBodyFast(InstanceType type, int object_size, 627 void HeapObject::IterateBodyFast(InstanceType type, int object_size,
653 ObjectVisitor* v) { 628 ObjectVisitor* v) {
654 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); 629 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v);
655 } 630 }
656 } // namespace internal 631 } // namespace internal
657 } // namespace v8 632 } // namespace v8
658 633
659 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ 634 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698