55package v8go
66
77type CPUProfileNode struct {
8+ // The id of the current node, unique within the tree.
9+ nodeId int
10+
11+ // The id of the script where the function originates.
12+ scriptId int
13+
814 // The resource name for script from where the function originates.
915 scriptResourceName string
1016
@@ -17,13 +23,29 @@ type CPUProfileNode struct {
1723 // The number of the column where the function originates.
1824 columnNumber int
1925
26+ // The count of samples where the function was currently executing.
27+ hitCount int
28+
29+ // The bailout reason for the function if the optimization was disabled for it.
30+ bailoutReason string
31+
2032 // The children node of this node.
2133 children []* CPUProfileNode
2234
2335 // The parent node of this node.
2436 parent * CPUProfileNode
2537}
2638
39+ // Returns node id.
40+ func (c * CPUProfileNode ) GetNodeId () int {
41+ return c .nodeId
42+ }
43+
44+ // Returns id for script from where the function originates.
45+ func (c * CPUProfileNode ) GetScriptId () int {
46+ return c .scriptId
47+ }
48+
2749// Returns function name (empty string for anonymous functions.)
2850func (c * CPUProfileNode ) GetFunctionName () string {
2951 return c .functionName
@@ -44,6 +66,16 @@ func (c *CPUProfileNode) GetColumnNumber() int {
4466 return c .columnNumber
4567}
4668
69+ // Returns count of samples where the function was currently executing.
70+ func (c * CPUProfileNode ) GetHitCount () int {
71+ return c .hitCount
72+ }
73+
74+ // Returns the bailout reason for the function if the optimization was disabled for it.
75+ func (c * CPUProfileNode ) GetBailoutReason () string {
76+ return c .bailoutReason
77+ }
78+
4779// Retrieves the ancestor node, or nil if the root.
4880func (c * CPUProfileNode ) GetParent () * CPUProfileNode {
4981 return c .parent
0 commit comments