V8 Project
v8::internal::String::FlatContent Class Reference

#include <objects.h>

+ Collaboration diagram for v8::internal::String::FlatContent:

Public Member Functions

bool IsFlat ()
 
bool IsOneByte ()
 
bool IsTwoByte ()
 
Vector< const uint8_t > ToOneByteVector ()
 
Vector< const uc16ToUC16Vector ()
 
uc16 Get (int i)
 

Private Types

enum  State { NON_FLAT , ONE_BYTE , TWO_BYTE }
 

Private Member Functions

 FlatContent (const uint8_t *start, int length)
 
 FlatContent (const uc16 *start, int length)
 
 FlatContent ()
 

Private Attributes

union {
   const uint8_t *   onebyte_start
 
   const uc16 *   twobyte_start
 
}; 
 
int length_
 
State state_
 

Friends

class String
 

Detailed Description

Definition at line 8628 of file objects.h.

Member Enumeration Documentation

◆ State

Enumerator
NON_FLAT 
ONE_BYTE 
TWO_BYTE 

Definition at line 8658 of file objects.h.

Constructor & Destructor Documentation

◆ FlatContent() [1/3]

v8::internal::String::FlatContent::FlatContent ( const uint8_t *  start,
int  length 
)
inlineexplicitprivate

◆ FlatContent() [2/3]

v8::internal::String::FlatContent::FlatContent ( const uc16 start,
int  length 
)
inlineexplicitprivate

Definition at line 8663 of file objects.h.

8664  : twobyte_start(start), length_(length), state_(TWO_BYTE) { }

◆ FlatContent() [3/3]

v8::internal::String::FlatContent::FlatContent ( )
inlineprivate

Definition at line 8665 of file objects.h.

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

Member Function Documentation

◆ Get()

uc16 v8::internal::String::FlatContent::Get ( int  i)
inline

Definition at line 8650 of file objects.h.

8650  {
8651  DCHECK(i < length_);
8652  DCHECK(state_ != NON_FLAT);
8653  if (state_ == ONE_BYTE) return onebyte_start[i];
8654  return twobyte_start[i];
8655  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK.

Referenced by v8::internal::RUNTIME_FUNCTION(), and v8::internal::String::SlowEquals().

+ Here is the caller graph for this function:

◆ IsFlat()

bool v8::internal::String::FlatContent::IsFlat ( )
inline

Definition at line 8631 of file objects.h.

8631 { return state_ != NON_FLAT; }

Referenced by v8::internal::RegExpImpl::AtomExecRaw(), v8::internal::String::CalculateLineEnds(), v8::internal::CompiledReplacement::Compile(), v8::internal::ConvertCase(), v8::internal::FindStringIndicesDispatch(), and v8::internal::FlatStringReader::PostGarbageCollection().

+ Here is the caller graph for this function:

◆ IsOneByte()

◆ IsTwoByte()

bool v8::internal::String::FlatContent::IsTwoByte ( )
inline

Definition at line 8635 of file objects.h.

8635 { return state_ == TWO_BYTE; }

Referenced by v8::internal::CompiledReplacement::Compile(), v8::internal::AstValueFactory::GetString(), v8::internal::String::IsTwoByteEqualTo(), v8::internal::IrregexpInterpreter::Match(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the caller graph for this function:

◆ ToOneByteVector()

◆ ToUC16Vector()

Vector<const uc16> v8::internal::String::FlatContent::ToUC16Vector ( )
inline

Friends And Related Function Documentation

◆ String

friend class String
friend

Definition at line 8674 of file objects.h.

Member Data Documentation

◆ 

union { ... }

◆ length_

int v8::internal::String::FlatContent::length_
private

Definition at line 8671 of file objects.h.

◆ onebyte_start

const uint8_t* v8::internal::String::FlatContent::onebyte_start

Definition at line 8668 of file objects.h.

◆ state_

State v8::internal::String::FlatContent::state_
private

Definition at line 8672 of file objects.h.

◆ twobyte_start

const uc16* v8::internal::String::FlatContent::twobyte_start

Definition at line 8669 of file objects.h.


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