Commit 3a742a34 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[debug] postpone all interrupts in debug scope

This simplifies a bit.

R=jgruber@chromium.org

Change-Id: If7a433c9d2b13edf4fe4485816ac5ab06435773e
Reviewed-on: https://chromium-review.googlesource.com/1172299Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55084}
parent 07aafb76
......@@ -173,8 +173,7 @@ v8::MaybeLocal<v8::Value> DebugStackTraceIterator::Evaluate(
v8::Local<v8::String> source, bool throw_on_side_effect) {
DCHECK(!Done());
Handle<Object> value;
i::SafeForInterruptsScope safe_for_interrupt_scope(
isolate_, i::StackGuard::TERMINATE_EXECUTION);
i::SafeForInterruptsScope safe_for_interrupt_scope(isolate_);
if (!DebugEvaluate::Local(isolate_, iterator_.frame()->id(),
inlined_frame_index_, Utils::OpenHandle(*source),
throw_on_side_effect)
......
......@@ -1741,7 +1741,6 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise) {
DebugScope debug_scope(this);
HandleScope scope(isolate_);
PostponeInterruptsScope postpone(isolate_);
DisableBreak no_recursive_break(this);
Handle<Context> native_context(isolate_->native_context());
......@@ -1869,7 +1868,6 @@ void Debug::ProcessCompileEvent(bool has_compile_error, Handle<Script> script) {
SuppressDebug while_processing(this);
DebugScope debug_scope(this);
HandleScope scope(isolate_);
PostponeInterruptsScope postpone(isolate_);
DisableBreak no_recursive_break(this);
AllowJavascriptExecution allow_script(isolate_);
debug_delegate_->ScriptCompiled(ToApiHandle<debug::Script>(script),
......@@ -2012,8 +2010,7 @@ DebugScope::DebugScope(Debug* debug)
: debug_(debug),
prev_(reinterpret_cast<DebugScope*>(
base::Relaxed_Load(&debug->thread_local_.current_debug_scope_))),
no_termination_exceptons_(debug_->isolate_,
StackGuard::TERMINATE_EXECUTION) {
no_interrupts_(debug_->isolate_) {
// Link recursive debugger entry.
base::Relaxed_Store(&debug_->thread_local_.current_debug_scope_,
reinterpret_cast<base::AtomicWord>(this));
......
......@@ -563,7 +563,7 @@ class DebugScope BASE_EMBEDDED {
Debug* debug_;
DebugScope* prev_; // Previous scope if entered recursively.
StackFrame::Id break_frame_id_; // Previous break frame id.
PostponeInterruptsScope no_termination_exceptons_;
PostponeInterruptsScope no_interrupts_;
};
// This scope is used to handle return values in nested debug break points.
......
......@@ -2046,7 +2046,8 @@ class PostponeInterruptsScope : public InterruptsScope {
// PostponeInterruptsScopes.
class SafeForInterruptsScope : public InterruptsScope {
public:
SafeForInterruptsScope(Isolate* isolate, int intercept_mask)
SafeForInterruptsScope(Isolate* isolate,
int intercept_mask = StackGuard::ALL_INTERRUPTS)
: InterruptsScope(isolate, intercept_mask,
InterruptsScope::kRunInterrupts) {}
virtual ~SafeForInterruptsScope() = default;
......
......@@ -298,8 +298,6 @@ class InterpreterHandle {
void NotifyDebugEventListeners(WasmInterpreter::Thread* thread) {
// Enter the debugger.
DebugScope debug_scope(isolate_->debug());
// Postpone interrupt during breakpoint processing.
PostponeInterruptsScope postpone(isolate_);
// Check whether we hit a breakpoint.
if (isolate_->debug()->break_points_active()) {
......
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