Commit 9cf856a8 authored by dgozman's avatar dgozman Committed by Commit bot

Allow CpuProfiler::SetIdle to be called while executing JS.

This could be the case when running nested message loop
while paused in debugger.

BUG=none
LOG=N

Review-Url: https://codereview.chromium.org/1922703005
Cr-Commit-Position: refs/heads/master@{#35880}
parent 3e9924f6
...@@ -8354,7 +8354,7 @@ CpuProfile* CpuProfiler::StopProfiling(Local<String> title) { ...@@ -8354,7 +8354,7 @@ CpuProfile* CpuProfiler::StopProfiling(Local<String> title) {
void CpuProfiler::SetIdle(bool is_idle) { void CpuProfiler::SetIdle(bool is_idle) {
i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate(); i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
v8::StateTag state = isolate->current_vm_state(); v8::StateTag state = isolate->current_vm_state();
DCHECK(state == v8::EXTERNAL || state == v8::IDLE); DCHECK(state == v8::JS || state == v8::EXTERNAL || state == v8::IDLE);
if (isolate->js_entry_sp() != NULL) return; if (isolate->js_entry_sp() != NULL) return;
if (is_idle) { if (is_idle) {
isolate->set_current_vm_state(v8::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