Commit e16bd85b authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[tooling] Reland "Keep track of idle state even when we aren't profiling"

> It isn't expensive to set this enum on the isolate and we only call
> this in chrome when the ThreadDebugger is enabled anyway.
>
> This means we have a correct idle state to use with the upcoming
> CDP event which emits the thread state.

This time, move the dcheck below the stack pointer check. It turns out
we call into this with current state == JS, but only when js is on the
stack, so we can just move the check lower.

Bug: chromium:1025490
Change-Id: Ic9b2eff1ae1880535d0c6da5487ebea4f7e5e62b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039050Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66192}
parent 9e548ec7
......@@ -4362,10 +4362,9 @@ void Isolate::PrintWithTimestamp(const char* format, ...) {
}
void Isolate::SetIdle(bool is_idle) {
if (!is_profiling()) return;
StateTag state = current_vm_state();
DCHECK(state == EXTERNAL || state == IDLE);
if (js_entry_sp() != kNullAddress) return;
DCHECK(state == EXTERNAL || state == IDLE);
if (is_idle) {
set_current_vm_state(IDLE);
} else if (state == 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