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

#include <string.h>

Inheritance diagram for v8::internal::ExternalTwoByteString:
Collaboration diagram for v8::internal::ExternalTwoByteString:

Public Types

using Char = uint16_t
 
using Resource = v8::String::ExternalStringResource
 
- 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

const Resourceresource () const
 
void SetResource (Isolate *isolate, const Resource *buffer)
 
void set_resource (Isolate *isolate, const Resource *buffer)
 
void update_data_cache (Isolate *isolate)
 
const uint16_t * GetChars () const
 
uint16_t Get (uint32_t index, const SharedStringAccessGuardIfNeeded &access_guard) const
 
const uint16_t * ExternalTwoByteStringGetData (uint32_t start)
 
- Public Member Functions inherited from v8::internal::ExternalString
void InitExternalPointerFields (Isolate *isolate)
 
void VisitExternalPointers (ObjectVisitor *visitor)
 
bool is_uncached () const
 
int ExternalPayloadSize () const
 
Address resource_as_address () const
 
void set_address_as_resource (Isolate *isolate, Address address)
 
uint32_t GetResourceRefForDeserialization ()
 
void SetResourceRefForSerialization (uint32_t ref)
 
void DisposeResource (Isolate *isolate)
 
void InitExternalPointerFieldsDuringExternalization (Tagged< Map > new_map, Isolate *isolate)
 
- 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 Attributes

static const bool kHasOneByteEncoding = false
 
- 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

Resourcemutable_resource ()
 

Additional Inherited Members

- 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)
 
- Public Attributes inherited from v8::internal::String
V8_OBJECT_INNER_CLASS class v8::internal::String::FlatContent V8_OBJECT_INNER_CLASS_END
 
- Protected Attributes inherited from v8::internal::ExternalString
ExternalPointerMember< kExternalStringResourceDataTagresource_data_
 
- Protected Attributes inherited from v8::internal::UncachedExternalString
ExternalPointerMember< kExternalStringResourceTagresource_
 

Detailed Description

Definition at line 1257 of file string.h.

Member Typedef Documentation

◆ Char

Definition at line 1260 of file string.h.

◆ Resource

Member Function Documentation

◆ ExternalTwoByteStringGetData()

const uint16_t * v8::internal::ExternalTwoByteString::ExternalTwoByteStringGetData ( uint32_t start)
inline

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

◆ Get()

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

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

Here is the call graph for this function:

◆ GetChars()

const uint16_t * v8::internal::ExternalTwoByteString::GetChars ( ) const
inline

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

Here is the call graph for this function:

◆ mutable_resource()

ExternalTwoByteString::Resource * v8::internal::ExternalTwoByteString::mutable_resource ( )
inlineprivate

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

◆ resource()

const ExternalTwoByteString::Resource * v8::internal::ExternalTwoByteString::resource ( ) const
inline

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

◆ set_resource()

void v8::internal::ExternalTwoByteString::set_resource ( Isolate * isolate,
const Resource * buffer )
inline

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

◆ SetResource()

void v8::internal::ExternalTwoByteString::SetResource ( Isolate * isolate,
const Resource * buffer )
inline

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

Here is the call graph for this function:

◆ update_data_cache()

void v8::internal::ExternalTwoByteString::update_data_cache ( Isolate * isolate)
inline

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

Member Data Documentation

◆ kHasOneByteEncoding

const bool v8::internal::ExternalTwoByteString::kHasOneByteEncoding = false
static

Definition at line 1259 of file string.h.


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