OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_V8_PROFILER_H_ | 5 #ifndef V8_V8_PROFILER_H_ |
6 #define V8_V8_PROFILER_H_ | 6 #define V8_V8_PROFILER_H_ |
7 | 7 |
8 #include <vector> | |
9 #include "v8.h" | 8 #include "v8.h" |
10 | 9 |
11 /** | 10 /** |
12 * Profiler support for the V8 JavaScript engine. | 11 * Profiler support for the V8 JavaScript engine. |
13 */ | 12 */ |
14 namespace v8 { | 13 namespace v8 { |
15 | 14 |
16 class HeapGraphNode; | 15 class HeapGraphNode; |
17 struct HeapStatsUpdate; | 16 struct HeapStatsUpdate; |
18 | 17 |
19 typedef uint32_t SnapshotObjectId; | 18 typedef uint32_t SnapshotObjectId; |
20 | 19 |
21 | |
22 struct V8_EXPORT CpuProfileDeoptInfo { | |
23 struct Frame { | |
24 int script_id; | |
25 size_t position; | |
26 }; | |
27 /** A pointer to a static string owned by v8. */ | |
28 const char* deopt_reason; | |
29 std::vector<Frame> stack; | |
30 }; | |
31 | |
32 | |
33 /** | 20 /** |
34 * CpuProfileNode represents a node in a call graph. | 21 * CpuProfileNode represents a node in a call graph. |
35 */ | 22 */ |
36 class V8_EXPORT CpuProfileNode { | 23 class V8_EXPORT CpuProfileNode { |
37 public: | 24 public: |
38 struct LineTick { | 25 struct LineTick { |
39 /** The 1-based number of the source line where the function originates. */ | 26 /** The 1-based number of the source line where the function originates. */ |
40 int line; | 27 int line; |
41 | 28 |
42 /** The count of samples associated with the source line. */ | 29 /** The count of samples associated with the source line. */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 78 |
92 /** Returns id of the node. The id is unique within the tree */ | 79 /** Returns id of the node. The id is unique within the tree */ |
93 unsigned GetNodeId() const; | 80 unsigned GetNodeId() const; |
94 | 81 |
95 /** Returns child nodes count of the node. */ | 82 /** Returns child nodes count of the node. */ |
96 int GetChildrenCount() const; | 83 int GetChildrenCount() const; |
97 | 84 |
98 /** Retrieves a child node by index. */ | 85 /** Retrieves a child node by index. */ |
99 const CpuProfileNode* GetChild(int index) const; | 86 const CpuProfileNode* GetChild(int index) const; |
100 | 87 |
101 /** Retrieves deopt infos for the node. */ | |
102 const std::vector<CpuProfileDeoptInfo>& GetDeoptInfos() const; | |
103 | |
104 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; | 88 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; |
105 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; | 89 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; |
106 }; | 90 }; |
107 | 91 |
108 | 92 |
109 /** | 93 /** |
110 * CpuProfile contains a CPU profile in a form of top-down call tree | 94 * CpuProfile contains a CPU profile in a form of top-down call tree |
111 * (from main() down to functions that do all the work). | 95 * (from main() down to functions that do all the work). |
112 */ | 96 */ |
113 class V8_EXPORT CpuProfile { | 97 class V8_EXPORT CpuProfile { |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 uint32_t index; // Index of the time interval that was changed. | 605 uint32_t index; // Index of the time interval that was changed. |
622 uint32_t count; // New value of count field for the interval with this index. | 606 uint32_t count; // New value of count field for the interval with this index. |
623 uint32_t size; // New value of size field for the interval with this index. | 607 uint32_t size; // New value of size field for the interval with this index. |
624 }; | 608 }; |
625 | 609 |
626 | 610 |
627 } // namespace v8 | 611 } // namespace v8 |
628 | 612 |
629 | 613 |
630 #endif // V8_V8_PROFILER_H_ | 614 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |