Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 3c042d7ab493b5b0b29b8dc57bf4aa99372813aa..8d43f002a6dd8e35f66cccf3fbcb269711f3542c 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -40,6 +40,7 @@ |
#include "src/prototype.h" |
#include "src/runtime.h" |
#include "src/runtime-profiler.h" |
+#include "src/sampler.h" |
#include "src/scanner-character-streams.h" |
#include "src/simulator.h" |
#include "src/snapshot.h" |
@@ -6775,6 +6776,18 @@ void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { |
} |
+void Isolate::GetSample(void* sp, void* fp, Sample* sample) { |
alph
2014/09/18 11:34:29
What about pc register? It is essential to determi
gholap
2014/09/18 23:24:14
Done.
|
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ i::TickSample tick_sample; |
+ i::RegisterState state; |
+ state.sp = reinterpret_cast<i::Address>(sp); |
+ state.fp = reinterpret_cast<i::Address>(fp); |
+ tick_sample.Init(isolate, state); |
+ sample = new (sample) Sample(&tick_sample.stack[0], |
+ &tick_sample.stack[tick_sample.frames_count]); |
+} |
+ |
+ |
void Isolate::SetEventLogger(LogEventCallback that) { |
// Do not overwrite the event logger if we want to log explicitly. |
if (i::FLAG_log_timer_events) return; |