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

Unified Diff: src/api.cc

Issue 1926863003: Make Isolate::GetStackSample API support simulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/profiler/sampler.h » ('j') | src/profiler/sampler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 47fc1ce1b2f62ba22dd739aeba225c14da1b9230..90f8ccabf150425eec1b6d70ed46501e49ad7b80 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7522,8 +7522,18 @@ bool Isolate::GetHeapObjectStatisticsAtLastGC(
void Isolate::GetStackSample(const RegisterState& state, void** frames,
size_t frames_limit, SampleInfo* sample_info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+#if defined(USE_SIMULATOR)
+ RegisterState regs;
+ regs.pc = state.pc;
+ regs.sp = state.sp;
+ regs.fp = state.fp;
+ i::SimulatorHelper::FillRegisters(isolate, &regs);
+ i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame,
+ frames, frames_limit, sample_info);
+#else
i::TickSample::GetStackSample(isolate, state, i::TickSample::kSkipCEntryFrame,
alph 2016/04/29 20:59:57 You don't have to copy this line twice. Just make:
lpy 2016/04/29 21:43:10 Done.
frames, frames_limit, sample_info);
+#endif
}
« no previous file with comments | « no previous file | src/profiler/sampler.h » ('j') | src/profiler/sampler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698