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 <map> | 8 #include <map> |
9 | 9 |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 kProcessToSpace = 2, | 104 kProcessToSpace = 2, |
105 kIterateWeaks = 3, | 105 kIterateWeaks = 3, |
106 // Data | 106 // Data |
107 kStoreBufferEntries = 0, | 107 kStoreBufferEntries = 0, |
108 kStoreBufferBlockEntries = 1 | 108 kStoreBufferBlockEntries = 1 |
109 }; | 109 }; |
110 | 110 |
111 uword FirstObjectStart() const { return to_->start() | object_alignment_; } | 111 uword FirstObjectStart() const { return to_->start() | object_alignment_; } |
112 void Prologue(Isolate* isolate, bool invoke_api_callbacks); | 112 void Prologue(Isolate* isolate, bool invoke_api_callbacks); |
113 void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor); | 113 void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor); |
| 114 void IterateObjectIdTable(Isolate* isolate, ScavengerVisitor* visitor); |
114 void IterateRoots(Isolate* isolate, | 115 void IterateRoots(Isolate* isolate, |
115 ScavengerVisitor* visitor, | 116 ScavengerVisitor* visitor, |
116 bool visit_prologue_weak_persistent_handles); | 117 bool visit_prologue_weak_persistent_handles); |
117 void IterateWeakProperties(Isolate* isolate, ScavengerVisitor* visitor); | 118 void IterateWeakProperties(Isolate* isolate, ScavengerVisitor* visitor); |
118 void IterateWeakReferences(Isolate* isolate, ScavengerVisitor* visitor); | 119 void IterateWeakReferences(Isolate* isolate, ScavengerVisitor* visitor); |
119 void IterateWeakRoots(Isolate* isolate, | 120 void IterateWeakRoots(Isolate* isolate, |
120 HandleVisitor* visitor, | 121 HandleVisitor* visitor, |
121 bool visit_prologue_weak_persistent_handles); | 122 bool visit_prologue_weak_persistent_handles); |
122 void ProcessToSpace(ScavengerVisitor* visitor); | 123 void ProcessToSpace(ScavengerVisitor* visitor); |
123 uword ProcessWeakProperty(RawWeakProperty* raw_weak, | 124 uword ProcessWeakProperty(RawWeakProperty* raw_weak, |
(...skipping 16 matching lines...) Expand all Loading... |
140 end_ += sizeof(result); | 141 end_ += sizeof(result); |
141 ASSERT(end_ <= to_->end()); | 142 ASSERT(end_ <= to_->end()); |
142 return result; | 143 return result; |
143 } | 144 } |
144 bool PromotedStackHasMore() const { | 145 bool PromotedStackHasMore() const { |
145 return end_ < to_->end(); | 146 return end_ < to_->end(); |
146 } | 147 } |
147 | 148 |
148 void ProcessPeerReferents(); | 149 void ProcessPeerReferents(); |
149 | 150 |
| 151 void ProcessObjectIdTable(); |
| 152 |
150 VirtualMemory* space_; | 153 VirtualMemory* space_; |
151 MemoryRegion* to_; | 154 MemoryRegion* to_; |
152 MemoryRegion* from_; | 155 MemoryRegion* from_; |
153 | 156 |
154 Heap* heap_; | 157 Heap* heap_; |
155 | 158 |
156 typedef std::map<RawObject*, void*> PeerTable; | 159 typedef std::map<RawObject*, void*> PeerTable; |
157 PeerTable peer_table_; | 160 PeerTable peer_table_; |
158 | 161 |
159 // Current allocation top and end. These values are being accessed directly | 162 // Current allocation top and end. These values are being accessed directly |
(...skipping 18 matching lines...) Expand all Loading... |
178 | 181 |
179 friend class ScavengerVisitor; | 182 friend class ScavengerVisitor; |
180 friend class ScavengerWeakVisitor; | 183 friend class ScavengerWeakVisitor; |
181 | 184 |
182 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 185 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
183 }; | 186 }; |
184 | 187 |
185 } // namespace dart | 188 } // namespace dart |
186 | 189 |
187 #endif // VM_SCAVENGER_H_ | 190 #endif // VM_SCAVENGER_H_ |
OLD | NEW |