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

#include <string.h>

Inheritance diagram for v8::internal::SeqOneByteString:
Collaboration diagram for v8::internal::SeqOneByteString:

Classes

class  BodyDescriptor
 

Public Types

using Char = uint8_t
 
- Public Types inherited from v8::internal::String
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

uint8_t Get (uint32_t index) const
 
uint8_t Get (uint32_t index, const SharedStringAccessGuardIfNeeded &access_guard) const
 
void SeqOneByteStringSet (uint32_t index, uint16_t value)
 
void SeqOneByteStringSetChars (uint32_t index, const uint8_t *string, uint32_t length)
 
Address GetCharsAddress () const
 
V8_INLINE uint8_t * GetChars (const DisallowGarbageCollection &no_gc)
 
V8_INLINE uint8_t * GetChars (const DisallowGarbageCollection &no_gc, const SharedStringAccessGuardIfNeeded &access_guard)
 
DataAndPaddingSizes GetDataAndPaddingSizes () const
 
void clear_padding_destructively (uint32_t length)
 
int AllocatedSize () const
 
- Public Member Functions inherited from v8::internal::SeqString
DataAndPaddingSizes GetDataAndPaddingSizes () const
 
void ClearPadding ()
 
- Public Member Functions inherited from v8::internal::String
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 V8_INLINE constexpr int32_t DataSizeFor (int32_t length)
 
static V8_INLINE constexpr int32_t SizeFor (int32_t length)
 
static bool IsCompatibleMap (Tagged< Map > map, ReadOnlyRoots roots)
 
- Static Public Member Functions inherited from v8::internal::SeqString
static V8_WARN_UNUSED_RESULT Handle< StringTruncate (Isolate *isolate, Handle< SeqString > string, uint32_t new_length)
 
- Static Public Member Functions inherited from v8::internal::String
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)
 

Static Public Attributes

static const bool kHasOneByteEncoding = true
 
static const uint32_t kMaxCharsSize = kMaxLength
 
- Static Public Attributes inherited from v8::internal::String
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

 FLEXIBLE_ARRAY_MEMBER (Char, chars)
 

Friends

struct OffsetsForDebug
 
class CodeStubAssembler
 
class ToDirectStringAssembler
 
class IntlBuiltinsAssembler
 
class StringBuiltinsAssembler
 
class StringFromCharCodeAssembler
 
class SandboxTesting
 
class maglev::MaglevAssembler
 
class compiler::AccessBuilder
 
class TorqueGeneratedSeqOneByteStringAsserts
 

Additional Inherited Members

- Public Attributes inherited from v8::internal::String
V8_OBJECT_INNER_CLASS class v8::internal::String::FlatContent V8_OBJECT_INNER_CLASS_END
 

Detailed Description

Definition at line 849 of file string.h.

Member Typedef Documentation

◆ Char

Definition at line 852 of file string.h.

Member Function Documentation

◆ AllocatedSize()

int v8::internal::SeqOneByteString::AllocatedSize ( ) const
inline

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

Here is the call graph for this function:

◆ clear_padding_destructively()

void v8::internal::SeqOneByteString::clear_padding_destructively ( uint32_t length)
inline

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

Here is the call graph for this function:

◆ DataSizeFor()

V8_INLINE constexpr int32_t v8::internal::SeqOneByteString::DataSizeFor ( int32_t length)
staticconstexpr

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

Here is the caller graph for this function:

◆ FLEXIBLE_ARRAY_MEMBER()

v8::internal::SeqOneByteString::FLEXIBLE_ARRAY_MEMBER ( Char ,
chars  )
private

◆ Get() [1/2]

uint8_t v8::internal::SeqOneByteString::Get ( uint32_t index) const
inline

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

Here is the call graph for this function:

◆ Get() [2/2]

uint8_t v8::internal::SeqOneByteString::Get ( uint32_t index,
const SharedStringAccessGuardIfNeeded & access_guard ) const
inline

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

Here is the call graph for this function:

◆ GetChars() [1/2]

uint8_t * v8::internal::SeqOneByteString::GetChars ( const DisallowGarbageCollection & no_gc)

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

Here is the call graph for this function:

◆ GetChars() [2/2]

uint8_t * v8::internal::SeqOneByteString::GetChars ( const DisallowGarbageCollection & no_gc,
const SharedStringAccessGuardIfNeeded & access_guard )

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

◆ GetCharsAddress()

Address v8::internal::SeqOneByteString::GetCharsAddress ( ) const
inline

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

◆ GetDataAndPaddingSizes()

SeqString::DataAndPaddingSizes v8::internal::SeqOneByteString::GetDataAndPaddingSizes ( ) const

Definition at line 1971 of file string.cc.

◆ IsCompatibleMap()

bool v8::internal::SeqOneByteString::IsCompatibleMap ( Tagged< Map > map,
ReadOnlyRoots roots )
inlinestatic

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

◆ SeqOneByteStringSet()

void v8::internal::SeqOneByteString::SeqOneByteStringSet ( uint32_t index,
uint16_t value )
inline

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

Here is the call graph for this function:

◆ SeqOneByteStringSetChars()

void v8::internal::SeqOneByteString::SeqOneByteStringSetChars ( uint32_t index,
const uint8_t * string,
uint32_t length )
inline

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

Here is the call graph for this function:

◆ SizeFor()

V8_INLINE constexpr int32_t v8::internal::SeqOneByteString::SizeFor ( int32_t length)
staticconstexpr

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

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

Friends And Related Symbol Documentation

◆ CodeStubAssembler

friend class CodeStubAssembler
friend

Definition at line 897 of file string.h.

◆ compiler::AccessBuilder

friend class compiler::AccessBuilder
friend

Definition at line 904 of file string.h.

◆ IntlBuiltinsAssembler

friend class IntlBuiltinsAssembler
friend

Definition at line 899 of file string.h.

◆ maglev::MaglevAssembler

friend class maglev::MaglevAssembler
friend

Definition at line 903 of file string.h.

◆ OffsetsForDebug

friend struct OffsetsForDebug
friend

Definition at line 896 of file string.h.

◆ SandboxTesting

friend class SandboxTesting
friend

Definition at line 902 of file string.h.

◆ StringBuiltinsAssembler

friend class StringBuiltinsAssembler
friend

Definition at line 900 of file string.h.

◆ StringFromCharCodeAssembler

friend class StringFromCharCodeAssembler
friend

Definition at line 901 of file string.h.

◆ ToDirectStringAssembler

friend class ToDirectStringAssembler
friend

Definition at line 898 of file string.h.

◆ TorqueGeneratedSeqOneByteStringAsserts

friend class TorqueGeneratedSeqOneByteStringAsserts
friend

Definition at line 905 of file string.h.

Member Data Documentation

◆ kHasOneByteEncoding

const bool v8::internal::SeqOneByteString::kHasOneByteEncoding = true
static

Definition at line 851 of file string.h.

◆ kMaxCharsSize

const uint32_t v8::internal::SeqOneByteString::kMaxCharsSize = kMaxLength
static

Definition at line 886 of file string.h.


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