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 VM_OBJECT_GRAPH_H_ | 5 #ifndef VM_OBJECT_GRAPH_H_ |
6 #define VM_OBJECT_GRAPH_H_ | 6 #define VM_OBJECT_GRAPH_H_ |
7 | 7 |
8 #include "vm/object.h" | 8 #include "vm/object.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ~ObjectGraph(); | 54 ~ObjectGraph(); |
55 | 55 |
56 // Visits all strongly reachable objects in the isolate's heap, in a | 56 // Visits all strongly reachable objects in the isolate's heap, in a |
57 // pre-order, depth first traversal. | 57 // pre-order, depth first traversal. |
58 void IterateObjects(Visitor* visitor); | 58 void IterateObjects(Visitor* visitor); |
59 | 59 |
60 // Like 'IterateObjects', but restricted to objects reachable from 'root' | 60 // Like 'IterateObjects', but restricted to objects reachable from 'root' |
61 // (including 'root' itself). | 61 // (including 'root' itself). |
62 void IterateObjectsFrom(const Object& root, Visitor* visitor); | 62 void IterateObjectsFrom(const Object& root, Visitor* visitor); |
63 | 63 |
| 64 // The number of bytes retained by 'obj'. |
| 65 intptr_t SizeRetainedByInstance(const Object& obj); |
| 66 |
| 67 // The number of bytes retained by the set of all objects of the given class. |
| 68 intptr_t SizeRetainedByClass(intptr_t class_id); |
| 69 |
64 private: | 70 private: |
65 Isolate* isolate_; | 71 Isolate* isolate_; |
66 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph); | 72 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph); |
67 }; | 73 }; |
68 | 74 |
69 } // namespace dart | 75 } // namespace dart |
70 | 76 |
71 #endif // VM_OBJECT_GRAPH_H_ | 77 #endif // VM_OBJECT_GRAPH_H_ |
OLD | NEW |