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

Unified Diff: src/api.cc

Issue 2105943002: Expose TickSample and its APIs in v8-profiler.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 6 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 | « include/v8-profiler.h ('k') | src/log.h » ('j') | src/profiler/cpu-profiler.h » ('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 7268eee4dce7d300a2c8ffcf8b7f40d176041076..2cda597298d8fcd3bfd5d178eeb9b30852b872d3 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -36,6 +36,7 @@
#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
+#include "src/frames-inl.h"
#include "src/gdb-jit.h"
#include "src/global-handles.h"
#include "src/icu_util.h"
@@ -7569,23 +7570,18 @@ bool Isolate::GetHeapCodeAndMetadataStatistics(
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;
- if (!i::SimulatorHelper::FillRegisters(isolate, &regs)) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ if (!i::SimulatorHelper::FillRegisters(isolate,
+ const_cast<RegisterState*>(&state))) {
alph 2016/06/30 21:18:08 please avoid using const_cast, as the caller is no
lpy 2016/06/30 22:51:29 Done.
sample_info->frames_count = 0;
sample_info->vm_state = OTHER;
sample_info->external_callback_entry = nullptr;
return;
}
-#else
- const RegisterState& regs = state;
#endif
- i::TickSample::GetStackSample(isolate, regs, i::TickSample::kSkipCEntryFrame,
- frames, frames_limit, sample_info);
+ TickSample::GetStackSample(this, state, TickSample::kSkipCEntryFrame, frames,
+ frames_limit, sample_info);
}
size_t Isolate::NumberOfPhantomHandleResetsSinceLastCall() {
« no previous file with comments | « include/v8-profiler.h ('k') | src/log.h » ('j') | src/profiler/cpu-profiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698