| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #endif // defined(__GNUC__) && (__GNUC__ >= 4) | 57 #endif // defined(__GNUC__) && (__GNUC__ >= 4) |
| 58 | 58 |
| 59 #endif // _WIN32 | 59 #endif // _WIN32 |
| 60 | 60 |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Profiler support for the V8 JavaScript engine. | 63 * Profiler support for the V8 JavaScript engine. |
| 64 */ | 64 */ |
| 65 namespace v8 { | 65 namespace v8 { |
| 66 | 66 |
| 67 typedef uint32_t SnapshotObjectId; |
| 67 | 68 |
| 68 /** | 69 /** |
| 69 * CpuProfileNode represents a node in a call graph. | 70 * CpuProfileNode represents a node in a call graph. |
| 70 */ | 71 */ |
| 71 class V8EXPORT CpuProfileNode { | 72 class V8EXPORT CpuProfileNode { |
| 72 public: | 73 public: |
| 73 /** Returns function name (empty string for anonymous functions.) */ | 74 /** Returns function name (empty string for anonymous functions.) */ |
| 74 Handle<String> GetFunctionName() const; | 75 Handle<String> GetFunctionName() const; |
| 75 | 76 |
| 76 /** Returns resource name for script from where the function originates. */ | 77 /** Returns resource name for script from where the function originates. */ |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 * Returns node name. Depending on node's type this can be the name | 268 * Returns node name. Depending on node's type this can be the name |
| 268 * of the constructor (for objects), the name of the function (for | 269 * of the constructor (for objects), the name of the function (for |
| 269 * closures), string value, or an empty string (for compiled code). | 270 * closures), string value, or an empty string (for compiled code). |
| 270 */ | 271 */ |
| 271 Handle<String> GetName() const; | 272 Handle<String> GetName() const; |
| 272 | 273 |
| 273 /** | 274 /** |
| 274 * Returns node id. For the same heap object, the id remains the same | 275 * Returns node id. For the same heap object, the id remains the same |
| 275 * across all snapshots. | 276 * across all snapshots. |
| 276 */ | 277 */ |
| 277 uint64_t GetId() const; | 278 SnapshotObjectId GetId() const; |
| 278 | 279 |
| 279 /** Returns node's own size, in bytes. */ | 280 /** Returns node's own size, in bytes. */ |
| 280 int GetSelfSize() const; | 281 int GetSelfSize() const; |
| 281 | 282 |
| 282 /** | 283 /** |
| 283 * Returns node's retained size, in bytes. That is, self + sizes of | 284 * Returns node's retained size, in bytes. That is, self + sizes of |
| 284 * the objects that are reachable only from this object. In other | 285 * the objects that are reachable only from this object. In other |
| 285 * words, the size of memory that will be reclaimed having this node | 286 * words, the size of memory that will be reclaimed having this node |
| 286 * collected. | 287 * collected. |
| 287 */ | 288 */ |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 /** Returns heap snapshot UID (assigned by the profiler.) */ | 332 /** Returns heap snapshot UID (assigned by the profiler.) */ |
| 332 unsigned GetUid() const; | 333 unsigned GetUid() const; |
| 333 | 334 |
| 334 /** Returns heap snapshot title. */ | 335 /** Returns heap snapshot title. */ |
| 335 Handle<String> GetTitle() const; | 336 Handle<String> GetTitle() const; |
| 336 | 337 |
| 337 /** Returns the root node of the heap graph. */ | 338 /** Returns the root node of the heap graph. */ |
| 338 const HeapGraphNode* GetRoot() const; | 339 const HeapGraphNode* GetRoot() const; |
| 339 | 340 |
| 340 /** Returns a node by its id. */ | 341 /** Returns a node by its id. */ |
| 341 const HeapGraphNode* GetNodeById(uint64_t id) const; | 342 const HeapGraphNode* GetNodeById(SnapshotObjectId id) const; |
| 342 | 343 |
| 343 /** Returns total nodes count in the snapshot. */ | 344 /** Returns total nodes count in the snapshot. */ |
| 344 int GetNodesCount() const; | 345 int GetNodesCount() const; |
| 345 | 346 |
| 346 /** Returns a node by index. */ | 347 /** Returns a node by index. */ |
| 347 const HeapGraphNode* GetNode(int index) const; | 348 const HeapGraphNode* GetNode(int index) const; |
| 348 | 349 |
| 349 /** | 350 /** |
| 350 * Deletes the snapshot and removes it from HeapProfiler's list. | 351 * Deletes the snapshot and removes it from HeapProfiler's list. |
| 351 * All pointers to nodes, edges and paths previously returned become | 352 * All pointers to nodes, edges and paths previously returned become |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 }; | 511 }; |
| 511 | 512 |
| 512 | 513 |
| 513 } // namespace v8 | 514 } // namespace v8 |
| 514 | 515 |
| 515 | 516 |
| 516 #undef V8EXPORT | 517 #undef V8EXPORT |
| 517 | 518 |
| 518 | 519 |
| 519 #endif // V8_V8_PROFILER_H_ | 520 #endif // V8_V8_PROFILER_H_ |
| OLD | NEW |