v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
globals.h
Go to the documentation of this file.
1// Copyright 2012 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_COMMON_GLOBALS_H_
6#define V8_COMMON_GLOBALS_H_
7
8#include <stddef.h>
9#include <stdint.h>
10
11#include <limits>
12#include <ostream>
13
14#include "include/v8-internal.h"
17#include "src/base/enum-set.h"
18#include "src/base/flags.h"
19#include "src/base/logging.h"
20#include "src/base/macros.h"
22
23#define V8_INFINITY std::numeric_limits<double>::infinity()
24
25// AIX has jmpbuf redefined as __jmpbuf in /usr/include/sys/context.h
26// which replaces v8's jmpbuf , resulting in undefined symbol errors
27#if defined(V8_OS_AIX) && defined(jmpbuf)
28#undef jmpbuf
29#endif
30
31namespace v8 {
32
33namespace base {
34class Mutex;
35class RecursiveMutex;
36} // namespace base
37
38namespace internal {
39
40// Determine whether we are running in a simulated environment.
41// Setting USE_SIMULATOR explicitly from the build script will force
42// the use of a simulated environment.
43#if !defined(USE_SIMULATOR)
44#if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64)
45#define USE_SIMULATOR 1
46#endif
47#if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM)
48#define USE_SIMULATOR 1
49#endif
50#if (V8_TARGET_ARCH_PPC64 && !V8_HOST_ARCH_PPC64)
51#define USE_SIMULATOR 1
52#endif
53#if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64)
54#define USE_SIMULATOR 1
55#endif
56#if (V8_TARGET_ARCH_S390X && !V8_HOST_ARCH_S390X)
57#define USE_SIMULATOR 1
58#endif
59#if (V8_TARGET_ARCH_RISCV64 && !V8_HOST_ARCH_RISCV64)
60#define USE_SIMULATOR 1
61#endif
62#if (V8_TARGET_ARCH_RISCV32 && !V8_HOST_ARCH_RISCV32)
63#define USE_SIMULATOR 1
64#endif
65#if (V8_TARGET_ARCH_LOONG64 && !V8_HOST_ARCH_LOONG64)
66#define USE_SIMULATOR 1
67#endif
68#endif
69
70#if USE_SIMULATOR
71#define USE_SIMULATOR_BOOL true
72#else
73#define USE_SIMULATOR_BOOL false
74#endif
75
76// Determine whether the architecture uses an embedded constant pool
77// (contiguous constant pool embedded in code object).
78#if V8_TARGET_ARCH_PPC64
79#define V8_EMBEDDED_CONSTANT_POOL_BOOL true
80#else
81#define V8_EMBEDDED_CONSTANT_POOL_BOOL false
82#endif
83
84#ifdef DEBUG
85#define DEBUG_BOOL true
86#else
87#define DEBUG_BOOL false
88#endif
89
90#ifdef V8_MAP_PACKING
91#define V8_MAP_PACKING_BOOL true
92#else
93#define V8_MAP_PACKING_BOOL false
94#endif
95
96#ifdef V8_COMPRESS_POINTERS
97#define COMPRESS_POINTERS_BOOL true
98#else
99#define COMPRESS_POINTERS_BOOL false
100#endif
101
102#if COMPRESS_POINTERS_BOOL && V8_TARGET_ARCH_X64
103#define DECOMPRESS_POINTER_BY_ADDRESSING_MODE true
104#else
105#define DECOMPRESS_POINTER_BY_ADDRESSING_MODE false
106#endif
107
108#ifdef V8_COMPRESS_POINTERS_IN_SHARED_CAGE
109#define COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL true
110#else
111#define COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL false
112#endif
113
114#if COMPRESS_POINTERS_BOOL && !COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL
115#define COMPRESS_POINTERS_IN_MULTIPLE_CAGES_BOOL true
116#else
117#define COMPRESS_POINTERS_IN_MULTIPLE_CAGES_BOOL false
118#endif
119
120#ifndef V8_DISABLE_WRITE_BARRIERS
121#define V8_CAN_CREATE_SHARED_HEAP_BOOL true
122#else
123#define V8_CAN_CREATE_SHARED_HEAP_BOOL false
124#endif
125
126#ifdef V8_LOWER_LIMITS_MODE
127#define V8_LOWER_LIMITS_MODE_BOOL true
128#else
129#define V8_LOWER_LIMITS_MODE_BOOL false
130#endif
131
132#ifdef V8_STATIC_ROOTS_GENERATION
133#define V8_STATIC_ROOTS_GENERATION_BOOL true
134#else
135#define V8_STATIC_ROOTS_GENERATION_BOOL false
136#endif
137
138#ifdef V8_ENABLE_LEAPTIERING
139#define V8_ENABLE_LEAPTIERING_BOOL true
140
141// If we have predictable and shared builtin objects, then dispatch handles of
142// builtins are stored in the read only segment of the JSDispatchTable.
143// Otherwise, we need a table of per-isolate dispatch handles of builtins.
144#ifdef V8_STATIC_ROOTS
145#define V8_STATIC_DISPATCH_HANDLES_BOOL true
146#else
147#define V8_STATIC_DISPATCH_HANDLES_BOOL false
148#endif // !V8_STATIC_ROOTS
149
150#else
151#define V8_ENABLE_LEAPTIERING_BOOL false
152#endif
153
154#ifdef V8_ENABLE_SANDBOX
155#define V8_ENABLE_SANDBOX_BOOL true
156static_assert(V8_ENABLE_LEAPTIERING_BOOL);
157#define V8_JS_LINKAGE_INCLUDES_DISPATCH_HANDLE 1
158#define V8_JS_LINKAGE_INCLUDES_DISPATCH_HANDLE_BOOL true
159#else
160#define V8_ENABLE_SANDBOX_BOOL false
161#define V8_JS_LINKAGE_INCLUDES_DISPATCH_HANDLE_BOOL false
162#endif
163
164#ifdef V8_ENABLE_CONTROL_FLOW_INTEGRITY
165#define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL true
166#else
167#define ENABLE_CONTROL_FLOW_INTEGRITY_BOOL false
168#endif
169
170#if V8_TARGET_ARCH_ARM
171// Set stack limit lower for ARM than for other architectures because stack
172// allocating MacroAssembler takes 120K bytes. See issue crbug.com/405338
173#define V8_DEFAULT_STACK_SIZE_KB 864
174#elif V8_TARGET_ARCH_IA32
175// In mid-2022, we're observing an increase in stack overflow crashes on
176// 32-bit Windows; the suspicion is that some third-party software suddenly
177// started to consume a lot more stack memory (before V8 is even initialized).
178// So we speculatively lower the ia32 limit to the ARM limit for the time
179// being. See crbug.com/1346791.
180#define V8_DEFAULT_STACK_SIZE_KB 864
181#elif V8_USE_ADDRESS_SANITIZER
182// ASan makes C++ frames consume more stack, so V8 should leave more stack
183// space available in case a C++ call happens. ClusterFuzz found a case where
184// even just 1 KB less than the default stack size would be enough (see
185// crbug.com/1486275); to be more robust towards future CF reports we'll
186// use an even lower limit.
187#define V8_DEFAULT_STACK_SIZE_KB 960
188#else
189// Slightly less than 1MB, since Windows' default stack size for
190// the main execution thread is 1MB.
191#define V8_DEFAULT_STACK_SIZE_KB 984
192#endif
193
194// Helper macros to enable handling of direct C calls in the simulator.
195#if defined(USE_SIMULATOR) && \
196 (defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \
197 defined(V8_TARGET_ARCH_LOONG64) || defined(V8_TARGET_ARCH_RISCV64))
198#define V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS
199#define V8_IF_USE_SIMULATOR(V) , V
200#else
201#define V8_IF_USE_SIMULATOR(V)
202#endif // defined(USE_SIMULATOR) && \
203 // (defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_MIPS64) || \
204 // defined(V8_TARGET_ARCH_LOONG64))
205
206// Minimum stack size in KB required by compilers.
208
209// In order to emit more efficient stack checks in optimized code,
210// deoptimization may implicitly exceed the V8 stack limit by this many bytes.
211// Stack checks in functions with `difference between optimized and unoptimized
212// stack frame sizes <= slack` can simply emit the simple stack check.
214
215// Sanity-check, assuming that we aim for a real OS stack size of at least 1MB.
216static_assert(V8_DEFAULT_STACK_SIZE_KB * KB +
218 MB);
219
220// The V8_ENABLE_NEAR_CODE_RANGE_BOOL enables logic that tries to allocate
221// code range within a pc-relative call/jump proximity from embedded builtins.
222// This machinery could help only when we have an opportunity to choose where
223// to allocate code range and could benefit from it. This is the case for the
224// following configurations:
225// - external code space AND pointer compression are enabled,
226// - short builtin calls feature is enabled while pointer compression is not.
227#if (defined(V8_SHORT_BUILTIN_CALLS) && !defined(V8_COMPRESS_POINTERS)) || \
228 defined(V8_EXTERNAL_CODE_SPACE)
229#define V8_ENABLE_NEAR_CODE_RANGE_BOOL true
230#else
231#define V8_ENABLE_NEAR_CODE_RANGE_BOOL false
232#endif
233
234// This constant is used for detecting whether the machine has >= 4GB of
235// physical memory by checking the max old space size.
237
238// Determine whether dict mode prototypes feature is enabled.
239#ifdef V8_ENABLE_SWISS_NAME_DICTIONARY
240#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL true
241#else
242#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL false
243#endif
244
245// Determine whether dict property constness tracking feature is enabled.
246#ifdef V8_DICT_PROPERTY_CONST_TRACKING
247#define V8_DICT_PROPERTY_CONST_TRACKING_BOOL true
248#else
249#define V8_DICT_PROPERTY_CONST_TRACKING_BOOL false
250#endif
251
252#ifdef V8_EXTERNAL_CODE_SPACE
253#define V8_EXTERNAL_CODE_SPACE_BOOL true
254#else
255#define V8_EXTERNAL_CODE_SPACE_BOOL false
256#endif
257
258// Support for builtin jump table disassembly.
259#if defined(V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH) && defined(ENABLE_DISASSEMBLER)
260#define V8_BUILTIN_JUMP_TABLE_INFO_BOOL true
261#else
262#define V8_BUILTIN_JUMP_TABLE_INFO_BOOL false
263#endif
264
265// V8_HEAP_USE_PTHREAD_JIT_WRITE_PROTECT controls how V8 sets permissions for
266// executable pages.
267// In particular,
268// 1) when memory region is reserved for code range, the whole region is
269// committed with RWX permissions and then the whole region is discarded,
270// 2) since reconfiguration of RWX page permissions is not allowed on MacOS on
271// ARM64 ("Apple M1"/Apple Silicon), there must be no attempts to change
272// them,
273// 3) the request to set RWX permissions in the execeutable page region just
274// commits the pages without changing permissions (see (1), they were already
275// allocated as RWX and then deommitted),
276// 4) in order to make executable pages inaccessible one must use
277// OS::DiscardSystemPages() instead of using OS::DecommitPages() or setting
278// permissions to kNoAccess because the latter two are not allowed by the
279// MacOS (see (2)).
280//
281// This is applicable only to MacOS on ARM64 ("Apple M1"/Apple Silicon) which
282// has a APRR/MAP_JIT machinery for fast W^X permission switching (see
283// pthread_jit_write_protect).
284//
285// This approach doesn't work and shouldn't be used for V8 configuration with
286// enabled pointer compression and disabled external code space because
287// a) the pointer compression cage has to be reserved with MAP_JIT flag which
288// is too expensive,
289// b) in case of shared pointer compression cage if the code range will be
290// deleted while the cage is still alive then attempt to configure
291// permissions of pages that were previously set to RWX will fail.
292//
293#if V8_HAS_PTHREAD_JIT_WRITE_PROTECT && \
294 !(defined(V8_COMPRESS_POINTERS) && !defined(V8_EXTERNAL_CODE_SPACE))
295#define V8_HEAP_USE_PTHREAD_JIT_WRITE_PROTECT true
296#else
297#define V8_HEAP_USE_PTHREAD_JIT_WRITE_PROTECT false
298#endif
299
300// Protect the JavaScript heap with BrowserEngineKit APIs.
301#if V8_HAS_BECORE_JIT_WRITE_PROTECT && \
302 !(defined(V8_COMPRESS_POINTERS) && !defined(V8_EXTERNAL_CODE_SPACE))
303#define V8_HEAP_USE_BECORE_JIT_WRITE_PROTECT true
304#else
305#define V8_HEAP_USE_BECORE_JIT_WRITE_PROTECT false
306#endif
307
308// Protect the JavaScript heap with memory protection keys.
309#if V8_HAS_PKU_JIT_WRITE_PROTECT && \
310 !(defined(V8_COMPRESS_POINTERS) && !defined(V8_EXTERNAL_CODE_SPACE))
311#define V8_HEAP_USE_PKU_JIT_WRITE_PROTECT true
312#else
313#define V8_HEAP_USE_PKU_JIT_WRITE_PROTECT false
314#endif
315
316// Enable hardware features to make the sandbox memory temporarily inaccessible.
317// This is currently only used with pkeys and in debug mode.
318// TODO(sroettger): add a gn arg to toggle this once we enable it in non-debug
319// builds.
320#if V8_HAS_PKU_JIT_WRITE_PROTECT && defined(V8_ENABLE_SANDBOX) && defined(DEBUG)
321#define V8_ENABLE_SANDBOX_HARDWARE_SUPPORT true
322#else
323#define V8_ENABLE_SANDBOX_HARDWARE_SUPPORT false
324#endif
325
326// Determine whether tagged pointers are 8 bytes (used in Torque layouts for
327// choosing where to insert padding).
328#if V8_TARGET_ARCH_64_BIT && !defined(V8_COMPRESS_POINTERS)
329#define TAGGED_SIZE_8_BYTES true
330#else
331#define TAGGED_SIZE_8_BYTES false
332#endif
333
334#if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_X64)
335#define V8_OS_WIN_X64 true
336#endif
337
338#if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_ARM64)
339#define V8_OS_WIN_ARM64 true
340#endif
341
342#if defined(V8_OS_WIN_X64) || defined(V8_OS_WIN_ARM64)
343#define V8_OS_WIN64 true
344#endif
345
346// Support for floating point parameters in calls to C.
347// It's currently enabled only for the platforms listed below. We don't plan
348// to add support for IA32, because it has a totally different approach
349// (using FP stack).
350#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM64) || \
351 defined(V8_TARGET_ARCH_MIPS64) || defined(V8_TARGET_ARCH_LOONG64) || \
352 defined(V8_TARGET_ARCH_RISCV64)
353#define V8_ENABLE_FP_PARAMS_IN_C_LINKAGE 1
354#endif
355
356#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
357#define V8_EXPERIMENTAL_UNDEFINED_DOUBLE_BOOL true
358#else
359#define V8_EXPERIMENTAL_UNDEFINED_DOUBLE_BOOL false
360#endif
361
362// Superclass for classes only using static method functions.
363// The subclass of AllStatic cannot be instantiated at all.
365#ifdef DEBUG
366 public:
367 AllStatic() = delete;
368#endif
369};
370
371// -----------------------------------------------------------------------------
372// Constants
373
374constexpr int kMaxInt = 0x7FFFFFFF;
375constexpr int kMinInt = -kMaxInt - 1;
376constexpr int kMaxInt8 = (1 << 7) - 1;
377constexpr int kMinInt8 = -(1 << 7);
378constexpr int kMaxUInt8 = (1 << 8) - 1;
379constexpr int kMinUInt8 = 0;
380constexpr int kMaxInt16 = (1 << 15) - 1;
381constexpr int kMinInt16 = -(1 << 15);
382constexpr int kMaxUInt16 = (1 << 16) - 1;
383constexpr int kMinUInt16 = 0;
384constexpr int kMaxInt31 = kMaxInt / 2;
385constexpr int kMinInt31 = kMinInt / 2;
386
387constexpr uint32_t kMaxUInt32 = 0xFFFF'FFFFu;
388constexpr uint32_t kMinUInt32 = 0;
389
390constexpr uint64_t kMaxUInt64 = 0xFFFF'FFFF'FFFF'FFFFu;
391constexpr uint64_t kMinUInt64 = 0;
392
393constexpr int kInt8Size = sizeof(int8_t);
394constexpr int kUInt8Size = sizeof(uint8_t);
395constexpr int kByteSize = 1;
396constexpr int kCharSize = sizeof(char);
397constexpr int kShortSize = sizeof(short); // NOLINT
398constexpr int kInt16Size = sizeof(int16_t);
399constexpr int kUInt16Size = sizeof(uint16_t);
400constexpr int kIntSize = sizeof(int);
401constexpr int kInt32Size = sizeof(int32_t);
402constexpr int kInt64Size = sizeof(int64_t);
403constexpr int kUInt32Size = sizeof(uint32_t);
404constexpr int kSizetSize = sizeof(size_t);
405constexpr int kFloat16Size = sizeof(uint16_t);
406constexpr int kFloatSize = sizeof(float);
407constexpr int kDoubleSize = sizeof(double);
408constexpr int kIntptrSize = sizeof(intptr_t);
409constexpr int kUIntptrSize = sizeof(uintptr_t);
410constexpr int kSystemPointerSize = sizeof(void*);
411constexpr int kSystemPointerHexDigits = kSystemPointerSize == 4 ? 8 : 12;
414
415#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32
417#else
418constexpr int kElidedFrameSlots = 0;
419#endif
420
421constexpr int kDoubleSizeLog2 = 3;
422// The maximal length of the string representation for a double value
423// (e.g. "-2.2250738585072020E-308"). It is composed as follows:
424// - 17 decimal digits, see base::kBase10MaximalLength (dtoa.h)
425// - 1 sign
426// - 1 decimal point
427// - 1 E or e
428// - 1 exponent sign
429// - 3 exponent
430constexpr int kMaxDoubleStringLength = 24;
431
432// Total wasm code space per engine (i.e. per process) is limited to make
433// certain attacks that rely on heap spraying harder.
434// Do not access directly, but via the {--wasm-max-committed-code-mb} flag.
435// Just below 4GB, such that {kMaxWasmCodeMemory} fits in a 32-bit size_t.
436constexpr uint32_t kMaxCommittedWasmCodeMB = 4095;
437
438// The actual maximum code space size used can be configured with
439// --max-wasm-code-space-size. This constant is the default value, and at the
440// same time the maximum allowed value (checked by the WasmCodeManager).
441#if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_LOONG64
442// ARM64 and Loong64 only supports direct calls within a 128 MB range.
443constexpr uint32_t kDefaultMaxWasmCodeSpaceSizeMb = 128;
444#elif V8_TARGET_ARCH_PPC64
445// Branches only take 26 bits.
446constexpr uint32_t kDefaultMaxWasmCodeSpaceSizeMb = 32;
447#else
448// Use 1024 MB limit for code spaces on other platforms. This is smaller than
449// the total allowed code space (kMaxWasmCodeMemory) to avoid unnecessarily
450// big reservations, and to ensure that distances within a code space fit
451// within a 32-bit signed integer.
452constexpr uint32_t kDefaultMaxWasmCodeSpaceSizeMb = 1024;
453#endif
454
455// Align IsolateData to a most common CPU cache line size.
456constexpr size_t kIsolateDataAlignment = 64;
457
458#if V8_HOST_ARCH_64_BIT
459constexpr int kSystemPointerSizeLog2 = 3;
460constexpr intptr_t kIntptrSignBit =
461 static_cast<intptr_t>(uintptr_t{0x8000000000000000});
462constexpr bool kPlatformRequiresCodeRange = true;
463#if V8_HOST_ARCH_PPC64 && V8_TARGET_ARCH_PPC64 && V8_OS_LINUX
464constexpr size_t kMaximalCodeRangeSize = 512 * MB;
465constexpr size_t kMinExpectedOSPageSize = 64 * KB; // OS page on PPC Linux
466#elif V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_LOONG64 || V8_TARGET_ARCH_RISCV64
467constexpr size_t kMaximalCodeRangeSize =
469 : 256 * MB;
470constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
471#elif V8_TARGET_ARCH_X64
472constexpr size_t kMaximalCodeRangeSize =
474 : 512 * MB;
475constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
476#else
477constexpr size_t kMaximalCodeRangeSize = 128 * MB;
478constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
479#endif
480#if V8_OS_WIN
481constexpr size_t kMinimumCodeRangeSize = 4 * MB;
482constexpr size_t kReservedCodeRangePages = 1;
483#else
484constexpr size_t kMinimumCodeRangeSize = 3 * MB;
485constexpr size_t kReservedCodeRangePages = 0;
486#endif
487
488// These constants define the total trusted space memory per process.
489constexpr size_t kMaximalTrustedRangeSize = 1 * GB;
490constexpr size_t kMinimumTrustedRangeSize = 32 * MB;
491
492#else // V8_HOST_ARCH_64_BIT
493
494constexpr int kSystemPointerSizeLog2 = 2;
495constexpr intptr_t kIntptrSignBit = 0x80000000;
496#if V8_HOST_ARCH_PPC64 && V8_TARGET_ARCH_PPC64 && V8_OS_LINUX
497constexpr bool kPlatformRequiresCodeRange = false;
498constexpr size_t kMaximalCodeRangeSize = 0 * MB;
499constexpr size_t kMinimumCodeRangeSize = 0 * MB;
500constexpr size_t kMinExpectedOSPageSize = 64 * KB; // OS page on PPC Linux
501#elif V8_TARGET_ARCH_RISCV32
502constexpr bool kPlatformRequiresCodeRange = false;
503constexpr size_t kMaximalCodeRangeSize = 2048LL * MB;
504constexpr size_t kMinimumCodeRangeSize = 0 * MB;
505constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
506#else
507constexpr bool kPlatformRequiresCodeRange = false;
508constexpr size_t kMaximalCodeRangeSize = 0 * MB;
509constexpr size_t kMinimumCodeRangeSize = 0 * MB;
510constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
511#endif
512constexpr size_t kReservedCodeRangePages = 0;
513#endif // V8_HOST_ARCH_64_BIT
514
515static_assert(kSystemPointerSize == (1 << kSystemPointerSizeLog2));
516
517#ifdef V8_COMPRESS_ZONES
518#define COMPRESS_ZONES_BOOL true
519#else
520#define COMPRESS_ZONES_BOOL false
521#endif // V8_COMPRESS_ZONES
522
523// The flag controls whether zones pointer compression should be enabled for
524// TurboFan graphs or not.
526
527#ifdef V8_COMPRESS_POINTERS
528static_assert(
530 "Pointer compression can be enabled only for 64-bit architectures");
531
532constexpr int kTaggedSize = kInt32Size;
533constexpr int kTaggedSizeLog2 = 2;
534
535// These types define raw and atomic storage types for tagged values stored
536// on V8 heap.
537using Tagged_t = uint32_t;
539
540#else
541
544
545// These types define raw and atomic storage types for tagged values stored
546// on V8 heap.
549
550#endif // V8_COMPRESS_POINTERS
551
552//
553// JavaScript Dispatch Table
554//
555// A JSDispatchHandle represents a 32-bit index into a JSDispatchTable.
558
560
561constexpr int kJSDispatchTableEntrySize = 16;
563
564// The size of the virtual memory reservation for the JSDispatchTable.
565// As with the other tables, a maximum table size in combination with shifted
566// indices allows omitting bounds checks.
568 (V8_LOWER_LIMITS_MODE_BOOL ? 16 : 256) * MB;
569// The maximum number of entries in a JSDispatchTable.
570constexpr size_t kMaxJSDispatchEntries =
572
573#ifdef V8_TARGET_ARCH_64_BIT
574
575constexpr uint32_t kJSDispatchHandleShift = V8_LOWER_LIMITS_MODE_BOOL ? 12 : 8;
576static_assert((1 << (32 - kJSDispatchHandleShift)) == kMaxJSDispatchEntries,
577 "kJSDispatchTableReservationSize and kJSDispatchEntryHandleShift "
578 "don't match");
579
580#elif defined(V8_TARGET_ARCH_32_BIT)
581
582// Since the table is not contiguous on 32 bit platforms the indices can become
583// arbitrarily large and we need the full 32 bit range to hold them.
584constexpr uint32_t kJSDispatchHandleShift = 0;
585
586#endif
587
588static_assert(kTaggedSize == (1 << kTaggedSizeLog2));
589static_assert((kTaggedSize == 8) == TAGGED_SIZE_8_BYTES);
590
592static_assert(sizeof(Tagged_t) == kTaggedSize);
593static_assert(sizeof(AtomicTagged_t) == kTaggedSize);
594
595static_assert(kTaggedSize == kApiTaggedSize);
596
597// TODO(ishell): use kTaggedSize or kSystemPointerSize instead.
598#ifndef V8_COMPRESS_POINTERS
601static_assert(kPointerSize == (1 << kPointerSizeLog2));
602#endif
603
604#ifdef V8_COMPRESS_POINTERS_8GB
605// To support 8GB heaps, all allocations are aligned to at least 8 bytes.
606#define V8_COMPRESS_POINTERS_8GB_BOOL true
607#else
608#define V8_COMPRESS_POINTERS_8GB_BOOL false
609#endif
610
611// This type defines the raw storage type for external (or off-V8 heap) pointers
612// stored on V8 heap.
614#ifdef V8_ENABLE_SANDBOX
615static_assert(kExternalPointerSlotSize == kTaggedSize);
616#else
618#endif
619
620// The storage type for pointers referring to CppHeap objects stored on the V8
621// heap.
623#ifdef V8_COMPRESS_POINTERS
624static_assert(kCppHeapPointerSlotSize == sizeof(uint32_t));
625#else
627#endif
628
630// When the sandbox is enabled, trusted pointers are implemented as indirect
631// pointers (indices into the trusted pointer table). Otherwise they are regular
632// tagged pointers.
633#ifdef V8_ENABLE_SANDBOX
636#else
639#endif
641
642// Pointers between trusted objects use compressed pointers with the trusted
643// space base when the sandbox is enabled. Otherwise, they are regular tagged
644// pointers. Either way, they are always kTaggedSize fields.
646
648
649// Dispatch handle constant used as a placeholder. This is currently used by
650// compilers when generating JS calls. In that case, the actual dispatch handle
651// value is only loaded by the low-level MacroAssembler operations, but a
652// placeholder value is necessary prior to that to satisfy linkage constraints.
653// TODO(saelo): instead, we could let the compiler load the dispatch handle
654// from the JSFunction and then use a MacroAssembler operation that uses the
655// dispatch handle directly. We just need to be sure that no GC can happen
656// between the load of the dispatch handle and the use.
658// Dispatch handle constant that can be used for direct calls when it is known
659// that the callee doesn't use the dispatch handle. This is for example the
660// case when performing direct calls to JS builtins.
662 << kJSDispatchHandleShift);
663
665
669
672
673// Maximum object size that gets allocated into regular pages. Objects larger
674// than that size are allocated in large object space and are never moved in
675// memory. This also applies to new space allocation, since objects are never
676// migrated from new space to large object space. Takes double alignment into
677// account.
678//
679// Current value: half of the page size.
680constexpr int kMaxRegularHeapObjectSize = (1 << (kPageSizeBits - 1));
681
682constexpr int kBitsPerByte = 8;
683constexpr int kBitsPerByteLog2 = 3;
688
689// IEEE 754 single precision floating point number bit layout.
690constexpr uint32_t kBinary32SignMask = 0x80000000u;
691constexpr uint32_t kBinary32ExponentMask = 0x7f800000u;
692constexpr uint32_t kBinary32MantissaMask = 0x007fffffu;
693constexpr int kBinary32ExponentBias = 127;
694constexpr int kBinary32MaxExponent = 0xFE;
695constexpr int kBinary32MinExponent = 0x01;
696constexpr int kBinary32MantissaBits = 23;
697constexpr int kBinary32ExponentShift = 23;
698
699// Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
700// other bits set.
701constexpr uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
702
703constexpr int kOneByteSize = kCharSize;
704
705// 128 bit SIMD value size.
706constexpr int kSimd128Size = 16;
707
708// 256 bit SIMD value size.
709constexpr int kSimd256Size = 32;
710
711// FUNCTION_ADDR(f) gets the address of a C function f.
712#define FUNCTION_ADDR(f) (reinterpret_cast<v8::internal::Address>(f))
713
714// FUNCTION_CAST<F>(addr) casts an address into a function
715// of type F. Used to invoke generated code from within C.
716template <typename F>
717F FUNCTION_CAST(uint8_t* addr) {
718 return reinterpret_cast<F>(reinterpret_cast<Address>(addr));
719}
720
721template <typename F>
723 return reinterpret_cast<F>(addr);
724}
725
726// Determine whether the architecture uses function descriptors
727// which provide a level of indirection between the function pointer
728// and the function entrypoint.
729#if V8_HOST_ARCH_PPC64 && \
730 (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN && \
731 (!defined(_CALL_ELF) || _CALL_ELF == 1)))
732#define USES_FUNCTION_DESCRIPTORS 1
733#define FUNCTION_ENTRYPOINT_ADDRESS(f) \
734 (reinterpret_cast<v8::internal::Address*>( \
735 &(reinterpret_cast<intptr_t*>(f)[0])))
736#else
737#define USES_FUNCTION_DESCRIPTORS 0
738#endif
739
740constexpr bool StaticStringsEqual(const char* s1, const char* s2) {
741 for (;; ++s1, ++s2) {
742 if (*s1 != *s2) return false;
743 if (*s1 == '\0') return true;
744 }
745}
746
747// -----------------------------------------------------------------------------
748// Declarations for use in both the preparser and the rest of V8.
749
750// The Strict Mode (ECMA-262 5th edition, 4.2.2).
751
752enum class LanguageMode : bool { kSloppy, kStrict };
753static const size_t LanguageModeSize = 2;
754
755inline size_t hash_value(LanguageMode mode) {
756 return static_cast<size_t>(mode);
757}
758
759inline const char* LanguageMode2String(LanguageMode mode) {
760 switch (mode) {
762 return "sloppy";
764 return "strict";
765 }
766 UNREACHABLE();
767}
768
769inline std::ostream& operator<<(std::ostream& os, LanguageMode mode) {
770 return os << LanguageMode2String(mode);
771}
772
773inline bool is_sloppy(LanguageMode language_mode) {
774 return language_mode == LanguageMode::kSloppy;
775}
776
777inline bool is_strict(LanguageMode language_mode) {
778 return language_mode != LanguageMode::kSloppy;
779}
780
781inline bool is_valid_language_mode(int language_mode) {
782 return language_mode == static_cast<int>(LanguageMode::kSloppy) ||
783 language_mode == static_cast<int>(LanguageMode::kStrict);
784}
785
786inline LanguageMode construct_language_mode(bool strict_bit) {
787 return static_cast<LanguageMode>(strict_bit);
788}
789
790// Return kStrict if either of the language modes is kStrict, or kSloppy
791// otherwise.
793 LanguageMode mode2) {
794 static_assert(LanguageModeSize == 2);
795 return static_cast<LanguageMode>(static_cast<int>(mode1) |
796 static_cast<int>(mode2));
797}
798
799// A non-keyed store is of the form a.x = foo or a["x"] = foo whereas
800// a keyed store is of the form a[expression] = foo.
802
804
806
807// Whether floating point registers should be saved (and restored).
809
810// This enum describes the ownership semantics of an indirect pointer.
812 // A regular reference from one HeapObject to another one through an indirect
813 // pointer, where the referenced object should be kept alive as long as the
814 // referencing object is alive.
815 kStrong,
816 // A reference from one HeapObject to another one through an indirect pointer
817 // with custom ownership semantics. Used for example for references from
818 // JSFunctions to Code objects which follow custom weak ownership semantics.
819 kCustom
820};
821
822// Whether arguments are passed on a known stack location or through a
823// register.
824enum class ArgvMode { kStack, kRegister };
825
827 // This version of CallApiCallback used by IC system, it gets additional
828 // target function argument which is used both for stack trace reconstruction
829 // in case exception is thrown inside the callback and for callback
830 // side-effects checking by debugger.
831 kGeneric,
832
833 // The following two versions are used for generating calls from optimized
834 // code. They don't need to support side effects checking because function
835 // will be deoptimized when side effects checking is enabled, and they don't
836 // get the target function because it can be reconstructed from the lazy
837 // deopt info in case exception is thrown.
838
839 // This version is used for compiling code when Isolate profiling or runtime
840 // call stats is disabled. The code that uses this version must be created
841 // with a dependency on NoProfilingProtector.
843
844 // This version contains a dynamic check for enabled profiler and it supports
845 // runtime call stats.
847};
848
849// This constant is used as an undefined value when passing source positions.
850constexpr int kNoSourcePosition = -1;
851
852// This constant is used to signal the function entry implicit stack check
853// bytecode offset.
855
856// This constant is used to signal the function exit interrupt budget handling
857// bytecode offset.
859
860// This constant is used to indicate missing deoptimization information.
861constexpr int kNoDeoptimizationId = -1;
862
863// Deoptimize bailout kind:
864// - Eager: a check failed in the optimized code and deoptimization happens
865// immediately.
866// - Lazy: the code has been marked as dependent on some assumption which
867// is checked elsewhere and can trigger deoptimization the next time the
868// code is executed.
869enum class DeoptimizeKind : uint8_t {
870 kEager,
871 kLazy,
872};
875static_assert(static_cast<int>(kFirstDeoptimizeKind) == 0);
876constexpr int kDeoptimizeKindCount = static_cast<int>(kLastDeoptimizeKind) + 1;
878 return static_cast<size_t>(kind);
879}
880constexpr const char* ToString(DeoptimizeKind kind) {
881 switch (kind) {
883 return "Eager";
885 return "Lazy";
886 }
887}
888inline std::ostream& operator<<(std::ostream& os, DeoptimizeKind kind) {
889 return os << ToString(kind);
890}
891
892// Indicates whether the lookup is related to sloppy-mode block-scoped
893// function hoisting, and is a synthetic assignment for that.
895
896inline std::ostream& operator<<(std::ostream& os,
897 const LookupHoistingMode& mode) {
898 switch (mode) {
900 return os << "normal hoisting";
902 return os << "legacy sloppy hoisting";
903 }
904 UNREACHABLE();
905}
906
907static_assert(kSmiValueSize <= 32, "Unsupported Smi tagging scheme");
908// Smi sign bit position must be 32-bit aligned so we can use sign extension
909// instructions on 64-bit architectures without additional shifts.
910static_assert((kSmiValueSize + kSmiShiftSize + kSmiTagSize) % 32 == 0,
911 "Unsupported Smi tagging scheme");
912
917static_assert(!SmiValuesAre32Bits() == SmiValuesAre31Bits(),
918 "Unsupported Smi tagging scheme");
920 "Unsupported Smi tagging scheme");
922 "Unsupported Smi tagging scheme");
923
924// Mask for the sign bit in a smi.
925constexpr intptr_t kSmiSignMask = static_cast<intptr_t>(
926 uintptr_t{1} << (kSmiValueSize + kSmiShiftSize + kSmiTagSize - 1));
927
928// Desired alignment for tagged pointers.
930constexpr intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
931constexpr intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
932
933// Object alignment for 8GB pointer compressed heap.
934constexpr intptr_t kObjectAlignment8GbHeap = 8;
936
937#ifdef V8_COMPRESS_POINTERS_8GB
938static_assert(
940 "When the 8GB heap is enabled, all allocations should be aligned to twice "
941 "the size of a tagged value.");
942#endif
943
944// Desired alignment for system pointers.
945constexpr intptr_t kPointerAlignment = (1 << kSystemPointerSizeLog2);
947
948// Desired alignment for double values.
949constexpr intptr_t kDoubleAlignment = 8;
950constexpr intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1;
951
952// Desired alignment for generated code is 64 bytes on x64 (to allow 64-bytes
953// loop header alignment) and 32 bytes (to improve cache line utilization) on
954// other architectures.
955#if V8_TARGET_ARCH_X64
956constexpr int kCodeAlignmentBits = 6;
957#elif V8_TARGET_ARCH_PPC64
958// 64 byte alignment is needed on ppc64 to make sure p10 prefixed instructions
959// don't cross 64-byte boundaries.
960constexpr int kCodeAlignmentBits = 6;
961#else
962constexpr int kCodeAlignmentBits = 5;
963#endif
964constexpr intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
965constexpr intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
966
968
969// The lower 32 bits of the cleared weak reference value is always equal to
970// the |kClearedWeakHeapObjectLower32| constant but on 64-bit architectures
971// the value of the upper 32 bits part may be
972// 1) zero when pointer compression is disabled,
973// 2) upper 32 bits of the isolate root value when pointer compression is
974// enabled.
975// This is necessary to make pointer decompression computation also suitable
976// for cleared weak reference.
977// Note, that real heap objects can't have lower 32 bits equal to 3 because
978// this offset belongs to page header. So, in either case it's enough to
979// compare only the lower 32 bits of a Tagged<MaybeObject> value in order to
980// figure out if it's a cleared reference or not.
982
983// Zap-value: The value used for zapping dead objects.
984// Should be a recognizable hex value tagged as a failure.
985#ifdef V8_HOST_ARCH_64_BIT
986constexpr uint64_t kClearedFreeMemoryValue = 0;
987constexpr uint64_t kZapValue = uint64_t{0xdeadbeedbeadbeef};
988constexpr uint64_t kHandleZapValue = uint64_t{0x1baddead0baddeaf};
989constexpr uint64_t kGlobalHandleZapValue = uint64_t{0x1baffed00baffedf};
990constexpr uint64_t kPersistentHandleZapValue = uint64_t{0x1baffed66baffedf};
991constexpr uint64_t kTracedHandleEagerResetZapValue =
992 uint64_t{0x1beffedaabaffedf};
993constexpr uint64_t kTracedHandleMinorGCResetZapValue =
994 uint64_t{0x1beffedeebaffedf};
995constexpr uint64_t kTracedHandleMinorGCWeakResetZapValue =
996 uint64_t{0x1beffed11baffedf};
997constexpr uint64_t kTracedHandleFullGCResetZapValue =
998 uint64_t{0x1beffed77baffedf};
999constexpr uint64_t kFromSpaceZapValue = uint64_t{0x1beefdad0beefdaf};
1000constexpr uint64_t kDebugZapValue = uint64_t{0xbadbaddbbadbaddb};
1001constexpr uint64_t kSlotsZapValue = uint64_t{0xbeefdeadbeefdeef};
1002constexpr uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf;
1003#else
1004constexpr uint32_t kClearedFreeMemoryValue = 0;
1005constexpr uint32_t kZapValue = 0xdeadbeef;
1006constexpr uint32_t kHandleZapValue = 0xbaddeaf;
1007constexpr uint32_t kGlobalHandleZapValue = 0xbaffedf;
1008constexpr uint32_t kPersistentHandleZapValue = 0xbaff6df;
1009constexpr uint32_t kTracedHandleEagerResetZapValue = 0xbeffedf;
1010constexpr uint32_t kTracedHandleMinorGCResetZapValue = 0xbeffadf;
1011constexpr uint32_t kTracedHandleMinorGCWeakResetZapValue = 0xbe11adf;
1012constexpr uint32_t kTracedHandleFullGCResetZapValue = 0xbe77adf;
1013constexpr uint32_t kFromSpaceZapValue = 0xbeefdaf;
1014constexpr uint32_t kSlotsZapValue = 0xbeefdeef;
1015constexpr uint32_t kDebugZapValue = 0xbadbaddb;
1016constexpr uint32_t kFreeListZapValue = 0xfeed1eaf;
1017#endif
1018
1019constexpr int kCodeZapValue = 0xbadc0de;
1020constexpr uint32_t kPhantomReferenceZap = 0xca11bac;
1021
1022// On Intel architecture, cache line size is 64 bytes.
1023// On ARM it may be less (32 bytes), but as far this constant is
1024// used for aligning data, it doesn't hurt to align on a greater value.
1025#define PROCESSOR_CACHE_LINE_SIZE 64
1026
1027// Constants relevant to double precision floating point numbers.
1028// If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
1029constexpr uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
1030
1031enum class V8_EXPORT_ENUM HeapObjectReferenceType {
1034};
1035
1036enum class ArgumentsType {
1037 kRuntime,
1038 kJS,
1039};
1040
1041// -----------------------------------------------------------------------------
1042// Forward declarations for frequently used classes
1043
1044class AccessorInfo;
1045template <ArgumentsType>
1046class Arguments;
1049class Assembler;
1050class ClassScope;
1051class InstructionStream;
1052class BigInt;
1053class Code;
1054class CodeSpace;
1055class Context;
1056class DeclarationScope;
1057class Debug;
1058class DebugInfo;
1059class Descriptor;
1060class DescriptorArray;
1061template <typename T>
1062class DirectHandle;
1063#ifdef V8_ENABLE_DIRECT_HANDLE
1064template <typename T>
1065class DirectHandleVector;
1066#endif
1067class TransitionArray;
1068class ExternalReference;
1070class FeedbackVector;
1071class FixedArray;
1072class Foreign;
1075class GlobalDictionary;
1076template <typename T>
1077class Handle;
1078class Heap;
1079class HeapNumber;
1080class Boolean;
1081class Null;
1082class Undefined;
1083class HeapObject;
1084class IC;
1085template <typename T>
1087class InterceptorInfo;
1088class Isolate;
1089class JSReceiver;
1090class JSArray;
1091class JSFunction;
1092class JSObject;
1093class JSProxy;
1094class JSBoundFunction;
1095class JSWrappedFunction;
1096class LocalIsolate;
1097class MacroAssembler;
1098class Map;
1100#ifdef V8_ENABLE_DIRECT_HANDLE
1101template <typename T>
1102class MaybeDirectHandle;
1103#endif
1104template <typename T>
1105class MaybeHandle;
1106template <typename T>
1107class MaybeDirectHandle;
1108template <typename T>
1110class MaybeObjectHandle;
1113template <typename T>
1114class MaybeWeak;
1116class MessageLocation;
1117class ModuleScope;
1118class Name;
1119class NameDictionary;
1120class NativeContext;
1121class NewSpace;
1123class NumberDictionary;
1124class Object;
1126template <HeapObjectReferenceType kRefType, typename StorageType>
1127class TaggedImpl;
1128class StrongTaggedValue;
1129class TaggedValue;
1130class CompressedObjectSlot;
1131class CompressedMaybeObjectSlot;
1132class CompressedMapWordSlot;
1133class CompressedHeapObjectSlot;
1134template <typename Cage>
1136class MainCage;
1138#ifdef V8_ENABLE_SANDBOX
1139class TrustedCage;
1141#else
1142// The trusted cage does not exist in this case.
1144#endif
1145class ExternalCodeCompressionScheme;
1146template <typename CompressionScheme>
1148template <typename CompressionScheme>
1150class FullObjectSlot;
1152class FullHeapObjectSlot;
1154class OldSpace;
1155class ReadOnlySpace;
1156class RelocInfo;
1157class Scope;
1158class ScopeInfo;
1159class Script;
1161class Smi;
1162template <typename Config, class Allocator = FreeStoreAllocationPolicy>
1164class String;
1165class StringStream;
1166class Struct;
1167class Symbol;
1168template <typename T>
1169class Tagged;
1170template <typename... Ts>
1171class Union;
1172class Variable;
1173namespace maglev {
1174class MaglevAssembler;
1175}
1176namespace compiler {
1177class AccessBuilder;
1178}
1179
1180// Number is either a Smi or a HeapNumber.
1182// Numeric is either a Number or a BigInt.
1184// A primitive JavaScript value, which excludes JS objects.
1187// A user-exposed JavaScript value, as opposed to V8-internal values like Holes
1188// or a FixedArray.
1199// Object prototypes are either JSReceivers or null -- they are not allowed to
1200// be any other primitive value.
1202
1205
1207
1208// Slots are either full-pointer slots or compressed slots depending on whether
1209// pointer compression is enabled or not.
1211#ifdef V8_COMPRESS_POINTERS
1212 using TObjectSlot = CompressedObjectSlot;
1213 using TMaybeObjectSlot = CompressedMaybeObjectSlot;
1214 using THeapObjectSlot = CompressedHeapObjectSlot;
1215 using TOffHeapObjectSlot =
1217#ifdef V8_EXTERNAL_CODE_SPACE
1220#else
1222#endif // V8_EXTERNAL_CODE_SPACE
1223#else
1229#endif // V8_COMPRESS_POINTERS
1230#ifdef V8_ENABLE_SANDBOX
1231 using TProtectedPointerSlot =
1235#else
1238#endif // V8_ENABLE_SANDBOX
1239};
1240
1241// An ObjectSlot instance describes a kTaggedSize-sized on-heap field ("slot")
1242// holding an Object value (smi or strong heap object).
1244
1245// A MaybeObjectSlot instance describes a kTaggedSize-sized on-heap field
1246// ("slot") holding Tagged<MaybeObject> (smi or weak heap object or strong heap
1247// object).
1249
1250// A HeapObjectSlot instance describes a kTaggedSize-sized field ("slot")
1251// holding a weak or strong pointer to a heap object (think:
1252// Tagged<HeapObjectReference>).
1254
1255// An OffHeapObjectSlot instance describes a kTaggedSize-sized field ("slot")
1256// holding an Object value (smi or strong heap object), whose slot location is
1257// off-heap.
1259
1260// A InstructionStreamSlot instance describes a kTaggedSize-sized field
1261// ("slot") holding a strong pointer to an InstructionStream object. The
1262// InstructionStream object slots might be compressed and since code space might
1263// be allocated off the main heap the load operations require explicit cage base
1264// value for code space.
1266
1267// A protected pointer is one where both the pointer itself and the pointed-to
1268// object are protected from modifications by an attacker if the sandbox is
1269// enabled. In practice, this means that they are pointers from one
1270// TrustedObject to another TrustedObject as (only) trusted objects cannot
1271// directly be manipulated by an attacker.
1273// Same as a ProtectedPointerSlot, but can be weak.
1275
1277
1279
1280template <typename TSlot>
1282 static constexpr bool value = false;
1283};
1284#ifdef V8_ENABLE_SANDBOX
1285template <>
1287 static constexpr bool value = true;
1288};
1289template <>
1290struct SlotHoldsTrustedPointerImpl<ProtectedMaybeObjectSlot> {
1291 static constexpr bool value = true;
1292};
1293#endif
1294
1295template <typename TSlot>
1296static constexpr bool SlotHoldsTrustedPointerV =
1298
1299// -----------------------------------------------------------------------------
1300// Miscellaneous
1301
1302// NOTE: SpaceIterator depends on AllocationSpace enumeration values being
1303// consecutive.
1305 RO_SPACE, // Immortal, immovable and immutable objects,
1306 NEW_SPACE, // Young generation space for regular objects collected
1307 // with Scavenger/MinorMS.
1308 OLD_SPACE, // Old generation regular object space.
1309 CODE_SPACE, // Old generation code object space, marked executable.
1310 SHARED_SPACE, // Space shared between multiple isolates. Optional.
1311 TRUSTED_SPACE, // Space for trusted objects. When the sandbox is enabled,
1312 // this space will be located outside of it so that objects in
1313 // it cannot directly be corrupted by an attacker.
1314 SHARED_TRUSTED_SPACE, // Trusted space but for shared objects. Optional.
1315 NEW_LO_SPACE, // Young generation large object space.
1316 LO_SPACE, // Old generation large object space.
1317 CODE_LO_SPACE, // Old generation large code object space.
1318 SHARED_LO_SPACE, // Space shared between multiple isolates. Optional.
1319 SHARED_TRUSTED_LO_SPACE, // Like TRUSTED_SPACE but for shared large objects.
1320 TRUSTED_LO_SPACE, // Like TRUSTED_SPACE but for large objects.
1321
1331constexpr int kSpaceTagSize = 4;
1332static_assert(FIRST_SPACE == 0);
1333
1334constexpr bool IsAnyCodeSpace(AllocationSpace space) {
1335 return space == CODE_SPACE || space == CODE_LO_SPACE;
1336}
1337constexpr bool IsAnyTrustedSpace(AllocationSpace space) {
1338 return space == TRUSTED_SPACE || space == TRUSTED_LO_SPACE ||
1339 space == SHARED_TRUSTED_SPACE || space == SHARED_TRUSTED_LO_SPACE;
1340}
1341constexpr bool IsAnySharedSpace(AllocationSpace space) {
1342 return space == SHARED_SPACE || space == SHARED_LO_SPACE ||
1343 space == SHARED_TRUSTED_SPACE || space == SHARED_TRUSTED_LO_SPACE;
1344}
1345constexpr bool IsAnyNewSpace(AllocationSpace space) {
1346 return space == NEW_SPACE || space == NEW_LO_SPACE;
1347}
1348
1349constexpr const char* ToString(AllocationSpace space) {
1350 switch (space) {
1352 return "read_only_space";
1354 return "new_space";
1356 return "old_space";
1358 return "code_space";
1360 return "shared_space";
1362 return "trusted_space";
1364 return "shared_trusted_space";
1366 return "new_large_object_space";
1368 return "large_object_space";
1370 return "code_large_object_space";
1372 return "shared_large_object_space";
1374 return "shared_trusted_large_object_space";
1376 return "trusted_large_object_space";
1377 }
1378}
1379
1380inline std::ostream& operator<<(std::ostream& os, AllocationSpace space) {
1381 return os << ToString(space);
1382}
1383
1384enum class AllocationType : uint8_t {
1385 kYoung, // Regular object allocated in NEW_SPACE or NEW_LO_SPACE.
1386 kOld, // Regular object allocated in OLD_SPACE or LO_SPACE.
1387 kCode, // InstructionStream object allocated in CODE_SPACE or CODE_LO_SPACE.
1388 kMap, // Map object allocated in OLD_SPACE.
1389 kReadOnly, // Object allocated in RO_SPACE.
1390 kSharedOld, // Regular object allocated in OLD_SPACE in the shared heap.
1391 kSharedMap, // Map object in OLD_SPACE in the shared heap.
1392 kSharedTrusted, // Trusted objects in TRUSTED_SPACE in the shared heap.
1393 kTrusted, // Object allocated in TRUSTED_SPACE or TRUSTED_LO_SPACE.
1394};
1395
1396constexpr const char* ToString(AllocationType kind) {
1397 switch (kind) {
1399 return "Young";
1401 return "Old";
1403 return "Code";
1405 return "Map";
1407 return "ReadOnly";
1409 return "SharedOld";
1411 return "SharedMap";
1413 return "Trusted";
1415 return "SharedTrusted";
1416 }
1417}
1418
1419inline std::ostream& operator<<(std::ostream& os, AllocationType type) {
1420 return os << ToString(type);
1421}
1422
1423// Reason for a garbage collection.
1424//
1425// These values are persisted to logs. Entries should not be renumbered and
1426// numeric values should never be reused. If you add new items here, update
1427// src/tools/metrics/histograms/enums.xml in chromium.
1428enum class GarbageCollectionReason : int {
1429 kUnknown = 0,
1431 kAllocationLimit = 2,
1432 kContextDisposal = 3,
1434 kDebugger = 5,
1435 kDeserializer = 6,
1439 kFullHashtable = 10,
1440 kHeapProfiler = 11,
1441 kTask = 12,
1442 kLastResort = 13,
1444 kMakeHeapIterable = 15,
1445 kMemoryPressure = 16,
1446 kMemoryReducer = 17,
1447 kRuntime = 18,
1448 kSamplingProfiler = 19,
1449 kSnapshotCreator = 20,
1450 kTesting = 21,
1451 kExternalFinalize = 22,
1453 kMeasureMemory = 24,
1457 kFrozen = 28,
1459
1461};
1462
1463static_assert(kGarbageCollectionReasonMaxValue ==
1464 static_cast<int>(GarbageCollectionReason::NUM_REASONS) - 1,
1465 "The value of kGarbageCollectionReasonMaxValue is inconsistent.");
1466
1467constexpr const char* ToString(GarbageCollectionReason reason) {
1468 switch (reason) {
1470 return "allocation failure";
1472 return "allocation limit";
1474 return "context disposal";
1476 return "counters extension";
1478 return "debugger";
1480 return "deserialize";
1482 return "external memory pressure";
1484 return "finalize incremental marking via stack guard";
1486 return "finalize incremental marking via task";
1488 return "full hash-table";
1490 return "heap profiler";
1492 return "task";
1494 return "last resort";
1496 return "low memory notification";
1498 return "make heap iterable";
1500 return "memory pressure";
1502 return "memory reducer";
1504 return "runtime";
1506 return "sampling profiler";
1508 return "snapshot creator";
1510 return "testing";
1512 return "external finalize";
1514 return "global allocation limit";
1516 return "measure memory";
1518 return "unknown";
1520 return "background allocation failure";
1522 return "finalize concurrent MinorMS";
1524 return "CppHeap allocation failure";
1526 return "frozen";
1528 return "idle context disposal";
1530 UNREACHABLE();
1531 }
1532}
1533
1534inline std::ostream& operator<<(std::ostream& os,
1535 GarbageCollectionReason reason) {
1536 return os << ToString(reason);
1537}
1538
1540 return static_cast<uint8_t>(kind);
1541}
1542
1547
1549 // The allocated address is kTaggedSize aligned (this is default for most of
1550 // the allocations).
1552 // The allocated address is kDoubleSize aligned.
1554 // The (allocated address + kTaggedSize) is kDoubleSize aligned.
1557
1558// TODO(ishell, v8:8875): Consider using aligned allocations once the
1559// allocation alignment inconsistency is fixed. For now we keep using
1560// tagged aligned (not double aligned) access since all our supported platforms
1561// allow tagged-aligned access to doubles and full words.
1562#define USE_ALLOCATION_ALIGNMENT_BOOL false
1563
1565
1570
1572
1573constexpr const char* ToString(GarbageCollector collector) {
1574 switch (collector) {
1576 return "Scavenger";
1578 return "Mark-Sweep-Compact";
1580 return "Minor Mark-Sweep";
1581 }
1582}
1583
1584inline std::ostream& operator<<(std::ostream& os, GarbageCollector collector) {
1585 return os << ToString(collector);
1586}
1587
1594
1596
1597enum class PageSize { kRegular, kLarge };
1598
1599enum class CodeFlushMode {
1603};
1604
1610
1611enum class NewJSObjectType : uint8_t {
1614};
1615
1619
1623
1625 return mode.contains(CodeFlushMode::kForceFlush);
1626}
1627
1629 return mode.empty();
1630}
1631
1632// Indicates whether a script should be parsed and compiled in REPL mode.
1633enum class REPLMode {
1634 kYes,
1635 kNo,
1636};
1637
1638inline REPLMode construct_repl_mode(bool is_repl_mode) {
1639 return is_repl_mode ? REPLMode::kYes : REPLMode::kNo;
1640}
1641
1642// Indicates whether a script is parsed during debugging.
1644 kYes,
1645 kNo,
1646};
1647
1648// Flag indicating whether code is built into the VM (one of the natives files).
1650
1651// ParseRestriction is used to restrict the set of valid statements in a
1652// unit of compilation. Restriction violations cause a syntax error.
1653enum ParseRestriction : bool {
1654 NO_PARSE_RESTRICTION, // All expressions are allowed.
1655 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression.
1657
1666
1667// State for inline cache call sites. Aliased as IC::State.
1669 // No feedback will be collected.
1671 // Has never been executed.
1673 // Has been executed and only one receiver type has been seen.
1675 // Check failed due to prototype (or map deprecation).
1677 // Multiple receiver types have been seen.
1679 // Many DOM receiver types have been seen for the same accessor.
1680 MEGADOM,
1681 // Many receiver types have been seen.
1683 // A generic handler is installed and no extra typefeedback is recorded.
1684 GENERIC,
1685};
1686
1687inline size_t hash_value(InlineCacheState mode) {
1688 return base::bit_cast<int>(mode);
1689}
1690
1691// Printing support.
1693 switch (state) {
1695 return "NOFEEDBACK";
1697 return "UNINITIALIZED";
1699 return "MONOMORPHIC";
1701 return "RECOMPUTE_HANDLER";
1703 return "POLYMORPHIC";
1705 return "MEGAMORPHIC";
1707 return "MEGADOM";
1709 return "GENERIC";
1710 }
1711 UNREACHABLE();
1712}
1713
1715
1717
1722
1723// The result that might be returned by Setter/Definer/Deleter interceptor
1724// callback when it doesn't throw an exception.
1726 kFalse = 0,
1727 kTrue = 1,
1728 kNotIntercepted = 2,
1729};
1730
1732
1733// Union used for customized checking of the IEEE double types
1734// inlined within v8 runtime, rather than going to the underlying
1735// platform headers and libraries
1737 double d;
1738 struct {
1739 unsigned int man_low : 32;
1740 unsigned int man_high : 20;
1741 unsigned int exp : 11;
1742 unsigned int sign : 1;
1744};
1745
1747 double d;
1748 struct {
1749 unsigned int sign : 1;
1750 unsigned int exp : 11;
1751 unsigned int man_high : 20;
1752 unsigned int man_low : 32;
1754};
1755
1756#if V8_TARGET_LITTLE_ENDIAN
1757using IeeeDoubleArchType = IeeeDoubleLittleEndianArchType;
1758constexpr int kIeeeDoubleMantissaWordOffset = 0;
1759constexpr int kIeeeDoubleExponentWordOffset = 4;
1760#else
1764#endif
1765
1766// -----------------------------------------------------------------------------
1767// Macros
1768
1769// Testers for test.
1770
1771#define HAS_SMI_TAG(value) \
1772 ((static_cast<i::Tagged_t>(value) & ::i::kSmiTagMask) == ::i::kSmiTag)
1773
1774#define HAS_STRONG_HEAP_OBJECT_TAG(value) \
1775 (((static_cast<i::Tagged_t>(value) & ::i::kHeapObjectTagMask) == \
1776 ::i::kHeapObjectTag))
1777
1778#define HAS_WEAK_HEAP_OBJECT_TAG(value) \
1779 (((static_cast<i::Tagged_t>(value) & ::i::kHeapObjectTagMask) == \
1780 ::i::kWeakHeapObjectTag))
1781
1782// OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer
1783#define OBJECT_POINTER_ALIGN(value) \
1784 (((value) + ::i::kObjectAlignmentMask) & ~::i::kObjectAlignmentMask)
1785
1786// OBJECT_POINTER_ALIGN is used to statically align object sizes to
1787// kObjectAlignment (which is kTaggedSize). ALIGN_TO_ALLOCATION_ALIGNMENT is
1788// used for dynamic allocations to align sizes and addresses to at least 8 bytes
1789// when an 8GB+ compressed heap is enabled.
1790// TODO(v8:13070): Consider merging this with OBJECT_POINTER_ALIGN.
1791#ifdef V8_COMPRESS_POINTERS_8GB
1792#define ALIGN_TO_ALLOCATION_ALIGNMENT(value) \
1793 (((value) + ::i::kObjectAlignment8GbHeapMask) & \
1794 ~::i::kObjectAlignment8GbHeapMask)
1795#else
1796#define ALIGN_TO_ALLOCATION_ALIGNMENT(value) (value)
1797#endif
1798
1799// OBJECT_POINTER_PADDING returns the padding size required to align value
1800// as a HeapObject pointer
1801#define OBJECT_POINTER_PADDING(value) (OBJECT_POINTER_ALIGN(value) - (value))
1802
1803// POINTER_SIZE_ALIGN returns the value aligned as a system pointer.
1804#define POINTER_SIZE_ALIGN(value) \
1805 (((value) + ::i::kPointerAlignmentMask) & ~::i::kPointerAlignmentMask)
1806
1807// POINTER_SIZE_PADDING returns the padding size required to align value
1808// as a system pointer.
1809#define POINTER_SIZE_PADDING(value) (POINTER_SIZE_ALIGN(value) - (value))
1810
1811// CODE_POINTER_ALIGN returns the value aligned as a generated code segment.
1812#define CODE_POINTER_ALIGN(value) \
1813 (((value) + ::i::kCodeAlignmentMask) & ~::i::kCodeAlignmentMask)
1814
1815// CODE_POINTER_PADDING returns the padding size required to align value
1816// as a generated code segment.
1817#define CODE_POINTER_PADDING(value) (CODE_POINTER_ALIGN(value) - (value))
1818
1819// DOUBLE_POINTER_ALIGN returns the value aligned for double pointers.
1820#define DOUBLE_POINTER_ALIGN(value) \
1821 (((value) + ::i::kDoubleAlignmentMask) & ~::i::kDoubleAlignmentMask)
1822
1823// Prediction hint for branches.
1824enum class BranchHint : uint8_t { kNone, kTrue, kFalse };
1825
1826// Like BranchHint but for GotoIf/GotoIfNot.
1827enum class GotoHint : uint8_t {
1828 kNone,
1829 kLabel, // Jump to the given label.
1830 kFallthrough, // Don't jump, fall through.
1831};
1832
1833// Defines hints about receiver values based on structural knowledge.
1834enum class ConvertReceiverMode : unsigned {
1835 kNullOrUndefined, // Guaranteed to be null or undefined.
1836 kNotNullOrUndefined, // Guaranteed to never be null or undefined.
1837 kAny, // No specific knowledge about receiver.
1838
1839 kLast = kAny
1840};
1841
1842inline size_t hash_value(ConvertReceiverMode mode) {
1843 return base::bit_cast<unsigned>(mode);
1844}
1845
1846inline std::ostream& operator<<(std::ostream& os, ConvertReceiverMode mode) {
1847 switch (mode) {
1849 return os << "NULL_OR_UNDEFINED";
1851 return os << "NOT_NULL_OR_UNDEFINED";
1853 return os << "ANY";
1854 }
1855 UNREACHABLE();
1856}
1857
1858// Valid hints for the abstract operation OrdinaryToPrimitive,
1859// implemented according to ES6, section 7.1.1.
1861
1862// Valid hints for the abstract operation ToPrimitive,
1863// implemented according to ES6, section 7.1.1.
1865
1866// Defines specifics about arguments object or rest parameter creation.
1867enum class CreateArgumentsType : uint8_t {
1871};
1872
1873inline size_t hash_value(CreateArgumentsType type) {
1874 return base::bit_cast<uint8_t>(type);
1875}
1876
1877inline std::ostream& operator<<(std::ostream& os, CreateArgumentsType type) {
1878 switch (type) {
1880 return os << "MAPPED_ARGUMENTS";
1882 return os << "UNMAPPED_ARGUMENTS";
1884 return os << "REST_PARAMETER";
1885 }
1886 UNREACHABLE();
1887}
1888
1889// Threshold calculated using a microbenckmark.
1890// https://chromium-review.googlesource.com/c/v8/v8/+/3429210
1892
1893enum ScopeType : uint8_t {
1894 SCRIPT_SCOPE, // The top-level scope for a script or a top-level eval.
1895 REPL_MODE_SCOPE, // The top-level scope for a repl-mode script.
1896 CLASS_SCOPE, // The scope introduced by a class.
1897 EVAL_SCOPE, // The top-level scope for an eval source.
1898 FUNCTION_SCOPE, // The top-level scope for a function.
1899 MODULE_SCOPE, // The scope introduced by a module literal
1900 CATCH_SCOPE, // The scope introduced by catch.
1901 BLOCK_SCOPE, // The scope introduced by a new block.
1902 WITH_SCOPE, // The scope introduced by with.
1903 SHADOW_REALM_SCOPE, // Synthetic scope for ShadowRealm NativeContexts.
1904};
1905
1906inline std::ostream& operator<<(std::ostream& os, ScopeType type) {
1907 switch (type) {
1909 return os << "EVAL_SCOPE";
1911 return os << "FUNCTION_SCOPE";
1913 return os << "MODULE_SCOPE";
1915 return os << "SCRIPT_SCOPE";
1917 return os << "CATCH_SCOPE";
1919 return os << "BLOCK_SCOPE";
1921 return os << "CLASS_SCOPE";
1923 return os << "WITH_SCOPE";
1925 return os << "SHADOW_REALM_SCOPE";
1927 return os << "REPL_MODE_SCOPE";
1928 }
1929 UNREACHABLE();
1930}
1931
1932// AllocationSiteMode controls whether allocations are tracked by an allocation
1933// site.
1939
1941
1942// The mips architecture prior to revision 5 has inverted encoding for sNaN.
1943#if (V8_TARGET_ARCH_MIPS64 && !defined(_MIPS_ARCH_MIPS64R6) && \
1944 (!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR)))
1945constexpr uint32_t kHoleNanUpper32 = 0xFFFF7FFF;
1946constexpr uint32_t kHoleNanLower32 = 0xFFFF7FFF;
1947#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1948constexpr uint32_t kUndefinedNanUpper32 = 0xFFFE7FFF;
1949constexpr uint32_t kUndefinedNanLower32 = 0xFFFE7FFF;
1950#endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1951#else
1952constexpr uint32_t kHoleNanUpper32 = 0xFFF7FFFF;
1953constexpr uint32_t kHoleNanLower32 = 0xFFF7FFFF;
1954#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1955constexpr uint32_t kUndefinedNanUpper32 = 0xFFFFFFFF;
1956constexpr uint32_t kUndefinedNanLower32 = 0xFFFFFFFF;
1957#endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1958#endif
1959
1960constexpr uint64_t kHoleNanInt64 =
1961 (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32;
1962#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1963constexpr uint64_t kUndefinedNanInt64 =
1964 (static_cast<uint64_t>(kUndefinedNanUpper32) << 32) | kUndefinedNanLower32;
1965#endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1966
1967#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1968// TODO(nicohartmann): Use proper constants.
1969inline bool IsUndefinedNan(double d) {
1970 uint64_t b;
1971 std::memcpy(&b, &d, sizeof(double));
1972 return b == kUndefinedNanInt64;
1973}
1974inline double UndefinedNan() {
1975 uint64_t b = kUndefinedNanInt64;
1976 double d;
1977 std::memcpy(&d, &b, sizeof(double));
1978 return d;
1979}
1980#endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
1981
1982// ES6 section 20.1.2.6 Number.MAX_SAFE_INTEGER
1983constexpr uint64_t kMaxSafeIntegerUint64 = 9007199254740991; // 2^53-1
1984static_assert(kMaxSafeIntegerUint64 == (uint64_t{1} << 53) - 1);
1985constexpr double kMaxSafeInteger = static_cast<double>(kMaxSafeIntegerUint64);
1986// ES6 section 21.1.2.8 Number.MIN_SAFE_INTEGER
1988
1989constexpr double kMaxUInt32Double = double{kMaxUInt32};
1990
1991constexpr int64_t kMaxAdditiveSafeInteger = 4503599627370495; // 2^52 - 1
1992static_assert(kMaxAdditiveSafeInteger == (int64_t{1} << 52) - 1);
1993constexpr int64_t kMinAdditiveSafeInteger = -4503599627370496; // - 2^52
1994static_assert(kMinAdditiveSafeInteger == -(int64_t{1} << 52));
1996// Number of bits to shift left before addition to detect potential overflow.
1998
2001// kMinAdditiveSafeInteger + kMinAdditiveSafeInteger would overflow the integer
2002// safe addition.
2003static_assert(kMinAdditiveSafeInteger + (kMinAdditiveSafeInteger + 1) >=
2005
2006// The order of this enum has to be kept in sync with the predicates below.
2007enum class VariableMode : uint8_t {
2008 // User declared variables:
2009 kLet, // declared via 'let' declarations (first lexical)
2010
2011 kConst, // declared via 'const' declarations
2012
2013 kUsing, // declared via 'using' declaration for explicit resource management
2014
2015 kAwaitUsing, // declared via 'await using' declaration for explicit resource
2016 // management
2017 // (last lexical)
2018
2019 kVar, // declared via 'var', and 'function' declarations
2020
2021 // Variables introduced by the compiler:
2022 kTemporary, // temporary variables (not user-visible), stack-allocated
2023 // unless the scope as a whole has forced context allocation
2024
2025 kDynamic, // always require dynamic lookup (we don't know
2026 // the declaration)
2027
2028 kDynamicGlobal, // requires dynamic lookup, but we know that the
2029 // variable is global unless it has been shadowed
2030 // by an eval-introduced variable
2031
2032 kDynamicLocal, // requires dynamic lookup, but we know that the
2033 // variable is local and where it is unless it
2034 // has been shadowed by an eval-introduced
2035 // variable
2036
2037 // Variables for private methods or accessors whose access require
2038 // brand check. Declared only in class scopes by the compiler
2039 // and allocated only in class contexts:
2040 kPrivateMethod, // Does not coexist with any other variable with the same
2041 // name in the same scope.
2042
2043 kPrivateSetterOnly, // Incompatible with variables with the same name but
2044 // any mode other than kPrivateGetterOnly. Transition to
2045 // kPrivateGetterAndSetter if a later declaration for the
2046 // same name with kPrivateGetterOnly is made.
2047
2048 kPrivateGetterOnly, // Incompatible with variables with the same name but
2049 // any mode other than kPrivateSetterOnly. Transition to
2050 // kPrivateGetterAndSetter if a later declaration for the
2051 // same name with kPrivateSetterOnly is made.
2052
2053 kPrivateGetterAndSetter, // Does not coexist with any other variable with the
2054 // same name in the same scope.
2055
2058};
2059
2060// Printing support
2061#ifdef DEBUG
2062inline const char* VariableMode2String(VariableMode mode) {
2063 switch (mode) {
2064 case VariableMode::kVar:
2065 return "VAR";
2066 case VariableMode::kLet:
2067 return "LET";
2069 return "PRIVATE_GETTER_ONLY";
2071 return "PRIVATE_SETTER_ONLY";
2073 return "PRIVATE_METHOD";
2075 return "PRIVATE_GETTER_AND_SETTER";
2077 return "CONST";
2079 return "DYNAMIC";
2081 return "DYNAMIC_GLOBAL";
2083 return "DYNAMIC_LOCAL";
2085 return "TEMPORARY";
2087 return "USING";
2089 return "AWAIT_USING";
2090 }
2091 UNREACHABLE();
2092}
2093#endif
2094
2096 switch (mode) {
2098 return "const";
2100 return "using";
2102 return "await using";
2103 default:
2104 UNREACHABLE();
2105 }
2106}
2107
2115
2117 return mode >= VariableMode::kDynamic && mode <= VariableMode::kDynamicLocal;
2118}
2119
2121 static_assert(static_cast<uint8_t>(VariableMode::kLet) ==
2122 0); // Implies that mode >= VariableMode::kLet.
2123 return mode <= VariableMode::kVar;
2124}
2125
2130
2132 return mode == VariableMode::kPrivateMethod;
2133}
2134
2139
2144
2149
2154
2156 static_assert(static_cast<uint8_t>(VariableMode::kLet) ==
2157 0); // Implies that mode >= VariableMode::kLet.
2159}
2160
2161enum VariableLocation : uint8_t {
2162 // Before and during variable allocation, a variable whose location is
2163 // not yet determined. After allocation, a variable looked up as a
2164 // property on the global object (and possibly absent). name() is the
2165 // variable name, index() is invalid.
2167
2168 // A slot in the parameter section on the stack. index() is the
2169 // parameter index, counting left-to-right. The receiver is index -1;
2170 // the first parameter is index 0.
2172
2173 // A slot in the local section on the stack. index() is the variable
2174 // index in the stack frame, starting at 0.
2176
2177 // An indexed slot in a heap context. index() is the variable index in
2178 // the context object on the heap, starting at 0. scope() is the
2179 // corresponding scope.
2181
2182 // A named slot in a heap context. name() is the variable name in the
2183 // context object on the heap, with lookup starting at the current
2184 // context. index() is invalid.
2186
2187 // A named slot in a module's export table.
2189
2190 // An indexed slot in a script context. index() is the variable
2191 // index in the context object on the heap, starting at 0.
2192 // Important: REPL_GLOBAL variables from different scripts with the
2193 // same name share a single script context slot. Every
2194 // script context will reserve a slot, but only one will be used.
2195 // REPL_GLOBAL variables are stored in script contexts, but accessed like
2196 // globals, i.e. they always require a lookup at runtime to find the right
2197 // script context.
2199
2202
2203// ES6 specifies declarative environment records with mutable and immutable
2204// bindings that can be in two states: initialized and uninitialized.
2205// When accessing a binding, it needs to be checked for initialization.
2206// However in the following cases the binding is initialized immediately
2207// after creation so the initialization check can always be skipped:
2208//
2209// 1. Var declared local variables.
2210// var foo;
2211// 2. A local variable introduced by a function declaration.
2212// function foo() {}
2213// 3. Parameters
2214// function x(foo) {}
2215// 4. Catch bound variables.
2216// try {} catch (foo) {}
2217// 6. Function name variables of named function expressions.
2218// var x = function foo() {}
2219// 7. Implicit binding of 'this'.
2220// 8. Implicit binding of 'arguments' in functions.
2221//
2222// The following enum specifies a flag that indicates if the binding needs a
2223// distinct initialization step (kNeedsInitialization) or if the binding is
2224// immediately initialized upon creation (kCreatedInitialized).
2226
2227// Static variables can only be used with the class in the closest
2228// class scope as receivers.
2229enum class IsStaticFlag : uint8_t { kNotStatic, kStatic };
2230
2232
2233enum class InterpreterPushArgsMode : unsigned {
2236 kOther
2237};
2238
2240 return base::bit_cast<unsigned>(mode);
2241}
2242
2243inline std::ostream& operator<<(std::ostream& os,
2245 switch (mode) {
2247 return os << "ArrayFunction";
2249 return os << "WithFinalSpread";
2251 return os << "Other";
2252 }
2253 UNREACHABLE();
2254}
2255
2256inline uint32_t ObjectHash(Address address) {
2257 // All objects are at least pointer aligned, so we can remove the trailing
2258 // zeros.
2259 return static_cast<uint32_t>(address >> kTaggedSizeLog2);
2260}
2261
2262// Type feedback is encoded in such a way that, we can combine the feedback
2263// at different points by performing an 'OR' operation. Type feedback moves
2264// to a more generic type when we combine feedback.
2265//
2266// kSignedSmall -> kSignedSmallInputs -> kAdditiveSafeInteger
2267// -> kNumber -> kNumberOrOddball -> kAny
2268// kString -> kAny
2269// kBigInt64 -> kBigInt -> kAny
2270//
2271// Technically we wouldn't need the separation between the kNumber and the
2272// kNumberOrOddball values here, since for binary operations, we always
2273// truncate oddballs to numbers. In practice though it causes TurboFan to
2274// generate quite a lot of unused code though if we always handle numbers
2275// and oddballs everywhere, although in 99% of the use sites they are only
2276// used with numbers.
2278 public:
2279 enum {
2280 kNone = 0x0,
2284 kNumber = 0xF,
2287 kBigInt = 0x60,
2288 kString = 0x80,
2291 kAny = 0x1FF
2293};
2294
2295// Type feedback is encoded in such a way that, we can combine the feedback
2296// at different points by performing an 'OR' operation.
2297// This is distinct from BinaryOperationFeedback on purpose, because the
2298// feedback that matters differs greatly as well as the way it is consumed.
2340
2357
2358// Type feedback is encoded in such a way that, we can combine the feedback
2359// at different points by performing an 'OR' operation. Type feedback moves
2360// to a more generic type when we combine feedback.
2361// kNone -> kEnumCacheKeysAndIndices -> kEnumCacheKeys -> kAny
2362enum class ForInFeedback : uint8_t {
2363 kNone = 0x0,
2365 kEnumCacheKeys = 0x3,
2366 kAny = 0x7
2367};
2368static_assert((static_cast<int>(ForInFeedback::kNone) |
2369 static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices)) ==
2370 static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices));
2371static_assert((static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices) |
2372 static_cast<int>(ForInFeedback::kEnumCacheKeys)) ==
2373 static_cast<int>(ForInFeedback::kEnumCacheKeys));
2374static_assert((static_cast<int>(ForInFeedback::kEnumCacheKeys) |
2375 static_cast<int>(ForInFeedback::kAny)) ==
2376 static_cast<int>(ForInFeedback::kAny));
2377
2378enum class UnicodeEncoding : uint8_t {
2379 // Different unicode encodings in a |word32|:
2380 UTF16, // hi 16bits -> trailing surrogate or 0, low 16bits -> lead surrogate
2381 UTF32, // full UTF32 code unit / Unicode codepoint
2382};
2383
2384inline size_t hash_value(UnicodeEncoding encoding) {
2385 return static_cast<uint8_t>(encoding);
2386}
2387
2388inline std::ostream& operator<<(std::ostream& os, UnicodeEncoding encoding) {
2389 switch (encoding) {
2391 return os << "UTF16";
2393 return os << "UTF32";
2394 }
2395 UNREACHABLE();
2396}
2397
2399
2400inline std::ostream& operator<<(std::ostream& os, IterationKind kind) {
2401 switch (kind) {
2403 return os << "IterationKind::kKeys";
2405 return os << "IterationKind::kValues";
2407 return os << "IterationKind::kEntries";
2408 }
2409 UNREACHABLE();
2410}
2411
2412enum class CollectionKind { kMap, kSet };
2413
2414inline std::ostream& operator<<(std::ostream& os, CollectionKind kind) {
2415 switch (kind) {
2417 return os << "CollectionKind::kMap";
2419 return os << "CollectionKind::kSet";
2420 }
2421 UNREACHABLE();
2422}
2423
2424enum class IsolateExecutionModeFlag : uint8_t {
2425 // Default execution mode.
2426 kNoFlags = 0,
2427 // Set if the Isolate is being profiled. Causes collection of extra compile
2428 // info.
2429 kIsProfiling = 1 << 0,
2430 // Set if side effect checking is enabled for the Isolate.
2431 // See Debug::StartSideEffectCheckMode().
2432 kCheckSideEffects = 1 << 1,
2433};
2434
2435// Flags for the runtime function kDefineKeyedOwnPropertyInLiteral.
2436// - Whether the function name should be set or not.
2438 kNoFlags = 0,
2439 kSetFunctionName = 1 << 0
2440};
2444
2446 kNoFlags = 0,
2447 kSetFunctionName = 1 << 0
2448};
2451
2466
2468 AssemblerDebugInfo(const char* name, const char* file, int line)
2469 : name(name), file(file), line(line) {}
2470 const char* name;
2471 const char* file;
2472 int line;
2473};
2474
2475inline std::ostream& operator<<(std::ostream& os,
2476 const AssemblerDebugInfo& info) {
2477 os << "(" << info.name << ":" << info.file << ":" << info.line << ")";
2478 return os;
2479}
2480
2481using FileAndLine = std::pair<const char*, int>;
2482
2483// The state kInProgress (= an optimization request for this function is
2484// currently being serviced) currently means that no other tiering action can
2485// happen. Define this constant so we can static_assert it at related code
2486// sites.
2487static constexpr bool kTieringStateInProgressBlocksTierup = true;
2488
2489#ifndef V8_ENABLE_LEAPTIERING
2490
2491#define TIERING_STATE_LIST(V) \
2492 V(None, 0b000) \
2493 V(InProgress, 0b001) \
2494 V(RequestMaglev_Synchronous, 0b010) \
2495 V(RequestMaglev_Concurrent, 0b011) \
2496 V(RequestTurbofan_Synchronous, 0b100) \
2497 V(RequestTurbofan_Concurrent, 0b101)
2498
2499enum class TieringState : int32_t {
2500#define V(Name, Value) k##Name = Value,
2502#undef V
2503 kLastTieringState = kRequestTurbofan_Concurrent,
2504};
2505
2506// To efficiently check whether a marker is kNone or kInProgress using a single
2507// mask, we expect the kNone to be 0 and kInProgress to be 1 so that we can
2508// mask off the lsb for checking.
2509static_assert(static_cast<int>(TieringState::kNone) == 0b00 &&
2510 static_cast<int>(TieringState::kInProgress) == 0b01);
2511static_assert(static_cast<int>(TieringState::kLastTieringState) <= 0b111);
2512static constexpr uint32_t kNoneOrInProgressMask = 0b110;
2513
2514#define V(Name, Value) \
2515 constexpr bool Is##Name(TieringState state) { \
2516 return state == TieringState::k##Name; \
2517 }
2519#undef V
2520
2521constexpr bool IsRequestMaglev(TieringState state) {
2522 return IsRequestMaglev_Concurrent(state) ||
2523 IsRequestMaglev_Synchronous(state);
2524}
2525constexpr bool IsRequestTurbofan(TieringState state) {
2526 return IsRequestTurbofan_Concurrent(state) ||
2527 IsRequestTurbofan_Synchronous(state);
2528}
2529
2530constexpr const char* ToString(TieringState marker) {
2531 switch (marker) {
2532#define V(Name, Value) \
2533 case TieringState::k##Name: \
2534 return "TieringState::k" #Name;
2536#undef V
2537 }
2538}
2539
2540inline std::ostream& operator<<(std::ostream& os, TieringState marker) {
2541 return os << ToString(marker);
2542}
2543
2544#undef TIERING_STATE_LIST
2545
2546#endif // !V8_ENABLE_LEAPTIERING
2547
2548// State machine:
2549// S(tate)0: kPending
2550// S1: kEarlySparkplug
2551// S2: kDelayMaglev
2552// S3: kEarlyMaglev
2553// S4: kEarlyTurbofan
2554// S5: kNormal
2555//
2556// C(ondition)0: sparkplug compile
2557// C1: maglev compile
2558// C2: deopt early
2559// C3: ic was stable early
2560// C4: turbofan compile
2561// C5: ic change or deopt
2562//
2563// S0 - C0 -> S1 - C1 - C3 -> S3 - C4 -> S4 -|
2564// | | |
2565// | |--------------------|
2566// | |
2567// C2 C5
2568// | |
2569// --> S2 --> S5
2570enum class CachedTieringDecision : int32_t {
2571 kPending,
2576 kNormal,
2577};
2578
2581
2582inline std::ostream& operator<<(std::ostream& os,
2583 SpeculationMode speculation_mode) {
2584 switch (speculation_mode) {
2586 return os << "SpeculationMode::kAllowSpeculation";
2588 return os << "SpeculationMode::kDisallowSpeculation";
2589 }
2590}
2591
2593
2594enum class ConcurrencyMode : uint8_t { kSynchronous, kConcurrent };
2595
2596constexpr bool IsSynchronous(ConcurrencyMode mode) {
2597 return mode == ConcurrencyMode::kSynchronous;
2598}
2599constexpr bool IsConcurrent(ConcurrencyMode mode) {
2600 return mode == ConcurrencyMode::kConcurrent;
2601}
2602
2603constexpr const char* ToString(ConcurrencyMode mode) {
2604 switch (mode) {
2606 return "ConcurrencyMode::kSynchronous";
2608 return "ConcurrencyMode::kConcurrent";
2609 }
2610}
2611inline std::ostream& operator<<(std::ostream& os, ConcurrencyMode mode) {
2612 return os << ToString(mode);
2613}
2614
2615// An architecture independent representation of the sets of registers available
2616// for instruction creation.
2617enum class AliasingKind {
2618 // Registers alias a single register of every other size (e.g. Intel).
2619 kOverlap,
2620 // Registers alias two registers of the next smaller size (e.g. ARM).
2621 kCombine,
2622 // SIMD128 Registers are independent of every other size (e.g Riscv)
2624};
2625
2626#define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \
2627 C(Handler, handler) \
2628 C(CEntryFP, c_entry_fp) \
2629 C(CFunction, c_function) \
2630 C(Context, context) \
2631 C(Exception, exception) \
2632 C(TopmostScriptHavingContext, topmost_script_having_context) \
2633 C(PendingHandlerContext, pending_handler_context) \
2634 C(PendingHandlerEntrypoint, pending_handler_entrypoint) \
2635 C(PendingHandlerConstantPool, pending_handler_constant_pool) \
2636 C(PendingHandlerFP, pending_handler_fp) \
2637 C(PendingHandlerSP, pending_handler_sp) \
2638 C(NumFramesAbovePendingHandler, num_frames_above_pending_handler) \
2639 C(IsOnCentralStackFlag, is_on_central_stack_flag) \
2640 C(JSEntrySP, js_entry_sp)
2641
2643#define DECLARE_ENUM(CamelName, hacker_name) k##CamelName##Address,
2645#undef DECLARE_ENUM
2648
2649// The reason for a WebAssembly trap.
2650#define FOREACH_WASM_TRAPREASON(V) \
2651 V(TrapUnreachable) \
2652 V(TrapMemOutOfBounds) \
2653 V(TrapUnalignedAccess) \
2654 V(TrapDivByZero) \
2655 V(TrapDivUnrepresentable) \
2656 V(TrapRemByZero) \
2657 V(TrapFloatUnrepresentable) \
2658 V(TrapFuncSigMismatch) \
2659 V(TrapDataSegmentOutOfBounds) \
2660 V(TrapElementSegmentOutOfBounds) \
2661 V(TrapTableOutOfBounds) \
2662 V(TrapRethrowNull) \
2663 V(TrapNullDereference) \
2664 V(TrapIllegalCast) \
2665 V(TrapArrayOutOfBounds) \
2666 V(TrapArrayTooLarge) \
2667 V(TrapStringOffsetOutOfBounds)
2668
2670 kInBounds = 0b00,
2671 kHandleOOB = 0b01,
2672 kHandleHoles = 0b10,
2673 kHandleOOBAndHoles = 0b11,
2674};
2675
2677 bool handle_holes) {
2678 return static_cast<KeyedAccessLoadMode>(
2679 static_cast<int>(handle_oob) | (static_cast<int>(handle_holes) << 1));
2680}
2681
2684 using T = std::underlying_type<KeyedAccessLoadMode>::type;
2685 return static_cast<KeyedAccessLoadMode>(static_cast<T>(mode1) |
2686 static_cast<T>(mode2));
2687}
2688
2690 using T = std::underlying_type<KeyedAccessLoadMode>::type;
2691 return (static_cast<T>(load_mode) &
2692 static_cast<T>(KeyedAccessLoadMode::kHandleOOB)) != 0;
2693}
2694
2696 using T = std::underlying_type<KeyedAccessLoadMode>::type;
2697 return (static_cast<T>(load_mode) &
2698 static_cast<T>(KeyedAccessLoadMode::kHandleHoles)) != 0;
2699}
2700
2707
2708inline std::ostream& operator<<(std::ostream& os, KeyedAccessStoreMode mode) {
2709 switch (mode) {
2711 return os << "kInBounds";
2713 return os << "kGrowAndHandleCOW";
2715 return os << "kIgnoreTypedArrayOOB";
2717 return os << "kHandleCOW";
2718 }
2719 UNREACHABLE();
2720}
2721
2723
2725 return store_mode == KeyedAccessStoreMode::kInBounds;
2726}
2727
2729 return store_mode == KeyedAccessStoreMode::kHandleCOW ||
2731}
2732
2734 return store_mode == KeyedAccessStoreMode::kInBounds ||
2736}
2737
2741
2743 return store_mode == KeyedAccessStoreMode::kGrowAndHandleCOW;
2744}
2745
2747
2748// Helper stubs can be called in different ways depending on where the target
2749// code is located and how the call sequence is expected to look like:
2750// - CodeObject: Call on-heap {Code} object via {RelocInfo::CODE_TARGET}.
2751// - WasmRuntimeStub: Call native {WasmCode} stub via
2752// {RelocInfo::WASM_STUB_CALL}.
2753// - BuiltinPointer: Call a builtin based on a builtin pointer with dynamic
2754// contents. If builtins are embedded, we call directly into off-heap code
2755// without going through the on-heap Code trampoline.
2756enum class StubCallMode {
2758#if V8_ENABLE_WEBASSEMBLY
2759 kCallWasmRuntimeStub,
2760#endif // V8_ENABLE_WEBASSEMBLY
2762};
2763
2764enum class NeedsContext { kYes, kNo };
2765
2766constexpr int kInvalidInfoId = -1;
2768
2770
2773
2774enum class AdaptArguments { kYes, kNo };
2777
2778constexpr int kJSArgcReceiverSlots = 1;
2779constexpr uint16_t kDontAdaptArgumentsSentinel = 0;
2780
2781// Helper to get the parameter count for functions with JS linkage.
2782inline constexpr int JSParameterCount(int param_count_without_receiver) {
2783 return param_count_without_receiver + kJSArgcReceiverSlots;
2784}
2785
2786// A special {Parameter} index for JSCalls that represents the closure.
2787// The constant is defined here for accessibility (without having to include TF
2788// internals), even though it is mostly relevant to Turbofan.
2791
2792// Opaque data type for identifying stack frames. Used extensively
2793// by the debugger.
2794// ID_MIN_VALUE and ID_MAX_VALUE are specified to ensure that enumeration type
2795// has correct value range (see Issue 830 for more details).
2797
2798enum class ExceptionStatus : bool { kException = false, kSuccess = true };
2800 return !static_cast<bool>(status);
2801}
2802
2803// Used in the ScopeInfo flags fields for the function name variable for named
2804// function expressions, and for the receiver. Must be declared here so that it
2805// can be used in Torque.
2807
2808#ifdef V8_COMPRESS_POINTERS
2809class PtrComprCageBase {
2810 public:
2811 explicit constexpr PtrComprCageBase(Address address) : address_(address) {}
2812 // NOLINTNEXTLINE
2813 inline PtrComprCageBase(const Isolate* isolate);
2814 // NOLINTNEXTLINE
2815 inline PtrComprCageBase(const LocalIsolate* isolate);
2816
2817 inline Address address() const { return address_; }
2818
2819 bool operator==(const PtrComprCageBase& other) const {
2820 return address_ == other.address_;
2821 }
2822
2823 private:
2824 Address address_;
2825};
2826#else
2828 public:
2829 explicit constexpr PtrComprCageBase(Address address) {}
2830 PtrComprCageBase() = default;
2831 // NOLINTNEXTLINE
2832 PtrComprCageBase(const Isolate* isolate) {}
2833 // NOLINTNEXTLINE
2835};
2836#endif
2837
2838class int31_t {
2839 public:
2840 constexpr int31_t() : value_(0) {}
2841 constexpr int31_t(int value) : value_(value) { // NOLINT(runtime/explicit)
2842 DCHECK_EQ((value & 0x80000000) != 0, (value & 0x40000000) != 0);
2843 }
2844 int31_t& operator=(int value) {
2845 DCHECK_EQ((value & 0x80000000) != 0, (value & 0x40000000) != 0);
2846 value_ = value;
2847 return *this;
2848 }
2849 int32_t value() const { return value_; }
2850 operator int32_t() const { return value_; }
2851
2852 private:
2853 int32_t value_;
2854};
2855
2857 // String and then Symbol properties according to the spec
2858 // ES#sec-object.assign
2860 // Order of property addition
2862};
2863
2865 // The string must be transitioned to a new representation by first copying.
2866 kCopy,
2867 // The string can be transitioned in-place by changing its map.
2868 kInPlace,
2869 // The string is already transitioned to the desired representation.
2871};
2872
2874 public:
2875 WasmCodePointer() = default;
2876 explicit constexpr WasmCodePointer(uint32_t value) : value_(value) {}
2877
2878 uint32_t value() const { return value_; }
2879
2880 bool operator==(const WasmCodePointer& other) const {
2881 return value_ == other.value_;
2882 }
2883 bool operator!=(const WasmCodePointer& other) const {
2884 return value_ != other.value_;
2885 }
2886
2887 template <typename H>
2888 friend H AbslHashValue(H h, const WasmCodePointer& code_pointer) {
2889 return H::combine(std::move(h), code_pointer.value());
2890 }
2891
2892 private:
2893 uint32_t value_ = -1;
2894};
2895
2896constexpr uint64_t kInvalidWasmSignatureHash = ~uint64_t{0};
2897
2899
2900} // namespace internal
2901
2902// Tag dispatching support for atomic loads and stores.
2913
2914} // namespace v8
2915
2916namespace i = v8::internal;
2917
2918#endif // V8_COMMON_GLOBALS_H_
#define DEFINE_OPERATORS_FOR_FLAGS(Type)
Definition flags.h:100
constexpr int kPageSizeBits
Builtins::Kind kind
Definition builtins.cc:40
static constexpr size_t kExternalAllocationSoftLimit
static const int kDontThrow
static const int kThrowOnError
PtrComprCageBase(const LocalIsolate *isolate)
Definition globals.h:2834
PtrComprCageBase(const Isolate *isolate)
Definition globals.h:2832
constexpr PtrComprCageBase(Address address)
Definition globals.h:2829
friend H AbslHashValue(H h, const WasmCodePointer &code_pointer)
Definition globals.h:2888
constexpr WasmCodePointer(uint32_t value)
Definition globals.h:2876
bool operator==(const WasmCodePointer &other) const
Definition globals.h:2880
bool operator!=(const WasmCodePointer &other) const
Definition globals.h:2883
constexpr int31_t()
Definition globals.h:2840
int31_t & operator=(int value)
Definition globals.h:2844
constexpr int31_t(int value)
Definition globals.h:2841
int32_t value() const
Definition globals.h:2849
#define V8_ENABLE_LEAPTIERING_BOOL
Definition globals.h:151
#define V8_EXTERNAL_CODE_SPACE_BOOL
Definition globals.h:255
#define TAGGED_SIZE_8_BYTES
Definition globals.h:331
#define COMPRESS_POINTERS_BOOL
Definition globals.h:99
#define V8_DEFAULT_STACK_SIZE_KB
Definition globals.h:191
STRONG
Definition globals.h:1033
#define V8_LOWER_LIMITS_MODE_BOOL
Definition globals.h:129
#define COMPRESS_ZONES_BOOL
Definition globals.h:520
#define FOR_EACH_ISOLATE_ADDRESS_NAME(C)
Definition globals.h:2626
#define TIERING_STATE_LIST(V)
Definition globals.h:2491
WEAK
Definition globals.h:1032
Atomic32 AtomicWord
Definition atomicops.h:76
V8_INLINE Dest bit_cast(Source const &source)
Definition macros.h:95
int32_t Atomic32
Definition atomicops.h:59
constexpr uint32_t kPersistentHandleZapValue
Definition globals.h:1008
bool is_valid_language_mode(int language_mode)
Definition globals.h:781
constexpr int kMinInt
Definition globals.h:375
PropertiesEnumerationMode
Definition globals.h:2856
@ kEnumerationOrder
Definition globals.h:2859
@ kPropertyAdditionOrder
Definition globals.h:2861
constexpr intptr_t kPointerAlignment
Definition globals.h:945
constexpr bool IsSharedAllocationType(AllocationType kind)
Definition globals.h:1543
constexpr int kByteSize
Definition globals.h:395
constexpr int kBinary32MinExponent
Definition globals.h:695
bool(*)(FullObjectSlot pointer) WeakSlotCallback
Definition globals.h:1276
IndirectPointerHandle TrustedPointerHandle
GarbageCollectionReason
Definition globals.h:1428
constexpr int kFunctionEntryBytecodeOffset
Definition globals.h:854
SlotTraits::TProtectedMaybeObjectSlot ProtectedMaybeObjectSlot
Definition globals.h:1274
constexpr int kIntSize
Definition globals.h:400
constexpr int kUInt8Size
Definition globals.h:394
constexpr int kSmallOrderedHashMapMinCapacity
Definition globals.h:2772
constexpr int kSpaceTagSize
Definition globals.h:1331
constexpr int H
constexpr const char * ToString(DeoptimizeKind kind)
Definition globals.h:880
constexpr int kMinUInt8
Definition globals.h:379
@ kNeedsInitialization
Definition globals.h:2225
@ kCreatedInitialized
Definition globals.h:2225
constexpr int kTaggedSize
Definition globals.h:542
bool StoreModeHandlesCOW(KeyedAccessStoreMode store_mode)
Definition globals.h:2728
bool StoreModeIsInBounds(KeyedAccessStoreMode store_mode)
Definition globals.h:2724
bool StoreModeCanGrow(KeyedAccessStoreMode store_mode)
Definition globals.h:2742
constexpr int kBinary32ExponentBias
Definition globals.h:693
constexpr int kMinInt31
Definition globals.h:385
constexpr double kMaxSafeInteger
Definition globals.h:1985
constexpr int kInt64Size
Definition globals.h:402
LanguageMode stricter_language_mode(LanguageMode mode1, LanguageMode mode2)
Definition globals.h:792
constexpr int kMaxRegularHeapObjectSize
Definition globals.h:680
constexpr int kSimd128Size
Definition globals.h:706
@ LAST_ALLOCATION_SITE_MODE
Definition globals.h:1937
@ TRACK_ALLOCATION_SITE
Definition globals.h:1936
@ DONT_TRACK_ALLOCATION_SITE
Definition globals.h:1935
constexpr double kMaxUInt32Double
Definition globals.h:1989
Address CppHeapPointer_t
constexpr int kMaxInt8
Definition globals.h:376
constexpr int kMinParameterIndex
Definition globals.h:2790
constexpr int kBitsPerByte
Definition globals.h:682
constexpr int kCodePointerSize
Definition globals.h:640
constexpr int kSystemPointerHexDigits
Definition globals.h:411
constexpr DeoptimizeKind kFirstDeoptimizeKind
Definition globals.h:873
constexpr int kJSCallClosureParameterIndex
Definition globals.h:2789
constexpr int kBinary32MaxExponent
Definition globals.h:694
bool is_sloppy(LanguageMode language_mode)
Definition globals.h:773
constexpr int GB
Definition v8-internal.h:57
constexpr uint32_t kPhantomReferenceZap
Definition globals.h:1020
static constexpr uint32_t kFalse
constexpr int kNoSourcePosition
Definition globals.h:850
constexpr int kProtectedPointerSize
Definition globals.h:645
constexpr int kMaxUInt8
Definition globals.h:378
constexpr size_t kIsolateDataAlignment
Definition globals.h:456
constexpr int kPointerSizeLog2
Definition globals.h:600
constexpr intptr_t kObjectAlignment
Definition globals.h:930
OrdinaryToPrimitiveHint
Definition globals.h:1860
bool IsLexicalVariableMode(VariableMode mode)
Definition globals.h:2155
size_t hash_value(AtomicMemoryOrder order)
constexpr uint32_t kFromSpaceZapValue
Definition globals.h:1013
constexpr int kInt16Size
Definition globals.h:398
constexpr JSDispatchHandle kInvalidDispatchHandle(0xffffffff<< kJSDispatchHandleShift)
bool IsDeclaredVariableMode(VariableMode mode)
Definition globals.h:2120
constexpr int kOneByteSize
Definition globals.h:703
static constexpr bool SlotHoldsTrustedPointerV
Definition globals.h:1296
bool IsForceFlushingEnabled(base::EnumSet< CodeFlushMode > mode)
Definition globals.h:1624
constexpr uint32_t kTracedHandleEagerResetZapValue
Definition globals.h:1009
constexpr int kJSDispatchHandleSize
Definition globals.h:647
const size_t kShortBuiltinCallsOldSpaceSizeThreshold
Definition globals.h:236
constexpr uint32_t kBinary32SignMask
Definition globals.h:690
const int kSmiTagSize
Definition v8-internal.h:87
constexpr int kCharSize
Definition globals.h:396
bool IsByteCodeFlushingEnabled(base::EnumSet< CodeFlushMode > mode)
Definition globals.h:1620
constexpr int kBinary32ExponentShift
Definition globals.h:697
constexpr uint64_t kMinUInt64
Definition globals.h:391
constexpr int kEmbedderDataSlotSize
Definition globals.h:664
constexpr int kPCOnStackSize
Definition globals.h:412
constexpr int kPointerSize
Definition globals.h:599
@ USE_DEFAULT_MINIMUM_CAPACITY
Definition globals.h:1567
@ USE_CUSTOM_MINIMUM_CAPACITY
Definition globals.h:1568
uint32_t ObjectHash(Address address)
Definition globals.h:2256
@ SHADOW_REALM_SCOPE
Definition globals.h:1903
constexpr size_t kJSDispatchTableReservationSize
Definition globals.h:567
constexpr bool IsSynchronous(ConcurrencyMode mode)
Definition globals.h:2596
constexpr int kFloatSize
Definition globals.h:406
@ kLastVariableLocation
Definition globals.h:2200
constexpr int kMaxUInt16
Definition globals.h:382
const Address kWeakHeapObjectMask
Definition globals.h:967
bool IsBaselineCodeFlushingEnabled(base::EnumSet< CodeFlushMode > mode)
Definition globals.h:1616
constexpr intptr_t kCodeAlignment
Definition globals.h:964
constexpr int kMinInt16
Definition globals.h:381
constexpr uint16_t kDontAdaptArgumentsSentinel
Definition globals.h:2779
REPLMode construct_repl_mode(bool is_repl_mode)
Definition globals.h:1638
constexpr uint64_t kHoleNanInt64
Definition globals.h:1960
constexpr int kMaxDoubleStringLength
Definition globals.h:430
constexpr uint32_t kDefaultMaxWasmCodeSpaceSizeMb
Definition globals.h:452
Tagged_t TrustedPointer_t
Definition globals.h:638
const char * InlineCacheState2String(InlineCacheState state)
Definition globals.h:1692
bool IsPrivateMethodVariableMode(VariableMode mode)
Definition globals.h:2131
constexpr int kSmallOrderedHashSetMinCapacity
Definition globals.h:2771
F FUNCTION_CAST(uint8_t *addr)
Definition globals.h:717
constexpr size_t kMinExpectedOSPageSize
Definition globals.h:510
Address Tagged_t
Definition globals.h:547
constexpr uint64_t kMaxSafeIntegerUint64
Definition globals.h:1983
constexpr int kSystemPointerSizeLog2
Definition globals.h:494
base::StrongAlias< JSDispatchHandleAliasTag, uint32_t > JSDispatchHandle
Definition globals.h:557
constexpr int kMaxInt31
Definition globals.h:384
constexpr uint32_t kMaxCommittedWasmCodeMB
Definition globals.h:436
constexpr intptr_t kObjectAlignment8GbHeapMask
Definition globals.h:935
constexpr int kFPOnStackSize
Definition globals.h:413
constexpr int kScopeInfoMaxInlinedLocalNamesSize
Definition globals.h:1891
InterpreterPushArgsMode
Definition globals.h:2233
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 report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
constexpr int kJSArgcReceiverSlots
Definition globals.h:2778
constexpr int kFunctionExitBytecodeOffset
Definition globals.h:858
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)
constexpr intptr_t kCodeAlignmentMask
Definition globals.h:965
constexpr size_t kReservedCodeRangePages
Definition globals.h:512
constexpr bool IsAnyCodeSpace(AllocationSpace space)
Definition globals.h:1334
constexpr int kUIntptrSize
Definition globals.h:409
bool IsImmutableLexicalVariableMode(VariableMode mode)
Definition globals.h:2145
constexpr uint32_t kTracedHandleMinorGCWeakResetZapValue
Definition globals.h:1011
constexpr int kInvalidInfoId
Definition globals.h:2766
StringTransitionStrategy
Definition globals.h:2864
KeyedAccessLoadMode GeneralizeKeyedAccessLoadMode(KeyedAccessLoadMode mode1, KeyedAccessLoadMode mode2)
Definition globals.h:2682
constexpr int64_t kMaxAdditiveSafeInteger
Definition globals.h:1991
constexpr int kMinUInt16
Definition globals.h:383
constexpr int kSimd256Size
Definition globals.h:709
uint32_t IndirectPointerHandle
constexpr int kSystemPointerSize
Definition globals.h:410
const char * LanguageMode2String(LanguageMode mode)
Definition globals.h:759
constexpr intptr_t kObjectAlignment8GbHeap
Definition globals.h:934
constexpr bool IsRequestTurbofan(TieringState state)
Definition globals.h:2525
constexpr int kAdditiveSafeIntegerBitLength
Definition globals.h:1995
KeyedAccessLoadMode CreateKeyedAccessLoadMode(bool handle_oob, bool handle_holes)
Definition globals.h:2676
constexpr int kMinInt8
Definition globals.h:377
@ SLOPPY_FUNCTION_NAME_VARIABLE
Definition globals.h:2113
@ SLOPPY_BLOCK_FUNCTION_VARIABLE
Definition globals.h:2112
@ PARAMETER_VARIABLE
Definition globals.h:2110
static constexpr bool kCompressGraphZone
Definition globals.h:525
constexpr int kStackLimitSlackForDeoptimizationInBytes
Definition globals.h:213
constexpr int kTaggedSizeLog2
Definition globals.h:543
constexpr int kEmbedderDataSlotSizeInTaggedSlots
Definition globals.h:666
constexpr int kCodeAlignmentBits
Definition globals.h:962
constexpr intptr_t kObjectAlignmentMask
Definition globals.h:931
@ ONLY_SINGLE_FUNCTION_LITERAL
Definition globals.h:1655
@ NO_PARSE_RESTRICTION
Definition globals.h:1654
constexpr size_t kMinimumCodeRangeSize
Definition globals.h:509
Address ExternalPointer_t
constexpr uint64_t kMaxUInt64
Definition globals.h:390
constexpr uint32_t kDebugZapValue
Definition globals.h:1015
constexpr int kElidedFrameSlots
Definition globals.h:418
constexpr JSDispatchHandle kNullJSDispatchHandle(0)
constexpr uint32_t kTracedHandleMinorGCResetZapValue
Definition globals.h:1010
constexpr uint32_t kZapValue
Definition globals.h:1005
constexpr int kBitsPerInt
Definition globals.h:687
constexpr bool SmiValuesAre31Bits()
constexpr AdaptArguments kDontAdapt
Definition globals.h:2776
constexpr DeoptimizeKind kLastDeoptimizeKind
Definition globals.h:874
constexpr uint32_t kGlobalHandleZapValue
Definition globals.h:1007
constexpr bool IsAnyTrustedSpace(AllocationSpace space)
Definition globals.h:1337
constexpr JSDispatchHandle kPlaceholderDispatchHandle(0x0)
constexpr int kInt32Size
Definition globals.h:401
refactor address components for immediate indexing make OptimizeMaglevOnNextCall optimize to turbofan instead of maglev filter for tracing turbofan compilation trace turbo cfg trace TurboFan s graph trimmer trace TurboFan s control equivalence trace TurboFan s register allocator trace stack load store counters for optimized code in run fuzzing &&concurrent_recompilation trace_turbo trace_turbo_scheduled trace_turbo_stack_accesses verify TurboFan machine graph of code stubs enable FixedArray bounds checks print TurboFan statistics of wasm compilations maximum cumulative size of bytecode considered for inlining scale factor of bytecode size used to calculate the inlining budget * KB
Definition flags.cc:1366
constexpr int kDeoptimizeKindCount
Definition globals.h:876
constexpr int kExternalPointerSlotSize
Definition globals.h:613
bool IsFlushingDisabled(base::EnumSet< CodeFlushMode > mode)
Definition globals.h:1628
constexpr int kSwissNameDictionaryInitialCapacity
Definition globals.h:2769
constexpr uint32_t kClearedFreeMemoryValue
Definition globals.h:1004
constexpr int kFunctionLiteralIdTopLevel
Definition globals.h:2767
constexpr int kIndirectPointerSize
Definition globals.h:629
constexpr uint32_t kHoleNanLower32
Definition globals.h:1953
bool is_strict(LanguageMode language_mode)
Definition globals.h:777
@ kIsolateAddressCount
Definition globals.h:2646
constexpr int kTrustedPointerSize
Definition globals.h:637
@ FIRST_MUTABLE_SPACE
Definition globals.h:1324
@ SHARED_TRUSTED_LO_SPACE
Definition globals.h:1319
@ FIRST_GROWABLE_PAGED_SPACE
Definition globals.h:1326
@ LAST_GROWABLE_PAGED_SPACE
Definition globals.h:1327
@ FIRST_SWEEPABLE_SPACE
Definition globals.h:1328
@ SHARED_TRUSTED_SPACE
Definition globals.h:1314
@ LAST_MUTABLE_SPACE
Definition globals.h:1325
@ LAST_SWEEPABLE_SPACE
Definition globals.h:1329
const int kSmiShiftSize
constexpr AdaptArguments kAdapt
Definition globals.h:2775
const int kSmiValueSize
constexpr bool kPlatformRequiresCodeRange
Definition globals.h:507
bool StoreModeIgnoresTypeArrayOOB(KeyedAccessStoreMode store_mode)
Definition globals.h:2738
constexpr uint64_t kQuietNaNMask
Definition globals.h:701
constexpr int kCodeZapValue
Definition globals.h:1019
ExternalBackingStoreType
Definition globals.h:1605
bool IsPrivateAccessorVariableMode(VariableMode mode)
Definition globals.h:2126
constexpr size_t kMaxJSDispatchEntries
Definition globals.h:570
constexpr int JSParameterCount(int param_count_without_receiver)
Definition globals.h:2782
constexpr int kMaxInt16
Definition globals.h:380
constexpr uint32_t kTracedHandleFullGCResetZapValue
Definition globals.h:1012
constexpr bool SmiValuesAre32Bits()
constexpr int kBinary32MantissaBits
Definition globals.h:696
constexpr uint32_t kMinUInt32
Definition globals.h:388
constexpr int kCppHeapPointerSlotSize
Definition globals.h:622
bool(*)(Heap *heap, FullObjectSlot pointer) WeakSlotCallbackWithHeap
Definition globals.h:1278
constexpr uint32_t kHoleNanUpper32
Definition globals.h:1952
constexpr bool IsRequestMaglev(TieringState state)
Definition globals.h:2521
constexpr int kUInt32Size
Definition globals.h:403
static constexpr bool kTieringStateInProgressBlocksTierup
Definition globals.h:2487
bool IsPrivateMethodOrAccessorVariableMode(VariableMode mode)
Definition globals.h:2135
base::AtomicWord AtomicTagged_t
Definition globals.h:548
constexpr uint32_t kFreeListZapValue
Definition globals.h:1016
constexpr int kJSDispatchTableEntrySizeLog2
Definition globals.h:562
DefineKeyedOwnPropertyFlag
Definition globals.h:2445
bool IsSerializableVariableMode(VariableMode mode)
Definition globals.h:2140
constexpr int kBitsPerSystemPointer
Definition globals.h:684
constexpr bool IsAnyNewSpace(AllocationSpace space)
Definition globals.h:1345
DefineKeyedOwnPropertyInLiteralFlag
Definition globals.h:2437
@ kExternalFloat64Array
Definition globals.h:2461
@ kExternalUint32Array
Definition globals.h:2458
@ kExternalBigInt64Array
Definition globals.h:2463
@ kExternalInt32Array
Definition globals.h:2457
@ kExternalInt8Array
Definition globals.h:2453
@ kExternalUint8ClampedArray
Definition globals.h:2462
@ kExternalUint8Array
Definition globals.h:2454
@ kExternalUint16Array
Definition globals.h:2456
@ kExternalFloat32Array
Definition globals.h:2460
@ kExternalInt16Array
Definition globals.h:2455
@ kExternalFloat16Array
Definition globals.h:2459
@ kExternalBigUint64Array
Definition globals.h:2464
constexpr uint32_t kQuietNaNHighBitsMask
Definition globals.h:1029
constexpr intptr_t kIntptrSignBit
Definition globals.h:495
constexpr size_t kMaximalCodeRangeSize
Definition globals.h:508
constexpr bool kIsSmiValueInUpper32Bits
Definition globals.h:913
constexpr int kUInt16Size
Definition globals.h:399
constexpr intptr_t kSmiSignMask
Definition globals.h:925
bool operator==(ExternalReference lhs, ExternalReference rhs)
bool IsDynamicVariableMode(VariableMode mode)
Definition globals.h:2116
constexpr int kAdditiveSafeIntegerShift
Definition globals.h:1997
IsolateExecutionModeFlag
Definition globals.h:2424
bool IsImmutableLexicalOrPrivateVariableMode(VariableMode mode)
Definition globals.h:2150
static constexpr uint32_t kNoneOrInProgressMask
Definition globals.h:2512
constexpr int kDoubleSizeLog2
Definition globals.h:421
LanguageMode construct_language_mode(bool strict_bit)
Definition globals.h:786
constexpr int kMaxInt
Definition globals.h:374
bool LoadModeHandlesHoles(KeyedAccessLoadMode load_mode)
Definition globals.h:2695
constexpr int kIeeeDoubleExponentWordOffset
Definition globals.h:1763
constexpr int kBitsPerByteLog2
Definition globals.h:683
V8_INLINE bool operator!(ExceptionStatus status)
Definition globals.h:2799
constexpr double kMinSafeInteger
Definition globals.h:1987
constexpr int kGarbageCollectionReasonMaxValue
constexpr int kStackSpaceRequiredForCompilation
Definition globals.h:207
constexpr int kDoubleSize
Definition globals.h:407
constexpr int kSizetSize
Definition globals.h:404
constexpr intptr_t kDoubleAlignmentMask
Definition globals.h:950
constexpr int kBitsPerSystemPointerLog2
Definition globals.h:685
DECLARE_ENUM(enum_item, ignore)
constexpr int kNoDeoptimizationId
Definition globals.h:861
const uint32_t kClearedWeakHeapObjectLower32
Definition globals.h:981
constexpr uint32_t kBinary32MantissaMask
Definition globals.h:692
constexpr int kShortSize
Definition globals.h:397
constexpr int kInt8Size
Definition globals.h:393
bool StoreModeSupportsTypeArray(KeyedAccessStoreMode store_mode)
Definition globals.h:2733
constexpr int64_t kMinAdditiveSafeInteger
Definition globals.h:1993
constexpr size_t kExternalAllocationSoftLimit
Definition globals.h:670
constexpr uint32_t kSlotsZapValue
Definition globals.h:1014
constexpr uint64_t kInvalidWasmSignatureHash
Definition globals.h:2896
constexpr uint32_t kMaxUInt32
Definition globals.h:387
constexpr intptr_t kPointerAlignmentMask
Definition globals.h:946
constexpr int kObjectAlignmentBits
Definition globals.h:929
bool LoadModeHandlesOOB(KeyedAccessLoadMode load_mode)
Definition globals.h:2689
constexpr bool StaticStringsEqual(const char *s1, const char *s2)
Definition globals.h:740
constexpr bool IsConcurrent(ConcurrencyMode mode)
Definition globals.h:2599
@ kStartAtPrototype
Definition globals.h:1714
constexpr int kIeeeDoubleMantissaWordOffset
Definition globals.h:1762
IeeeDoubleBigEndianArchType IeeeDoubleArchType
Definition globals.h:1761
constexpr int kFloat16Size
Definition globals.h:405
std::pair< const char *, int > FileAndLine
Definition globals.h:2481
constexpr intptr_t kDoubleAlignment
Definition globals.h:949
V8HeapCompressionSchemeImpl< MainCage > V8HeapCompressionScheme
Definition globals.h:1137
constexpr uint32_t kBinary32ExponentMask
Definition globals.h:691
constexpr int kJSDispatchTableEntrySize
Definition globals.h:561
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
Definition flags.cc:2197
const char * ImmutableLexicalVariableModeToString(VariableMode mode)
Definition globals.h:2095
constexpr int kIntptrSize
Definition globals.h:408
constexpr bool kIsSmiValueInLower32Bits
Definition globals.h:915
const int kApiTaggedSize
constexpr bool IsAnySharedSpace(AllocationSpace space)
Definition globals.h:1341
static const size_t LanguageModeSize
Definition globals.h:753
constexpr uint32_t kHandleZapValue
Definition globals.h:1006
AllocationSiteUpdateMode
Definition globals.h:1940
static constexpr ReleaseStoreTag kReleaseStore
Definition globals.h:2910
V8_INLINE Local< Primitive > Null(Isolate *isolate)
static constexpr SeqCstAccessTag kSeqCstAccess
Definition globals.h:2912
static constexpr RelaxedLoadTag kRelaxedLoad
Definition globals.h:2909
V8_INLINE Local< Primitive > Undefined(Isolate *isolate)
static constexpr RelaxedStoreTag kRelaxedStore
Definition globals.h:2911
static constexpr AcquireLoadTag kAcquireLoad
Definition globals.h:2908
#define DCHECK_EQ(v1, v2)
Definition logging.h:485
#define V8_EXPORT_ENUM
Definition macros.h:461
AssemblerDebugInfo(const char *name, const char *file, int line)
Definition globals.h:2468
OffHeapFullObjectSlot TInstructionStreamSlot
Definition globals.h:1228
FullMaybeObjectSlot TMaybeObjectSlot
Definition globals.h:1225
OffHeapFullObjectSlot TOffHeapObjectSlot
Definition globals.h:1227
FullObjectSlot TObjectSlot
Definition globals.h:1224
TObjectSlot TProtectedPointerSlot
Definition globals.h:1236
FullHeapObjectSlot THeapObjectSlot
Definition globals.h:1226
TMaybeObjectSlot TProtectedMaybeObjectSlot
Definition globals.h:1237
struct v8::internal::IeeeDoubleBigEndianArchType::@33 bits
struct v8::internal::IeeeDoubleLittleEndianArchType::@32 bits
#define V8_INLINE
Definition v8config.h:500