forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathptr-compr.cc
More file actions
52 lines (36 loc) · 1.32 KB
/
ptr-compr.cc
File metadata and controls
52 lines (36 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/common/ptr-compr-inl.h"
namespace v8::internal {
#ifdef V8_COMPRESS_POINTERS
#ifdef V8_COMPRESS_POINTERS_IN_SHARED_CAGE
#define THREAD_LOCAL_IF_MULTICAGE
#else
#define THREAD_LOCAL_IF_MULTICAGE thread_local
#endif // V8_COMPRESS_POINTERS_IN_SHARED_CAGE
THREAD_LOCAL_IF_MULTICAGE uintptr_t MainCage::base_ = kNullAddress;
// static
Address MainCage::base_non_inlined() { return base_; }
// static
void MainCage::set_base_non_inlined(Address base) { base_ = base; }
#ifdef V8_ENABLE_SANDBOX
uintptr_t TrustedCage::base_ = kNullAddress;
// static
Address TrustedCage::base_non_inlined() { return base_; }
// static
void TrustedCage::set_base_non_inlined(Address base) { base_ = base; }
#endif // V8_ENABLE_SANDBOX
#ifdef V8_EXTERNAL_CODE_SPACE
THREAD_LOCAL_IF_MULTICAGE uintptr_t ExternalCodeCompressionScheme::base_ =
kNullAddress;
// static
Address ExternalCodeCompressionScheme::base_non_inlined() { return base_; }
// static
void ExternalCodeCompressionScheme::set_base_non_inlined(Address base) {
base_ = base;
}
#endif // V8_EXTERNAL_CODE_SPACE
#undef THREAD_LOCAL_IF_MULTICAGE
#endif // V8_COMPRESS_POINTERS
} // namespace v8::internal