| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 RUNTIME_VM_OBJECT_GRAPH_H_ | 5 #ifndef RUNTIME_VM_OBJECT_GRAPH_H_ |
| 6 #define RUNTIME_VM_OBJECT_GRAPH_H_ | 6 #define RUNTIME_VM_OBJECT_GRAPH_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // trigger GC in any way. | 56 // trigger GC in any way. |
| 57 virtual Direction VisitObject(StackIterator* it) = 0; | 57 virtual Direction VisitObject(StackIterator* it) = 0; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 explicit ObjectGraph(Thread* thread); | 60 explicit ObjectGraph(Thread* thread); |
| 61 ~ObjectGraph(); | 61 ~ObjectGraph(); |
| 62 | 62 |
| 63 // Visits all strongly reachable objects in the isolate's heap, in a | 63 // Visits all strongly reachable objects in the isolate's heap, in a |
| 64 // pre-order, depth first traversal. | 64 // pre-order, depth first traversal. |
| 65 void IterateObjects(Visitor* visitor); | 65 void IterateObjects(Visitor* visitor); |
| 66 void IterateUserObjects(Visitor* visitor); |
| 66 | 67 |
| 67 // Like 'IterateObjects', but restricted to objects reachable from 'root' | 68 // Like 'IterateObjects', but restricted to objects reachable from 'root' |
| 68 // (including 'root' itself). | 69 // (including 'root' itself). |
| 69 void IterateObjectsFrom(const Object& root, Visitor* visitor); | 70 void IterateObjectsFrom(const Object& root, Visitor* visitor); |
| 70 void IterateObjectsFrom(intptr_t class_id, Visitor* visitor); | 71 void IterateObjectsFrom(intptr_t class_id, Visitor* visitor); |
| 71 | 72 |
| 72 // The number of bytes retained by 'obj'. | 73 // The number of bytes retained by 'obj'. |
| 73 intptr_t SizeRetainedByInstance(const Object& obj); | 74 intptr_t SizeRetainedByInstance(const Object& obj); |
| 74 intptr_t SizeReachableByInstance(const Object& obj); | 75 intptr_t SizeReachableByInstance(const Object& obj); |
| 75 | 76 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 SnapshotRoots roots, | 108 SnapshotRoots roots, |
| 108 bool collect_garbage); | 109 bool collect_garbage); |
| 109 | 110 |
| 110 private: | 111 private: |
| 111 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph); | 112 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph); |
| 112 }; | 113 }; |
| 113 | 114 |
| 114 } // namespace dart | 115 } // namespace dart |
| 115 | 116 |
| 116 #endif // RUNTIME_VM_OBJECT_GRAPH_H_ | 117 #endif // RUNTIME_VM_OBJECT_GRAPH_H_ |
| OLD | NEW |