| v8-profiler.h | | v8-profiler.h | |
| | | | |
| skipping to change at line 255 | | skipping to change at line 255 | |
| | | | |
| /** | | /** | |
| * Returns node name. Depending on node's type this can be the name | | * Returns node name. Depending on node's type this can be the name | |
| * of the constructor (for objects), the name of the function (for | | * of the constructor (for objects), the name of the function (for | |
| * closures), string value, or an empty string (for compiled code). | | * closures), string value, or an empty string (for compiled code). | |
| */ | | */ | |
| Handle<String> GetName() const; | | Handle<String> GetName() const; | |
| | | | |
| /** | | /** | |
| * Returns node id. For the same heap object, the id remains the same | | * Returns node id. For the same heap object, the id remains the same | |
|
| * across all snapshots. | | * across all snapshots. Not applicable to aggregated heap snapshots | |
| | | * as they only contain aggregated instances. | |
| */ | | */ | |
| uint64_t GetId() const; | | uint64_t GetId() const; | |
| | | | |
|
| | | /** | |
| | | * Returns the number of instances. Only applicable to aggregated | |
| | | * heap snapshots. | |
| | | */ | |
| | | int GetInstancesCount() const; | |
| | | | |
| /** Returns node's own size, in bytes. */ | | /** Returns node's own size, in bytes. */ | |
| int GetSelfSize() const; | | int GetSelfSize() const; | |
| | | | |
| /** Returns node's network (self + reachable nodes) size, in bytes. */ | | /** Returns node's network (self + reachable nodes) size, in bytes. */ | |
| int GetReachableSize() const; | | int GetReachableSize() const; | |
| | | | |
| /** | | /** | |
| * Returns node's retained size, in bytes. That is, self + sizes of | | * Returns node's retained size, in bytes. That is, self + sizes of | |
| * the objects that are reachable only from this object. In other | | * the objects that are reachable only from this object. In other | |
| * words, the size of memory that will be reclaimed having this node | | * words, the size of memory that will be reclaimed having this node | |
| | | | |
| skipping to change at line 306 | | skipping to change at line 313 | |
| | | | |
| /** Returns the root node for deleted nodes. */ | | /** Returns the root node for deleted nodes. */ | |
| const HeapGraphNode* GetDeletionsRoot() const; | | const HeapGraphNode* GetDeletionsRoot() const; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * HeapSnapshots record the state of the JS heap at some moment. | | * HeapSnapshots record the state of the JS heap at some moment. | |
| */ | | */ | |
| class V8EXPORT HeapSnapshot { | | class V8EXPORT HeapSnapshot { | |
| public: | | public: | |
|
| | | enum Type { | |
| | | kFull = 0, // Heap snapshot with all instances and references. | |
| | | kAggregated = 1 // Snapshot doesn't contain individual heap entries, | |
| | | //instead they are grouped by constructor name. | |
| | | }; | |
| | | | |
| | | /** Returns heap snapshot type. */ | |
| | | Type GetType() const; | |
| | | | |
| /** Returns heap snapshot UID (assigned by the profiler.) */ | | /** Returns heap snapshot UID (assigned by the profiler.) */ | |
| unsigned GetUid() const; | | unsigned GetUid() const; | |
| | | | |
| /** Returns heap snapshot title. */ | | /** Returns heap snapshot title. */ | |
| Handle<String> GetTitle() const; | | Handle<String> GetTitle() const; | |
| | | | |
| /** Returns the root node of the heap graph. */ | | /** Returns the root node of the heap graph. */ | |
| const HeapGraphNode* GetRoot() const; | | const HeapGraphNode* GetRoot() const; | |
| | | | |
|
| /** Returns a diff between this snapshot and another one. */ | | /** | |
| | | * Returns a diff between this snapshot and another one. Only snapshots | |
| | | * of the same type can be compared. | |
| | | */ | |
| const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const; | | const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Interface for controlling heap profiling. | | * Interface for controlling heap profiling. | |
| */ | | */ | |
| class V8EXPORT HeapProfiler { | | class V8EXPORT HeapProfiler { | |
| public: | | public: | |
| /** Returns the number of snapshots taken. */ | | /** Returns the number of snapshots taken. */ | |
| static int GetSnapshotsCount(); | | static int GetSnapshotsCount(); | |
| | | | |
| /** Returns a snapshot by index. */ | | /** Returns a snapshot by index. */ | |
| static const HeapSnapshot* GetSnapshot(int index); | | static const HeapSnapshot* GetSnapshot(int index); | |
| | | | |
| /** Returns a profile by uid. */ | | /** Returns a profile by uid. */ | |
| static const HeapSnapshot* FindSnapshot(unsigned uid); | | static const HeapSnapshot* FindSnapshot(unsigned uid); | |
| | | | |
|
| /** Takes a heap snapshot and returns it. Title may be an empty string. * | | /** | |
| / | | * Takes a heap snapshot and returns it. Title may be an empty string. | |
| static const HeapSnapshot* TakeSnapshot(Handle<String> title); | | * See HeapSnapshot::Type for types description. | |
| | | */ | |
| | | static const HeapSnapshot* TakeSnapshot( | |
| | | Handle<String> title, | |
| | | HeapSnapshot::Type type = HeapSnapshot::kFull); | |
| }; | | }; | |
| | | | |
| } // namespace v8 | | } // namespace v8 | |
| | | | |
| #undef V8EXPORT | | #undef V8EXPORT | |
| | | | |
| #endif // V8_V8_PROFILER_H_ | | #endif // V8_V8_PROFILER_H_ | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 28 lines changed or added | |
|