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 fields. | 54 // Returns true for all header and internal 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 template <typename ObjectVisitor> | 58 template <typename ObjectVisitor> |
58 static inline void IterateBodyImpl(HeapObject* obj, int start_offset, | 59 static inline void IterateBodyImpl(HeapObject* obj, int start_offset, |
59 int end_offset, ObjectVisitor* v); | 60 int end_offset, ObjectVisitor* v); |
60 | 61 |
| 62 // Treats all header and internal fields in the range as tagged. |
61 template <typename StaticVisitor> | 63 template <typename StaticVisitor> |
62 static inline void IterateBodyImpl(Heap* heap, HeapObject* obj, | 64 static inline void IterateBodyImpl(Heap* heap, HeapObject* obj, |
63 int start_offset, int end_offset); | 65 int start_offset, int end_offset); |
64 }; | 66 }; |
65 | 67 |
66 | 68 |
67 // 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 |
68 // 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) |
69 // interval. | 71 // interval. |
70 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... |
130 static inline int SizeOf(Map* map, HeapObject* object); | 132 static inline int SizeOf(Map* map, HeapObject* object); |
131 }; | 133 }; |
132 | 134 |
133 | 135 |
134 typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor; | 136 typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor; |
135 | 137 |
136 } // namespace internal | 138 } // namespace internal |
137 } // namespace v8 | 139 } // namespace v8 |
138 | 140 |
139 #endif // V8_OBJECTS_BODY_DESCRIPTORS_H_ | 141 #endif // V8_OBJECTS_BODY_DESCRIPTORS_H_ |
OLD | NEW |