This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
forked from rogchap/v8go
-
Notifications
You must be signed in to change notification settings - Fork 3
/
cpuprofilenode.go
59 lines (45 loc) · 1.54 KB
/
cpuprofilenode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2021 the v8go contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package v8go
type CPUProfileNode struct {
// The resource name for script from where the function originates.
scriptResourceName string
// The function name (empty string for anonymous functions.)
functionName string
// The number of the line where the function originates.
lineNumber int
// The number of the column where the function originates.
columnNumber int
// The children node of this node.
children []*CPUProfileNode
// The parent node of this node.
parent *CPUProfileNode
}
// Returns function name (empty string for anonymous functions.)
func (c *CPUProfileNode) GetFunctionName() string {
return c.functionName
}
// Returns resource name for script from where the function originates.
func (c *CPUProfileNode) GetScriptResourceName() string {
return c.scriptResourceName
}
// Returns number of the line where the function originates.
func (c *CPUProfileNode) GetLineNumber() int {
return c.lineNumber
}
// Returns number of the column where the function originates.
func (c *CPUProfileNode) GetColumnNumber() int {
return c.columnNumber
}
// Retrieves the ancestor node, or nil if the root.
func (c *CPUProfileNode) GetParent() *CPUProfileNode {
return c.parent
}
func (c *CPUProfileNode) GetChildrenCount() int {
return len(c.children)
}
// Retrieves a child node by index.
func (c *CPUProfileNode) GetChild(index int) *CPUProfileNode {
return c.children[index]
}