Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 73384946ba7d93594fd5c3d78753dfe01c2726f6..469dfdc477927bf415d73e4e0bc0b39b6a70bf81 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -1298,6 +1298,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 { |
Benedikt Meurer
2014/09/03 04:24:30
I would really love to get rid of the public field
gholap
2014/09/03 19:44:29
Let us discuss this in person?
|
+ Sample() |
+ : frames_count(0) {} |
+ static const unsigned kMaxFramesCount = 255; |
Benedikt Meurer
2014/09/03 04:24:30
Should probably be
enum { kMaxFramesCount = 255u
gholap
2014/09/03 19:44:29
Done.
|
+ |
+ void* stack[kMaxFramesCount]; // Call stack. |
+ unsigned frames_count; // Number of captured frames. |
Benedikt Meurer
2014/09/03 04:24:30
I think this should be size_t instead of unsigned.
gholap
2014/09/03 19:44:29
Done.
|
+}; |
+ |
+ |
+/** |
* A JSON Parser. |
*/ |
class V8_EXPORT JSON { |
@@ -4217,6 +4240,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 |