Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects-body-descriptors.h

Issue 2808093003: [heap] Introduce HeapVisitor interface. (Closed)
Patch Set: fix compile error Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698