OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_SCAVENGER_H_ | 5 #ifndef VM_SCAVENGER_H_ |
6 #define VM_SCAVENGER_H_ | 6 #define VM_SCAVENGER_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 kProcessToSpace = 2, | 96 kProcessToSpace = 2, |
97 kIterateWeaks = 3, | 97 kIterateWeaks = 3, |
98 // Data | 98 // Data |
99 kStoreBufferEntries = 0, | 99 kStoreBufferEntries = 0, |
100 kStoreBufferBlockEntries = 1 | 100 kStoreBufferBlockEntries = 1 |
101 }; | 101 }; |
102 | 102 |
103 uword FirstObjectStart() const { return to_->start() | object_alignment_; } | 103 uword FirstObjectStart() const { return to_->start() | object_alignment_; } |
104 void Prologue(Isolate* isolate, bool invoke_api_callbacks); | 104 void Prologue(Isolate* isolate, bool invoke_api_callbacks); |
105 void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor); | 105 void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor); |
| 106 void IterateObjectIdTable(Isolate* isolate, ScavengerVisitor* visitor); |
106 void IterateRoots(Isolate* isolate, | 107 void IterateRoots(Isolate* isolate, |
107 ScavengerVisitor* visitor, | 108 ScavengerVisitor* visitor, |
108 bool visit_prologue_weak_persistent_handles); | 109 bool visit_prologue_weak_persistent_handles); |
109 void IterateWeakProperties(Isolate* isolate, ScavengerVisitor* visitor); | 110 void IterateWeakProperties(Isolate* isolate, ScavengerVisitor* visitor); |
110 void IterateWeakReferences(Isolate* isolate, ScavengerVisitor* visitor); | 111 void IterateWeakReferences(Isolate* isolate, ScavengerVisitor* visitor); |
111 void IterateWeakRoots(Isolate* isolate, | 112 void IterateWeakRoots(Isolate* isolate, |
112 HandleVisitor* visitor, | 113 HandleVisitor* visitor, |
113 bool visit_prologue_weak_persistent_handles); | 114 bool visit_prologue_weak_persistent_handles); |
114 void ProcessToSpace(ScavengerVisitor* visitor); | 115 void ProcessToSpace(ScavengerVisitor* visitor); |
115 uword ProcessWeakProperty(RawWeakProperty* raw_weak, | 116 uword ProcessWeakProperty(RawWeakProperty* raw_weak, |
(...skipping 16 matching lines...) Expand all Loading... |
132 end_ += sizeof(result); | 133 end_ += sizeof(result); |
133 ASSERT(end_ <= to_->end()); | 134 ASSERT(end_ <= to_->end()); |
134 return result; | 135 return result; |
135 } | 136 } |
136 bool PromotedStackHasMore() const { | 137 bool PromotedStackHasMore() const { |
137 return end_ < to_->end(); | 138 return end_ < to_->end(); |
138 } | 139 } |
139 | 140 |
140 void ProcessWeakTables(); | 141 void ProcessWeakTables(); |
141 | 142 |
| 143 void ProcessObjectIdTable(Isolate* isolate); |
| 144 |
142 VirtualMemory* space_; | 145 VirtualMemory* space_; |
143 MemoryRegion* to_; | 146 MemoryRegion* to_; |
144 MemoryRegion* from_; | 147 MemoryRegion* from_; |
145 | 148 |
146 Heap* heap_; | 149 Heap* heap_; |
147 | 150 |
148 // Current allocation top and end. These values are being accessed directly | 151 // Current allocation top and end. These values are being accessed directly |
149 // from generated code. | 152 // from generated code. |
150 uword top_; | 153 uword top_; |
151 uword end_; | 154 uword end_; |
(...skipping 15 matching lines...) Expand all Loading... |
167 | 170 |
168 friend class ScavengerVisitor; | 171 friend class ScavengerVisitor; |
169 friend class ScavengerWeakVisitor; | 172 friend class ScavengerWeakVisitor; |
170 | 173 |
171 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 174 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
172 }; | 175 }; |
173 | 176 |
174 } // namespace dart | 177 } // namespace dart |
175 | 178 |
176 #endif // VM_SCAVENGER_H_ | 179 #endif // VM_SCAVENGER_H_ |
OLD | NEW |