v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
write-barrier.h
Go to the documentation of this file.
1// Copyright 2021 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#ifndef V8_HEAP_CPPGC_WRITE_BARRIER_H_
6#define V8_HEAP_CPPGC_WRITE_BARRIER_H_
7
11
12namespace cppgc {
13namespace internal {
14
16 public:
17 static void Enter() { write_barrier_enabled_.Enter(); }
18 static void Exit() { write_barrier_enabled_.Exit(); }
19
20 private:
21 FlagUpdater() = delete;
22};
23
24#if defined(CPPGC_YOUNG_GENERATION)
25class V8_EXPORT_PRIVATE YoungGenerationEnabler final {
26 public:
27 static void Enable();
28 static void Disable();
29
30 static bool IsEnabled();
31
32 private:
33 template <typename T>
34 friend class v8::base::LeakyObject;
35
36 static YoungGenerationEnabler& Instance();
37
38 YoungGenerationEnabler() = default;
39
40 size_t is_enabled_;
42};
43#endif // defined(CPPGC_YOUNG_GENERATION)
44
45} // namespace internal
46} // namespace cppgc
47
48#endif // V8_HEAP_CPPGC_WRITE_BARRIER_H_
static AtomicEntryFlag write_barrier_enabled_
base::Mutex & mutex_
#define V8_EXPORT_PRIVATE
Definition macros.h:460