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

Unified Diff: include/v8.h

Issue 422593003: Initial GetSample implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed Address from public API. Removed the function to copy TickSample to Sample. Created 6 years, 4 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/log.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 5730fdf8e7fa5bccdf55eaa2de8b45145c606297..b02cbc8db7ba414b48296998e54dce47c37c0589 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1289,6 +1289,29 @@ class V8_EXPORT StackFrame {
/**
+ * Isolate::Getsample collects the current JS execution state as a sample.
+ * A collected sample contains,
+ * - stack : An array of addresses.
+ * One address per stack frame.
+ * The address is the instruction pointer,
+ * pointing to the instruction which led to the
+ * creation of the stack frame.
+ * (for example, a function call)
+ * - frames_count: Number of stack frames that were captured.
+ * That is, stack[frames_count+i] might contain meaningless
+ * addresses for any i >= 0.
+ */
+struct V8_EXPORT Sample {
+ Sample()
+ : frames_count(0) {}
+ static const unsigned kMaxFramesCount = 255;
+
+ void* stack[kMaxFramesCount]; // Call stack.
+ unsigned frames_count; // Number of captured frames.
+};
+
+
+/**
* A JSON Parser.
*/
class V8_EXPORT JSON {
@@ -4208,6 +4231,11 @@ class V8_EXPORT Isolate {
void GetHeapStatistics(HeapStatistics* heap_statistics);
/**
+ * Get a sample from the isolate.
+ */
+ void GetSample(Sample* sample);
+
+ /**
* Adjusts the amount of registered external memory. Used to give V8 an
* indication of the amount of externally allocated memory that is kept alive
* by JavaScript objects. V8 uses this to decide when to perform global
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/log.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698