| 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 #ifndef VM_GC_MARKER_H_ | 5 #ifndef VM_GC_MARKER_H_ |
| 6 #define VM_GC_MARKER_H_ | 6 #define VM_GC_MARKER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 // Forward declarations. | 12 // Forward declarations. |
| 13 class HandleVisitor; |
| 13 class Heap; | 14 class Heap; |
| 14 class Isolate; | 15 class Isolate; |
| 15 class MarkingVisitor; | 16 class MarkingVisitor; |
| 16 class ObjectPointerVisitor; | 17 class ObjectPointerVisitor; |
| 17 class PageSpace; | 18 class PageSpace; |
| 18 | 19 |
| 19 // The class GCMarker is used to mark reachable old generation objects as part | 20 // The class GCMarker is used to mark reachable old generation objects as part |
| 20 // of the mark-sweep collection. The marking bit used is defined in RawObject. | 21 // of the mark-sweep collection. The marking bit used is defined in RawObject. |
| 21 class GCMarker : public ValueObject { | 22 class GCMarker : public ValueObject { |
| 22 public: | 23 public: |
| 23 explicit GCMarker(Heap* heap) : heap_(heap) { } | 24 explicit GCMarker(Heap* heap) : heap_(heap) { } |
| 24 ~GCMarker() { } | 25 ~GCMarker() { } |
| 25 | 26 |
| 26 void MarkObjects(Isolate* isolate, PageSpace* page_space); | 27 void MarkObjects(Isolate* isolate, PageSpace* page_space); |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 void Prologue(Isolate* isolate); | 30 void Prologue(Isolate* isolate); |
| 30 void IterateRoots(Isolate* isolate, ObjectPointerVisitor* visitor); | 31 void IterateRoots(Isolate* isolate, ObjectPointerVisitor* visitor); |
| 31 void IterateWeakRoots(Isolate* isolate, ObjectPointerVisitor* visitor); | 32 void IterateWeakRoots(Isolate* isolate, HandleVisitor* visitor); |
| 32 void DrainMarkingStack(Isolate* isolate, MarkingVisitor* visitor); | 33 void DrainMarkingStack(Isolate* isolate, MarkingVisitor* visitor); |
| 33 | 34 |
| 34 Heap* heap_; | 35 Heap* heap_; |
| 35 | 36 |
| 36 DISALLOW_IMPLICIT_CONSTRUCTORS(GCMarker); | 37 DISALLOW_IMPLICIT_CONSTRUCTORS(GCMarker); |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 } // namespace dart | 40 } // namespace dart |
| 40 | 41 |
| 41 #endif // VM_GC_MARKER_H_ | 42 #endif // VM_GC_MARKER_H_ |
| OLD | NEW |