v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
member-storage.h
Go to the documentation of this file.
1// Copyright 2022 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_MEMBER_STORAGE_H_
6#define V8_HEAP_CPPGC_MEMBER_STORAGE_H_
7
9
10namespace cppgc {
11namespace internal {
12
13#if defined(CPPGC_POINTER_COMPRESSION)
14class CageBaseGlobalUpdater final {
15 public:
16 CageBaseGlobalUpdater() = delete;
17 static void UpdateCageBase(uintptr_t cage_base) {
18 CPPGC_DCHECK(CageBaseGlobal::IsBaseConsistent());
19 CPPGC_DCHECK(0u == (cage_base & CageBaseGlobal::kLowerHalfWordMask));
20 CageBaseGlobal::g_base_.base =
21 cage_base | CageBaseGlobal::kLowerHalfWordMask;
22 }
23
24 static uintptr_t GetCageBase() {
25 CPPGC_DCHECK(CageBaseGlobal::IsBaseConsistent());
26 return CageBaseGlobal::g_base_.base & ~CageBaseGlobal::kLowerHalfWordMask;
27 }
28};
29#endif // defined(CPPGC_POINTER_COMPRESSION)
30
31} // namespace internal
32} // namespace cppgc
33
34#endif // V8_HEAP_CPPGC_MEMBER_STORAGE_H_
#define CPPGC_DCHECK(condition)
Definition logging.h:36