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

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

Issue 1453043003: Fix BytecodeArray::BodyDescriptor::SizeOf(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | 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/objects-body-descriptors.h" 8 #include "src/objects-body-descriptors.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 ObjectVisitor* v) { 227 ObjectVisitor* v) {
228 IteratePointer(obj, kConstantPoolOffset, v); 228 IteratePointer(obj, kConstantPoolOffset, v);
229 } 229 }
230 230
231 template <typename StaticVisitor> 231 template <typename StaticVisitor>
232 static inline void IterateBody(HeapObject* obj, int object_size) { 232 static inline void IterateBody(HeapObject* obj, int object_size) {
233 Heap* heap = obj->GetHeap(); 233 Heap* heap = obj->GetHeap();
234 IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset); 234 IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset);
235 } 235 }
236 236
237 static inline int SizeOf(Map* map, HeapObject* object) { 237 static inline int SizeOf(Map* map, HeapObject* obj) {
238 return SizeFor( 238 return reinterpret_cast<BytecodeArray*>(obj)->BytecodeArraySize();
239 reinterpret_cast<FixedArray*>(object)->synchronized_length());
240 } 239 }
241 }; 240 };
242 241
243 242
244 class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase { 243 class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase {
245 public: 244 public:
246 static bool IsValidSlot(HeapObject* obj, int offset) { 245 static bool IsValidSlot(HeapObject* obj, int offset) {
247 return offset == kBasePointerOffset; 246 return offset == kBasePointerOffset;
248 } 247 }
249 248
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 574
576 template <typename ObjectVisitor> 575 template <typename ObjectVisitor>
577 void HeapObject::IterateBodyFast(InstanceType type, int object_size, 576 void HeapObject::IterateBodyFast(InstanceType type, int object_size,
578 ObjectVisitor* v) { 577 ObjectVisitor* v) {
579 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); 578 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v);
580 } 579 }
581 } // namespace internal 580 } // namespace internal
582 } // namespace v8 581 } // namespace v8
583 582
584 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ 583 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698