Commit eda8ea16 authored by dgozman's avatar dgozman Committed by Commit bot

Ignore CpuProfiler::SetIdle call when not profiling.

It truned out we can enter nested message loop and call
SetIdle from inside the compilation in some obscure
situations. To not whitelist all the possible StateTag values,
we'd better ignore this call when not profiling as it has
no effect anyway.

This patch also reverts DCHECK change from https://codereview.chromium.org/1922703005/.

BUG=none
LOG=N

Review-Url: https://codereview.chromium.org/1936703002
Cr-Commit-Position: refs/heads/master@{#35946}
parent 567aa1be
......@@ -8361,9 +8361,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;
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment