v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
interrupts-scope.cc
Go to the documentation of this file.
1// Copyright 2019 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
8
9namespace v8 {
10namespace internal {
11
13 InterruptsScope* last_postpone_scope = nullptr;
14 for (InterruptsScope* current = this; current; current = current->prev_) {
15 // We only consider scopes related to passed flag.
16 if (!(current->intercept_mask_ & flag)) continue;
17 if (current->mode_ == kRunInterrupts) {
18 // If innermost scope is kRunInterrupts scope, prevent interrupt from
19 // being intercepted.
20 break;
21 } else {
22 DCHECK_EQ(current->mode_, kPostponeInterrupts);
23 last_postpone_scope = current;
24 }
25 }
26 // If there is no postpone scope for passed flag then we should not intercept.
27 if (!last_postpone_scope) return false;
28 last_postpone_scope->intercepted_flags_ |= flag;
29 return true;
30}
31
32} // namespace internal
33} // namespace v8
bool Intercept(StackGuard::InterruptFlag flag)
LineAndColumn current
#define DCHECK_EQ(v1, v2)
Definition logging.h:485