V8 Project
v8::internal::SeqTwoByteString Class Reference

#include <objects.h>

+ Inheritance diagram for v8::internal::SeqTwoByteString:
+ Collaboration diagram for v8::internal::SeqTwoByteString:

Public Member Functions

uint16_t SeqTwoByteStringGet (int index)
 
void SeqTwoByteStringSet (int index, uint16_t value)
 
Address GetCharsAddress ()
 
uc16GetChars ()
 
const uint16_t * SeqTwoByteStringGetData (unsigned start)
 
int SeqTwoByteStringSize (InstanceType instance_type)
 
 STATIC_ASSERT (static_cast< int >((kMaxSize - kHeaderSize)/sizeof(uint16_t)) >=String::kMaxLength)
 
- Public Member Functions inherited from v8::internal::String
 STATIC_ASSERT ((kArrayIndexLengthBits > 0))
 
 STATIC_ASSERT (IS_POWER_OF_TWO(kMaxCachedArrayIndexLength+1))
 
int length () const
 
void set_length (int value)
 
int synchronized_length () const
 
void synchronized_set_length (int value)
 
bool IsOneByteRepresentation () const
 
bool IsTwoByteRepresentation () const
 
bool IsOneByteRepresentationUnderneath ()
 
bool IsTwoByteRepresentationUnderneath ()
 
bool HasOnlyOneByteChars ()
 
void Set (int index, uint16_t value)
 
 INLINE (uint16_t Get(int index))
 
FlatContent GetFlatContent ()
 
StringGetUnderlying ()
 
bool MarkAsUndetectable ()
 
bool Equals (String *other)
 
bool IsUtf8EqualTo (Vector< const char > str, bool allow_prefix_match=false)
 
bool IsOneByteEqualTo (Vector< const uint8_t > str)
 
bool IsTwoByteEqualTo (Vector< const uc16 > str)
 
SmartArrayPointer< char > ToCString (AllowNullsFlag allow_nulls, RobustnessFlag robustness_flag, int offset, int length, int *length_output=0)
 
SmartArrayPointer< char > ToCString (AllowNullsFlag allow_nulls=DISALLOW_NULLS, RobustnessFlag robustness_flag=FAST_STRING_TRAVERSAL, int *length_output=0)
 
SmartArrayPointer< uc16ToWideCString (RobustnessFlag robustness_flag=FAST_STRING_TRAVERSAL)
 
bool ComputeArrayIndex (uint32_t *index)
 
bool MakeExternal (v8::String::ExternalStringResource *resource)
 
bool MakeExternal (v8::String::ExternalOneByteStringResource *resource)
 
bool AsArrayIndex (uint32_t *index)
 
void PrintOn (FILE *out)
 
bool LooksValid ()
 
void StringShortPrint (StringStream *accumulator)
 
void PrintUC16 (OStream &os, int start=0, int end=-1)
 
bool IsFlat ()
 
 STATIC_ASSERT (kMaxArrayIndexSize<(1<< kArrayIndexLengthBits))
 
const uc16GetTwoByteData (unsigned start)
 
void SetForwardedInternalizedString (String *string)
 
StringGetForwardedInternalizedString ()
 
- Public Member Functions inherited from v8::internal::Name
uint32_t hash_field ()
 
void set_hash_field (uint32_t value)
 
bool HasHashCode ()
 
uint32_t Hash ()
 
bool Equals (Name *other)
 
bool AsArrayIndex (uint32_t *index)
 
bool IsOwn ()
 
 STATIC_ASSERT ((kArrayIndexLengthBits > 0))
 
 STATIC_ASSERT (IS_POWER_OF_TWO(kMaxCachedArrayIndexLength+1))
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static int SizeFor (int length)
 
- Static Public Member Functions inherited from v8::internal::SeqString
static MUST_USE_RESULT Handle< StringTruncate (Handle< SeqString > string, int new_length)
 
- Static Public Member Functions inherited from v8::internal::String
static Handle< StringFlatten (Handle< String > string, PretenureFlag pretenure=NOT_TENURED)
 
static bool Equals (Handle< String > one, Handle< String > two)
 
template<typename sinkchar >
static void WriteToFlat (String *source, sinkchar *sink, int from, int to)
 
static int NonAsciiStart (const char *chars, int length)
 
static bool IsAscii (const char *chars, int length)
 
static bool IsAscii (const uint8_t *chars, int length)
 
static int NonOneByteStart (const uc16 *chars, int length)
 
static bool IsOneByte (const uc16 *chars, int length)
 
template<class Visitor >
static ConsStringVisitFlat (Visitor *visitor, String *string, int offset=0)
 
static Handle< FixedArrayCalculateLineEnds (Handle< String > string, bool include_ending_line)
 
- Static Public Member Functions inherited from v8::internal::Name
static bool Equals (Handle< Name > one, Handle< Name > two)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 

Static Public Attributes

static const bool kHasOneByteEncoding = false
 
static const int kMaxSize = 512 * MB - 1
 
- Static Public Attributes inherited from v8::internal::SeqString
static const int kHeaderSize = String::kSize
 
- Static Public Attributes inherited from v8::internal::String
static const int kMaxCachedArrayIndexLength = 7
 
static const int kArrayIndexValueBits = 24
 
static const int kArrayIndexLengthBits
 
static const unsigned int kContainsCachedArrayIndexMask
 
static const int kLengthOffset = Name::kSize
 
static const int kSize = kLengthOffset + kPointerSize
 
static const int kMaxArrayIndexSize = 10
 
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 int kEmptyStringHash = kIsNotArrayIndexMask
 
static const int kMaxLength = (1 << 28) - 16
 
static const int kMaxHashCalcLength = 16383
 
static const int kMaxShortPrintLength = 1024
 
- Static Public Attributes inherited from v8::internal::Name
static const int kHashFieldOffset = HeapObject::kHeaderSize
 
static const int kSize = kHashFieldOffset + kPointerSize
 
static const int kHashNotComputedMask = 1
 
static const int kIsNotArrayIndexMask = 1 << 1
 
static const int kNofHashBitFields = 2
 
static const int kHashShift = kNofHashBitFields
 
static const uint32_t kHashBitMask = 0xffffffffu >> kHashShift
 
static const int kMaxCachedArrayIndexLength = 7
 
static const int kArrayIndexValueBits = 24
 
static const int kArrayIndexLengthBits
 
static const unsigned int kContainsCachedArrayIndexMask
 
static const int kEmptyHashField
 
- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (SeqTwoByteString)
 

Additional Inherited Members

- Public Types inherited from v8::internal::String
enum  Encoding { ONE_BYTE_ENCODING , TWO_BYTE_ENCODING }
 
- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 
- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 
- Static Protected Member Functions inherited from v8::internal::Name
static bool IsHashFieldComputed (uint32_t field)
 

Detailed Description

Definition at line 8991 of file objects.h.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::SeqTwoByteString::DISALLOW_IMPLICIT_CONSTRUCTORS ( SeqTwoByteString  )
private

◆ GetChars()

uc16 * v8::internal::SeqTwoByteString::GetChars ( )
inline

Definition at line 3497 of file objects-inl.h.

3497  {
3498  return reinterpret_cast<uc16*>(FIELD_ADDR(this, kHeaderSize));
3499 }
static const int kHeaderSize
Definition: objects.h:8941
uint16_t uc16
Definition: globals.h:184
#define FIELD_ADDR(p, offset)
Definition: objects-inl.h:1173

References FIELD_ADDR, and v8::internal::FixedArrayBase::kHeaderSize.

◆ GetCharsAddress()

Address v8::internal::SeqTwoByteString::GetCharsAddress ( )
inline

Definition at line 3492 of file objects-inl.h.

3492  {
3493  return FIELD_ADDR(this, kHeaderSize);
3494 }

References FIELD_ADDR, and v8::internal::FixedArrayBase::kHeaderSize.

◆ SeqTwoByteStringGet()

uint16_t v8::internal::SeqTwoByteString::SeqTwoByteStringGet ( int  index)
inline

Definition at line 3502 of file objects-inl.h.

3502  {
3503  DCHECK(index >= 0 && index < length());
3504  return READ_SHORT_FIELD(this, kHeaderSize + index * kShortSize);
3505 }
#define DCHECK(condition)
Definition: logging.h:205
const int kShortSize
Definition: globals.h:123
#define READ_SHORT_FIELD(p, offset)
Definition: objects-inl.h:1290

References DCHECK, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::kShortSize, v8::internal::FixedArrayBase::length(), and READ_SHORT_FIELD.

+ Here is the call graph for this function:

◆ SeqTwoByteStringGetData()

const uc16 * v8::internal::SeqTwoByteString::SeqTwoByteStringGetData ( unsigned  start)

Definition at line 8105 of file objects.cc.

8105  {
8106  return reinterpret_cast<uc16*>(
8107  reinterpret_cast<char*>(this) - kHeapObjectTag + kHeaderSize) + start;
8108 }
const int kHeapObjectTag
Definition: v8.h:5737

References v8::internal::HeapObject::kHeaderSize, and v8::internal::kHeapObjectTag.

◆ SeqTwoByteStringSet()

void v8::internal::SeqTwoByteString::SeqTwoByteStringSet ( int  index,
uint16_t  value 
)
inline

Definition at line 3508 of file objects-inl.h.

3508  {
3509  DCHECK(index >= 0 && index < length());
3510  WRITE_SHORT_FIELD(this, kHeaderSize + index * kShortSize, value);
3511 }
#define WRITE_SHORT_FIELD(p, offset, value)
Definition: objects-inl.h:1293

References DCHECK, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::kShortSize, v8::internal::FixedArrayBase::length(), and WRITE_SHORT_FIELD.

+ Here is the call graph for this function:

◆ SeqTwoByteStringSize()

int v8::internal::SeqTwoByteString::SeqTwoByteStringSize ( InstanceType  instance_type)
inline

Definition at line 3514 of file objects-inl.h.

3514  {
3515  return SizeFor(length());
3516 }
static int SizeFor(int length)
Definition: objects.h:9015

References v8::internal::FixedArrayBase::length(), and v8::internal::FixedArray::SizeFor().

+ Here is the call graph for this function:

◆ SizeFor()

static int v8::internal::SeqTwoByteString::SizeFor ( int  length)
inlinestatic

Definition at line 9015 of file objects.h.

9015  {
9017  }
#define OBJECT_POINTER_ALIGN(value)
Definition: globals.h:578

References v8::internal::Object::kHeaderSize, v8::internal::kShortSize, and OBJECT_POINTER_ALIGN.

Referenced by v8::internal::Heap::AllocateInternalizedStringImpl(), v8::internal::Heap::AllocateRawTwoByteString(), v8::internal::Heap::AllocateTwoByteInternalizedString(), v8::internal::HeapObject::SizeFromMap(), and v8::internal::SeqString::Truncate().

+ Here is the caller graph for this function:

◆ STATIC_ASSERT()

v8::internal::SeqTwoByteString::STATIC_ASSERT ( static_cast< int >((kMaxSize - kHeaderSize)/sizeof(uint16_t)) >=String::kMaxLength  )

Member Data Documentation

◆ kHasOneByteEncoding

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

Definition at line 8993 of file objects.h.

◆ kMaxSize

const int v8::internal::SeqTwoByteString::kMaxSize = 512 * MB - 1
static

Definition at line 9020 of file objects.h.

Referenced by v8::internal::Heap::AllocateRawTwoByteString().


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