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

Unified Diff: src/api.cc

Issue 578163002: Implemented GetSample. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
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;

Powered by Google App Engine
This is Rietveld 408576698