V8 Project
v8::internal::ExternalTwoByteString Class Reference

#include <objects.h>

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

Public Types

typedef v8::String::ExternalStringResource Resource
 
- 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 }
 

Public Member Functions

const Resourceresource ()
 
void set_resource (const Resource *buffer)
 
void update_data_cache ()
 
const uint16_t * GetChars ()
 
uint16_t ExternalTwoByteStringGet (int index)
 
const uint16_t * ExternalTwoByteStringGetData (unsigned start)
 
void ExternalTwoByteStringIterateBody (ObjectVisitor *v)
 
template<typename StaticVisitor >
void ExternalTwoByteStringIterateBody ()
 
- Public Member Functions inherited from v8::internal::ExternalString
bool is_short ()
 
 STATIC_ASSERT (kResourceOffset==Internals::kStringResourceOffset)
 
- 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 Attributes

static const bool kHasOneByteEncoding = false
 
- Static Public Attributes inherited from v8::internal::ExternalString
static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize)
 
static const int kShortSize = kResourceOffset + kPointerSize
 
static const int kResourceDataOffset = kResourceOffset + kPointerSize
 
static const int kSize = kResourceDataOffset + kPointerSize
 
static const int kMaxShortLength
 
- 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 (ExternalTwoByteString)
 

Additional Inherited Members

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

Member Typedef Documentation

◆ Resource

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::ExternalTwoByteString::DISALLOW_IMPLICIT_CONSTRUCTORS ( ExternalTwoByteString  )
private

◆ ExternalTwoByteStringGet()

uint16_t v8::internal::ExternalTwoByteString::ExternalTwoByteStringGet ( int  index)
inline

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

3636  {
3637  DCHECK(index >= 0 && index < length());
3638  return GetChars()[index];
3639 }
#define DCHECK(condition)
Definition: logging.h:205

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

+ Here is the call graph for this function:

◆ ExternalTwoByteStringGetData()

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

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

3643  {
3644  return GetChars() + start;
3645 }

◆ ExternalTwoByteStringIterateBody() [1/2]

template<typename StaticVisitor >
void v8::internal::ExternalTwoByteString::ExternalTwoByteStringIterateBody
inline

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

7154  {
7156  StaticVisitor::VisitExternalTwoByteString(
7157  reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset)));
7158 }
An ExternalStringResource is a wrapper around a two-byte string buffer that resides outside V8's heap...
Definition: v8.h:1885
static const int kResourceOffset
Definition: objects.h:9136
v8::String::ExternalStringResource Resource
Definition: objects.h:9196
#define FIELD_ADDR(p, offset)
Definition: objects-inl.h:1173

References FIELD_ADDR.

◆ ExternalTwoByteStringIterateBody() [2/2]

void v8::internal::ExternalTwoByteString::ExternalTwoByteStringIterateBody ( ObjectVisitor v)
inline

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

7146  {
7148  v->VisitExternalTwoByteString(
7149  reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset)));
7150 }

References FIELD_ADDR.

◆ GetChars()

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

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

3631  {
3632  return resource()->data();
3633 }
virtual const uint16_t * data() const =0
The string data from the underlying buffer.

◆ resource()

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

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

3610  {
3611  return *reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset));
3612 }

References FIELD_ADDR.

◆ set_resource()

void v8::internal::ExternalTwoByteString::set_resource ( const Resource buffer)
inline

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

3624  {
3625  *reinterpret_cast<const Resource**>(
3627  if (resource != NULL) update_data_cache();
3628 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References FIELD_ADDR, and NULL.

◆ update_data_cache()

void v8::internal::ExternalTwoByteString::update_data_cache ( )
inline

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

3615  {
3616  if (is_short()) return;
3617  const uint16_t** data_field =
3618  reinterpret_cast<const uint16_t**>(FIELD_ADDR(this, kResourceDataOffset));
3619  *data_field = resource()->data();
3620 }
static const int kResourceDataOffset
Definition: objects.h:9138
unsigned short uint16_t
Definition: unicode.cc:23

References FIELD_ADDR.

Member Data Documentation

◆ kHasOneByteEncoding

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

Definition at line 9194 of file objects.h.


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