v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
heap-consistency.cc
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
6
8#include "src/base/logging.h"
10
11namespace cppgc {
12namespace subtle {
13
14// static
16 cppgc::HeapHandle& heap_handle) {
17 auto& heap_base = internal::HeapBase::From(heap_handle);
18 return !heap_base.IsGCForbidden();
19}
20
21// static
23 auto& heap_base = internal::HeapBase::From(heap_handle);
24 heap_base.EnterDisallowGCScope();
25}
26
27// static
29 auto& heap_base = internal::HeapBase::From(heap_handle);
30 heap_base.LeaveDisallowGCScope();
31}
32
34 cppgc::HeapHandle& heap_handle)
35 : heap_handle_(heap_handle) {
36 Enter(heap_handle);
37}
38
42
43// static
45 auto& heap_base = internal::HeapBase::From(heap_handle);
46 heap_base.EnterNoGCScope();
47}
48
49// static
51 auto& heap_base = internal::HeapBase::From(heap_handle);
52 heap_base.LeaveNoGCScope();
53}
54
56 cppgc::HeapHandle& heap_handle)
57 : heap_handle_(heap_handle) {
58 Enter(heap_handle);
59}
60
62
63} // namespace subtle
64} // namespace cppgc
static HeapBase & From(cppgc::HeapHandle &heap_handle)
Definition heap-base.h:88
DisallowGarbageCollectionScope(HeapHandle &heap_handle)
static bool IsGarbageCollectionAllowed(HeapHandle &heap_handle)
static void Enter(HeapHandle &heap_handle)
static void Leave(HeapHandle &heap_handle)
NoGarbageCollectionScope(HeapHandle &heap_handle)
static void Leave(HeapHandle &heap_handle)
static void Enter(HeapHandle &heap_handle)