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

Unified 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: comments addressed Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-profiler.h
diff --git a/include/v8-profiler.h b/include/v8-profiler.h
index f9439c2e629445c610b226438a21f82b2687b8de..a5e7d95e067f7c9209dbffc6e511fee7353b0944 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -17,6 +17,33 @@ struct HeapStatsUpdate;
typedef uint32_t SnapshotObjectId;
+
+class V8_EXPORT CpuProfileDeoptInfo {
+ public:
+ struct Frame {
+ int script_id;
+ unsigned int position;
yurys 2015/03/30 13:20:18 unsigned
+ };
+
+ /** Retrieves the reason of deopt. */
+ const char* GetDeoptReason() const;
+
+ /**
+ * Retrieves a height of inlined functions stack for the location
+ * where the deopt happened. I.e. if function A inlined B which inlined C
+ * and the deopt happened in the code which belongs to the inlined C
+ * 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.
+ * The second for B where C was inlined and the third for A where B was
+ * inlined. If there were no inlines then there will be the only frame
+ * for A with the location of the deopt.
+ */
+ unsigned GetFramesCount() const;
yurys 2015/03/30 13:20:18 Why not return a pointer/reference to std::vector<
+
+ /** Returns the deopt frame and a few inline frames.*/
alph 2015/03/30 13:10:33 drop 'a few'
+ bool GetCallFrames(Frame* frames, unsigned int length) const;
yurys 2015/03/30 13:20:18 ditto
+};
+
+
/**
* CpuProfileNode represents a node in a call graph.
*/
@@ -85,6 +112,12 @@ class V8_EXPORT CpuProfileNode {
/** Retrieves a child node by index. */
const CpuProfileNode* GetChild(int index) const;
+ /** Retrieves a number of deopts happened on the node. */
+ unsigned GetDeoptCount() const;
+
+ /** Retrieves a particular deopt for the node. */
+ const CpuProfileDeoptInfo* GetDeoptInfo(unsigned index) const;
+
static const int kNoLineNumberInfo = Message::kNoLineNumberInfo;
static const int kNoColumnNumberInfo = Message::kNoColumnInfo;
};
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698