V8 Project
v8::internal::Internals Class Reference

This class exports constants and functionality from within v8 that is necessary to implement inline functions in the v8 api. More...

#include <v8.h>

+ Collaboration diagram for v8::internal::Internals:

Static Public Member Functions

static void CheckInitializedImpl (v8::Isolate *isolate)
 
static void CheckInitialized (v8::Isolate *isolate)
 
static bool HasHeapObjectTag (const internal::Object *value)
 
static int SmiValue (const internal::Object *value)
 
static internal::ObjectIntToSmi (int value)
 
static bool IsValidSmi (intptr_t value)
 
static int GetInstanceType (const internal::Object *obj)
 
static int GetOddballKind (const internal::Object *obj)
 
static bool IsExternalTwoByteString (int instance_type)
 
static uint8_t GetNodeFlag (internal::Object **obj, int shift)
 
static void UpdateNodeFlag (internal::Object **obj, bool value, int shift)
 
static uint8_t GetNodeState (internal::Object **obj)
 
static void UpdateNodeState (internal::Object **obj, uint8_t value)
 
static void SetEmbedderData (v8::Isolate *isolate, uint32_t slot, void *data)
 
static void * GetEmbedderData (const v8::Isolate *isolate, uint32_t slot)
 
static internal::Object ** GetRoot (v8::Isolate *isolate, int index)
 
template<typename T >
static T ReadField (const internal::Object *ptr, int offset)
 
template<typename T >
static T ReadEmbedderData (const v8::Context *context, int index)
 

Static Public Attributes

static const int kHeapObjectMapOffset = 0
 
static const int kMapInstanceTypeAndBitFieldOffset
 
static const int kStringResourceOffset = 3 * kApiPointerSize
 
static const int kOddballKindOffset = 3 * kApiPointerSize
 
static const int kForeignAddressOffset = kApiPointerSize
 
static const int kJSObjectHeaderSize = 3 * kApiPointerSize
 
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize
 
static const int kContextHeaderSize = 2 * kApiPointerSize
 
static const int kContextEmbedderDataIndex = 95
 
static const int kFullStringRepresentationMask = 0x07
 
static const int kStringEncodingMask = 0x4
 
static const int kExternalTwoByteRepresentationTag = 0x02
 
static const int kExternalOneByteRepresentationTag = 0x06
 
static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize
 
static const int kAmountOfExternalAllocatedMemoryOffset
 
static const int kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset
 
static const int kIsolateRootsOffset
 
static const int kUndefinedValueRootIndex = 5
 
static const int kNullValueRootIndex = 7
 
static const int kTrueValueRootIndex = 8
 
static const int kFalseValueRootIndex = 9
 
static const int kEmptyStringRootIndex = 164
 
static const int kExternalAllocationLimit = 192 * 1024 * 1024
 
static const int kNodeClassIdOffset = 1 * kApiPointerSize
 
static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3
 
static const int kNodeStateMask = 0xf
 
static const int kNodeStateIsWeakValue = 2
 
static const int kNodeStateIsPendingValue = 3
 
static const int kNodeStateIsNearDeathValue = 4
 
static const int kNodeIsIndependentShift = 4
 
static const int kNodeIsPartiallyDependentShift = 5
 
static const int kJSObjectType = 0xbc
 
static const int kFirstNonstringType = 0x80
 
static const int kOddballType = 0x83
 
static const int kForeignType = 0x88
 
static const int kUndefinedOddballKind = 5
 
static const int kNullOddballKind = 3
 
static const uint32_t kNumIsolateDataSlots = 4
 

Detailed Description

This class exports constants and functionality from within v8 that is necessary to implement inline functions in the v8 api.

Don't depend on functions and constants defined here.

Definition at line 5815 of file v8.h.

Member Function Documentation

◆ CheckInitialized()

static void v8::internal::Internals::CheckInitialized ( v8::Isolate isolate)
inlinestatic

Definition at line 5873 of file v8.h.

5873  {
5874 #ifdef V8_ENABLE_CHECKS
5875  CheckInitializedImpl(isolate);
5876 #endif
5877  }
static void CheckInitializedImpl(v8::Isolate *isolate)

References CheckInitializedImpl().

+ Here is the call graph for this function:

◆ CheckInitializedImpl()

static void v8::internal::Internals::CheckInitializedImpl ( v8::Isolate isolate)
static

Referenced by CheckInitialized().

+ Here is the caller graph for this function:

◆ GetEmbedderData()

static void* v8::internal::Internals::GetEmbedderData ( const v8::Isolate isolate,
uint32_t  slot 
)
inlinestatic

Definition at line 5945 of file v8.h.

5946  {
5947  const uint8_t* addr = reinterpret_cast<const uint8_t*>(isolate) +
5949  return *reinterpret_cast<void* const*>(addr);
5950  }
static const int kIsolateEmbedderDataOffset
Definition: v8.h:5835
const int kApiPointerSize
Definition: v8.h:5732

References v8::internal::kApiPointerSize, and kIsolateEmbedderDataOffset.

◆ GetInstanceType()

static int v8::internal::Internals::GetInstanceType ( const internal::Object obj)
inlinestatic

Definition at line 5896 of file v8.h.

5896  {
5897  typedef internal::Object O;
5898  O* map = ReadField<O*>(obj, kHeapObjectMapOffset);
5899  // Map::InstanceType is defined so that it will always be loaded into
5900  // the LS 8 bits of one 16-bit word, regardless of endianess.
5901  return ReadField<uint16_t>(map, kMapInstanceTypeAndBitFieldOffset) & 0xff;
5902  }
static const int kHeapObjectMapOffset
Definition: v8.h:5819
static const int kMapInstanceTypeAndBitFieldOffset
Definition: v8.h:5820
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References kHeapObjectMapOffset, kMapInstanceTypeAndBitFieldOffset, and map.

◆ GetNodeFlag()

static uint8_t v8::internal::Internals::GetNodeFlag ( internal::Object **  obj,
int  shift 
)
inlinestatic

Definition at line 5914 of file v8.h.

5914  {
5915  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
5916  return *addr & static_cast<uint8_t>(1U << shift);
5917  }
static const int kNodeFlagsOffset
Definition: v8.h:5854
enable harmony numeric enable harmony object literal extensions Optimize object Array shift

References kNodeFlagsOffset, and shift.

◆ GetNodeState()

static uint8_t v8::internal::Internals::GetNodeState ( internal::Object **  obj)
inlinestatic

Definition at line 5926 of file v8.h.

5926  {
5927  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
5928  return *addr & kNodeStateMask;
5929  }
static const int kNodeStateMask
Definition: v8.h:5855

References kNodeFlagsOffset, and kNodeStateMask.

◆ GetOddballKind()

static int v8::internal::Internals::GetOddballKind ( const internal::Object obj)
inlinestatic

Definition at line 5904 of file v8.h.

5904  {
5905  typedef internal::Object O;
5906  return SmiValue(ReadField<O*>(obj, kOddballKindOffset));
5907  }
static const int kOddballKindOffset
Definition: v8.h:5824
static int SmiValue(const internal::Object *value)
Definition: v8.h:5884

References kOddballKindOffset, and SmiValue().

+ Here is the call graph for this function:

◆ GetRoot()

static internal::Object** v8::internal::Internals::GetRoot ( v8::Isolate isolate,
int  index 
)
inlinestatic

Definition at line 5952 of file v8.h.

5953  {
5954  uint8_t* addr = reinterpret_cast<uint8_t*>(isolate) + kIsolateRootsOffset;
5955  return reinterpret_cast<internal::Object**>(addr + index * kApiPointerSize);
5956  }
static const int kIsolateRootsOffset
Definition: v8.h:5840

References v8::internal::kApiPointerSize, and kIsolateRootsOffset.

◆ HasHeapObjectTag()

static bool v8::internal::Internals::HasHeapObjectTag ( const internal::Object value)
inlinestatic

Definition at line 5879 of file v8.h.

5879  {
5880  return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) ==
5881  kHeapObjectTag);
5882  }
const intptr_t kHeapObjectTagMask
Definition: v8.h:5739
const int kHeapObjectTag
Definition: v8.h:5737

References v8::internal::kHeapObjectTag, and v8::internal::kHeapObjectTagMask.

◆ IntToSmi()

static internal::Object* v8::internal::Internals::IntToSmi ( int  value)
inlinestatic

Definition at line 5888 of file v8.h.

5888  {
5889  return PlatformSmiTagging::IntToSmi(value);
5890  }
internal::Object * IntToSmi(int value)
Definition: v8.h:5749

References v8::internal::IntToSmi().

Referenced by v8::internal::Smi::FromInt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsExternalTwoByteString()

static bool v8::internal::Internals::IsExternalTwoByteString ( int  instance_type)
inlinestatic

Definition at line 5909 of file v8.h.

5909  {
5910  int representation = (instance_type & kFullStringRepresentationMask);
5911  return representation == kExternalTwoByteRepresentationTag;
5912  }
static const int kFullStringRepresentationMask
Definition: v8.h:5830
static const int kExternalTwoByteRepresentationTag
Definition: v8.h:5832

References kExternalTwoByteRepresentationTag, and kFullStringRepresentationMask.

◆ IsValidSmi()

static bool v8::internal::Internals::IsValidSmi ( intptr_t  value)
inlinestatic

Definition at line 5892 of file v8.h.

5892  {
5893  return PlatformSmiTagging::IsValidSmi(value);
5894  }

Referenced by v8::internal::Smi::IsValid().

+ Here is the caller graph for this function:

◆ ReadEmbedderData()

template<typename T >
static T v8::internal::Internals::ReadEmbedderData ( const v8::Context context,
int  index 
)
inlinestatic

Definition at line 5966 of file v8.h.

5966  {
5967  typedef internal::Object O;
5968  typedef internal::Internals I;
5969  O* ctx = *reinterpret_cast<O* const*>(context);
5970  int embedder_data_offset = I::kContextHeaderSize +
5971  (internal::kApiPointerSize * I::kContextEmbedderDataIndex);
5972  O* embedder_data = I::ReadField<O*>(ctx, embedder_data_offset);
5973  int value_offset =
5974  I::kFixedArrayHeaderSize + (internal::kApiPointerSize * index);
5975  return I::ReadField<T>(embedder_data, value_offset);
5976  }

References v8::internal::I, and v8::internal::kApiPointerSize.

◆ ReadField()

template<typename T >
static T v8::internal::Internals::ReadField ( const internal::Object ptr,
int  offset 
)
inlinestatic

Definition at line 5959 of file v8.h.

5959  {
5960  const uint8_t* addr =
5961  reinterpret_cast<const uint8_t*>(ptr) + offset - kHeapObjectTag;
5962  return *reinterpret_cast<const T*>(addr);
5963  }
#define T(name, string, precedence)
Definition: token.cc:25

References v8::internal::kHeapObjectTag, and T.

◆ SetEmbedderData()

static void v8::internal::Internals::SetEmbedderData ( v8::Isolate isolate,
uint32_t  slot,
void *  data 
)
inlinestatic

Definition at line 5937 of file v8.h.

5939  {
5940  uint8_t *addr = reinterpret_cast<uint8_t *>(isolate) +
5942  *reinterpret_cast<void**>(addr) = data;
5943  }

References v8::internal::kApiPointerSize, and kIsolateEmbedderDataOffset.

◆ SmiValue()

static int v8::internal::Internals::SmiValue ( const internal::Object value)
inlinestatic

Definition at line 5884 of file v8.h.

5884  {
5885  return PlatformSmiTagging::SmiToInt(value);
5886  }

Referenced by GetOddballKind(), and v8::internal::Smi::value().

+ Here is the caller graph for this function:

◆ UpdateNodeFlag()

static void v8::internal::Internals::UpdateNodeFlag ( internal::Object **  obj,
bool  value,
int  shift 
)
inlinestatic

Definition at line 5919 of file v8.h.

5920  {
5921  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
5922  uint8_t mask = static_cast<uint8_t>(1U << shift);
5923  *addr = static_cast<uint8_t>((*addr & ~mask) | (value << shift));
5924  }

References kNodeFlagsOffset, and shift.

◆ UpdateNodeState()

static void v8::internal::Internals::UpdateNodeState ( internal::Object **  obj,
uint8_t  value 
)
inlinestatic

Definition at line 5931 of file v8.h.

5932  {
5933  uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + kNodeFlagsOffset;
5934  *addr = static_cast<uint8_t>((*addr & ~kNodeStateMask) | value);
5935  }

References kNodeFlagsOffset, and kNodeStateMask.

Member Data Documentation

◆ kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset

const int v8::internal::Internals::kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset
static
Initial value:
=
static const int kAmountOfExternalAllocatedMemoryOffset
Definition: v8.h:5836
const int kApiInt64Size
Definition: v8.h:5734

Definition at line 5838 of file v8.h.

Referenced by v8::internal::Isolate::Init().

◆ kAmountOfExternalAllocatedMemoryOffset

const int v8::internal::Internals::kAmountOfExternalAllocatedMemoryOffset
static
Initial value:

Definition at line 5836 of file v8.h.

Referenced by v8::internal::Isolate::Init().

◆ kContextEmbedderDataIndex

const int v8::internal::Internals::kContextEmbedderDataIndex = 95
static

Definition at line 5829 of file v8.h.

◆ kContextHeaderSize

const int v8::internal::Internals::kContextHeaderSize = 2 * kApiPointerSize
static

Definition at line 5828 of file v8.h.

◆ kEmptyStringRootIndex

const int v8::internal::Internals::kEmptyStringRootIndex = 164
static

Definition at line 5847 of file v8.h.

◆ kExternalAllocationLimit

const int v8::internal::Internals::kExternalAllocationLimit = 192 * 1024 * 1024
static

Definition at line 5851 of file v8.h.

◆ kExternalOneByteRepresentationTag

const int v8::internal::Internals::kExternalOneByteRepresentationTag = 0x06
static

Definition at line 5833 of file v8.h.

◆ kExternalTwoByteRepresentationTag

const int v8::internal::Internals::kExternalTwoByteRepresentationTag = 0x02
static

Definition at line 5832 of file v8.h.

Referenced by IsExternalTwoByteString().

◆ kFalseValueRootIndex

const int v8::internal::Internals::kFalseValueRootIndex = 9
static

Definition at line 5846 of file v8.h.

◆ kFirstNonstringType

const int v8::internal::Internals::kFirstNonstringType = 0x80
static

Definition at line 5863 of file v8.h.

◆ kFixedArrayHeaderSize

const int v8::internal::Internals::kFixedArrayHeaderSize = 2 * kApiPointerSize
static

Definition at line 5827 of file v8.h.

◆ kForeignAddressOffset

const int v8::internal::Internals::kForeignAddressOffset = kApiPointerSize
static

Definition at line 5825 of file v8.h.

◆ kForeignType

const int v8::internal::Internals::kForeignType = 0x88
static

Definition at line 5865 of file v8.h.

◆ kFullStringRepresentationMask

const int v8::internal::Internals::kFullStringRepresentationMask = 0x07
static

Definition at line 5830 of file v8.h.

Referenced by IsExternalTwoByteString().

◆ kHeapObjectMapOffset

const int v8::internal::Internals::kHeapObjectMapOffset = 0
static

Definition at line 5819 of file v8.h.

Referenced by GetInstanceType().

◆ kIsolateEmbedderDataOffset

const int v8::internal::Internals::kIsolateEmbedderDataOffset = 0 * kApiPointerSize
static

Definition at line 5835 of file v8.h.

Referenced by GetEmbedderData(), v8::internal::Isolate::Init(), and SetEmbedderData().

◆ kIsolateRootsOffset

const int v8::internal::Internals::kIsolateRootsOffset
static
Initial value:

Definition at line 5840 of file v8.h.

Referenced by GetRoot(), and v8::internal::Isolate::Init().

◆ kJSObjectHeaderSize

const int v8::internal::Internals::kJSObjectHeaderSize = 3 * kApiPointerSize
static

Definition at line 5826 of file v8.h.

◆ kJSObjectType

const int v8::internal::Internals::kJSObjectType = 0xbc
static

Definition at line 5862 of file v8.h.

◆ kMapInstanceTypeAndBitFieldOffset

const int v8::internal::Internals::kMapInstanceTypeAndBitFieldOffset
static
Initial value:
=
const int kApiIntSize
Definition: v8.h:5733

Definition at line 5820 of file v8.h.

Referenced by GetInstanceType().

◆ kNodeClassIdOffset

const int v8::internal::Internals::kNodeClassIdOffset = 1 * kApiPointerSize
static

Definition at line 5853 of file v8.h.

Referenced by v8::internal::GlobalHandles::Node::Node().

◆ kNodeFlagsOffset

const int v8::internal::Internals::kNodeFlagsOffset = 1 * kApiPointerSize + 3
static

◆ kNodeIsIndependentShift

const int v8::internal::Internals::kNodeIsIndependentShift = 4
static

Definition at line 5859 of file v8.h.

Referenced by v8::internal::GlobalHandles::Node::Node().

◆ kNodeIsPartiallyDependentShift

const int v8::internal::Internals::kNodeIsPartiallyDependentShift = 5
static

Definition at line 5860 of file v8.h.

Referenced by v8::internal::GlobalHandles::Node::Node().

◆ kNodeStateIsNearDeathValue

const int v8::internal::Internals::kNodeStateIsNearDeathValue = 4
static

Definition at line 5858 of file v8.h.

Referenced by v8::internal::GlobalHandles::Node::Node().

◆ kNodeStateIsPendingValue

const int v8::internal::Internals::kNodeStateIsPendingValue = 3
static

Definition at line 5857 of file v8.h.

Referenced by v8::internal::GlobalHandles::Node::Node().

◆ kNodeStateIsWeakValue

const int v8::internal::Internals::kNodeStateIsWeakValue = 2
static

Definition at line 5856 of file v8.h.

Referenced by v8::internal::GlobalHandles::Node::Node().

◆ kNodeStateMask

const int v8::internal::Internals::kNodeStateMask = 0xf
static

Definition at line 5855 of file v8.h.

Referenced by GetNodeState(), v8::internal::GlobalHandles::Node::Node(), and UpdateNodeState().

◆ kNullOddballKind

const int v8::internal::Internals::kNullOddballKind = 3
static

Definition at line 5868 of file v8.h.

◆ kNullValueRootIndex

const int v8::internal::Internals::kNullValueRootIndex = 7
static

Definition at line 5844 of file v8.h.

◆ kNumIsolateDataSlots

const uint32_t v8::internal::Internals::kNumIsolateDataSlots = 4
static

Definition at line 5870 of file v8.h.

Referenced by v8::internal::Isolate::GetData(), and v8::internal::Isolate::SetData().

◆ kOddballKindOffset

const int v8::internal::Internals::kOddballKindOffset = 3 * kApiPointerSize
static

Definition at line 5824 of file v8.h.

Referenced by GetOddballKind().

◆ kOddballType

const int v8::internal::Internals::kOddballType = 0x83
static

Definition at line 5864 of file v8.h.

◆ kStringEncodingMask

const int v8::internal::Internals::kStringEncodingMask = 0x4
static

Definition at line 5831 of file v8.h.

◆ kStringResourceOffset

const int v8::internal::Internals::kStringResourceOffset = 3 * kApiPointerSize
static

Definition at line 5822 of file v8.h.

◆ kTrueValueRootIndex

const int v8::internal::Internals::kTrueValueRootIndex = 8
static

Definition at line 5845 of file v8.h.

◆ kUndefinedOddballKind

const int v8::internal::Internals::kUndefinedOddballKind = 5
static

Definition at line 5867 of file v8.h.

◆ kUndefinedValueRootIndex

const int v8::internal::Internals::kUndefinedValueRootIndex = 5
static

Definition at line 5843 of file v8.h.


The documentation for this class was generated from the following file: