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

#include <string.h>

Inheritance diagram for v8::internal::String:
Collaboration diagram for v8::internal::String:

Classes

class  FlatContent
 
class  Match
 

Public Types

enum  Encoding { ONE_BYTE_ENCODING , TWO_BYTE_ENCODING }
 
enum class  EqualityType { kWholeString , kPrefix , kNoLengthCheck }
 
enum  TrimMode { kTrim , kTrimStart , kTrimEnd }
 
enum class  Utf8EncodingFlag { kNoFlags = 0 , kNullTerminate = 1u << 0 , kReplaceInvalid = 1u << 1 }
 
using Utf8EncodingFlags = base::Flags<Utf8EncodingFlag>
 
using LineEndsVector = base::SmallVector<int32_t, kInlineLineEndsSize>
 
- Public Types inherited from v8::internal::Name
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

template<typename IsolateT >
void MakeThin (IsolateT *isolate, Tagged< String > canonical)
 
template<typename Char >
V8_INLINE base::Vector< const Char > GetCharVector (const DisallowGarbageCollection &no_gc)
 
template<typename Char >
const Char * GetDirectStringChars (const DisallowGarbageCollection &no_gc) const
 
template<typename Char >
const Char * GetDirectStringChars (const DisallowGarbageCollection &no_gc, const SharedStringAccessGuardIfNeeded &access_guard) const
 
const uint8_t * AddressOfCharacterAt (uint32_t start_index, const DisallowGarbageCollection &no_gc)
 
uint32_t length () const
 
uint32_t length (AcquireLoadTag) const
 
void set_length (uint32_t hash)
 
void set_length (uint32_t hash, ReleaseStoreTag)
 
bool IsOneByteRepresentation () const
 
bool IsTwoByteRepresentation () const
 
void Set (uint32_t index, uint16_t value)
 
V8_INLINE uint16_t Get (uint32_t index) const
 
V8_INLINE uint16_t Get (uint32_t index, Isolate *isolate) const
 
V8_INLINE uint16_t Get (uint32_t index, LocalIsolate *local_isolate) const
 
V8_INLINE uint16_t Get (uint32_t index, const SharedStringAccessGuardIfNeeded &access_guard) const
 
V8_EXPORT_PRIVATE V8_INLINE FlatContent GetFlatContent (const DisallowGarbageCollection &no_gc)
 
V8_EXPORT_PRIVATE V8_INLINE FlatContent GetFlatContent (const DisallowGarbageCollection &no_gc, const SharedStringAccessGuardIfNeeded &)
 
Tagged< StringGetUnderlying () const
 
bool Equals (Tagged< String > other) const
 
template<EqualityType kEqType = EqualityType::kWholeString, typename Char >
bool IsEqualTo (base::Vector< const Char > str, Isolate *isolate) const
 
template<EqualityType kEqType = EqualityType::kWholeString, typename Char >
bool IsEqualTo (base::Vector< const Char > str) const
 
template<EqualityType kEqType = EqualityType::kWholeString, typename Char >
bool IsEqualTo (base::Vector< const Char > str, LocalIsolate *isolate) const
 
V8_EXPORT_PRIVATE bool HasOneBytePrefix (base::Vector< const char > str)
 
V8_EXPORT_PRIVATE bool IsOneByteEqualTo (base::Vector< const char > str)
 
std::unique_ptr< char[]> ToCString (uint32_t offset, uint32_t length, size_t *length_output=nullptr)
 
V8_EXPORT_PRIVATE std::unique_ptr< char[]> ToCString (size_t *length_output=nullptr)
 
template<typename T >
bool MarkForExternalizationDuringGC (Isolate *isolate, T *resource)
 
template<typename T >
void MakeExternalDuringGC (Isolate *isolate, T *resource)
 
V8_EXPORT_PRIVATE bool MakeExternal (Isolate *isolate, v8::String::ExternalStringResource *resource)
 
V8_EXPORT_PRIVATE bool MakeExternal (Isolate *isolate, v8::String::ExternalOneByteStringResource *resource)
 
bool SupportsExternalization (v8::String::Encoding)
 
bool AsArrayIndex (uint32_t *index)
 
bool AsIntegerIndex (size_t *index)
 
V8_EXPORT_PRIVATE void PrintOn (FILE *out)
 
V8_EXPORT_PRIVATE void PrintOn (std::ostream &out)
 
const char * PrefixForDebugPrint () const
 
const char * SuffixForDebugPrint () const
 
void StringShortPrint (StringStream *accumulator)
 
void PrintUC16 (std::ostream &os, int start=0, int end=-1)
 
void PrintUC16 (StringStream *accumulator, int start, int end)
 
bool IsFlat () const
 
bool IsShared () const
 
template<typename TDispatcher >
V8_INLINE auto DispatchToSpecificType (TDispatcher &&dispatcher) const -> std::common_type_t< decltype(dispatcher(Tagged< SeqOneByteString >{})), decltype(dispatcher(Tagged< SeqTwoByteString >{})), decltype(dispatcher(Tagged< ExternalOneByteString >{})), decltype(dispatcher(Tagged< ExternalTwoByteString >{})), decltype(dispatcher(Tagged< ThinString >{})), decltype(dispatcher(Tagged< ConsString >{})), decltype(dispatcher(Tagged< SlicedString >{}))>
 
template<String::EqualityType kEqType, typename Char >
bool IsEqualToImpl (base::Vector< const Char > str, const SharedStringAccessGuardIfNeeded &access_guard) const
 
template<typename Char >
bool IsConsStringEqualToImpl (Tagged< ConsString > string, base::Vector< const Char > str, const SharedStringAccessGuardIfNeeded &access_guard)
 
template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
HandleType< StringFlatten (Isolate *isolate, HandleType< T > string, AllocationType allocation)
 
template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
HandleType< StringFlatten (LocalIsolate *isolate, HandleType< T > string, AllocationType allocation)
 
template<>
base::Vector< const uint8_t > GetCharVector (const DisallowGarbageCollection &no_gc)
 
template<>
base::Vector< const base::uc16GetCharVector (const DisallowGarbageCollection &no_gc)
 
- Public Member Functions inherited from v8::internal::Name
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 IsOneByteRepresentationUnderneath (Tagged< String > string)
 
template<template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
static HandleType< NumberToNumber (Isolate *isolate, HandleType< String > subject)
 
template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
static V8_INLINE HandleType< StringFlatten (Isolate *isolate, HandleType< T > string, AllocationType allocation=AllocationType::kYoung)
 
template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
static V8_INLINE HandleType< StringFlatten (LocalIsolate *isolate, HandleType< T > string, AllocationType allocation=AllocationType::kYoung)
 
template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
static HandleType< StringShare (Isolate *isolate, HandleType< T > string)
 
static V8_WARN_UNUSED_RESULT ComparisonResult Compare (Isolate *isolate, DirectHandle< String > x, DirectHandle< String > y)
 
static Tagged< ObjectIndexOf (Isolate *isolate, DirectHandle< Object > receiver, DirectHandle< Object > search, DirectHandle< Object > position)
 
static int IndexOf (Isolate *isolate, DirectHandle< String > receiver, DirectHandle< String > search, uint32_t start_index)
 
static Tagged< ObjectLastIndexOf (Isolate *isolate, DirectHandle< Object > receiver, DirectHandle< Object > search, DirectHandle< Object > position)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< StringGetSubstitution (Isolate *isolate, Match *match, DirectHandle< String > replacement, uint32_t start_index=0)
 
static bool Equals (Isolate *isolate, DirectHandle< String > one, DirectHandle< String > two)
 
static bool IsIdentifier (Isolate *isolate, DirectHandle< String > str)
 
static int32_t ToArrayIndex (Address addr)
 
template<typename SinkCharT >
static void WriteToFlat (Tagged< String > source, SinkCharT *sink, uint32_t start, uint32_t length)
 
template<typename SinkCharT >
static void WriteToFlat (Tagged< String > source, SinkCharT *sink, uint32_t start, uint32_t length, const SharedStringAccessGuardIfNeeded &access_guard)
 
template<typename SinkCharT >
static void WriteToFlat2 (SinkCharT *dst, Tagged< ConsString > src, uint32_t src_index, uint32_t length, const SharedStringAccessGuardIfNeeded &aguard, const DisallowGarbageCollection &no_gc)
 
static size_t Utf8Length (Isolate *isolate, DirectHandle< String > string)
 
static size_t WriteUtf8 (Isolate *isolate, DirectHandle< String > string, char *buffer, size_t capacity, Utf8EncodingFlags flags, size_t *processed_characters_return=nullptr)
 
static bool IsWellFormedUnicode (Isolate *isolate, DirectHandle< String > string)
 
static bool IsAscii (const char *chars, uint32_t length)
 
static bool IsAscii (const uint8_t *chars, uint32_t length)
 
static uint32_t NonOneByteStart (const base::uc16 *chars, uint32_t length)
 
static bool IsOneByte (const base::uc16 *chars, uint32_t length)
 
template<class Visitor >
static Tagged< ConsStringVisitFlat (Visitor *visitor, Tagged< String > string, int offset=0)
 
template<class Visitor >
static Tagged< ConsStringVisitFlat (Visitor *visitor, Tagged< String > string, int offset, const SharedStringAccessGuardIfNeeded &access_guard)
 
template<typename IsolateT >
static LineEndsVector CalculateLineEndsVector (IsolateT *isolate, DirectHandle< String > string, bool include_ending_line)
 
template<typename IsolateT >
static Handle< FixedArrayCalculateLineEnds (IsolateT *isolate, DirectHandle< String > string, bool include_ending_line)
 
static bool IsInPlaceInternalizable (Tagged< String > string)
 
static bool IsInPlaceInternalizable (InstanceType instance_type)
 
static bool IsInPlaceInternalizableExcludingExternal (InstanceType instance_type)
 
template<typename TDispatcher , typename... TArgs>
static auto DispatchToSpecificTypeWithoutCast (InstanceType instance_type, TArgs &&... args)
 
- Static Public Member Functions inherited from v8::internal::Name
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)
 

Public Attributes

V8_OBJECT_INNER_CLASS class v8::internal::String::FlatContent V8_OBJECT_INNER_CLASS_END
 

Static Public Attributes

static const int32_t kMaxOneByteCharCode = unibrow::Latin1::kMaxChar
 
static const uint32_t kMaxOneByteCharCodeU = unibrow::Latin1::kMaxChar
 
static const int kMaxUtf16CodeUnit = 0xffff
 
static const uint32_t kMaxUtf16CodeUnitU = kMaxUtf16CodeUnit
 
static const base::uc32 kMaxCodePoint = 0x10ffff
 
static const uint32_t kMaxLength = v8::String::kMaxLength
 
static const uint32_t kMaxHashCalcLength = 16383
 
static const uint32_t kMaxShortPrintLength = 1024
 
static uint32_t constexpr kInlineLineEndsSize = 32
 
- Static Public Attributes inherited from v8::internal::Name
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

V8_INLINE uint16_t GetImpl (uint32_t index, const SharedStringAccessGuardIfNeeded &access_guard) const
 
template<EqualityType kEqType, typename Char >
V8_INLINE bool IsEqualToImpl (base::Vector< const Char > str, const SharedStringAccessGuardIfNeeded &access_guard) const
 
V8_EXPORT_PRIVATE FlatContent SlowGetFlatContent (const DisallowGarbageCollection &no_gc, const SharedStringAccessGuardIfNeeded &)
 
template<template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
 EXPORT_TEMPLATE_DECLARE (V8_EXPORT_PRIVATE) static HandleType< String > SlowShare(Isolate *isolate
 
V8_EXPORT_PRIVATE bool SlowEquals (Tagged< String > other) const
 
V8_EXPORT_PRIVATE bool SlowEquals (Tagged< String > other, const SharedStringAccessGuardIfNeeded &) const
 
V8_EXPORT_PRIVATE bool SlowAsArrayIndex (uint32_t *index)
 
V8_EXPORT_PRIVATE bool SlowAsIntegerIndex (size_t *index)
 
V8_EXPORT_PRIVATE uint32_t ComputeAndSetRawHash ()
 
V8_EXPORT_PRIVATE uint32_t ComputeAndSetRawHash (const SharedStringAccessGuardIfNeeded &)
 

Static Private Member Functions

template<typename Char >
static V8_NOINLINE bool IsConsStringEqualToImpl (Tagged< ConsString > string, base::Vector< const Char > str, const SharedStringAccessGuardIfNeeded &access_guard)
 
template<template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
static V8_EXPORT_PRIVATE HandleType< StringSlowFlatten (Isolate *isolate, HandleType< ConsString > cons, AllocationType allocation)
 
V8_EXPORT_PRIVATE static V8_INLINE std::optional< FlatContentTryGetFlatContentFromDirectString (const DisallowGarbageCollection &no_gc, Tagged< String > string, uint32_t offset, uint32_t length, const SharedStringAccessGuardIfNeeded &)
 
static V8_EXPORT_PRIVATE bool SlowEquals (Isolate *isolate, DirectHandle< String > one, DirectHandle< String > two)
 

Private Attributes

HandleType< Stringsource
 
uint32_t length_
 

Friends

class Name
 
class CodeStubAssembler
 
class StringTableInsertionKey
 
class SharedStringTableInsertionKey
 
class SandboxTesting
 
class InternalizedStringKey
 
struct OffsetsForDebug
 
class Accessors
 
class StringBuiltinsAssembler
 
class maglev::MaglevAssembler
 
class maglev::MaglevGraphBuilder
 
class compiler::AccessBuilder
 
class wasm::baseline::LiftoffCompiler
 
class TorqueGeneratedStringAsserts
 

Detailed Description

Definition at line 113 of file string.h.

Member Typedef Documentation

◆ LineEndsVector

◆ Utf8EncodingFlags

Member Enumeration Documentation

◆ Encoding

Enumerator
ONE_BYTE_ENCODING 
TWO_BYTE_ENCODING 

Definition at line 115 of file string.h.

◆ EqualityType

Enumerator
kWholeString 
kPrefix 
kNoLengthCheck 

Definition at line 392 of file string.h.

◆ TrimMode

Enumerator
kTrim 
kTrimStart 
kTrimEnd 

Definition at line 471 of file string.h.

◆ Utf8EncodingFlag

Enumerator
kNoFlags 
kNullTerminate 
kReplaceInvalid 

Definition at line 560 of file string.h.

Member Function Documentation

◆ AddressOfCharacterAt()

const uint8_t * v8::internal::String::AddressOfCharacterAt ( uint32_t start_index,
const DisallowGarbageCollection & no_gc )

Definition at line 2206 of file string.cc.

Here is the call graph for this function:

◆ AsArrayIndex()

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

Definition at line 1594 of file string-inl.h.

Here is the call graph for this function:

◆ AsIntegerIndex()

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

Definition at line 1607 of file string-inl.h.

Here is the call graph for this function:

◆ CalculateLineEnds()

template<typename IsolateT >
template Handle< FixedArray > v8::internal::String::CalculateLineEnds ( IsolateT * isolate,
DirectHandle< String > string,
bool include_ending_line )
static

Definition at line 1194 of file string.cc.

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

◆ CalculateLineEndsVector()

template<typename IsolateT >
template String::LineEndsVector v8::internal::String::CalculateLineEndsVector ( IsolateT * isolate,
DirectHandle< String > string,
bool include_ending_line )
static

Definition at line 1164 of file string.cc.

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

◆ Compare()

ComparisonResult v8::internal::String::Compare ( Isolate * isolate,
DirectHandle< String > x,
DirectHandle< String > y )
static

Definition at line 1353 of file string.cc.

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

◆ ComputeAndSetRawHash() [1/2]

uint32_t v8::internal::String::ComputeAndSetRawHash ( )
private

Definition at line 1827 of file string.cc.

◆ ComputeAndSetRawHash() [2/2]

uint32_t v8::internal::String::ComputeAndSetRawHash ( const SharedStringAccessGuardIfNeeded & access_guard)
private

Definition at line 1832 of file string.cc.

Here is the call graph for this function:

◆ DispatchToSpecificType()

template<typename TDispatcher >
V8_INLINE auto v8::internal::String::DispatchToSpecificType ( TDispatcher && dispatcher) const -> std::common_type_t< decltype(dispatcher(Tagged<SeqOneByteString>{})), decltype(dispatcher(Tagged<SeqTwoByteString>{})), decltype(dispatcher(Tagged<ExternalOneByteString>{})), decltype(dispatcher(Tagged<ExternalTwoByteString>{})), decltype(dispatcher(Tagged<ThinString>{})), decltype(dispatcher(Tagged<ConsString>{})), decltype(dispatcher(Tagged<SlicedString>{}))>

Definition at line 295 of file string-inl.h.

Here is the caller graph for this function:

◆ DispatchToSpecificTypeWithoutCast()

template<typename TDispatcher , typename... TArgs>
auto v8::internal::String::DispatchToSpecificTypeWithoutCast ( InstanceType instance_type,
TArgs &&... args )
inlinestatic

Definition at line 257 of file string-inl.h.

◆ Equals() [1/2]

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

Definition at line 544 of file string-inl.h.

Here is the call graph for this function:

◆ Equals() [2/2]

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

Definition at line 535 of file string-inl.h.

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

◆ EXPORT_TEMPLATE_DECLARE()

template<template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
v8::internal::String::EXPORT_TEMPLATE_DECLARE ( V8_EXPORT_PRIVATE )
private

◆ Flatten() [1/4]

template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
HandleType< String > v8::internal::String::Flatten ( Isolate * isolate,
HandleType< T > string,
AllocationType allocation )

Definition at line 809 of file string-inl.h.

Here is the call graph for this function:

◆ Flatten() [2/4]

template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
static V8_INLINE HandleType< String > v8::internal::String::Flatten ( Isolate * isolate,
HandleType< T > string,
AllocationType allocation = AllocationType::kYoung )
static

◆ Flatten() [3/4]

template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
HandleType< String > v8::internal::String::Flatten ( LocalIsolate * isolate,
HandleType< T > string,
AllocationType allocation )

Definition at line 847 of file string-inl.h.

◆ Flatten() [4/4]

template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
static V8_INLINE HandleType< String > v8::internal::String::Flatten ( LocalIsolate * isolate,
HandleType< T > string,
AllocationType allocation = AllocationType::kYoung )
static

◆ Get() [1/4]

uint16_t v8::internal::String::Get ( uint32_t index) const

Definition at line 964 of file string-inl.h.

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

◆ Get() [2/4]

uint16_t v8::internal::String::Get ( uint32_t index,
const SharedStringAccessGuardIfNeeded & access_guard ) const

Definition at line 979 of file string-inl.h.

Here is the call graph for this function:

◆ Get() [3/4]

uint16_t v8::internal::String::Get ( uint32_t index,
Isolate * isolate ) const

Definition at line 969 of file string-inl.h.

Here is the call graph for this function:

◆ Get() [4/4]

uint16_t v8::internal::String::Get ( uint32_t index,
LocalIsolate * local_isolate ) const

Definition at line 974 of file string-inl.h.

Here is the call graph for this function:

◆ GetCharVector() [1/3]

template<>
base::Vector< const uint8_t > v8::internal::String::GetCharVector ( const DisallowGarbageCollection & no_gc)
inline

Definition at line 1133 of file string-inl.h.

Here is the call graph for this function:

◆ GetCharVector() [2/3]

template<>
base::Vector< const base::uc16 > v8::internal::String::GetCharVector ( const DisallowGarbageCollection & no_gc)
inline

Definition at line 1141 of file string-inl.h.

Here is the call graph for this function:

◆ GetCharVector() [3/3]

template<typename Char >
V8_INLINE base::Vector< const Char > v8::internal::String::GetCharVector ( const DisallowGarbageCollection & no_gc)

◆ GetDirectStringChars() [1/2]

template<typename Char >
const Char * v8::internal::String::GetDirectStringChars ( const DisallowGarbageCollection & no_gc) const
inline

Definition at line 686 of file string-inl.h.

Here is the call graph for this function:

◆ GetDirectStringChars() [2/2]

template<typename Char >
const Char * v8::internal::String::GetDirectStringChars ( const DisallowGarbageCollection & no_gc,
const SharedStringAccessGuardIfNeeded & access_guard ) const
inline

Definition at line 696 of file string-inl.h.

Here is the call graph for this function:

◆ GetFlatContent() [1/2]

String::FlatContent v8::internal::String::GetFlatContent ( const DisallowGarbageCollection & no_gc)

Definition at line 885 of file string-inl.h.

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

◆ GetFlatContent() [2/2]

String::FlatContent v8::internal::String::GetFlatContent ( const DisallowGarbageCollection & no_gc,
const SharedStringAccessGuardIfNeeded & access_guard )

Definition at line 935 of file string-inl.h.

Here is the call graph for this function:

◆ GetImpl()

uint16_t v8::internal::String::GetImpl ( uint32_t index,
const SharedStringAccessGuardIfNeeded & access_guard ) const
private

Definition at line 984 of file string-inl.h.

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

◆ GetSubstitution()

MaybeDirectHandle< String > v8::internal::String::GetSubstitution ( Isolate * isolate,
Match * match,
DirectHandle< String > replacement,
uint32_t start_index = 0 )
static

Definition at line 1495 of file string.cc.

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

◆ GetUnderlying()

Tagged< String > v8::internal::String::GetUnderlying ( ) const
inline

Definition at line 1012 of file string-inl.h.

Here is the call graph for this function:

◆ HasOneBytePrefix()

bool v8::internal::String::HasOneBytePrefix ( base::Vector< const char > str)

Definition at line 1762 of file string.cc.

◆ IndexOf() [1/2]

Tagged< Object > v8::internal::String::IndexOf ( Isolate * isolate,
DirectHandle< Object > receiver,
DirectHandle< Object > search,
DirectHandle< Object > position )
static

Definition at line 1426 of file string.cc.

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

◆ IndexOf() [2/2]

int v8::internal::String::IndexOf ( Isolate * isolate,
DirectHandle< String > receiver,
DirectHandle< String > search,
uint32_t start_index )
static

Definition at line 1466 of file string.cc.

Here is the call graph for this function:

◆ IsAscii() [1/2]

static bool v8::internal::String::IsAscii ( const char * chars,
uint32_t length )
inlinestatic

Definition at line 575 of file string.h.

Here is the caller graph for this function:

◆ IsAscii() [2/2]

static bool v8::internal::String::IsAscii ( const uint8_t * chars,
uint32_t length )
inlinestatic

Definition at line 579 of file string.h.

◆ IsConsStringEqualToImpl() [1/2]

template<typename Char >
bool v8::internal::String::IsConsStringEqualToImpl ( Tagged< ConsString > string,
base::Vector< const Char > str,
const SharedStringAccessGuardIfNeeded & access_guard )

Definition at line 650 of file string-inl.h.

Here is the call graph for this function:

◆ IsConsStringEqualToImpl() [2/2]

template<typename Char >
static V8_NOINLINE bool v8::internal::String::IsConsStringEqualToImpl ( Tagged< ConsString > string,
base::Vector< const Char > str,
const SharedStringAccessGuardIfNeeded & access_guard )
staticprivate
Here is the caller graph for this function:

◆ IsEqualTo() [1/3]

template<String::EqualityType kEqType, typename Char >
bool v8::internal::String::IsEqualTo ( base::Vector< const Char > str) const
inline

Definition at line 561 of file string-inl.h.

Here is the call graph for this function:

◆ IsEqualTo() [2/3]

template<String::EqualityType kEqType, typename Char >
bool v8::internal::String::IsEqualTo ( base::Vector< const Char > str,
Isolate * isolate ) const
inline

Definition at line 554 of file string-inl.h.

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

◆ IsEqualTo() [3/3]

template<String::EqualityType kEqType, typename Char >
bool v8::internal::String::IsEqualTo ( base::Vector< const Char > str,
LocalIsolate * isolate ) const
inline

Definition at line 568 of file string-inl.h.

Here is the call graph for this function:

◆ IsEqualToImpl() [1/2]

template<String::EqualityType kEqType, typename Char >
bool v8::internal::String::IsEqualToImpl ( base::Vector< const Char > str,
const SharedStringAccessGuardIfNeeded & access_guard ) const

Definition at line 575 of file string-inl.h.

Here is the call graph for this function:

◆ IsEqualToImpl() [2/2]

template<EqualityType kEqType, typename Char >
V8_INLINE bool v8::internal::String::IsEqualToImpl ( base::Vector< const Char > str,
const SharedStringAccessGuardIfNeeded & access_guard ) const
private
Here is the caller graph for this function:

◆ IsFlat()

bool v8::internal::String::IsFlat ( ) const
inline

Definition at line 1001 of file string-inl.h.

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

◆ IsIdentifier()

bool v8::internal::String::IsIdentifier ( Isolate * isolate,
DirectHandle< String > str )
static

Definition at line 1789 of file string.cc.

Here is the call graph for this function:

◆ IsInPlaceInternalizable() [1/2]

bool v8::internal::String::IsInPlaceInternalizable ( InstanceType instance_type)
inlinestatic

Definition at line 1690 of file string-inl.h.

◆ IsInPlaceInternalizable() [2/2]

bool v8::internal::String::IsInPlaceInternalizable ( Tagged< String > string)
inlinestatic

Definition at line 1685 of file string-inl.h.

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

◆ IsInPlaceInternalizableExcludingExternal()

bool v8::internal::String::IsInPlaceInternalizableExcludingExternal ( InstanceType instance_type)
inlinestatic

Definition at line 1707 of file string-inl.h.

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

◆ IsOneByte()

static bool v8::internal::String::IsOneByte ( const base::uc16 * chars,
uint32_t length )
inlinestatic

Definition at line 625 of file string.h.

Here is the call graph for this function:

◆ IsOneByteEqualTo()

bool v8::internal::String::IsOneByteEqualTo ( base::Vector< const char > str)
inline

Definition at line 681 of file string-inl.h.

Here is the call graph for this function:

◆ IsOneByteRepresentation()

bool v8::internal::String::IsOneByteRepresentation ( ) const
inline

Definition at line 364 of file string-inl.h.

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

◆ IsOneByteRepresentationUnderneath()

bool v8::internal::String::IsOneByteRepresentationUnderneath ( Tagged< String > string)
inlinestatic

Definition at line 373 of file string-inl.h.

Here is the caller graph for this function:

◆ IsShared()

bool v8::internal::String::IsShared ( ) const
inline

Definition at line 1006 of file string-inl.h.

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

◆ IsTwoByteRepresentation()

bool v8::internal::String::IsTwoByteRepresentation ( ) const
inline

Definition at line 368 of file string-inl.h.

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

◆ IsWellFormedUnicode()

bool v8::internal::String::IsWellFormedUnicode ( Isolate * isolate,
DirectHandle< String > string )
inlinestatic

Definition at line 1114 of file string-inl.h.

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

◆ LastIndexOf()

Tagged< Object > v8::internal::String::LastIndexOf ( Isolate * isolate,
DirectHandle< Object > receiver,
DirectHandle< Object > search,
DirectHandle< Object > position )
static

Definition at line 1689 of file string.cc.

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

◆ length() [1/2]

uint32_t v8::internal::String::length ( ) const
inline

Definition at line 127 of file string-inl.h.

Here is the caller graph for this function:

◆ length() [2/2]

uint32_t v8::internal::String::length ( AcquireLoadTag ) const
inline

Definition at line 129 of file string-inl.h.

Here is the call graph for this function:

◆ MakeExternal() [1/2]

bool v8::internal::String::MakeExternal ( Isolate * isolate,
v8::String::ExternalOneByteStringResource * resource )

Definition at line 435 of file string.cc.

Here is the call graph for this function:

◆ MakeExternal() [2/2]

V8_EXPORT_PRIVATE bool v8::internal::String::MakeExternal ( Isolate * isolate,
v8::String::ExternalStringResource * resource )

◆ MakeExternalDuringGC()

template<typename T >
void v8::internal::String::MakeExternalDuringGC ( Isolate * isolate,
T * resource )

Definition at line 289 of file string.cc.

Here is the call graph for this function:

◆ MakeThin()

template<typename IsolateT >
void v8::internal::String::MakeThin ( IsolateT * isolate,
Tagged< String > canonical )

Definition at line 134 of file string.cc.

Here is the call graph for this function:

◆ MarkForExternalizationDuringGC()

template<typename T >
bool v8::internal::String::MarkForExternalizationDuringGC ( Isolate * isolate,
T * resource )
Here is the caller graph for this function:

◆ NonOneByteStart()

static uint32_t v8::internal::String::NonOneByteStart ( const base::uc16 * chars,
uint32_t length )
inlinestatic

Definition at line 584 of file string.h.

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

◆ PrefixForDebugPrint()

const char * v8::internal::String::PrefixForDebugPrint ( ) const

Definition at line 568 of file string.cc.

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

◆ PrintOn() [1/2]

void v8::internal::String::PrintOn ( FILE * out)

Definition at line 1910 of file string.cc.

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

◆ PrintOn() [2/2]

void v8::internal::String::PrintOn ( std::ostream & out)

Definition at line 1917 of file string.cc.

Here is the call graph for this function:

◆ PrintUC16() [1/2]

void v8::internal::String::PrintUC16 ( std::ostream & os,
int start = 0,
int end = -1 )

Definition at line 621 of file string.cc.

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

◆ PrintUC16() [2/2]

void v8::internal::String::PrintUC16 ( StringStream * accumulator,
int start,
int end )

Definition at line 629 of file string.cc.

Here is the call graph for this function:

◆ Set()

void v8::internal::String::Set ( uint32_t index,
uint16_t value )
inline

Definition at line 992 of file string-inl.h.

Here is the call graph for this function:

◆ set_length() [1/2]

void v8::internal::String::set_length ( uint32_t hash)
inline

Definition at line 133 of file string-inl.h.

◆ set_length() [2/2]

void v8::internal::String::set_length ( uint32_t hash,
ReleaseStoreTag  )
inline

Definition at line 135 of file string-inl.h.

Here is the call graph for this function:

◆ Share()

template<typename T , template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<T>, DirectHandle<String>>)
HandleType< String > v8::internal::String::Share ( Isolate * isolate,
HandleType< T > string )
inlinestatic

Definition at line 946 of file string-inl.h.

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

◆ SlowAsArrayIndex()

bool v8::internal::String::SlowAsArrayIndex ( uint32_t * index)
private

Definition at line 1881 of file string.cc.

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

◆ SlowAsIntegerIndex()

bool v8::internal::String::SlowAsIntegerIndex ( size_t * index)
private

Definition at line 1895 of file string.cc.

Here is the caller graph for this function:

◆ SlowEquals() [1/3]

bool v8::internal::String::SlowEquals ( Isolate * isolate,
DirectHandle< String > one,
DirectHandle< String > two )
staticprivate

Definition at line 1284 of file string.cc.

Here is the call graph for this function:

◆ SlowEquals() [2/3]

bool v8::internal::String::SlowEquals ( Tagged< String > other) const
private

Definition at line 1219 of file string.cc.

Here is the caller graph for this function:

◆ SlowEquals() [3/3]

bool v8::internal::String::SlowEquals ( Tagged< String > other,
const SharedStringAccessGuardIfNeeded & access_guard ) const
private

Definition at line 1225 of file string.cc.

Here is the call graph for this function:

◆ SlowFlatten()

template<template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
V8_EXPORT_PRIVATE HandleType< String > v8::internal::String::SlowFlatten ( Isolate * isolate,
HandleType< ConsString > cons,
AllocationType allocation )
inlinestaticprivate

Definition at line 714 of file string-inl.h.

Here is the call graph for this function:

◆ SlowGetFlatContent()

V8_EXPORT_PRIVATE FlatContent v8::internal::String::SlowGetFlatContent ( const DisallowGarbageCollection & no_gc,
const SharedStringAccessGuardIfNeeded &  )
private
Here is the caller graph for this function:

◆ StringShortPrint()

void v8::internal::String::StringShortPrint ( StringStream * accumulator)

Definition at line 604 of file string.cc.

Here is the call graph for this function:

◆ SuffixForDebugPrint()

const char * v8::internal::String::SuffixForDebugPrint ( ) const

Definition at line 598 of file string.cc.

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

◆ SupportsExternalization()

bool v8::internal::String::SupportsExternalization ( v8::String::Encoding encoding)

Definition at line 529 of file string.cc.

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

◆ ToArrayIndex()

int32_t v8::internal::String::ToArrayIndex ( Address addr)
static

Definition at line 648 of file string.cc.

◆ ToCString() [1/2]

std::unique_ptr< char[]> v8::internal::String::ToCString ( size_t * length_output = nullptr)

Definition at line 766 of file string.cc.

Here is the call graph for this function:

◆ ToCString() [2/2]

std::unique_ptr< char[]> v8::internal::String::ToCString ( uint32_t offset,
uint32_t length,
size_t * length_output = nullptr )

Definition at line 711 of file string.cc.

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

◆ ToNumber()

template<template< typename > typename HandleType>
requires (std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
HandleType< Number > v8::internal::String::ToNumber ( Isolate * isolate,
HandleType< String > subject )
static

Definition at line 661 of file string.cc.

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

◆ TryGetFlatContentFromDirectString()

std::optional< String::FlatContent > v8::internal::String::TryGetFlatContentFromDirectString ( const DisallowGarbageCollection & no_gc,
Tagged< String > string,
uint32_t offset,
uint32_t length,
const SharedStringAccessGuardIfNeeded & access_guard )
staticprivate

Definition at line 855 of file string-inl.h.

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

◆ Utf8Length()

size_t v8::internal::String::Utf8Length ( Isolate * isolate,
DirectHandle< String > string )
inlinestatic

Definition at line 1093 of file string-inl.h.

Here is the call graph for this function:

◆ VisitFlat() [1/2]

template<class Visitor >
Tagged< ConsString > v8::internal::String::VisitFlat ( Visitor * visitor,
Tagged< String > string,
int offset,
const SharedStringAccessGuardIfNeeded & access_guard )
inlinestatic

Definition at line 1033 of file string-inl.h.

Here is the call graph for this function:

◆ VisitFlat() [2/2]

template<class Visitor >
Tagged< ConsString > v8::internal::String::VisitFlat ( Visitor * visitor,
Tagged< String > string,
int offset = 0 )
inlinestatic

Definition at line 1025 of file string-inl.h.

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

◆ WriteToFlat() [1/2]

template<typename SinkCharT >
void v8::internal::String::WriteToFlat ( Tagged< String > source,
SinkCharT * sink,
uint32_t start,
uint32_t length )
static

Definition at line 772 of file string.cc.

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

◆ WriteToFlat() [2/2]

template<typename SinkCharT >
void v8::internal::String::WriteToFlat ( Tagged< String > source,
SinkCharT * sink,
uint32_t start,
uint32_t length,
const SharedStringAccessGuardIfNeeded & access_guard )
static

Definition at line 780 of file string.cc.

◆ WriteToFlat2()

template<typename SinkCharT >
void v8::internal::String::WriteToFlat2 ( SinkCharT * dst,
Tagged< ConsString > src,
uint32_t src_index,
uint32_t length,
const SharedStringAccessGuardIfNeeded & aguard,
const DisallowGarbageCollection & no_gc )
static

Definition at line 1074 of file string.cc.

◆ WriteUtf8()

size_t v8::internal::String::WriteUtf8 ( Isolate * isolate,
DirectHandle< String > string,
char * buffer,
size_t capacity,
Utf8EncodingFlags flags,
size_t * processed_characters_return = nullptr )
static

Definition at line 1113 of file string.cc.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Accessors

friend class Accessors
friend

Definition at line 694 of file string.h.

◆ CodeStubAssembler

friend class CodeStubAssembler
friend

Definition at line 687 of file string.h.

◆ compiler::AccessBuilder

friend class compiler::AccessBuilder
friend

Definition at line 698 of file string.h.

◆ InternalizedStringKey

friend class InternalizedStringKey
friend

Definition at line 691 of file string.h.

◆ maglev::MaglevAssembler

friend class maglev::MaglevAssembler
friend

Definition at line 696 of file string.h.

◆ maglev::MaglevGraphBuilder

friend class maglev::MaglevGraphBuilder
friend

Definition at line 697 of file string.h.

◆ Name

friend class Name
friend

Definition at line 686 of file string.h.

◆ OffsetsForDebug

friend struct OffsetsForDebug
friend

Definition at line 693 of file string.h.

◆ SandboxTesting

friend class SandboxTesting
friend

Definition at line 690 of file string.h.

◆ SharedStringTableInsertionKey

friend class SharedStringTableInsertionKey
friend

Definition at line 689 of file string.h.

◆ StringBuiltinsAssembler

friend class StringBuiltinsAssembler
friend

Definition at line 695 of file string.h.

◆ StringTableInsertionKey

friend class StringTableInsertionKey
friend

Definition at line 688 of file string.h.

◆ TorqueGeneratedStringAsserts

friend class TorqueGeneratedStringAsserts
friend

Definition at line 700 of file string.h.

◆ wasm::baseline::LiftoffCompiler

friend class wasm::baseline::LiftoffCompiler
friend

Definition at line 699 of file string.h.

Member Data Documentation

◆ kInlineLineEndsSize

uint32_t constexpr v8::internal::String::kInlineLineEndsSize = 32
staticconstexpr

Definition at line 641 of file string.h.

◆ kMaxCodePoint

const base::uc32 v8::internal::String::kMaxCodePoint = 0x10ffff
static

Definition at line 504 of file string.h.

◆ kMaxHashCalcLength

const uint32_t v8::internal::String::kMaxHashCalcLength = 16383
static

Definition at line 515 of file string.h.

◆ kMaxLength

const uint32_t v8::internal::String::kMaxLength = v8::String::kMaxLength
static

Definition at line 511 of file string.h.

◆ kMaxOneByteCharCode

const int32_t v8::internal::String::kMaxOneByteCharCode = unibrow::Latin1::kMaxChar
static

Definition at line 500 of file string.h.

◆ kMaxOneByteCharCodeU

const uint32_t v8::internal::String::kMaxOneByteCharCodeU = unibrow::Latin1::kMaxChar
static

Definition at line 501 of file string.h.

◆ kMaxShortPrintLength

const uint32_t v8::internal::String::kMaxShortPrintLength = 1024
static

Definition at line 518 of file string.h.

◆ kMaxUtf16CodeUnit

const int v8::internal::String::kMaxUtf16CodeUnit = 0xffff
static

Definition at line 502 of file string.h.

◆ kMaxUtf16CodeUnitU

const uint32_t v8::internal::String::kMaxUtf16CodeUnitU = kMaxUtf16CodeUnit
static

Definition at line 503 of file string.h.

◆ length_

uint32_t v8::internal::String::length_
private

Definition at line 761 of file string.h.

◆ source

HandleType<String> v8::internal::String::source
private

Definition at line 738 of file string.h.

◆ V8_OBJECT_INNER_CLASS_END

V8_OBJECT_INNER_CLASS class v8::internal::String::FlatContent v8::internal::String::V8_OBJECT_INNER_CLASS_END

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