v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-internal.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <atomic>
#include <iterator>
#include <memory>
#include <type_traits>
#include "v8config.h"
Include dependency graph for v8-internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SmiTagging< 4 >
 
struct  SmiTagging< 8 >
 
class  Internals
 
struct  CastCheck< PerformCheck >
 
class  BackingStoreBase
 
class  StrongRootAllocatorBase
 
class  StrongRootAllocator< T >
 
class  WrappedIterator< Iterator, ElementType >
 
class  ValueHelper
 
class  HandleHelper
 

Namespaces

namespace  v8
 
namespace  v8::internal
 

Macros

#define TAG(i)
 
#define SHARED_EXTERNAL_POINTER_TAGS(V)
 
#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V)
 
#define ALL_EXTERNAL_POINTER_TAGS(V)
 
#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag)   Name = Tag,
 
#define MAKE_TAG(HasMarkBit, TypeTag)
 
#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...)    static_assert(IsSharedExternalPointerType(Tag));
 
#define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...)    static_assert(!IsSharedExternalPointerType(Tag));
 

Typedefs

typedef uintptr_t Address
 
using PlatformSmiTagging = SmiTagging< kApiTaggedSize >
 
using SandboxedPointer_t = Address
 
using ExternalPointerHandle = uint32_t
 
using ExternalPointer_t = Address
 
using IndirectPointerHandle = uint32_t
 
using TrustedPointerHandle = IndirectPointerHandle
 
using CodePointerHandle = IndirectPointerHandle
 

Enumerations

enum  ExternalPointerTag : uint64_t { kExternalPointerNullTag = MAKE_TAG(1, 0b00000000) , kAnyExternalPointerTag = MAKE_TAG(1, 0b11111111) , kExternalPointerFreeEntryTag = MAKE_TAG(0, 0b11111111) , kExternalPointerEvacuationEntryTag = MAKE_TAG(1, 0b11100111) }
 

Functions

constexpr bool PointerCompressionIsEnabled ()
 
constexpr bool SmiValuesAre31Bits ()
 
constexpr bool SmiValuesAre32Bits ()
 
constexpr bool Is64 ()
 
constexpr bool SandboxIsEnabled ()
 
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject (Address obj)
 
V8_EXPORT bool ShouldThrowOnError (internal::Isolate *isolate)
 
template<class T >
V8_INLINE void PerformCastCheck (T *data)
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr bool operator== (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr bool operator< (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr bool operator!= (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr bool operator> (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr bool operator>= (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr bool operator<= (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
 
template<typename Iterator , typename ElementType , typename OtherIterator , typename OtherElementType >
constexpr auto operator- (const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept -> decltype(x.base() - y.base())
 
template<typename Iterator , typename ElementType >
constexpr WrappedIterator< Iterator > operator+ (typename WrappedIterator< Iterator, ElementType >::difference_type n, const WrappedIterator< Iterator, ElementType > &x) noexcept
 
V8_EXPORT void VerifyHandleIsNonEmpty (bool is_empty)
 

Variables

constexpr int KB = 1024
 
constexpr int MB = KB * 1024
 
constexpr int GB = MB * 1024
 
const int kApiSystemPointerSize = sizeof(void*)
 
const int kApiDoubleSize = sizeof(double)
 
const int kApiInt32Size = sizeof(int32_t)
 
const int kApiInt64Size = sizeof(int64_t)
 
const int kApiSizetSize = sizeof(size_t)
 
const int kHeapObjectTag = 1
 
const int kWeakHeapObjectTag = 3
 
const int kHeapObjectTagSize = 2
 
const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1
 
const intptr_t kHeapObjectReferenceTagMask = 1 << (kHeapObjectTagSize - 1)
 
const int kForwardingTag = 0
 
const int kForwardingTagSize = 2
 
const intptr_t kForwardingTagMask = (1 << kForwardingTagSize) - 1
 
const int kSmiTag = 0
 
const int kSmiTagSize = 1
 
const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1
 
constexpr intptr_t kIntptrAllBitsSet = intptr_t{-1}
 
constexpr uintptr_t kUintptrAllBitsSet
 
const int kApiTaggedSize = kApiSystemPointerSize
 
const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize
 
const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize
 
const int kSmiMinValue = static_cast<int>(PlatformSmiTagging::kSmiMinValue)
 
const int kSmiMaxValue = static_cast<int>(PlatformSmiTagging::kSmiMaxValue)
 
constexpr size_t kMaxExternalPointers = 0
 
constexpr ExternalPointer_t kNullExternalPointer = 0
 
constexpr ExternalPointerHandle kNullExternalPointerHandle = 0
 
constexpr uint64_t kExternalPointerMarkBit = 1ULL << 62
 
constexpr uint64_t kExternalPointerTagMask = 0x40ff000000000000
 
constexpr uint64_t kExternalPointerTagMaskWithoutMarkBit = 0xff000000000000
 
constexpr uint64_t kExternalPointerTagShift = 48
 
constexpr uint64_t kAllExternalPointerTypeTags []
 
constexpr IndirectPointerHandle kNullIndirectPointerHandle = 0
 
constexpr size_t kTrustedPointerTableReservationSize = 64 * MB
 
constexpr uint32_t kTrustedPointerHandleShift = 9
 
constexpr TrustedPointerHandle kNullTrustedPointerHandle
 
constexpr int kTrustedPointerTableEntrySize = 8
 
constexpr int kTrustedPointerTableEntrySizeLog2 = 3
 
constexpr size_t kMaxTrustedPointers
 
constexpr size_t kCodePointerTableReservationSize = 16 * MB
 
constexpr uint32_t kCodePointerHandleShift = 12
 
constexpr CodePointerHandle kNullCodePointerHandle = kNullIndirectPointerHandle
 
constexpr uint32_t kCodePointerHandleMarker = 0x1
 
constexpr int kCodePointerTableEntrySize = 16
 
constexpr int kCodePointerTableEntrySizeLog2 = 4
 
constexpr size_t kMaxCodePointers
 
constexpr int kCodePointerTableEntryEntrypointOffset = 0
 
constexpr int kCodePointerTableEntryCodeObjectOffset = 8
 
constexpr bool kRuntimeGeneratedCodeObjectsLiveInTrustedSpace = true
 
constexpr bool kBuiltinCodeObjectsLiveInTrustedSpace = false
 
constexpr bool kAllCodeObjectsLiveInTrustedSpace
 
constexpr int kGarbageCollectionReasonMaxValue = 27
 

Macro Definition Documentation

◆ ALL_EXTERNAL_POINTER_TAGS

#define ALL_EXTERNAL_POINTER_TAGS (   V)
Value:
PER_ISOLATE_EXTERNAL_POINTER_TAGS(V)
#define SHARED_EXTERNAL_POINTER_TAGS(V)
#define V(Name)

Definition at line 439 of file v8-internal.h.

◆ CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS

#define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS (   Tag,
  ... 
)     static_assert(!IsSharedExternalPointerType(Tag));

Definition at line 487 of file v8-internal.h.

◆ CHECK_SHARED_EXTERNAL_POINTER_TAGS

#define CHECK_SHARED_EXTERNAL_POINTER_TAGS (   Tag,
  ... 
)     static_assert(IsSharedExternalPointerType(Tag));

Definition at line 485 of file v8-internal.h.

◆ EXTERNAL_POINTER_TAG_ENUM

#define EXTERNAL_POINTER_TAG_ENUM (   Name,
  Tag 
)    Name = Tag,

Definition at line 443 of file v8-internal.h.

◆ MAKE_TAG

#define MAKE_TAG (   HasMarkBit,
  TypeTag 
)
Value:
((static_cast<uint64_t>(TypeTag) << kExternalPointerTagShift) | \
(HasMarkBit ? kExternalPointerMarkBit : 0))

Definition at line 444 of file v8-internal.h.

◆ PER_ISOLATE_EXTERNAL_POINTER_TAGS

#define PER_ISOLATE_EXTERNAL_POINTER_TAGS (   V)
Value:
V(kForeignForeignAddressTag, TAG(10)) \
V(kNativeContextMicrotaskQueueTag, TAG(11)) \
V(kEmbedderDataSlotPayloadTag, TAG(12)) \
/* This tag essentially stands for a `void*` pointer in the V8 API, and */ \
/* it is the Embedder's responsibility to ensure type safety (against */ \
/* substitution) and lifetime validity of these objects. */ \
V(kExternalObjectValueTag, TAG(13)) \
V(kFunctionTemplateInfoCallbackTag, TAG(14)) \
V(kAccessorInfoGetterTag, TAG(15)) \
V(kAccessorInfoSetterTag, TAG(16)) \
V(kWasmInternalFunctionCallTargetTag, TAG(17)) \
V(kWasmTypeInfoNativeTypeTag, TAG(18)) \
V(kWasmExportedFunctionDataSignatureTag, TAG(19)) \
V(kWasmContinuationJmpbufTag, TAG(20)) \
V(kWasmIndirectFunctionTargetTag, TAG(21)) \
V(kArrayBufferExtensionTag, TAG(22))
#define TAG(i)

Definition at line 420 of file v8-internal.h.

◆ SHARED_EXTERNAL_POINTER_TAGS

#define SHARED_EXTERNAL_POINTER_TAGS (   V)
Value:
V(kFirstSharedTag, TAG(0)) \
V(kWaiterQueueNodeTag, TAG(0)) \
V(kExternalStringResourceTag, TAG(1)) \
V(kExternalStringResourceDataTag, TAG(2)) \
V(kLastSharedTag, TAG(2))

Definition at line 411 of file v8-internal.h.

◆ TAG

#define TAG (   i)
Value:
((kAllExternalPointerTypeTags[i] << kExternalPointerTagShift) | \
kExternalPointerMarkBit)

Definition at line 397 of file v8-internal.h.