| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 class HeapGraphNode; | 187 class HeapGraphNode; |
| 188 | 188 |
| 189 | 189 |
| 190 /** | 190 /** |
| 191 * HeapSnapshotEdge represents a directed connection between heap | 191 * HeapSnapshotEdge represents a directed connection between heap |
| 192 * graph nodes: from retaners to retained nodes. | 192 * graph nodes: from retaners to retained nodes. |
| 193 */ | 193 */ |
| 194 class V8EXPORT HeapGraphEdge { | 194 class V8EXPORT HeapGraphEdge { |
| 195 public: | 195 public: |
| 196 enum Type { | 196 enum Type { |
| 197 CONTEXT_VARIABLE = 0, // A variable from a function context. | 197 kContextVariable = 0, // A variable from a function context. |
| 198 ELEMENT = 1, // An element of an array. | 198 kElement = 1, // An element of an array. |
| 199 PROPERTY = 2, // A named object property. | 199 kProperty = 2, // A named object property. |
| 200 INTERNAL = 3 // A link that can't be accessed from JS, | 200 kInternal = 3 // A link that can't be accessed from JS, |
| 201 // thus, its name isn't a real property name. | 201 // thus, its name isn't a real property name. |
| 202 }; | 202 }; |
| 203 | 203 |
| 204 /** Returns edge type (see HeapGraphEdge::Type). */ | 204 /** Returns edge type (see HeapGraphEdge::Type). */ |
| 205 Type GetType() const; | 205 Type GetType() const; |
| 206 | 206 |
| 207 /** | 207 /** |
| 208 * Returns edge name. This can be a variable name, an element index, or | 208 * Returns edge name. This can be a variable name, an element index, or |
| 209 * a property name. | 209 * a property name. |
| 210 */ | 210 */ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 233 const HeapGraphNode* GetToNode() const; | 233 const HeapGraphNode* GetToNode() const; |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 | 236 |
| 237 /** | 237 /** |
| 238 * HeapGraphNode represents a node in a heap graph. | 238 * HeapGraphNode represents a node in a heap graph. |
| 239 */ | 239 */ |
| 240 class V8EXPORT HeapGraphNode { | 240 class V8EXPORT HeapGraphNode { |
| 241 public: | 241 public: |
| 242 enum Type { | 242 enum Type { |
| 243 INTERNAL = 0, // Internal node, a virtual one, for housekeeping. | 243 kInternal = 0, // Internal node, a virtual one, for housekeeping. |
| 244 ARRAY = 1, // An array of elements. | 244 kArray = 1, // An array of elements. |
| 245 STRING = 2, // A string. | 245 kString = 2, // A string. |
| 246 OBJECT = 3, // A JS object (except for arrays and strings). | 246 kObject = 3, // A JS object (except for arrays and strings). |
| 247 CODE = 4, // Compiled code. | 247 kCode = 4, // Compiled code. |
| 248 CLOSURE = 5 // Function closure. | 248 kClosure = 5 // Function closure. |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 /** Returns node type (see HeapGraphNode::Type). */ | 251 /** Returns node type (see HeapGraphNode::Type). */ |
| 252 Type GetType() const; | 252 Type GetType() const; |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * Returns node name. Depending on node's type this can be the name | 255 * Returns node name. Depending on node's type this can be the name |
| 256 * of the constructor (for objects), the name of the function (for | 256 * of the constructor (for objects), the name of the function (for |
| 257 * closures), string value, or an empty string (for compiled code). | 257 * closures), string value, or an empty string (for compiled code). |
| 258 */ | 258 */ |
| 259 Handle<String> GetName() const; | 259 Handle<String> GetName() const; |
| 260 | 260 |
| 261 /** | 261 /** |
| 262 * Returns node id. For the same heap object, the id remains the same | 262 * Returns node id. For the same heap object, the id remains the same |
| 263 * across all snapshots. | 263 * across all snapshots. |
| 264 */ | 264 */ |
| 265 uint64_t GetId() const; | 265 uint64_t GetId() const; |
| 266 | 266 |
| 267 /** Returns node's own size, in bytes. */ | 267 /** Returns node's own size, in bytes. */ |
| 268 int GetSelfSize() const; | 268 int GetSelfSize() const; |
| 269 | 269 |
| 270 /** Returns node's network (self + reachable nodes) size, in bytes. */ | 270 /** Returns node's network (self + reachable nodes) size, in bytes. */ |
| 271 int GetTotalSize() const; | 271 int GetReachableSize() const; |
| 272 | 272 |
| 273 /** | 273 /** |
| 274 * Returns node's private size, in bytes. That is, the size of memory | 274 * Returns node's retained size, in bytes. That is, self + sizes of |
| 275 * that will be reclaimed having this node collected. | 275 * the objects that are reachable only from this object. In other |
| 276 * words, the size of memory that will be reclaimed having this node |
| 277 * collected. |
| 276 */ | 278 */ |
| 277 int GetPrivateSize() const; | 279 int GetRetainedSize() const; |
| 278 | 280 |
| 279 /** Returns child nodes count of the node. */ | 281 /** Returns child nodes count of the node. */ |
| 280 int GetChildrenCount() const; | 282 int GetChildrenCount() const; |
| 281 | 283 |
| 282 /** Retrieves a child by index. */ | 284 /** Retrieves a child by index. */ |
| 283 const HeapGraphEdge* GetChild(int index) const; | 285 const HeapGraphEdge* GetChild(int index) const; |
| 284 | 286 |
| 285 /** Returns retainer nodes count of the node. */ | 287 /** Returns retainer nodes count of the node. */ |
| 286 int GetRetainersCount() const; | 288 int GetRetainersCount() const; |
| 287 | 289 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 }; | 346 }; |
| 345 | 347 |
| 346 | 348 |
| 347 } // namespace v8 | 349 } // namespace v8 |
| 348 | 350 |
| 349 | 351 |
| 350 #undef V8EXPORT | 352 #undef V8EXPORT |
| 351 | 353 |
| 352 | 354 |
| 353 #endif // V8_V8_PROFILER_H_ | 355 #endif // V8_V8_PROFILER_H_ |
| OLD | NEW |