Chromium Code Reviews| 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 "v8.h" | 8 #include "v8.h" |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Profiler support for the V8 JavaScript engine. | 11 * Profiler support for the V8 JavaScript engine. |
| 12 */ | 12 */ |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 | 14 |
| 15 class HeapGraphNode; | 15 class HeapGraphNode; |
| 16 struct HeapStatsUpdate; | 16 struct HeapStatsUpdate; |
| 17 | 17 |
| 18 typedef uint32_t SnapshotObjectId; | 18 typedef uint32_t SnapshotObjectId; |
| 19 | 19 |
| 20 | |
| 21 class V8_EXPORT CpuProfileDeoptInfo { | |
| 22 public: | |
| 23 struct Frame { | |
| 24 int script_id; | |
| 25 unsigned int position; | |
|
yurys
2015/03/30 13:20:18
unsigned
| |
| 26 }; | |
| 27 | |
| 28 /** Retrieves the reason of deopt. */ | |
| 29 const char* GetDeoptReason() const; | |
| 30 | |
| 31 /** | |
| 32 * Retrieves a height of inlined functions stack for the location | |
| 33 * where the deopt happened. I.e. if function A inlined B which inlined C | |
| 34 * and the deopt happened in the code which belongs to the inlined C | |
| 35 * then we will get 3 frames. The first for C where deopt happened. | |
|
alph
2015/03/30 13:10:33
... then there will be 3 frames.
| |
| 36 * The second for B where C was inlined and the third for A where B was | |
| 37 * inlined. If there were no inlines then there will be the only frame | |
| 38 * for A with the location of the deopt. | |
| 39 */ | |
| 40 unsigned GetFramesCount() const; | |
|
yurys
2015/03/30 13:20:18
Why not return a pointer/reference to std::vector<
| |
| 41 | |
| 42 /** Returns the deopt frame and a few inline frames.*/ | |
|
alph
2015/03/30 13:10:33
drop 'a few'
| |
| 43 bool GetCallFrames(Frame* frames, unsigned int length) const; | |
|
yurys
2015/03/30 13:20:18
ditto
| |
| 44 }; | |
| 45 | |
| 46 | |
| 20 /** | 47 /** |
| 21 * CpuProfileNode represents a node in a call graph. | 48 * CpuProfileNode represents a node in a call graph. |
| 22 */ | 49 */ |
| 23 class V8_EXPORT CpuProfileNode { | 50 class V8_EXPORT CpuProfileNode { |
| 24 public: | 51 public: |
| 25 struct LineTick { | 52 struct LineTick { |
| 26 /** The 1-based number of the source line where the function originates. */ | 53 /** The 1-based number of the source line where the function originates. */ |
| 27 int line; | 54 int line; |
| 28 | 55 |
| 29 /** The count of samples associated with the source line. */ | 56 /** The count of samples associated with the source line. */ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 | 105 |
| 79 /** Returns id of the node. The id is unique within the tree */ | 106 /** Returns id of the node. The id is unique within the tree */ |
| 80 unsigned GetNodeId() const; | 107 unsigned GetNodeId() const; |
| 81 | 108 |
| 82 /** Returns child nodes count of the node. */ | 109 /** Returns child nodes count of the node. */ |
| 83 int GetChildrenCount() const; | 110 int GetChildrenCount() const; |
| 84 | 111 |
| 85 /** Retrieves a child node by index. */ | 112 /** Retrieves a child node by index. */ |
| 86 const CpuProfileNode* GetChild(int index) const; | 113 const CpuProfileNode* GetChild(int index) const; |
| 87 | 114 |
| 115 /** Retrieves a number of deopts happened on the node. */ | |
| 116 unsigned GetDeoptCount() const; | |
| 117 | |
| 118 /** Retrieves a particular deopt for the node. */ | |
| 119 const CpuProfileDeoptInfo* GetDeoptInfo(unsigned index) const; | |
| 120 | |
| 88 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; | 121 static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; |
| 89 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; | 122 static const int kNoColumnNumberInfo = Message::kNoColumnInfo; |
| 90 }; | 123 }; |
| 91 | 124 |
| 92 | 125 |
| 93 /** | 126 /** |
| 94 * CpuProfile contains a CPU profile in a form of top-down call tree | 127 * CpuProfile contains a CPU profile in a form of top-down call tree |
| 95 * (from main() down to functions that do all the work). | 128 * (from main() down to functions that do all the work). |
| 96 */ | 129 */ |
| 97 class V8_EXPORT CpuProfile { | 130 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. | 638 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. | 639 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. | 640 uint32_t size; // New value of size field for the interval with this index. |
| 608 }; | 641 }; |
| 609 | 642 |
| 610 | 643 |
| 611 } // namespace v8 | 644 } // namespace v8 |
| 612 | 645 |
| 613 | 646 |
| 614 #endif // V8_V8_PROFILER_H_ | 647 #endif // V8_V8_PROFILER_H_ |
| OLD | NEW |