v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::Name Class Reference

#include <name.h>

Inheritance diagram for v8::internal::Name:
Collaboration diagram for v8::internal::Name:

Public Types

enum class  HashFieldType : uint32_t { kHash = 0b10 , kIntegerIndex = 0b00 , kForwardingIndex = 0b01 , kEmpty = 0b11 }
 
using HashFieldTypeBits = base::BitField<HashFieldType, 0, 2>
 
using HashBits
 
using IsInternalizedForwardingIndexBit = HashFieldTypeBits::Next<bool, 1>
 
using IsExternalForwardingIndexBit
 
using ForwardingIndexValueBits
 
using ArrayIndexValueBits
 
using ArrayIndexLengthBits
 

Public Member Functions

bool HasHashCode () const
 
bool HasForwardingIndex (AcquireLoadTag) const
 
bool HasInternalizedForwardingIndex (AcquireLoadTag) const
 
bool HasExternalForwardingIndex (AcquireLoadTag) const
 
uint32_t raw_hash_field () const
 
uint32_t raw_hash_field (AcquireLoadTag) const
 
void set_raw_hash_field (uint32_t hash)
 
void set_raw_hash_field (uint32_t hash, ReleaseStoreTag)
 
void set_raw_hash_field_if_empty (uint32_t hash)
 
uint32_t hash () const
 
bool TryGetHash (uint32_t *hash) const
 
bool Equals (Tagged< Name > other)
 
bool IsArrayIndex ()
 
bool AsArrayIndex (uint32_t *index)
 
bool AsIntegerIndex (size_t *index)
 
bool IsInteresting (Isolate *isolate)
 
bool IsPrivate ()
 
bool IsPrivateName ()
 
bool IsPrivateBrand ()
 
void NameShortPrint ()
 
int NameShortPrint (base::Vector< char > str)
 
uint32_t EnsureHash ()
 
uint32_t EnsureHash (const SharedStringAccessGuardIfNeeded &)
 
uint32_t EnsureRawHash ()
 
uint32_t EnsureRawHash (const SharedStringAccessGuardIfNeeded &)
 
uint32_t RawHash ()
 
- Public Member Functions inherited from v8::internal::HeapObjectLayout
 HeapObjectLayout ()=delete
 
Tagged< Mapmap () const
 
Tagged< Mapmap (AcquireLoadTag) const
 
MapWord map_word (RelaxedLoadTag) const
 
void set_map (Isolate *isolate, Tagged< Map > value)
 
template<typename IsolateT >
void set_map (IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
 
template<typename IsolateT >
void set_map_safe_transition (IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
 
void set_map_safe_transition_no_write_barrier (Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
 
template<typename IsolateT >
void set_map_after_allocation (IsolateT *isolate, Tagged< Map > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
void set_map_no_write_barrier (Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
 
void set_map_word_forwarded (Tagged< HeapObject > target_object, ReleaseStoreTag)
 
void set_map_word_forwarded (Tagged< HeapObject > target_object, RelaxedStoreTag)
 
Address ptr () const
 
Address address () const
 
ReadOnlyRoots EarlyGetReadOnlyRoots () const
 
int Size () const
 
V8_EXPORT_PRIVATE int SizeFromMap (Tagged< Map > map) const
 
WriteBarrierMode GetWriteBarrierMode (const DisallowGarbageCollection &promise)
 

Static Public Member Functions

static bool Equals (Isolate *isolate, DirectHandle< Name > one, DirectHandle< Name > two)
 
static bool ContainsCachedArrayIndex (uint32_t hash)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< StringToFunctionName (Isolate *isolate, DirectHandle< Name > name)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< StringToFunctionName (Isolate *isolate, DirectHandle< Name > name, DirectHandle< String > prefix)
 
static bool IsHashFieldComputed (uint32_t raw_hash_field)
 
static bool IsHash (uint32_t raw_hash_field)
 
static bool IsIntegerIndex (uint32_t raw_hash_field)
 
static bool IsForwardingIndex (uint32_t raw_hash_field)
 
static bool IsInternalizedForwardingIndex (uint32_t raw_hash_field)
 
static bool IsExternalForwardingIndex (uint32_t raw_hash_field)
 
static uint32_t CreateHashFieldValue (uint32_t hash, HashFieldType type)
 
static uint32_t CreateInternalizedForwardingIndex (uint32_t index)
 
static uint32_t CreateExternalForwardingIndex (uint32_t index)
 

Static Public Attributes

static constexpr int kHashNotComputedMask = 1
 
static constexpr int kEmptyHashField
 
static const int kMaxCachedArrayIndexLength = 7
 
static const uint32_t kMaxArrayIndex = kMaxUInt32 - 1
 
static const int kMaxArrayIndexSize = 10
 
static const int kMaxIntegerIndexSize
 
static const int kArrayIndexValueBits = 24
 
static const int kArrayIndexLengthBits
 
static const unsigned int kDoesNotContainCachedArrayIndexMask
 
static const unsigned int kDoesNotContainIntegerOrForwardingIndexMask = 0b10
 

Private Member Functions

uint32_t GetRawHashFromForwardingTable (uint32_t raw_hash) const
 

Private Attributes

std::atomic_uint32_t raw_hash_field_
 

Friends

class V8HeapExplorer
 
class CodeStubAssembler
 
class StringBuiltinsAssembler
 
class SandboxTesting
 
class maglev::MaglevGraphBuilder
 
class maglev::MaglevAssembler
 
class compiler::AccessBuilder
 
class compiler::WasmGraphBuilder
 
class TorqueGeneratedNameAsserts
 

Detailed Description

Definition at line 35 of file name.h.

Member Typedef Documentation

◆ ArrayIndexLengthBits

Initial value:

Definition at line 178 of file name.h.

◆ ArrayIndexValueBits

◆ ForwardingIndexValueBits

◆ HashBits

Initial value:

Definition at line 128 of file name.h.

◆ HashFieldTypeBits

Definition at line 127 of file name.h.

◆ IsExternalForwardingIndexBit

◆ IsInternalizedForwardingIndexBit

Member Enumeration Documentation

◆ HashFieldType

enum class v8::internal::Name::HashFieldType : uint32_t
strong
Enumerator
kHash 
kIntegerIndex 
kForwardingIndex 
kEmpty 

Definition at line 120 of file name.h.

Member Function Documentation

◆ AsArrayIndex()

bool v8::internal::Name::AsArrayIndex ( uint32_t * index)
inline

Definition at line 281 of file name-inl.h.

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

◆ AsIntegerIndex()

bool v8::internal::Name::AsIntegerIndex ( size_t * index)
inline

Definition at line 285 of file name-inl.h.

Here is the call graph for this function:

◆ ContainsCachedArrayIndex()

bool v8::internal::Name::ContainsCachedArrayIndex ( uint32_t hash)
inlinestatic

Definition at line 290 of file name-inl.h.

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

◆ CreateExternalForwardingIndex()

uint32_t v8::internal::Name::CreateExternalForwardingIndex ( uint32_t index)
inlinestatic

Definition at line 146 of file name-inl.h.

Here is the call graph for this function:

◆ CreateHashFieldValue()

uint32_t v8::internal::Name::CreateHashFieldValue ( uint32_t hash,
HashFieldType type )
inlinestatic

Definition at line 132 of file name-inl.h.

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

◆ CreateInternalizedForwardingIndex()

uint32_t v8::internal::Name::CreateInternalizedForwardingIndex ( uint32_t index)
inlinestatic

Definition at line 138 of file name-inl.h.

Here is the call graph for this function:

◆ EnsureHash() [1/2]

uint32_t v8::internal::Name::EnsureHash ( )
inline

Definition at line 208 of file name-inl.h.

Here is the call graph for this function:

◆ EnsureHash() [2/2]

uint32_t v8::internal::Name::EnsureHash ( const SharedStringAccessGuardIfNeeded & access_guard)
inline

Definition at line 210 of file name-inl.h.

Here is the call graph for this function:

◆ EnsureRawHash() [1/2]

uint32_t v8::internal::Name::EnsureRawHash ( )
inline

Definition at line 175 of file name-inl.h.

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

◆ EnsureRawHash() [2/2]

uint32_t v8::internal::Name::EnsureRawHash ( const SharedStringAccessGuardIfNeeded & access_guard)
inline

Definition at line 187 of file name-inl.h.

Here is the call graph for this function:

◆ Equals() [1/2]

bool v8::internal::Name::Equals ( Isolate * isolate,
DirectHandle< Name > one,
DirectHandle< Name > two )
inlinestatic

Definition at line 85 of file name-inl.h.

Here is the call graph for this function:

◆ Equals() [2/2]

bool v8::internal::Name::Equals ( Tagged< Name > other)
inline

Definition at line 76 of file name-inl.h.

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

◆ GetRawHashFromForwardingTable()

uint32_t v8::internal::Name::GetRawHashFromForwardingTable ( uint32_t raw_hash) const
inlineprivate

Definition at line 167 of file name-inl.h.

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

◆ HasExternalForwardingIndex()

bool v8::internal::Name::HasExternalForwardingIndex ( AcquireLoadTag ) const
inline

Definition at line 163 of file name-inl.h.

Here is the call graph for this function:

◆ HasForwardingIndex()

bool v8::internal::Name::HasForwardingIndex ( AcquireLoadTag ) const
inline

Definition at line 157 of file name-inl.h.

Here is the call graph for this function:

◆ hash()

uint32_t v8::internal::Name::hash ( ) const
inline

Definition at line 228 of file name-inl.h.

Here is the call graph for this function:

◆ HasHashCode()

bool v8::internal::Name::HasHashCode ( ) const
inline

Definition at line 153 of file name-inl.h.

Here is the call graph for this function:

◆ HasInternalizedForwardingIndex()

bool v8::internal::Name::HasInternalizedForwardingIndex ( AcquireLoadTag ) const
inline

Definition at line 160 of file name-inl.h.

Here is the call graph for this function:

◆ IsArrayIndex()

bool v8::internal::Name::IsArrayIndex ( )
inline

Definition at line 276 of file name-inl.h.

Here is the call graph for this function:

◆ IsExternalForwardingIndex()

bool v8::internal::Name::IsExternalForwardingIndex ( uint32_t raw_hash_field)
inlinestatic

Definition at line 125 of file name-inl.h.

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

◆ IsForwardingIndex()

bool v8::internal::Name::IsForwardingIndex ( uint32_t raw_hash_field)
inlinestatic

Definition at line 112 of file name-inl.h.

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

◆ IsHash()

bool v8::internal::Name::IsHash ( uint32_t raw_hash_field)
inlinestatic

Definition at line 101 of file name-inl.h.

Here is the call graph for this function:

◆ IsHashFieldComputed()

bool v8::internal::Name::IsHashFieldComputed ( uint32_t raw_hash_field)
inlinestatic

Definition at line 96 of file name-inl.h.

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

◆ IsIntegerIndex()

bool v8::internal::Name::IsIntegerIndex ( uint32_t raw_hash_field)
inlinestatic

Definition at line 106 of file name-inl.h.

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

◆ IsInteresting()

bool v8::internal::Name::IsInteresting ( Isolate * isolate)
inline

Definition at line 250 of file name-inl.h.

Here is the call graph for this function:

◆ IsInternalizedForwardingIndex()

bool v8::internal::Name::IsInternalizedForwardingIndex ( uint32_t raw_hash_field)
inlinestatic

Definition at line 118 of file name-inl.h.

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

◆ IsPrivate()

bool v8::internal::Name::IsPrivate ( )
inline

Definition at line 258 of file name-inl.h.

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

◆ IsPrivateBrand()

bool v8::internal::Name::IsPrivateBrand ( )
inline

Definition at line 269 of file name-inl.h.

Here is the call graph for this function:

◆ IsPrivateName()

bool v8::internal::Name::IsPrivateName ( )
inline

Definition at line 262 of file name-inl.h.

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

◆ NameShortPrint() [1/2]

void v8::internal::Name::NameShortPrint ( )

Definition at line 3830 of file objects-printer.cc.

Here is the call graph for this function:

◆ NameShortPrint() [2/2]

int v8::internal::Name::NameShortPrint ( base::Vector< char > str)

Definition at line 3845 of file objects-printer.cc.

Here is the call graph for this function:

◆ raw_hash_field() [1/2]

uint32_t v8::internal::Name::raw_hash_field ( ) const
inline

Definition at line 47 of file name.h.

Here is the caller graph for this function:

◆ raw_hash_field() [2/2]

uint32_t v8::internal::Name::raw_hash_field ( AcquireLoadTag ) const
inline

Definition at line 51 of file name.h.

◆ RawHash()

uint32_t v8::internal::Name::RawHash ( )
inline

Definition at line 200 of file name-inl.h.

Here is the call graph for this function:

◆ set_raw_hash_field() [1/2]

void v8::internal::Name::set_raw_hash_field ( uint32_t hash)
inline

Definition at line 55 of file name.h.

◆ set_raw_hash_field() [2/2]

void v8::internal::Name::set_raw_hash_field ( uint32_t hash,
ReleaseStoreTag  )
inline

Definition at line 59 of file name.h.

◆ set_raw_hash_field_if_empty()

void v8::internal::Name::set_raw_hash_field_if_empty ( uint32_t hash)
inline

Definition at line 214 of file name-inl.h.

Here is the call graph for this function:

◆ ToFunctionName() [1/2]

MaybeDirectHandle< String > v8::internal::Name::ToFunctionName ( Isolate * isolate,
DirectHandle< Name > name )
static

Definition at line 4049 of file objects.cc.

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

◆ ToFunctionName() [2/2]

MaybeDirectHandle< String > v8::internal::Name::ToFunctionName ( Isolate * isolate,
DirectHandle< Name > name,
DirectHandle< String > prefix )
static

Definition at line 4065 of file objects.cc.

Here is the call graph for this function:

◆ TryGetHash()

bool v8::internal::Name::TryGetHash ( uint32_t * hash) const
inline

Definition at line 237 of file name-inl.h.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CodeStubAssembler

friend class CodeStubAssembler
friend

Definition at line 230 of file name.h.

◆ compiler::AccessBuilder

friend class compiler::AccessBuilder
friend

Definition at line 235 of file name.h.

◆ compiler::WasmGraphBuilder

friend class compiler::WasmGraphBuilder
friend

Definition at line 236 of file name.h.

◆ maglev::MaglevAssembler

friend class maglev::MaglevAssembler
friend

Definition at line 234 of file name.h.

◆ maglev::MaglevGraphBuilder

friend class maglev::MaglevGraphBuilder
friend

Definition at line 233 of file name.h.

◆ SandboxTesting

friend class SandboxTesting
friend

Definition at line 232 of file name.h.

◆ StringBuiltinsAssembler

friend class StringBuiltinsAssembler
friend

Definition at line 231 of file name.h.

◆ TorqueGeneratedNameAsserts

friend class TorqueGeneratedNameAsserts
friend

Definition at line 237 of file name.h.

◆ V8HeapExplorer

friend class V8HeapExplorer
friend

Definition at line 229 of file name.h.

Member Data Documentation

◆ kArrayIndexLengthBits

const int v8::internal::Name::kArrayIndexLengthBits
static
Initial value:

Definition at line 170 of file name.h.

◆ kArrayIndexValueBits

const int v8::internal::Name::kArrayIndexValueBits = 24
static

Definition at line 169 of file name.h.

◆ kDoesNotContainCachedArrayIndexMask

const unsigned int v8::internal::Name::kDoesNotContainCachedArrayIndexMask
static
Initial value:
=
(~static_cast<unsigned>(kMaxCachedArrayIndexLength)
static constexpr U kMask
Definition bit-field.h:41
static constexpr int kShift
Definition bit-field.h:39
static const int kMaxCachedArrayIndexLength
Definition name.h:150

Definition at line 190 of file name.h.

◆ kDoesNotContainIntegerOrForwardingIndexMask

const unsigned int v8::internal::Name::kDoesNotContainIntegerOrForwardingIndexMask = 0b10
static

Definition at line 197 of file name.h.

◆ kEmptyHashField

int v8::internal::Name::kEmptyHashField
staticconstexpr
Initial value:

Definition at line 133 of file name.h.

◆ kHashNotComputedMask

int v8::internal::Name::kHashNotComputedMask = 1
staticconstexpr

Definition at line 131 of file name.h.

◆ kMaxArrayIndex

const uint32_t v8::internal::Name::kMaxArrayIndex = kMaxUInt32 - 1
static

Definition at line 152 of file name.h.

◆ kMaxArrayIndexSize

const int v8::internal::Name::kMaxArrayIndexSize = 10
static

Definition at line 155 of file name.h.

◆ kMaxCachedArrayIndexLength

const int v8::internal::Name::kMaxCachedArrayIndexLength = 7
static

Definition at line 150 of file name.h.

◆ kMaxIntegerIndexSize

const int v8::internal::Name::kMaxIntegerIndexSize
static
Initial value:
=
std::min(16, int{10 * (sizeof(size_t) / 4)})

Definition at line 163 of file name.h.

◆ raw_hash_field_

std::atomic_uint32_t v8::internal::Name::raw_hash_field_
private

Definition at line 241 of file name.h.


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