| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/gc_marker.h" | 5 #include "vm/gc_marker.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // Skip over new objects, but verify consistency of heap while at it. | 202 // Skip over new objects, but verify consistency of heap while at it. |
| 203 if (raw_obj->IsNewObject()) { | 203 if (raw_obj->IsNewObject()) { |
| 204 // TODO(iposva): Add consistency check. | 204 // TODO(iposva): Add consistency check. |
| 205 if (update_store_buffers_) { | 205 if (update_store_buffers_) { |
| 206 ASSERT(p != NULL); | 206 ASSERT(p != NULL); |
| 207 isolate()->store_buffer()->AddPointer(reinterpret_cast<uword>(p)); | 207 isolate()->store_buffer()->AddPointer(reinterpret_cast<uword>(p)); |
| 208 } | 208 } |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // TODO(iposva): merge old and code spaces. | |
| 213 MarkAndPush(raw_obj); | 212 MarkAndPush(raw_obj); |
| 214 } | 213 } |
| 215 | 214 |
| 216 Heap* heap_; | 215 Heap* heap_; |
| 217 Heap* vm_heap_; | 216 Heap* vm_heap_; |
| 218 PageSpace* page_space_; | 217 PageSpace* page_space_; |
| 219 MarkingStack* marking_stack_; | 218 MarkingStack* marking_stack_; |
| 220 typedef std::multimap<RawObject*, RawWeakProperty*> DelaySet; | 219 typedef std::multimap<RawObject*, RawWeakProperty*> DelaySet; |
| 221 DelaySet delay_set_; | 220 DelaySet delay_set_; |
| 222 bool update_store_buffers_; | 221 bool update_store_buffers_; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } | 274 } |
| 276 | 275 |
| 277 | 276 |
| 278 void GCMarker::IterateRoots(Isolate* isolate, | 277 void GCMarker::IterateRoots(Isolate* isolate, |
| 279 ObjectPointerVisitor* visitor, | 278 ObjectPointerVisitor* visitor, |
| 280 bool visit_prologue_weak_persistent_handles) { | 279 bool visit_prologue_weak_persistent_handles) { |
| 281 isolate->VisitObjectPointers(visitor, | 280 isolate->VisitObjectPointers(visitor, |
| 282 visit_prologue_weak_persistent_handles, | 281 visit_prologue_weak_persistent_handles, |
| 283 StackFrameIterator::kDontValidateFrames); | 282 StackFrameIterator::kDontValidateFrames); |
| 284 heap_->IterateNewPointers(visitor); | 283 heap_->IterateNewPointers(visitor); |
| 285 heap_->IterateCodePointers(visitor); | |
| 286 } | 284 } |
| 287 | 285 |
| 288 | 286 |
| 289 void GCMarker::IterateWeakRoots(Isolate* isolate, | 287 void GCMarker::IterateWeakRoots(Isolate* isolate, |
| 290 HandleVisitor* visitor, | 288 HandleVisitor* visitor, |
| 291 bool visit_prologue_weak_persistent_handles) { | 289 bool visit_prologue_weak_persistent_handles) { |
| 292 ApiState* state = isolate->api_state(); | 290 ApiState* state = isolate->api_state(); |
| 293 ASSERT(state != NULL); | 291 ASSERT(state != NULL); |
| 294 isolate->VisitWeakPersistentHandles(visitor, | 292 isolate->VisitWeakPersistentHandles(visitor, |
| 295 visit_prologue_weak_persistent_handles); | 293 visit_prologue_weak_persistent_handles); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 DrainMarkingStack(isolate, &mark); | 405 DrainMarkingStack(isolate, &mark); |
| 408 IterateWeakReferences(isolate, &mark); | 406 IterateWeakReferences(isolate, &mark); |
| 409 MarkingWeakVisitor mark_weak; | 407 MarkingWeakVisitor mark_weak; |
| 410 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); | 408 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); |
| 411 mark.Finalize(); | 409 mark.Finalize(); |
| 412 ProcessPeerReferents(page_space); | 410 ProcessPeerReferents(page_space); |
| 413 Epilogue(isolate, invoke_api_callbacks); | 411 Epilogue(isolate, invoke_api_callbacks); |
| 414 } | 412 } |
| 415 | 413 |
| 416 } // namespace dart | 414 } // namespace dart |
| OLD | NEW |