V8 Project
v8::internal::SeqOneByteString Class Reference

#include <objects.h>

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

Public Member Functions

uint16_t SeqOneByteStringGet (int index)
 
void SeqOneByteStringSet (int index, uint16_t value)
 
Address GetCharsAddress ()
 
uint8_t * GetChars ()
 
int SeqOneByteStringSize (InstanceType instance_type)
 
 STATIC_ASSERT ((kMaxSize - kHeaderSize) >=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 = true
 
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 (SeqOneByteString)
 

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 8955 of file objects.h.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::SeqOneByteString::DISALLOW_IMPLICIT_CONSTRUCTORS ( SeqOneByteString  )
private

◆ GetChars()

uint8_t * v8::internal::SeqOneByteString::GetChars ( )
inline

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

3487  {
3488  return reinterpret_cast<uint8_t*>(GetCharsAddress());
3489 }

◆ GetCharsAddress()

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

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

3482  {
3483  return FIELD_ADDR(this, kHeaderSize);
3484 }
static const int kHeaderSize
Definition: objects.h:8941
#define FIELD_ADDR(p, offset)
Definition: objects-inl.h:1173

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

◆ SeqOneByteStringGet()

uint16_t v8::internal::SeqOneByteString::SeqOneByteStringGet ( int  index)
inline

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

3469  {
3470  DCHECK(index >= 0 && index < length());
3471  return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
3472 }
#define DCHECK(condition)
Definition: logging.h:205
const int kCharSize
Definition: globals.h:122
#define READ_BYTE_FIELD(p, offset)
Definition: objects-inl.h:1296

References DCHECK, v8::internal::kCharSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::FixedArrayBase::length(), and READ_BYTE_FIELD.

+ Here is the call graph for this function:

◆ SeqOneByteStringSet()

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

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

3475  {
3476  DCHECK(index >= 0 && index < length() && value <= kMaxOneByteCharCode);
3477  WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize,
3478  static_cast<byte>(value));
3479 }
static const int32_t kMaxOneByteCharCode
Definition: objects.h:8811
#define WRITE_BYTE_FIELD(p, offset, value)
Definition: objects-inl.h:1303

References DCHECK, v8::internal::kCharSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::FixedArrayBase::length(), and WRITE_BYTE_FIELD.

+ Here is the call graph for this function:

◆ SeqOneByteStringSize()

int v8::internal::SeqOneByteString::SeqOneByteStringSize ( InstanceType  instance_type)
inline

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

3519  {
3520  return SizeFor(length());
3521 }
static int SizeFor(int length)
Definition: objects.h:8976

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

+ Here is the call graph for this function:

◆ SizeFor()

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

Definition at line 8976 of file objects.h.

8976  {
8978  }
#define OBJECT_POINTER_ALIGN(value)
Definition: globals.h:578

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

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

+ Here is the caller graph for this function:

◆ STATIC_ASSERT()

v8::internal::SeqOneByteString::STATIC_ASSERT ( (kMaxSize - kHeaderSize) >=String::kMaxLength  )

Member Data Documentation

◆ kHasOneByteEncoding

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

Definition at line 8957 of file objects.h.

◆ kMaxSize

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

Definition at line 8981 of file objects.h.

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


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