V8 Project
v8::internal::StringCharacterStream Class Reference

#include <objects.h>

+ Collaboration diagram for v8::internal::StringCharacterStream:

Public Member Functions

 StringCharacterStream (String *string, ConsStringIteratorOp *op, int offset=0)
 
uint16_t GetNext ()
 
bool HasMore ()
 
void Reset (String *string, int offset=0)
 
void VisitOneByteString (const uint8_t *chars, int length)
 
void VisitTwoByteString (const uint16_t *chars, int length)
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (StringCharacterStream)
 

Private Attributes

bool is_one_byte_
 
union {
   const uint8_t *   buffer8_
 
   const uint16_t *   buffer16_
 
}; 
 
const uint8_t * end_
 
ConsStringIteratorOpop_
 

Detailed Description

Definition at line 9334 of file objects.h.

Constructor & Destructor Documentation

◆ StringCharacterStream()

v8::internal::StringCharacterStream::StringCharacterStream ( String string,
ConsStringIteratorOp op,
int  offset = 0 
)
inline

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

3688  : is_one_byte_(false),
3689  op_(op) {
3690  Reset(string, offset);
3691 }
void Reset(String *string, int offset=0)
Definition: objects-inl.h:3694
ConsStringIteratorOp * op_
Definition: objects.h:9352

References Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::StringCharacterStream::DISALLOW_COPY_AND_ASSIGN ( StringCharacterStream  )
private

◆ GetNext()

uint16_t v8::internal::StringCharacterStream::GetNext ( )
inline

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

3676  {
3677  DCHECK(buffer8_ != NULL && end_ != NULL);
3678  // Advance cursor if needed.
3679  if (buffer8_ == end_) HasMore();
3680  DCHECK(buffer8_ < end_);
3681  return is_one_byte_ ? *buffer8_++ : *buffer16_++;
3682 }
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
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, and NULL.

Referenced by v8::internal::ConvertCaseHelper(), v8::internal::anonymous_namespace{conversions.cc}::StringCharacterStreamIterator::operator++(), v8::internal::CodeGenerator::PrintCode(), v8::internal::String::PrintUC16(), v8::internal::RUNTIME_FUNCTION(), v8::internal::String::StringShortPrint(), v8::internal::String::ToCString(), and v8::internal::String::ToWideCString().

+ Here is the caller graph for this function:

◆ HasMore()

bool v8::internal::StringCharacterStream::HasMore ( )
inline

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

3706  {
3707  if (buffer8_ != end_) return true;
3708  int offset;
3709  String* string = op_->Next(&offset);
3710  DCHECK_EQ(offset, 0);
3711  if (string == NULL) return false;
3712  String::VisitFlat(this, string);
3713  DCHECK(buffer8_ != end_);
3714  return true;
3715 }
String * Next(int *offset_out)
Definition: objects.h:9300
static ConsString * VisitFlat(Visitor *visitor, String *string, int offset=0)
Definition: objects-inl.h:3416
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

References buffer8_, DCHECK, DCHECK_EQ, end_, v8::internal::ConsStringIteratorOp::Next(), NULL, op_, and v8::internal::String::VisitFlat().

Referenced by v8::internal::ConvertCaseHelper(), v8::internal::anonymous_namespace{conversions.cc}::StringCharacterStreamIterator::operator++(), v8::internal::CodeGenerator::PrintCode(), v8::internal::String::PrintUC16(), v8::internal::RUNTIME_FUNCTION(), v8::internal::String::ToCString(), and v8::internal::String::ToWideCString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Reset()

void v8::internal::StringCharacterStream::Reset ( String string,
int  offset = 0 
)
inline

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

3694  {
3695  buffer8_ = NULL;
3696  end_ = NULL;
3697  ConsString* cons_string = String::VisitFlat(this, string, offset);
3698  op_->Reset(cons_string, offset);
3699  if (cons_string != NULL) {
3700  string = op_->Next(&offset);
3701  if (string != NULL) String::VisitFlat(this, string, offset);
3702  }
3703 }
void Reset(ConsString *cons_string, int offset=0)
Definition: objects.h:9293

References buffer8_, end_, v8::internal::ConsStringIteratorOp::Next(), NULL, op_, v8::internal::ConsStringIteratorOp::Reset(), and v8::internal::String::VisitFlat().

Referenced by StringCharacterStream(), v8::internal::String::StringShortPrint(), and v8::internal::String::ToCString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VisitOneByteString()

void v8::internal::StringCharacterStream::VisitOneByteString ( const uint8_t *  chars,
int  length 
)
inline

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

3719  {
3720  is_one_byte_ = true;
3721  buffer8_ = chars;
3722  end_ = chars + length;
3723 }

References buffer8_, end_, and is_one_byte_.

◆ VisitTwoByteString()

void v8::internal::StringCharacterStream::VisitTwoByteString ( const uint16_t *  chars,
int  length 
)
inline

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

3727  {
3728  is_one_byte_ = false;
3729  buffer16_ = chars;
3730  end_ = reinterpret_cast<const uint8_t*>(chars + length);
3731 }

References buffer16_, end_, and is_one_byte_.

Member Data Documentation

◆ 

union { ... }

◆ buffer16_

const uint16_t* v8::internal::StringCharacterStream::buffer16_

Definition at line 9349 of file objects.h.

Referenced by VisitTwoByteString().

◆ buffer8_

const uint8_t* v8::internal::StringCharacterStream::buffer8_

Definition at line 9348 of file objects.h.

Referenced by HasMore(), Reset(), and VisitOneByteString().

◆ end_

const uint8_t* v8::internal::StringCharacterStream::end_
private

Definition at line 9351 of file objects.h.

Referenced by HasMore(), Reset(), VisitOneByteString(), and VisitTwoByteString().

◆ is_one_byte_

bool v8::internal::StringCharacterStream::is_one_byte_
private

Definition at line 9346 of file objects.h.

Referenced by VisitOneByteString(), and VisitTwoByteString().

◆ op_

ConsStringIteratorOp* v8::internal::StringCharacterStream::op_
private

Definition at line 9352 of file objects.h.

Referenced by HasMore(), and Reset().


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