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

Unified Diff: src/api.cc

Issue 596533002: Initial implementation of GetStackSample sampling profiler API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ARM32 build. 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
« no previous file with comments | « include/v8.h ('k') | src/globals.h » ('j') | no next file with comments »
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 e11d14084b3e292c749d2597a2e51e7b49199c4b..0b0c157eb598f6d2948ce938bac8d12b7cd7dee7 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"
@@ -51,9 +52,9 @@
#define LOG_API(isolate, expr) LOG(isolate, ApiEntryCall(expr))
-#define ENTER_V8(isolate) \
- DCHECK((isolate)->IsInitialized()); \
- i::VMState<i::OTHER> __state__((isolate))
+#define ENTER_V8(isolate) \
+ DCHECK((isolate)->IsInitialized()); \
+ i::VMState<v8::OTHER> __state__((isolate))
namespace v8 {
@@ -6688,6 +6689,14 @@ void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
}
+void Isolate::GetStackSample(const RegisterState& state, void** frames,
+ size_t frames_limit, SampleInfo* sample_info) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ i::TickSample::GetStackSample(isolate, state, frames, frames_limit,
+ sample_info);
+}
+
+
void Isolate::SetEventLogger(LogEventCallback that) {
// Do not overwrite the event logger if we want to log explicitly.
if (i::FLAG_log_timer_events) return;
@@ -7173,13 +7182,13 @@ const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) {
void CpuProfiler::SetIdle(bool is_idle) {
i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
- i::StateTag state = isolate->current_vm_state();
- DCHECK(state == i::EXTERNAL || state == i::IDLE);
+ v8::StateTag state = isolate->current_vm_state();
+ DCHECK(state == v8::EXTERNAL || state == v8::IDLE);
if (isolate->js_entry_sp() != NULL) return;
if (is_idle) {
- isolate->set_current_vm_state(i::IDLE);
- } else if (state == i::IDLE) {
- isolate->set_current_vm_state(i::EXTERNAL);
+ isolate->set_current_vm_state(v8::IDLE);
+ } else if (state == v8::IDLE) {
+ isolate->set_current_vm_state(v8::EXTERNAL);
}
}
« no previous file with comments | « include/v8.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698