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

Unified Diff: src/api.cc

Issue 1936703002: Ignore CpuProfiler::SetIdle call when not profiling. (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 | no next file » | 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 8214028311bc1b7dcc60cd7cabb9801f86446438..084da50be8315e2a31302778157e846459222cee 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8352,9 +8352,11 @@ CpuProfile* CpuProfiler::StopProfiling(Local<String> title) {
void CpuProfiler::SetIdle(bool is_idle) {
- i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
+ i::CpuProfiler* profiler = reinterpret_cast<i::CpuProfiler*>(this);
+ if (!profiler->is_profiling()) return;
alph 2016/04/30 00:03:08 Sorry, didn't get how it helps. If we're not profi
dgozman 2016/04/30 00:10:39 This does not happen, since compilation cannot tri
alph 2016/04/30 00:29:20 Looks more robust to me. The problem is that when
+ i::Isolate* isolate = profiler->isolate();
v8::StateTag state = isolate->current_vm_state();
- DCHECK(state == v8::JS || state == v8::EXTERNAL || state == v8::IDLE);
+ DCHECK(state == v8::EXTERNAL || state == v8::IDLE);
if (isolate->js_entry_sp() != NULL) return;
if (is_idle) {
isolate->set_current_vm_state(v8::IDLE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698