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> | |
8 #include "v8.h" | 9 #include "v8.h" |
9 | 10 |
10 /** | 11 /** |
11 * Profiler support for the V8 JavaScript engine. | 12 * Profiler support for the V8 JavaScript engine. |
12 */ | 13 */ |
13 namespace v8 { | 14 namespace v8 { |
14 | 15 |
15 class HeapGraphNode; | 16 class HeapGraphNode; |
16 struct HeapStatsUpdate; | 17 struct HeapStatsUpdate; |
17 | 18 |
18 typedef uint32_t SnapshotObjectId; | 19 typedef uint32_t SnapshotObjectId; |
19 | 20 |
21 | |
22 struct V8_EXPORT CpuProfileDeoptInfo { | |
23 struct Frame { | |
24 int script_id; | |
25 unsigned int position; | |
yurys
2015/03/30 20:33:15
unsigned int -> unsigned
Sven Panne
2015/03/31 06:27:09
I think that size_t is the right type here, isn't
yurys
2015/03/31 06:53:49
Agree, size_t would be even better.
loislo
2015/03/31 08:22:51
done
| |
26 }; | |
27 const char* deopt_reason; | |
Sven Panne
2015/03/31 06:27:09
Add a comment about ownership here, naked pointer
loislo
2015/03/31 08:22:51
done
| |
28 std::vector<Frame> stack; | |
29 }; | |
30 | |
31 | |
20 /** | 32 /** |
21 * CpuProfileNode represents a node in a call graph. | 33 * CpuProfileNode represents a node in a call graph. |
22 */ | 34 */ |
23 class V8_EXPORT CpuProfileNode { | 35 class V8_EXPORT CpuProfileNode { |
24 public: | 36 public: |
25 struct LineTick { | 37 struct LineTick { |
26 /** The 1-based number of the source line where the function originates. */ | 38 /** The 1-based number of the source line where the function originates. */ |
27 int line; | 39 int line; |
28 | 40 |
29 /** The count of samples associated with the source line. */ | 41 /** The count of samples associated with the source line. */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 | 90 |
79 /** Returns id of the node. The id is unique within the tree */ | 91 /** Returns id of the node. The id is unique within the tree */ |
80 unsigned GetNodeId() const; | 92 unsigned GetNodeId() const; |
81 | 93 |
82 /** Returns child nodes count of the node. */ | 94 /** Returns child nodes count of the node. */ |
83 int GetChildrenCount() const; | 95 int GetChildrenCount() const; |
84 | 96 |
85 /** Retrieves a child node by index. */ | 97 /** Retrieves a child node by index. */ |
86 const CpuProfileNode* GetChild(int index) const; | 98 const CpuProfileNode* GetChild(int index) const; |
87 | 99 |
100 /** Retrieves deopt infos for the node. */ | |
101 const std::vector<CpuProfileDeoptInfo>& GetDeoptInfos() const; | |
102 | |
88 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; | 103 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; |
89 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; | 104 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; |
90 }; | 105 }; |
91 | 106 |
92 | 107 |
93 /** | 108 /** |
94 * CpuProfile contains a CPU profile in a form of top-down call tree | 109 * CpuProfile contains a CPU profile in a form of top-down call tree |
95 * (from main() down to functions that do all the work). | 110 * (from main() down to functions that do all the work). |
96 */ | 111 */ |
97 class V8_EXPORT CpuProfile { | 112 class V8_EXPORT CpuProfile { |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
605 uint32_t index; // Index of the time interval that was changed. | 620 uint32_t index; // Index of the time interval that was changed. |
606 uint32_t count; // New value of count field for the interval with this index. | 621 uint32_t count; // New value of count field for the interval with this index. |
607 uint32_t size; // New value of size field for the interval with this index. | 622 uint32_t size; // New value of size field for the interval with this index. |
608 }; | 623 }; |
609 | 624 |
610 | 625 |
611 } // namespace v8 | 626 } // namespace v8 |
612 | 627 |
613 | 628 |
614 #endif // V8_V8_PROFILER_H_ | 629 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |