v8  9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
v8-internal.h
Go to the documentation of this file.
1 // Copyright 2018 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 INCLUDE_V8_INTERNAL_H_
6 #define INCLUDE_V8_INTERNAL_H_
7 
8 #include <stddef.h>
9 #include <stdint.h>
10 #include <string.h>
11 #include <type_traits>
12 
13 #include "v8-version.h" // NOLINT(build/include_directory)
14 #include "v8config.h" // NOLINT(build/include_directory)
15 
16 namespace v8 {
17 
18 class Context;
19 class Data;
20 class Isolate;
21 
22 namespace internal {
23 
24 class Isolate;
25 
26 typedef uintptr_t Address;
27 static const Address kNullAddress = 0;
28 
29 /**
30  * Configuration of tagging scheme.
31  */
32 const int kApiSystemPointerSize = sizeof(void*);
33 const int kApiDoubleSize = sizeof(double);
34 const int kApiInt32Size = sizeof(int32_t);
35 const int kApiInt64Size = sizeof(int64_t);
36 
37 // Tag information for HeapObject.
38 const int kHeapObjectTag = 1;
39 const int kWeakHeapObjectTag = 3;
40 const int kHeapObjectTagSize = 2;
41 const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1;
42 
43 // Tag information for Smi.
44 const int kSmiTag = 0;
45 const int kSmiTagSize = 1;
46 const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1;
47 
48 template <size_t tagged_ptr_size>
49 struct SmiTagging;
50 
51 constexpr intptr_t kIntptrAllBitsSet = intptr_t{-1};
52 constexpr uintptr_t kUintptrAllBitsSet =
53  static_cast<uintptr_t>(kIntptrAllBitsSet);
54 
55 // Smi constants for systems where tagged pointer is a 32-bit value.
56 template <>
57 struct SmiTagging<4> {
58  enum { kSmiShiftSize = 0, kSmiValueSize = 31 };
59 
60  static constexpr intptr_t kSmiMinValue =
61  static_cast<intptr_t>(kUintptrAllBitsSet << (kSmiValueSize - 1));
62  static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1);
63 
64  V8_INLINE static int SmiToInt(const internal::Address value) {
65  int shift_bits = kSmiTagSize + kSmiShiftSize;
66  // Truncate and shift down (requires >> to be sign extending).
67  return static_cast<int32_t>(static_cast<uint32_t>(value)) >> shift_bits;
68  }
69  V8_INLINE static constexpr bool IsValidSmi(intptr_t value) {
70  // Is value in range [kSmiMinValue, kSmiMaxValue].
71  // Use unsigned operations in order to avoid undefined behaviour in case of
72  // signed integer overflow.
73  return (static_cast<uintptr_t>(value) -
74  static_cast<uintptr_t>(kSmiMinValue)) <=
75  (static_cast<uintptr_t>(kSmiMaxValue) -
76  static_cast<uintptr_t>(kSmiMinValue));
77  }
78 };
79 
80 // Smi constants for systems where tagged pointer is a 64-bit value.
81 template <>
82 struct SmiTagging<8> {
83  enum { kSmiShiftSize = 31, kSmiValueSize = 32 };
84 
85  static constexpr intptr_t kSmiMinValue =
86  static_cast<intptr_t>(kUintptrAllBitsSet << (kSmiValueSize - 1));
87  static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1);
88 
89  V8_INLINE static int SmiToInt(const internal::Address value) {
90  int shift_bits = kSmiTagSize + kSmiShiftSize;
91  // Shift down and throw away top 32 bits.
92  return static_cast<int>(static_cast<intptr_t>(value) >> shift_bits);
93  }
94  V8_INLINE static constexpr bool IsValidSmi(intptr_t value) {
95  // To be representable as a long smi, the value must be a 32-bit integer.
96  return (value == static_cast<int32_t>(value));
97  }
98 };
99 
100 #ifdef V8_COMPRESS_POINTERS
101 static_assert(
103  "Pointer compression can be enabled only for 64-bit architectures");
104 const int kApiTaggedSize = kApiInt32Size;
105 #else
107 #endif
108 
109 constexpr bool PointerCompressionIsEnabled() {
111 }
112 
113 constexpr bool HeapSandboxIsEnabled() {
114 #ifdef V8_HEAP_SANDBOX
115  return true;
116 #else
117  return false;
118 #endif
119 }
120 
121 using ExternalPointer_t = Address;
122 
123 // If the heap sandbox is enabled, these tag values will be XORed with the
124 // external pointers in the external pointer table to prevent use of pointers of
125 // the wrong type.
127  kExternalPointerNullTag = static_cast<Address>(0ULL),
128  kArrayBufferBackingStoreTag = static_cast<Address>(1ULL << 48),
129  kTypedArrayExternalPointerTag = static_cast<Address>(2ULL << 48),
130  kDataViewDataPointerTag = static_cast<Address>(3ULL << 48),
131  kExternalStringResourceTag = static_cast<Address>(4ULL << 48),
132  kExternalStringResourceDataTag = static_cast<Address>(5ULL << 48),
133  kForeignForeignAddressTag = static_cast<Address>(6ULL << 48),
134  kNativeContextMicrotaskQueueTag = static_cast<Address>(7ULL << 48),
135  // TODO(v8:10391, saelo): Currently has to be zero so that raw zero values are
136  // also nullptr
137  kEmbedderDataSlotPayloadTag = static_cast<Address>(0ULL << 48),
138 };
139 
140 #ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
142 #else
143 using PlatformSmiTagging = SmiTagging<kApiTaggedSize>;
144 #endif
145 
146 // TODO(ishell): Consinder adding kSmiShiftBits = kSmiShiftSize + kSmiTagSize
147 // since it's used much more often than the inividual constants.
148 const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize;
149 const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize;
150 const int kSmiMinValue = static_cast<int>(PlatformSmiTagging::kSmiMinValue);
151 const int kSmiMaxValue = static_cast<int>(PlatformSmiTagging::kSmiMaxValue);
152 constexpr bool SmiValuesAre31Bits() { return kSmiValueSize == 31; }
153 constexpr bool SmiValuesAre32Bits() { return kSmiValueSize == 32; }
154 
155 V8_INLINE static constexpr internal::Address IntToSmi(int value) {
156  return (static_cast<Address>(value) << (kSmiTagSize + kSmiShiftSize)) |
157  kSmiTag;
158 }
159 
160 // Converts encoded external pointer to address.
161 V8_EXPORT Address DecodeExternalPointerImpl(const Isolate* isolate,
162  ExternalPointer_t pointer,
163  ExternalPointerTag tag);
164 
165 // {obj} must be the raw tagged pointer representation of a HeapObject
166 // that's guaranteed to never be in ReadOnlySpace.
168 
169 // Returns if we need to throw when an error occurs. This infers the language
170 // mode based on the current context and the closure. This returns true if the
171 // language mode is strict.
172 V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate);
173 
174 /**
175  * This class exports constants and functionality from within v8 that
176  * is necessary to implement inline functions in the v8 api. Don't
177  * depend on functions and constants defined here.
178  */
179 class Internals {
180  public:
181  // These values match non-compiler-dependent values defined within
182  // the implementation of v8.
183  static const int kHeapObjectMapOffset = 0;
185  static const int kStringResourceOffset =
186  1 * kApiTaggedSize + 2 * kApiInt32Size;
187 
189  static const int kJSObjectHeaderSize = 3 * kApiTaggedSize;
190  static const int kFixedArrayHeaderSize = 2 * kApiTaggedSize;
193 #ifdef V8_HEAP_SANDBOX
195 #endif
197  static const int kFullStringRepresentationMask = 0x0f;
198  static const int kStringEncodingMask = 0x8;
199  static const int kExternalTwoByteRepresentationTag = 0x02;
200  static const int kExternalOneByteRepresentationTag = 0x0a;
201 
202  static const uint32_t kNumIsolateDataSlots = 4;
203 
204  // IsolateData layout guarantees.
205  static const int kIsolateEmbedderDataOffset = 0;
212  static const int kIsolateStackGuardOffset =
214  static const int kIsolateRootsOffset =
216 
217  static const int kExternalPointerTableBufferOffset = 0;
222 
223  static const int kUndefinedValueRootIndex = 4;
224  static const int kTheHoleValueRootIndex = 5;
225  static const int kNullValueRootIndex = 6;
226  static const int kTrueValueRootIndex = 7;
227  static const int kFalseValueRootIndex = 8;
228  static const int kEmptyStringRootIndex = 9;
229 
231  static const int kNodeFlagsOffset = 1 * kApiSystemPointerSize + 3;
232  static const int kNodeStateMask = 0x7;
233  static const int kNodeStateIsWeakValue = 2;
234  static const int kNodeStateIsPendingValue = 3;
235 
236  static const int kFirstNonstringType = 0x40;
237  static const int kOddballType = 0x43;
238  static const int kForeignType = 0x46;
239  static const int kJSSpecialApiObjectType = 0x410;
240  static const int kJSApiObjectType = 0x420;
241  static const int kJSObjectType = 0x421;
242 
243  static const int kUndefinedOddballKind = 5;
244  static const int kNullOddballKind = 3;
245 
246  // Constants used by PropertyCallbackInfo to check if we should throw when an
247  // error occurs.
248  static const int kThrowOnError = 0;
249  static const int kDontThrow = 1;
250  static const int kInferShouldThrowMode = 2;
251 
252  // Soft limit for AdjustAmountofExternalAllocatedMemory. Trigger an
253  // incremental GC once the external memory reaches this limit.
254  static constexpr int kExternalAllocationSoftLimit = 64 * 1024 * 1024;
255 
256  V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate);
257  V8_INLINE static void CheckInitialized(v8::Isolate* isolate) {
258 #ifdef V8_ENABLE_CHECKS
259  CheckInitializedImpl(isolate);
260 #endif
261  }
262 
263  V8_INLINE static bool HasHeapObjectTag(const internal::Address value) {
264  return (value & kHeapObjectTagMask) == static_cast<Address>(kHeapObjectTag);
265  }
266 
267  V8_INLINE static int SmiValue(const internal::Address value) {
268  return PlatformSmiTagging::SmiToInt(value);
269  }
270 
271  V8_INLINE static constexpr internal::Address IntToSmi(int value) {
272  return internal::IntToSmi(value);
273  }
274 
275  V8_INLINE static constexpr bool IsValidSmi(intptr_t value) {
276  return PlatformSmiTagging::IsValidSmi(value);
277  }
278 
279  V8_INLINE static int GetInstanceType(const internal::Address obj) {
280  typedef internal::Address A;
282  return ReadRawField<uint16_t>(map, kMapInstanceTypeOffset);
283  }
284 
285  V8_INLINE static int GetOddballKind(const internal::Address obj) {
287  }
288 
289  V8_INLINE static bool IsExternalTwoByteString(int instance_type) {
290  int representation = (instance_type & kFullStringRepresentationMask);
291  return representation == kExternalTwoByteRepresentationTag;
292  }
293 
294  V8_INLINE static uint8_t GetNodeFlag(internal::Address* obj, int shift) {
295  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
296  return *addr & static_cast<uint8_t>(1U << shift);
297  }
298 
299  V8_INLINE static void UpdateNodeFlag(internal::Address* obj, bool value,
300  int shift) {
301  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
302  uint8_t mask = static_cast<uint8_t>(1U << shift);
303  *addr = static_cast<uint8_t>((*addr & ~mask) | (value << shift));
304  }
305 
306  V8_INLINE static uint8_t GetNodeState(internal::Address* obj) {
307  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
308  return *addr & kNodeStateMask;
309  }
310 
311  V8_INLINE static void UpdateNodeState(internal::Address* obj, uint8_t value) {
312  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
313  *addr = static_cast<uint8_t>((*addr & ~kNodeStateMask) | value);
314  }
315 
316  V8_INLINE static void SetEmbedderData(v8::Isolate* isolate, uint32_t slot,
317  void* data) {
318  internal::Address addr = reinterpret_cast<internal::Address>(isolate) +
320  slot * kApiSystemPointerSize;
321  *reinterpret_cast<void**>(addr) = data;
322  }
323 
324  V8_INLINE static void* GetEmbedderData(const v8::Isolate* isolate,
325  uint32_t slot) {
326  internal::Address addr = reinterpret_cast<internal::Address>(isolate) +
328  slot * kApiSystemPointerSize;
329  return *reinterpret_cast<void* const*>(addr);
330  }
331 
332  V8_INLINE static internal::Address* GetRoot(v8::Isolate* isolate, int index) {
333  internal::Address addr = reinterpret_cast<internal::Address>(isolate) +
335  index * kApiSystemPointerSize;
336  return reinterpret_cast<internal::Address*>(addr);
337  }
338 
339  template <typename T>
340  V8_INLINE static T ReadRawField(internal::Address heap_object_ptr,
341  int offset) {
342  internal::Address addr = heap_object_ptr + offset - kHeapObjectTag;
343 #ifdef V8_COMPRESS_POINTERS
344  if (sizeof(T) > kApiTaggedSize) {
345  // TODO(ishell, v8:8875): When pointer compression is enabled 8-byte size
346  // fields (external pointers, doubles and BigInt data) are only
347  // kTaggedSize aligned so we have to use unaligned pointer friendly way of
348  // accessing them in order to avoid undefined behavior in C++ code.
349  T r;
350  memcpy(&r, reinterpret_cast<void*>(addr), sizeof(T));
351  return r;
352  }
353 #endif
354  return *reinterpret_cast<const T*>(addr);
355  }
356 
358  internal::Address heap_object_ptr, int offset) {
359 #ifdef V8_COMPRESS_POINTERS
360  uint32_t value = ReadRawField<uint32_t>(heap_object_ptr, offset);
361  internal::Address root = GetRootFromOnHeapAddress(heap_object_ptr);
362  return root + static_cast<internal::Address>(static_cast<uintptr_t>(value));
363 #else
364  return ReadRawField<internal::Address>(heap_object_ptr, offset);
365 #endif
366  }
367 
369  internal::Address heap_object_ptr, int offset) {
370 #ifdef V8_COMPRESS_POINTERS
371  uint32_t value = ReadRawField<uint32_t>(heap_object_ptr, offset);
372  return static_cast<internal::Address>(static_cast<uintptr_t>(value));
373 #else
374  return ReadRawField<internal::Address>(heap_object_ptr, offset);
375 #endif
376  }
377 
379  internal::Address obj) {
380 #ifdef V8_HEAP_SANDBOX
381  return internal::IsolateFromNeverReadOnlySpaceObject(obj);
382 #else
383  // Not used in non-sandbox mode.
384  return nullptr;
385 #endif
386  }
387 
389  const Isolate* isolate, ExternalPointer_t encoded_pointer,
390  ExternalPointerTag tag) {
391 #ifdef V8_HEAP_SANDBOX
392  return internal::DecodeExternalPointerImpl(isolate, encoded_pointer, tag);
393 #else
394  return encoded_pointer;
395 #endif
396  }
397 
399  internal::Isolate* isolate, internal::Address heap_object_ptr, int offset,
400  ExternalPointerTag tag) {
401 #ifdef V8_HEAP_SANDBOX
402  internal::ExternalPointer_t encoded_value =
403  ReadRawField<uint32_t>(heap_object_ptr, offset);
404  // We currently have to treat zero as nullptr in embedder slots.
405  return encoded_value ? DecodeExternalPointer(isolate, encoded_value, tag)
406  : 0;
407 #else
408  return ReadRawField<Address>(heap_object_ptr, offset);
409 #endif
410  }
411 
412 #ifdef V8_COMPRESS_POINTERS
413  // See v8:7703 or src/ptr-compr.* for details about pointer compression.
414  static constexpr size_t kPtrComprHeapReservationSize = size_t{1} << 32;
415  static constexpr size_t kPtrComprIsolateRootAlignment = size_t{1} << 32;
416 
418  internal::Address addr) {
419  return addr & -static_cast<intptr_t>(kPtrComprIsolateRootAlignment);
420  }
421 
425  return root + static_cast<internal::Address>(static_cast<uintptr_t>(value));
426  }
427 
428 #endif // V8_COMPRESS_POINTERS
429 };
430 
431 // Only perform cast check for types derived from v8::Data since
432 // other types do not implement the Cast method.
433 template <bool PerformCheck>
434 struct CastCheck {
435  template <class T>
436  static void Perform(T* data);
437 };
438 
439 template <>
440 template <class T>
441 void CastCheck<true>::Perform(T* data) {
442  T::Cast(data);
443 }
444 
445 template <>
446 template <class T>
447 void CastCheck<false>::Perform(T* data) {}
448 
449 template <class T>
451  CastCheck<std::is_base_of<Data, T>::value &&
452  !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
453 }
454 
455 // A base class for backing stores, which is needed due to vagaries of
456 // how static casts work with std::shared_ptr.
458 
459 } // namespace internal
460 } // namespace v8
461 
462 #endif // INCLUDE_V8_INTERNAL_H_
v8::internal::Internals::kFullStringRepresentationMask
static const int kFullStringRepresentationMask
Definition: v8-internal.h:197
v8::internal::Internals::kFalseValueRootIndex
static const int kFalseValueRootIndex
Definition: v8-internal.h:227
v8::internal::SmiTagging< 8 >::kSmiMaxValue
static constexpr intptr_t kSmiMaxValue
Definition: v8-internal.h:87
v8::internal::Internals::ReadRawField
static V8_INLINE T ReadRawField(internal::Address heap_object_ptr, int offset)
Definition: v8-internal.h:340
v8::internal::kDataViewDataPointerTag
@ kDataViewDataPointerTag
Definition: v8-internal.h:130
v8::internal::Internals::kNativeContextEmbedderDataOffset
static const int kNativeContextEmbedderDataOffset
Definition: v8-internal.h:196
v8::internal::Internals::kJSObjectHeaderSize
static const int kJSObjectHeaderSize
Definition: v8-internal.h:189
v8::Data
Definition: v8.h:1318
v8::internal::Internals::UpdateNodeFlag
static V8_INLINE void UpdateNodeFlag(internal::Address *obj, bool value, int shift)
Definition: v8-internal.h:299
v8::internal::Internals::GetInstanceType
static V8_INLINE int GetInstanceType(const internal::Address obj)
Definition: v8-internal.h:279
v8::internal::Internals::kMapInstanceTypeOffset
static const int kMapInstanceTypeOffset
Definition: v8-internal.h:184
v8::internal::Internals::GetNodeFlag
static V8_INLINE uint8_t GetNodeFlag(internal::Address *obj, int shift)
Definition: v8-internal.h:294
v8::internal::Address
uintptr_t Address
Definition: v8-internal.h:24
v8::internal::DecodeExternalPointerImpl
V8_EXPORT Address DecodeExternalPointerImpl(const Isolate *isolate, ExternalPointer_t pointer, ExternalPointerTag tag)
v8::internal::SmiTagging< 8 >::kSmiShiftSize
@ kSmiShiftSize
Definition: v8-internal.h:83
v8::internal::Internals::SetEmbedderData
static V8_INLINE void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
Definition: v8-internal.h:316
v8::internal::Internals::HasHeapObjectTag
static V8_INLINE bool HasHeapObjectTag(const internal::Address value)
Definition: v8-internal.h:263
v8::internal::Internals::ReadExternalPointerField
static V8_INLINE internal::Address ReadExternalPointerField(internal::Isolate *isolate, internal::Address heap_object_ptr, int offset, ExternalPointerTag tag)
Definition: v8-internal.h:398
v8::internal::kHeapObjectTag
const int kHeapObjectTag
Definition: v8-internal.h:38
v8::internal::Internals::kDontThrow
static const int kDontThrow
Definition: v8-internal.h:249
v8::internal::Internals::IsExternalTwoByteString
static V8_INLINE bool IsExternalTwoByteString(int instance_type)
Definition: v8-internal.h:289
v8::internal::Internals::UpdateNodeState
static V8_INLINE void UpdateNodeState(internal::Address *obj, uint8_t value)
Definition: v8-internal.h:311
v8::internal::CastCheck
Definition: v8-internal.h:434
V8_INLINE
#define V8_INLINE
Definition: v8config.h:380
v8::internal::ShouldThrowOnError
V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate *isolate)
v8::internal::kApiSystemPointerSize
const int kApiSystemPointerSize
Definition: v8-internal.h:32
v8::internal::Internals::CheckInitializedImpl
static V8_EXPORT void CheckInitializedImpl(v8::Isolate *isolate)
v8::internal::Internals::IntToSmi
static constexpr V8_INLINE internal::Address IntToSmi(int value)
Definition: v8-internal.h:271
v8::internal::SmiTagging< 8 >::IsValidSmi
static constexpr V8_INLINE bool IsValidSmi(intptr_t value)
Definition: v8-internal.h:94
v8::internal::SmiTagging< 4 >::kSmiMinValue
static constexpr intptr_t kSmiMinValue
Definition: v8-internal.h:60
v8::internal::SmiValuesAre31Bits
constexpr bool SmiValuesAre31Bits()
Definition: v8-internal.h:152
v8::internal::kExternalStringResourceDataTag
@ kExternalStringResourceDataTag
Definition: v8-internal.h:132
v8::internal::Internals::kHeapObjectMapOffset
static const int kHeapObjectMapOffset
Definition: v8-internal.h:183
v8::internal::kSmiValueSize
const int kSmiValueSize
Definition: v8-internal.h:149
v8::internal::kExternalPointerNullTag
@ kExternalPointerNullTag
Definition: v8-internal.h:127
v8::internal::Internals::kNodeClassIdOffset
static const int kNodeClassIdOffset
Definition: v8-internal.h:230
v8::internal::SmiTagging< 4 >::kSmiValueSize
@ kSmiValueSize
Definition: v8-internal.h:58
v8::internal::Internals::kIsolateRootsOffset
static const int kIsolateRootsOffset
Definition: v8-internal.h:214
v8::internal::SmiTagging< 8 >::SmiToInt
static V8_INLINE int SmiToInt(const internal::Address value)
Definition: v8-internal.h:89
v8::internal::kEmbedderDataSlotPayloadTag
@ kEmbedderDataSlotPayloadTag
Definition: v8-internal.h:137
v8::internal::Internals::kJSSpecialApiObjectType
static const int kJSSpecialApiObjectType
Definition: v8-internal.h:239
v8::internal::kApiDoubleSize
const int kApiDoubleSize
Definition: v8-internal.h:33
v8::internal::kApiInt64Size
const int kApiInt64Size
Definition: v8-internal.h:35
v8::internal::PerformCastCheck
V8_INLINE void PerformCastCheck(T *data)
Definition: v8-internal.h:450
v8::internal::Internals::kJSApiObjectType
static const int kJSApiObjectType
Definition: v8-internal.h:240
v8::internal::Internals::kIsolateFastCCallCallerPcOffset
static const int kIsolateFastCCallCallerPcOffset
Definition: v8-internal.h:208
v8::internal::Internals::kExternalOneByteRepresentationTag
static const int kExternalOneByteRepresentationTag
Definition: v8-internal.h:200
v8::internal::Internals::kExternalAllocationSoftLimit
static constexpr int kExternalAllocationSoftLimit
Definition: v8-internal.h:254
v8::internal::Internals::kIsolateStackGuardOffset
static const int kIsolateStackGuardOffset
Definition: v8-internal.h:212
v8::internal::Internals::GetRoot
static V8_INLINE internal::Address * GetRoot(v8::Isolate *isolate, int index)
Definition: v8-internal.h:332
v8::internal::Internals
Definition: v8-internal.h:179
v8::internal::Internals::DecodeExternalPointer
static V8_INLINE Address DecodeExternalPointer(const Isolate *isolate, ExternalPointer_t encoded_pointer, ExternalPointerTag tag)
Definition: v8-internal.h:388
v8::internal::Internals::kJSObjectType
static const int kJSObjectType
Definition: v8-internal.h:241
v8::internal::kForeignForeignAddressTag
@ kForeignForeignAddressTag
Definition: v8-internal.h:133
v8::internal::ExternalPointerTag
ExternalPointerTag
Definition: v8-internal.h:126
v8::internal::Internals::kStringEncodingMask
static const int kStringEncodingMask
Definition: v8-internal.h:198
v8::internal::Internals::kIsolateFastApiCallTargetOffset
static const int kIsolateFastApiCallTargetOffset
Definition: v8-internal.h:210
v8::internal::kTypedArrayExternalPointerTag
@ kTypedArrayExternalPointerTag
Definition: v8-internal.h:129
v8::internal::Internals::ReadTaggedSignedField
static V8_INLINE internal::Address ReadTaggedSignedField(internal::Address heap_object_ptr, int offset)
Definition: v8-internal.h:368
v8::internal::Internals::kNullOddballKind
static const int kNullOddballKind
Definition: v8-internal.h:244
v8::internal::Internals::kForeignType
static const int kForeignType
Definition: v8-internal.h:238
v8::internal::Internals::kIsolateEmbedderDataOffset
static const int kIsolateEmbedderDataOffset
Definition: v8-internal.h:205
v8::internal::Internals::kIsolateFastCCallCallerFpOffset
static const int kIsolateFastCCallCallerFpOffset
Definition: v8-internal.h:206
v8::internal::Internals::IsValidSmi
static constexpr V8_INLINE bool IsValidSmi(intptr_t value)
Definition: v8-internal.h:275
v8::internal::Internals::kUndefinedOddballKind
static const int kUndefinedOddballKind
Definition: v8-internal.h:243
V8_EXPORT
#define V8_EXPORT
Definition: v8config.h:512
v8::internal::IsolateFromNeverReadOnlySpaceObject
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
v8::internal::SmiTagging< 4 >::kSmiMaxValue
static constexpr intptr_t kSmiMaxValue
Definition: v8-internal.h:62
v8::internal::Internals::kFirstNonstringType
static const int kFirstNonstringType
Definition: v8-internal.h:236
v8::internal::Internals::kExternalPointerTableCapacityOffset
static const int kExternalPointerTableCapacityOffset
Definition: v8-internal.h:220
v8::internal
Definition: v8-cppgc.h:26
v8::internal::Internals::kExternalTwoByteRepresentationTag
static const int kExternalTwoByteRepresentationTag
Definition: v8-internal.h:199
v8::internal::Internals::kEmbedderDataSlotSize
static const int kEmbedderDataSlotSize
Definition: v8-internal.h:192
v8::internal::Internals::kTrueValueRootIndex
static const int kTrueValueRootIndex
Definition: v8-internal.h:226
v8::internal::Internals::kOddballKindOffset
static const int kOddballKindOffset
Definition: v8-internal.h:188
v8::internal::Internals::GetIsolateForHeapSandbox
static V8_INLINE internal::Isolate * GetIsolateForHeapSandbox(internal::Address obj)
Definition: v8-internal.h:378
v8::Context
Definition: v8.h:10561
v8::internal::Internals::kNodeStateMask
static const int kNodeStateMask
Definition: v8-internal.h:232
v8::Isolate
Definition: v8.h:8450
v8::internal::SmiTagging< 8 >::kSmiValueSize
@ kSmiValueSize
Definition: v8-internal.h:83
v8::internal::SmiTagging< 4 >::SmiToInt
static V8_INLINE int SmiToInt(const internal::Address value)
Definition: v8-internal.h:64
v8::internal::kApiInt32Size
const int kApiInt32Size
Definition: v8-internal.h:34
v8
Definition: libplatform.h:15
v8::internal::HeapSandboxIsEnabled
constexpr bool HeapSandboxIsEnabled()
Definition: v8-internal.h:113
v8::internal::Internals::kNullValueRootIndex
static const int kNullValueRootIndex
Definition: v8-internal.h:225
v8::internal::Internals::GetNodeState
static V8_INLINE uint8_t GetNodeState(internal::Address *obj)
Definition: v8-internal.h:306
v8::internal::BackingStoreBase
Definition: v8-internal.h:457
v8::internal::kIntptrAllBitsSet
constexpr intptr_t kIntptrAllBitsSet
Definition: v8-internal.h:51
v8::internal::kSmiMaxValue
const int kSmiMaxValue
Definition: v8-internal.h:151
v8::internal::Internals::kExternalPointerTableLengthOffset
static const int kExternalPointerTableLengthOffset
Definition: v8-internal.h:218
v8::internal::kUintptrAllBitsSet
constexpr uintptr_t kUintptrAllBitsSet
Definition: v8-internal.h:52
v8::internal::kSmiShiftSize
const int kSmiShiftSize
Definition: v8-internal.h:148
v8::internal::kSmiTag
const int kSmiTag
Definition: v8-internal.h:44
v8::internal::kApiTaggedSize
const int kApiTaggedSize
Definition: v8-internal.h:106
v8::internal::Internals::CheckInitialized
static V8_INLINE void CheckInitialized(v8::Isolate *isolate)
Definition: v8-internal.h:257
v8::internal::kExternalStringResourceTag
@ kExternalStringResourceTag
Definition: v8-internal.h:131
v8::internal::Internals::kNodeFlagsOffset
static const int kNodeFlagsOffset
Definition: v8-internal.h:231
v8::internal::Internals::kStringResourceOffset
static const int kStringResourceOffset
Definition: v8-internal.h:185
v8::internal::kHeapObjectTagMask
const intptr_t kHeapObjectTagMask
Definition: v8-internal.h:41
v8::internal::CastCheck::Perform
static void Perform(T *data)
v8::internal::Internals::kEmbedderDataArrayHeaderSize
static const int kEmbedderDataArrayHeaderSize
Definition: v8-internal.h:191
v8::internal::Internals::kNumIsolateDataSlots
static const uint32_t kNumIsolateDataSlots
Definition: v8-internal.h:202
v8::internal::kSmiMinValue
const int kSmiMinValue
Definition: v8-internal.h:150
v8::internal::Internals::SmiValue
static V8_INLINE int SmiValue(const internal::Address value)
Definition: v8-internal.h:267
v8::internal::Internals::ReadTaggedPointerField
static V8_INLINE internal::Address ReadTaggedPointerField(internal::Address heap_object_ptr, int offset)
Definition: v8-internal.h:357
v8::internal::Internals::kThrowOnError
static const int kThrowOnError
Definition: v8-internal.h:248
v8::internal::Internals::kOddballType
static const int kOddballType
Definition: v8-internal.h:237
v8::internal::Internals::kNodeStateIsPendingValue
static const int kNodeStateIsPendingValue
Definition: v8-internal.h:234
v8::internal::PointerCompressionIsEnabled
constexpr bool PointerCompressionIsEnabled()
Definition: v8-internal.h:109
v8::internal::kSmiTagSize
const int kSmiTagSize
Definition: v8-internal.h:45
v8::internal::kHeapObjectTagSize
const int kHeapObjectTagSize
Definition: v8-internal.h:40
v8::internal::SmiTagging< 8 >::kSmiMinValue
static constexpr intptr_t kSmiMinValue
Definition: v8-internal.h:85
v8::internal::SmiTagging< 4 >::IsValidSmi
static constexpr V8_INLINE bool IsValidSmi(intptr_t value)
Definition: v8-internal.h:69
v8::internal::SmiValuesAre32Bits
constexpr bool SmiValuesAre32Bits()
Definition: v8-internal.h:153
v8::internal::Internals::GetEmbedderData
static V8_INLINE void * GetEmbedderData(const v8::Isolate *isolate, uint32_t slot)
Definition: v8-internal.h:324
v8::internal::kWeakHeapObjectTag
const int kWeakHeapObjectTag
Definition: v8-internal.h:39
v8::internal::Internals::kUndefinedValueRootIndex
static const int kUndefinedValueRootIndex
Definition: v8-internal.h:223
v8::internal::kArrayBufferBackingStoreTag
@ kArrayBufferBackingStoreTag
Definition: v8-internal.h:128
v8::internal::Internals::GetOddballKind
static V8_INLINE int GetOddballKind(const internal::Address obj)
Definition: v8-internal.h:285
v8::internal::Internals::kNodeStateIsWeakValue
static const int kNodeStateIsWeakValue
Definition: v8-internal.h:233
v8::internal::Internals::kInferShouldThrowMode
static const int kInferShouldThrowMode
Definition: v8-internal.h:250
v8::internal::kSmiTagMask
const intptr_t kSmiTagMask
Definition: v8-internal.h:46
v8::internal::Internals::kFixedArrayHeaderSize
static const int kFixedArrayHeaderSize
Definition: v8-internal.h:190
v8::internal::SmiTagging< 4 >::kSmiShiftSize
@ kSmiShiftSize
Definition: v8-internal.h:58
v8::internal::kNativeContextMicrotaskQueueTag
@ kNativeContextMicrotaskQueueTag
Definition: v8-internal.h:134
v8::internal::Internals::kTheHoleValueRootIndex
static const int kTheHoleValueRootIndex
Definition: v8-internal.h:224
v8::internal::Internals::kEmptyStringRootIndex
static const int kEmptyStringRootIndex
Definition: v8-internal.h:228
v8::internal::Internals::kExternalPointerTableBufferOffset
static const int kExternalPointerTableBufferOffset
Definition: v8-internal.h:217