OLD | NEW |
---|---|
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 | 186 |
187 static inline int SizeOf(Map* map, HeapObject* object) { | 187 static inline int SizeOf(Map* map, HeapObject* object) { |
188 return map->instance_size(); | 188 return map->instance_size(); |
189 } | 189 } |
190 }; | 190 }; |
191 | 191 |
192 | 192 |
193 class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase { | 193 class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase { |
194 public: | 194 public: |
195 static bool IsValidSlot(HeapObject* obj, int offset) { | 195 static bool IsValidSlot(HeapObject* obj, int offset) { |
196 return offset == kConstantPoolOffset || offset == kHandlerTableOffset; | 196 return offset == kConstantPoolOffset || offset == kHandlerTableOffset; |
Michael Starzinger
2016/01/20 13:40:55
Please also update the IsValidSlot predicate. Mayb
| |
197 } | 197 } |
198 | 198 |
199 template <typename ObjectVisitor> | 199 template <typename ObjectVisitor> |
200 static inline void IterateBody(HeapObject* obj, int object_size, | 200 static inline void IterateBody(HeapObject* obj, int object_size, |
201 ObjectVisitor* v) { | 201 ObjectVisitor* v) { |
202 IteratePointer(obj, kConstantPoolOffset, v); | 202 IteratePointer(obj, kConstantPoolOffset, v); |
203 IteratePointer(obj, kHandlerTableOffset, v); | 203 IteratePointer(obj, kHandlerTableOffset, v); |
204 IteratePointer(obj, kSourcePositionTableOffset, v); | |
204 } | 205 } |
205 | 206 |
206 template <typename StaticVisitor> | 207 template <typename StaticVisitor> |
207 static inline void IterateBody(HeapObject* obj, int object_size) { | 208 static inline void IterateBody(HeapObject* obj, int object_size) { |
208 Heap* heap = obj->GetHeap(); | 209 Heap* heap = obj->GetHeap(); |
209 IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset); | 210 IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset); |
210 IteratePointer<StaticVisitor>(heap, obj, kHandlerTableOffset); | 211 IteratePointer<StaticVisitor>(heap, obj, kHandlerTableOffset); |
212 IteratePointer<StaticVisitor>(heap, obj, kSourcePositionTableOffset); | |
211 } | 213 } |
212 | 214 |
213 static inline int SizeOf(Map* map, HeapObject* obj) { | 215 static inline int SizeOf(Map* map, HeapObject* obj) { |
214 return reinterpret_cast<BytecodeArray*>(obj)->BytecodeArraySize(); | 216 return reinterpret_cast<BytecodeArray*>(obj)->BytecodeArraySize(); |
215 } | 217 } |
216 }; | 218 }; |
217 | 219 |
218 | 220 |
219 class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase { | 221 class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase { |
220 public: | 222 public: |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
558 | 560 |
559 template <typename ObjectVisitor> | 561 template <typename ObjectVisitor> |
560 void HeapObject::IterateBodyFast(InstanceType type, int object_size, | 562 void HeapObject::IterateBodyFast(InstanceType type, int object_size, |
561 ObjectVisitor* v) { | 563 ObjectVisitor* v) { |
562 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); | 564 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); |
563 } | 565 } |
564 } // namespace internal | 566 } // namespace internal |
565 } // namespace v8 | 567 } // namespace v8 |
566 | 568 |
567 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ | 569 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ |
OLD | NEW |