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)); |