| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 template <typename StaticVisitor> | 94 template <typename StaticVisitor> |
| 95 static inline void IterateBody(HeapObject* obj) { | 95 static inline void IterateBody(HeapObject* obj) { |
| 96 Heap* heap = obj->GetHeap(); | 96 Heap* heap = obj->GetHeap(); |
| 97 IteratePointers<StaticVisitor>(heap, obj, start_offset, end_offset); | 97 IteratePointers<StaticVisitor>(heap, obj, start_offset, end_offset); |
| 98 } | 98 } |
| 99 | 99 |
| 100 template <typename StaticVisitor> | 100 template <typename StaticVisitor> |
| 101 static inline void IterateBody(HeapObject* obj, int object_size) { | 101 static inline void IterateBody(HeapObject* obj, int object_size) { |
| 102 IterateBody(obj); | 102 IterateBody(obj); |
| 103 } | 103 } |
| 104 |
| 105 static inline int SizeOf(Map* map, HeapObject* object) { return kSize; } |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 | 108 |
| 107 // This class describes a body of an object of a variable size | 109 // This class describes a body of an object of a variable size |
| 108 // in which all pointer fields are located in the [start_offset, object_size) | 110 // in which all pointer fields are located in the [start_offset, object_size) |
| 109 // interval. | 111 // interval. |
| 110 template <int start_offset> | 112 template <int start_offset> |
| 111 class FlexibleBodyDescriptor final : public BodyDescriptorBase { | 113 class FlexibleBodyDescriptor final : public BodyDescriptorBase { |
| 112 public: | 114 public: |
| 113 static const int kStartOffset = start_offset; | 115 static const int kStartOffset = start_offset; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 131 static inline int SizeOf(Map* map, HeapObject* object); | 133 static inline int SizeOf(Map* map, HeapObject* object); |
| 132 }; | 134 }; |
| 133 | 135 |
| 134 | 136 |
| 135 typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor; | 137 typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor; |
| 136 | 138 |
| 137 } // namespace internal | 139 } // namespace internal |
| 138 } // namespace v8 | 140 } // namespace v8 |
| 139 | 141 |
| 140 #endif // V8_OBJECTS_BODY_DESCRIPTORS_H_ | 142 #endif // V8_OBJECTS_BODY_DESCRIPTORS_H_ |
| OLD | NEW |