v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
trusted-range.h
Go to the documentation of this file.
1
// Copyright 2023 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_TRUSTED_RANGE_H_
6
#define V8_HEAP_TRUSTED_RANGE_H_
7
8
#include "
src/common/globals.h
"
9
#include "
src/utils/allocation.h
"
10
#include "
v8-internal.h
"
11
12
namespace
v8
{
13
namespace
internal
{
14
15
#ifdef V8_ENABLE_SANDBOX
16
17
// When the sandbox is enabled, the heap's trusted spaces are located outside
18
// of the sandbox so that an attacker cannot corrupt their contents. This
19
// special virtual memory cage hosts them. It also acts as a pointer
20
// compression cage inside of which compressed pointers can be used to
21
// reference objects.
22
class
TrustedRange final :
public
VirtualMemoryCage {
23
public
:
24
bool
InitReservation(
size_t
requested);
25
26
// Initializes the process-wide TrustedRange if it hasn't been initialized
27
// yet. Returns the (initialized) TrustedRange or terminates the process if
28
// the virtual memory cannot be reserved.
29
static
TrustedRange* EnsureProcessWideTrustedRange(
size_t
requested_size);
30
31
// Returns the process-wide TrustedRange if it has been initialized (via
32
// EnsureProcessWideTrustedRange), otherwise nullptr.
33
V8_EXPORT_PRIVATE
static
TrustedRange* GetProcessWideTrustedRange();
34
};
35
36
#endif
// V8_ENABLE_SANDBOX
37
38
}
// namespace internal
39
}
// namespace v8
40
41
#endif
// V8_HEAP_TRUSTED_RANGE_H_
globals.h
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
V8_EXPORT_PRIVATE
#define V8_EXPORT_PRIVATE
Definition
macros.h:460
allocation.h
v8-internal.h
src
heap
trusted-range.h
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0