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
5
#include "
src/execution/interrupts-scope.h
"
6
7
#include "
src/execution/isolate.h
"
8
9
namespace
v8
{
10
namespace
internal
{
11
12
bool
InterruptsScope::Intercept
(
StackGuard::InterruptFlag
flag) {
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
v8::internal::InterruptsScope
Definition
interrupts-scope.h:18
v8::internal::InterruptsScope::kPostponeInterrupts
@ kPostponeInterrupts
Definition
interrupts-scope.h:20
v8::internal::InterruptsScope::kRunInterrupts
@ kRunInterrupts
Definition
interrupts-scope.h:20
v8::internal::InterruptsScope::prev_
InterruptsScope * prev_
Definition
interrupts-scope.h:48
v8::internal::InterruptsScope::Intercept
bool Intercept(StackGuard::InterruptFlag flag)
Definition
interrupts-scope.cc:12
v8::internal::InterruptsScope::intercepted_flags_
uint32_t intercepted_flags_
Definition
interrupts-scope.h:50
v8::internal::StackGuard::InterruptFlag
InterruptFlag
Definition
stack-guard.h:92
current
LineAndColumn current
Definition
earley-parser.cc:22
isolate.h
interrupts-scope.h
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
DCHECK_EQ
#define DCHECK_EQ(v1, v2)
Definition
logging.h:485
src
execution
interrupts-scope.cc
Generated on Sun Apr 6 2025 21:08:53 for v8 by
1.12.0