| 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_H_ | 5 #ifndef V8_OBJECTS_BODY_DESCRIPTORS_H_ |
| 6 #define V8_OBJECTS_BODY_DESCRIPTORS_H_ | 6 #define V8_OBJECTS_BODY_DESCRIPTORS_H_ |
| 7 | 7 |
| 8 #include "src/objects.h" | 8 #include "src/objects.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 int start_offset, int end_offset); | 44 int start_offset, int end_offset); |
| 45 | 45 |
| 46 template <typename ObjectVisitor> | 46 template <typename ObjectVisitor> |
| 47 static inline void IteratePointer(HeapObject* obj, int offset, | 47 static inline void IteratePointer(HeapObject* obj, int offset, |
| 48 ObjectVisitor* v); | 48 ObjectVisitor* v); |
| 49 | 49 |
| 50 template <typename StaticVisitor> | 50 template <typename StaticVisitor> |
| 51 static inline void IteratePointer(Heap* heap, HeapObject* obj, int offset); | 51 static inline void IteratePointer(Heap* heap, HeapObject* obj, int offset); |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 // Returns true for all header and internal fields. | 54 // Returns true for all header and embedder fields. |
| 55 static inline bool IsValidSlotImpl(HeapObject* obj, int offset); | 55 static inline bool IsValidSlotImpl(HeapObject* obj, int offset); |
| 56 | 56 |
| 57 // Treats all header and internal fields in the range as tagged. | 57 // Treats all header and embedder fields in the range as tagged. |
| 58 template <typename ObjectVisitor> | 58 template <typename ObjectVisitor> |
| 59 static inline void IterateBodyImpl(HeapObject* obj, int start_offset, | 59 static inline void IterateBodyImpl(HeapObject* obj, int start_offset, |
| 60 int end_offset, ObjectVisitor* v); | 60 int end_offset, ObjectVisitor* v); |
| 61 | 61 |
| 62 // Treats all header and internal fields in the range as tagged. | 62 // Treats all header and embedder fields in the range as tagged. |
| 63 template <typename StaticVisitor> | 63 template <typename StaticVisitor> |
| 64 static inline void IterateBodyImpl(Heap* heap, HeapObject* obj, | 64 static inline void IterateBodyImpl(Heap* heap, HeapObject* obj, |
| 65 int start_offset, int end_offset); | 65 int start_offset, int end_offset); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 | 68 |
| 69 // This class describes a body of an object of a fixed size | 69 // This class describes a body of an object of a fixed size |
| 70 // in which all pointer fields are located in the [start_offset, end_offset) | 70 // in which all pointer fields are located in the [start_offset, end_offset) |
| 71 // interval. | 71 // interval. |
| 72 template <int start_offset, int end_offset, int size> | 72 template <int start_offset, int end_offset, int size> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 static inline int SizeOf(Map* map, HeapObject* object); | 132 static inline int SizeOf(Map* map, HeapObject* object); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 | 135 |
| 136 typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor; | 136 typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor; |
| 137 | 137 |
| 138 } // namespace internal | 138 } // namespace internal |
| 139 } // namespace v8 | 139 } // namespace v8 |
| 140 | 140 |
| 141 #endif // V8_OBJECTS_BODY_DESCRIPTORS_H_ | 141 #endif // V8_OBJECTS_BODY_DESCRIPTORS_H_ |
| OLD | NEW |