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

Unified Diff: src/api.cc

Issue 22412003: Support idle time in CPU profiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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/cpu-profiler.h » ('j') | src/isolate.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 c0f7a97f790a674dedff7013c5fa7bf5730a5be5..9bbb65cc2020637c9cc5fdea8321417cb6c0af0c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7637,6 +7637,17 @@ void CpuProfiler::DeleteAllCpuProfiles() {
}
+void CpuProfiler::SetIdle(bool is_idle) {
+ i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
+ if (isolate->js_entry_sp() != NULL) return;
+ if (is_idle) {
Yang 2013/08/07 16:23:27 Could we assert that the current vm state at this
yurys 2013/08/07 16:55:44 Done.
+ isolate->set_current_vm_state(i::IDLE);
+ } else if (isolate->current_vm_state() == i::IDLE) {
+ isolate->set_current_vm_state(i::EXTERNAL);
+ }
+}
+
+
static i::HeapGraphEdge* ToInternal(const HeapGraphEdge* edge) {
return const_cast<i::HeapGraphEdge*>(
reinterpret_cast<const i::HeapGraphEdge*>(edge));
« no previous file with comments | « include/v8-profiler.h ('k') | src/cpu-profiler.h » ('j') | src/isolate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698