V8 Project
v8::internal::StringComparator::State Class Reference
+ Collaboration diagram for v8::internal::StringComparator::State:

Public Member Functions

 State (ConsStringIteratorOp *op)
 
void Init (String *string)
 
void VisitOneByteString (const uint8_t *chars, int length)
 
void VisitTwoByteString (const uint16_t *chars, int length)
 
void Advance (int consumed)
 

Public Attributes

ConsStringIteratorOp *const op_
 
bool is_one_byte_
 
int length_
 
union {
   const uint8_t *   buffer8_
 
   const uint16_t *   buffer16_
 
}; 
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (State)
 

Detailed Description

Definition at line 8560 of file objects.cc.

Constructor & Destructor Documentation

◆ State()

v8::internal::StringComparator::State::State ( ConsStringIteratorOp op)
inlineexplicit

Definition at line 8562 of file objects.cc.

8563  : op_(op), is_one_byte_(true), length_(0), buffer8_(NULL) {}
ConsStringIteratorOp *const op_
Definition: objects.cc:8607
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

◆ Advance()

void v8::internal::StringComparator::State::Advance ( int  consumed)
inline

Definition at line 8587 of file objects.cc.

8587  {
8588  DCHECK(consumed <= length_);
8589  // Still in buffer.
8590  if (length_ != consumed) {
8591  if (is_one_byte_) {
8592  buffer8_ += consumed;
8593  } else {
8594  buffer16_ += consumed;
8595  }
8596  length_ -= consumed;
8597  return;
8598  }
8599  // Advance state.
8600  int offset;
8601  String* next = op_->Next(&offset);
8602  DCHECK_EQ(0, offset);
8603  DCHECK(next != NULL);
8604  String::VisitFlat(this, next);
8605  }
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(condition)
Definition: logging.h:205
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

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

Referenced by v8::internal::StringComparator::Equals().

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::StringComparator::State::DISALLOW_IMPLICIT_CONSTRUCTORS ( State  )
private

◆ Init()

void v8::internal::StringComparator::State::Init ( String string)
inline

Definition at line 8565 of file objects.cc.

8565  {
8566  ConsString* cons_string = String::VisitFlat(this, string);
8567  op_->Reset(cons_string);
8568  if (cons_string != NULL) {
8569  int offset;
8570  string = op_->Next(&offset);
8571  String::VisitFlat(this, string, offset);
8572  }
8573  }
void Reset(ConsString *cons_string, int offset=0)
Definition: objects.h:9293

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

Referenced by v8::internal::StringComparator::Equals().

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

◆ VisitOneByteString()

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

Definition at line 8575 of file objects.cc.

8575  {
8576  is_one_byte_ = true;
8577  buffer8_ = chars;
8578  length_ = length;
8579  }

References buffer8_, is_one_byte_, and length_.

◆ VisitTwoByteString()

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

Definition at line 8581 of file objects.cc.

8581  {
8582  is_one_byte_ = false;
8583  buffer16_ = chars;
8584  length_ = length;
8585  }

References buffer16_, is_one_byte_, and length_.

Member Data Documentation

◆ 

union { ... }

◆ buffer16_

const uint16_t* v8::internal::StringComparator::State::buffer16_

Definition at line 8612 of file objects.cc.

Referenced by Advance(), and VisitTwoByteString().

◆ buffer8_

const uint8_t* v8::internal::StringComparator::State::buffer8_

◆ is_one_byte_

bool v8::internal::StringComparator::State::is_one_byte_

◆ length_

int v8::internal::StringComparator::State::length_

◆ op_

ConsStringIteratorOp* const v8::internal::StringComparator::State::op_

Definition at line 8607 of file objects.cc.

Referenced by Advance(), and Init().


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