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

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

Issue 2808533002: [heap] Reland "Remove size specializations in static object visitors. (patchset #4 id:60001 of http… (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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 130 return map->instance_size();
131 } 131 }
132 }; 132 };
133 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();
156 }
157 };
158
134 // Iterates the function object according to the visiting policy. 159 // Iterates the function object according to the visiting policy.
135 template <JSFunction::BodyVisitingPolicy body_visiting_policy> 160 template <JSFunction::BodyVisitingPolicy body_visiting_policy>
136 class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase { 161 class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase {
137 public: 162 public:
138 STATIC_ASSERT(kNonWeakFieldsEndOffset == kCodeEntryOffset); 163 STATIC_ASSERT(kNonWeakFieldsEndOffset == kCodeEntryOffset);
139 STATIC_ASSERT(kCodeEntryOffset + kPointerSize == kNextFunctionLinkOffset); 164 STATIC_ASSERT(kCodeEntryOffset + kPointerSize == kNextFunctionLinkOffset);
140 STATIC_ASSERT(kNextFunctionLinkOffset + kPointerSize == kSize); 165 STATIC_ASSERT(kNextFunctionLinkOffset + kPointerSize == kSize);
141 166
142 static bool IsValidSlot(HeapObject* obj, int offset) { 167 static bool IsValidSlot(HeapObject* obj, int offset) {
143 if (offset < kSize) return true; 168 if (offset < kSize) return true;
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 639
615 template <typename ObjectVisitor> 640 template <typename ObjectVisitor>
616 void HeapObject::IterateBodyFast(InstanceType type, int object_size, 641 void HeapObject::IterateBodyFast(InstanceType type, int object_size,
617 ObjectVisitor* v) { 642 ObjectVisitor* v) {
618 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); 643 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v);
619 } 644 }
620 } // namespace internal 645 } // namespace internal
621 } // namespace v8 646 } // namespace v8
622 647
623 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ 648 #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