15#ifdef V8_ENABLE_SANDBOX
17bool TrustedRange::InitReservation(
size_t requested) {
18 DCHECK_LE(requested, kMaximalTrustedRangeSize);
19 DCHECK_GE(requested, kMinimumTrustedRangeSize);
38 const size_t base_alignment =
size_t{4} *
GB;
40 const Address requested_start_hint =
44 VirtualMemoryCage::ReservationParams params;
45 params.page_allocator = page_allocator;
46 params.reservation_size = requested;
48 params.base_alignment = base_alignment;
49 params.requested_start_hint = requested_start_hint;
51 params.page_initialization_mode =
66 size_t guard_region_size = 1 *
MB;
77TrustedRange* process_wide_trusted_range_ =
nullptr;
80void InitProcessWideTrustedRange(
size_t requested_size) {
81 TrustedRange* trusted_range =
new TrustedRange();
82 if (!trusted_range->InitReservation(requested_size)) {
84 nullptr,
"Failed to reserve virtual memory for TrustedRange");
86 process_wide_trusted_range_ = trusted_range;
93TrustedRange* TrustedRange::EnsureProcessWideTrustedRange(
94 size_t requested_size) {
95 base::CallOnce(&init_trusted_range_once, InitProcessWideTrustedRange,
97 return process_wide_trusted_range_;
101TrustedRange* TrustedRange::GetProcessWideTrustedRange() {
102 return process_wide_trusted_range_;
virtual size_t AllocatePageSize()=0
static const int kPageSize
static V8_INLINE void InitBase(Address base)
static V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(Isolate *isolate, const char *location, const OOMDetails &details=kNoOOMDetails)
bool InitReservation(const ReservationParams ¶ms, base::AddressRegion existing_reservation=base::AddressRegion())
cppgc::PageAllocator * page_allocator_
constexpr size_t kPageSize
@ kAllocatedPagesCanBeUninitialized
void CallOnce(OnceType *once, std::function< void()> init_func)
v8::PageAllocator * GetPlatformPageAllocator()
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage * MB
#define V8_DECLARE_ONCE(NAME)
#define DCHECK_LE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
constexpr T RoundDown(T x, intptr_t m)
constexpr bool IsAligned(T value, U alignment)