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; | 196 return offset == kConstantPoolOffset || offset == kHandlerTableOffset; |
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 } | 204 } |
204 | 205 |
205 template <typename StaticVisitor> | 206 template <typename StaticVisitor> |
206 static inline void IterateBody(HeapObject* obj, int object_size) { | 207 static inline void IterateBody(HeapObject* obj, int object_size) { |
207 Heap* heap = obj->GetHeap(); | 208 Heap* heap = obj->GetHeap(); |
208 IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset); | 209 IteratePointer<StaticVisitor>(heap, obj, kConstantPoolOffset); |
| 210 IteratePointer<StaticVisitor>(heap, obj, kHandlerTableOffset); |
209 } | 211 } |
210 | 212 |
211 static inline int SizeOf(Map* map, HeapObject* obj) { | 213 static inline int SizeOf(Map* map, HeapObject* obj) { |
212 return reinterpret_cast<BytecodeArray*>(obj)->BytecodeArraySize(); | 214 return reinterpret_cast<BytecodeArray*>(obj)->BytecodeArraySize(); |
213 } | 215 } |
214 }; | 216 }; |
215 | 217 |
216 | 218 |
217 class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase { | 219 class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase { |
218 public: | 220 public: |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 558 |
557 template <typename ObjectVisitor> | 559 template <typename ObjectVisitor> |
558 void HeapObject::IterateBodyFast(InstanceType type, int object_size, | 560 void HeapObject::IterateBodyFast(InstanceType type, int object_size, |
559 ObjectVisitor* v) { | 561 ObjectVisitor* v) { |
560 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); | 562 BodyDescriptorApply<CallIterateBody, void>(type, this, object_size, v); |
561 } | 563 } |
562 } // namespace internal | 564 } // namespace internal |
563 } // namespace v8 | 565 } // namespace v8 |
564 | 566 |
565 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ | 567 #endif // V8_OBJECTS_BODY_DESCRIPTORS_INL_H_ |
OLD | NEW |