Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: include/v8-profiler.h

Issue 1045753002: CpuProfiler: public API for deopt info in cpu profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: unnecessary typedef was removed Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CpuProfileDeoptFrame {
23 int script_id;
24 size_t position;
25 };
26
27
28 #ifdef V8_OS_WIN
29 template class V8_EXPORT std::vector<CpuProfileDeoptFrame>;
30 #endif
31
32
33 struct V8_EXPORT CpuProfileDeoptInfo {
34 /** A pointer to a static string owned by v8. */
35 const char* deopt_reason;
36 std::vector<CpuProfileDeoptFrame> stack;
37 };
38
39
40 #ifdef V8_OS_WIN
41 template class V8_EXPORT std::vector<CpuProfileDeoptInfo>;
42 #endif
43
44
20 /** 45 /**
21 * CpuProfileNode represents a node in a call graph. 46 * CpuProfileNode represents a node in a call graph.
22 */ 47 */
23 class V8_EXPORT CpuProfileNode { 48 class V8_EXPORT CpuProfileNode {
24 public: 49 public:
25 struct LineTick { 50 struct LineTick {
26 /** The 1-based number of the source line where the function originates. */ 51 /** The 1-based number of the source line where the function originates. */
27 int line; 52 int line;
28 53
29 /** The count of samples associated with the source line. */ 54 /** The count of samples associated with the source line. */
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 103
79 /** Returns id of the node. The id is unique within the tree */ 104 /** Returns id of the node. The id is unique within the tree */
80 unsigned GetNodeId() const; 105 unsigned GetNodeId() const;
81 106
82 /** Returns child nodes count of the node. */ 107 /** Returns child nodes count of the node. */
83 int GetChildrenCount() const; 108 int GetChildrenCount() const;
84 109
85 /** Retrieves a child node by index. */ 110 /** Retrieves a child node by index. */
86 const CpuProfileNode* GetChild(int index) const; 111 const CpuProfileNode* GetChild(int index) const;
87 112
113 /** Retrieves deopt infos for the node. */
114 const std::vector<CpuProfileDeoptInfo>& GetDeoptInfos() const;
115
88 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; 116 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
89 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; 117 static const int kNoColumnNumberInfo = Message::kNoColumnInfo;
90 }; 118 };
91 119
92 120
93 /** 121 /**
94 * CpuProfile contains a CPU profile in a form of top-down call tree 122 * CpuProfile contains a CPU profile in a form of top-down call tree
95 * (from main() down to functions that do all the work). 123 * (from main() down to functions that do all the work).
96 */ 124 */
97 class V8_EXPORT CpuProfile { 125 class V8_EXPORT CpuProfile {
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 uint32_t index; // Index of the time interval that was changed. 633 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. 634 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. 635 uint32_t size; // New value of size field for the interval with this index.
608 }; 636 };
609 637
610 638
611 } // namespace v8 639 } // namespace v8
612 640
613 641
614 #endif // V8_V8_PROFILER_H_ 642 #endif // V8_V8_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698