v8-profiler.h | v8-profiler.h | |||
---|---|---|---|---|
skipping to change at line 194 | skipping to change at line 194 | |||
/** | /** | |||
* HeapSnapshotEdge represents a directed connection between heap | * HeapSnapshotEdge represents a directed connection between heap | |||
* graph nodes: from retaners to retained nodes. | * graph nodes: from retaners to retained nodes. | |||
*/ | */ | |||
class V8EXPORT HeapGraphEdge { | class V8EXPORT HeapGraphEdge { | |||
public: | public: | |||
enum Type { | enum Type { | |||
kContextVariable = 0, // A variable from a function context. | kContextVariable = 0, // A variable from a function context. | |||
kElement = 1, // An element of an array. | kElement = 1, // An element of an array. | |||
kProperty = 2, // A named object property. | kProperty = 2, // A named object property. | |||
kInternal = 3 // A link that can't be accessed from JS, | kInternal = 3, // A link that can't be accessed from JS, | |||
// thus, its name isn't a real property name. | // thus, its name isn't a real property name | |||
// (e.g. parts of a ConsString). | ||||
kHidden = 4, // A link that is needed for proper sizes | ||||
// calculation, but may be hidden from user. | ||||
kShortcut = 5 // A link that must not be followed during | ||||
// sizes calculation. | ||||
}; | }; | |||
/** Returns edge type (see HeapGraphEdge::Type). */ | /** Returns edge type (see HeapGraphEdge::Type). */ | |||
Type GetType() const; | Type GetType() const; | |||
/** | /** | |||
* Returns edge name. This can be a variable name, an element index, or | * Returns edge name. This can be a variable name, an element index, or | |||
* a property name. | * a property name. | |||
*/ | */ | |||
Handle<Value> GetName() const; | Handle<Value> GetName() const; | |||
skipping to change at line 235 | skipping to change at line 240 | |||
/** Returns destination node. */ | /** Returns destination node. */ | |||
const HeapGraphNode* GetToNode() const; | const HeapGraphNode* GetToNode() const; | |||
}; | }; | |||
/** | /** | |||
* HeapGraphNode represents a node in a heap graph. | * HeapGraphNode represents a node in a heap graph. | |||
*/ | */ | |||
class V8EXPORT HeapGraphNode { | class V8EXPORT HeapGraphNode { | |||
public: | public: | |||
enum Type { | enum Type { | |||
kInternal = 0, // Internal node, a virtual one, for housekeeping. | kInternal = 0, // For compatibility, will be removed. | |||
kHidden = 0, // Hidden node, may be filtered when shown to user. | ||||
kArray = 1, // An array of elements. | kArray = 1, // An array of elements. | |||
kString = 2, // A string. | kString = 2, // A string. | |||
kObject = 3, // A JS object (except for arrays and strings). | kObject = 3, // A JS object (except for arrays and strings). | |||
kCode = 4, // Compiled code. | kCode = 4, // Compiled code. | |||
kClosure = 5, // Function closure. | kClosure = 5, // Function closure. | |||
kRegExp = 6, // RegExp. | kRegExp = 6, // RegExp. | |||
kHeapNumber = 7 // Number stored in the heap. | kHeapNumber = 7 // Number stored in the heap. | |||
}; | }; | |||
/** Returns node type (see HeapGraphNode::Type). */ | /** Returns node type (see HeapGraphNode::Type). */ | |||
skipping to change at line 271 | skipping to change at line 277 | |||
/** | /** | |||
* Returns the number of instances. Only applicable to aggregated | * Returns the number of instances. Only applicable to aggregated | |||
* heap snapshots. | * heap snapshots. | |||
*/ | */ | |||
int GetInstancesCount() const; | 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. */ | ||||
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 | |||
* collected. | * collected. | |||
* | ||||
* Exact retained size calculation has O(N) (number of nodes) | ||||
* computational complexity, while approximate has O(1). It is | ||||
* assumed that initially heap profiling tools provide approximate | ||||
* sizes for all nodes, and then exact sizes are calculated for the | ||||
* most 'interesting' nodes. | ||||
*/ | */ | |||
int GetRetainedSize() const; | int GetRetainedSize(bool exact) const; | |||
/** Returns child nodes count of the node. */ | /** Returns child nodes count of the node. */ | |||
int GetChildrenCount() const; | int GetChildrenCount() const; | |||
/** Retrieves a child by index. */ | /** Retrieves a child by index. */ | |||
const HeapGraphEdge* GetChild(int index) const; | const HeapGraphEdge* GetChild(int index) const; | |||
/** Returns retainer nodes count of the node. */ | /** Returns retainer nodes count of the node. */ | |||
int GetRetainersCount() const; | int GetRetainersCount() const; | |||
/** Returns a retainer by index. */ | /** Returns a retainer by index. */ | |||
const HeapGraphEdge* GetRetainer(int index) const; | const HeapGraphEdge* GetRetainer(int index) const; | |||
/** Returns the number of simple retaining paths from the root to the nod e. */ | /** Returns the number of simple retaining paths from the root to the nod e. */ | |||
int GetRetainingPathsCount() const; | int GetRetainingPathsCount() const; | |||
/** Returns a retaining path by index. */ | /** Returns a retaining path by index. */ | |||
const HeapGraphPath* GetRetainingPath(int index) const; | const HeapGraphPath* GetRetainingPath(int index) const; | |||
/** | ||||
* Returns a dominator node. This is the node that participates in every | ||||
* path from the snapshot root to the current node. | ||||
*/ | ||||
const HeapGraphNode* GetDominatorNode() const; | ||||
}; | }; | |||
class V8EXPORT HeapSnapshotsDiff { | class V8EXPORT HeapSnapshotsDiff { | |||
public: | public: | |||
/** Returns the root node for added nodes. */ | /** Returns the root node for added nodes. */ | |||
const HeapGraphNode* GetAdditionsRoot() const; | const HeapGraphNode* GetAdditionsRoot() const; | |||
/** Returns the root node for deleted nodes. */ | /** Returns the root node for deleted nodes. */ | |||
const HeapGraphNode* GetDeletionsRoot() const; | const HeapGraphNode* GetDeletionsRoot() const; | |||
}; | }; | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 22 lines changed or added | |||