| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 /** | 263 /** |
| 264 * Returns node name. Depending on node's type this can be the name | 264 * Returns node name. Depending on node's type this can be the name |
| 265 * of the constructor (for objects), the name of the function (for | 265 * of the constructor (for objects), the name of the function (for |
| 266 * closures), string value, or an empty string (for compiled code). | 266 * closures), string value, or an empty string (for compiled code). |
| 267 */ | 267 */ |
| 268 Handle<String> GetName() const; | 268 Handle<String> GetName() const; |
| 269 | 269 |
| 270 /** | 270 /** |
| 271 * Returns node id. For the same heap object, the id remains the same | 271 * Returns node id. For the same heap object, the id remains the same |
| 272 * across all snapshots. Not applicable to aggregated heap snapshots | 272 * across all snapshots. |
| 273 * as they only contain aggregated instances. | |
| 274 */ | 273 */ |
| 275 uint64_t GetId() const; | 274 uint64_t GetId() const; |
| 276 | 275 |
| 277 /** | |
| 278 * Returns the number of instances. Only applicable to aggregated | |
| 279 * heap snapshots. | |
| 280 */ | |
| 281 int GetInstancesCount() const; | |
| 282 | |
| 283 /** Returns node's own size, in bytes. */ | 276 /** Returns node's own size, in bytes. */ |
| 284 int GetSelfSize() const; | 277 int GetSelfSize() const; |
| 285 | 278 |
| 286 /** | 279 /** |
| 287 * Returns node's retained size, in bytes. That is, self + sizes of | 280 * Returns node's retained size, in bytes. That is, self + sizes of |
| 288 * the objects that are reachable only from this object. In other | 281 * the objects that are reachable only from this object. In other |
| 289 * words, the size of memory that will be reclaimed having this node | 282 * words, the size of memory that will be reclaimed having this node |
| 290 * collected. | 283 * collected. |
| 291 * | 284 * |
| 292 * Exact retained size calculation has O(N) (number of nodes) | 285 * Exact retained size calculation has O(N) (number of nodes) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 316 const HeapGraphNode* GetDominatorNode() const; | 309 const HeapGraphNode* GetDominatorNode() const; |
| 317 }; | 310 }; |
| 318 | 311 |
| 319 | 312 |
| 320 /** | 313 /** |
| 321 * HeapSnapshots record the state of the JS heap at some moment. | 314 * HeapSnapshots record the state of the JS heap at some moment. |
| 322 */ | 315 */ |
| 323 class V8EXPORT HeapSnapshot { | 316 class V8EXPORT HeapSnapshot { |
| 324 public: | 317 public: |
| 325 enum Type { | 318 enum Type { |
| 326 kFull = 0, // Heap snapshot with all instances and references. | 319 kFull = 0 // Heap snapshot with all instances and references. |
| 327 kAggregated = 1 // Snapshot doesn't contain individual heap entries, | |
| 328 // instead they are grouped by constructor name. | |
| 329 }; | 320 }; |
| 330 enum SerializationFormat { | 321 enum SerializationFormat { |
| 331 kJSON = 0 // See format description near 'Serialize' method. | 322 kJSON = 0 // See format description near 'Serialize' method. |
| 332 }; | 323 }; |
| 333 | 324 |
| 334 /** Returns heap snapshot type. */ | 325 /** Returns heap snapshot type. */ |
| 335 Type GetType() const; | 326 Type GetType() const; |
| 336 | 327 |
| 337 /** Returns heap snapshot UID (assigned by the profiler.) */ | 328 /** Returns heap snapshot UID (assigned by the profiler.) */ |
| 338 unsigned GetUid() const; | 329 unsigned GetUid() const; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 }; | 493 }; |
| 503 | 494 |
| 504 | 495 |
| 505 } // namespace v8 | 496 } // namespace v8 |
| 506 | 497 |
| 507 | 498 |
| 508 #undef V8EXPORT | 499 #undef V8EXPORT |
| 509 | 500 |
| 510 | 501 |
| 511 #endif // V8_V8_PROFILER_H_ | 502 #endif // V8_V8_PROFILER_H_ |
| OLD | NEW |