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/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // (including 'root' itself). | 62 // (including 'root' itself). |
63 void IterateObjectsFrom(const Object& root, Visitor* visitor); | 63 void IterateObjectsFrom(const Object& root, Visitor* visitor); |
64 | 64 |
65 // The number of bytes retained by 'obj'. | 65 // The number of bytes retained by 'obj'. |
66 intptr_t SizeRetainedByInstance(const Object& obj); | 66 intptr_t SizeRetainedByInstance(const Object& obj); |
67 | 67 |
68 // The number of bytes retained by the set of all objects of the given class. | 68 // The number of bytes retained by the set of all objects of the given class. |
69 intptr_t SizeRetainedByClass(intptr_t class_id); | 69 intptr_t SizeRetainedByClass(intptr_t class_id); |
70 | 70 |
71 // Finds some retaining path from the isolate roots to 'obj'. Populates the | 71 // Finds some retaining path from the isolate roots to 'obj'. Populates the |
72 // provided array, starting with a direct parent of 'obj', up to the smaller | 72 // provided array, starting 'obj' itself, up to the smaller of the length of |
73 // of the length of the array and the length of the path. Returns the length | 73 // the array and the length of the path. Returns the length of the path. A |
74 // of the path. A null input array behaves like a zero-length input array. | 74 // null input array behaves like a zero-length input array. |
75 // | 75 // |
76 // To break the trivial path, the handle 'obj' is temporarily cleared during | 76 // To break the trivial path, the handle 'obj' is temporarily cleared during |
77 // the search, but restored before returning. If no path is found (i.e., the | 77 // the search, but restored before returning. If no path is found (i.e., the |
78 // provided handle was the only way to reach the object), zero is returned. | 78 // provided handle was the only way to reach the object), zero is returned. |
79 intptr_t RetainingPath(Object* obj, const Array& path); | 79 intptr_t RetainingPath(Object* obj, const Array& path); |
80 | 80 |
81 private: | 81 private: |
82 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph); | 82 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGraph); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace dart | 85 } // namespace dart |
86 | 86 |
87 #endif // VM_OBJECT_GRAPH_H_ | 87 #endif // VM_OBJECT_GRAPH_H_ |
OLD | NEW |