V8 Project
v8::internal::IteratingStringHasher Class Reference

#include <objects.h>

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

Public Member Functions

void VisitOneByteString (const uint8_t *chars, int length)
 
void VisitTwoByteString (const uint16_t *chars, int length)
 
- Public Member Functions inherited from v8::internal::StringHasher
 StringHasher (int length, uint32_t seed)
 
 INLINE (static uint32_t AddCharacterCore(uint32_t running_hash, uint16_t c))
 
 INLINE (static uint32_t GetHashCore(uint32_t running_hash))
 

Static Public Member Functions

static uint32_t Hash (String *string, uint32_t seed)
 
- Static Public Member Functions inherited from v8::internal::StringHasher
template<typename schar >
static uint32_t HashSequentialString (const schar *chars, int length, uint32_t seed)
 
static uint32_t ComputeUtf8Hash (Vector< const char > chars, uint32_t seed, int *utf16_length_out)
 
static uint32_t MakeArrayIndexHash (uint32_t value, int length)
 

Private Member Functions

 IteratingStringHasher (int len, uint32_t seed)
 
 DISALLOW_COPY_AND_ASSIGN (IteratingStringHasher)
 

Additional Inherited Members

- Static Public Attributes inherited from v8::internal::StringHasher
static const int kZeroHash = 27
 
- Protected Member Functions inherited from v8::internal::StringHasher
uint32_t GetHashField ()
 
bool has_trivial_hash ()
 
template<typename Char >
void AddCharacters (const Char *chars, int len)
 

Detailed Description

Definition at line 8395 of file objects.h.

Constructor & Destructor Documentation

◆ IteratingStringHasher()

v8::internal::IteratingStringHasher::IteratingStringHasher ( int  len,
uint32_t  seed 
)
inlineprivate

Definition at line 8402 of file objects.h.

8403  : StringHasher(len, seed) {}
StringHasher(int length, uint32_t seed)
Definition: objects-inl.h:6478

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::IteratingStringHasher::DISALLOW_COPY_AND_ASSIGN ( IteratingStringHasher  )
private

◆ Hash()

uint32_t v8::internal::IteratingStringHasher::Hash ( String string,
uint32_t  seed 
)
inlinestatic

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

6572  {
6573  IteratingStringHasher hasher(string->length(), seed);
6574  // Nothing to do.
6575  if (hasher.has_trivial_hash()) return hasher.GetHashField();
6576  ConsString* cons_string = String::VisitFlat(&hasher, string);
6577  // The string was flat.
6578  if (cons_string == NULL) return hasher.GetHashField();
6579  // This is a ConsString, iterate across it.
6580  ConsStringIteratorOp op(cons_string);
6581  int offset;
6582  while (NULL != (string = op.Next(&offset))) {
6583  String::VisitFlat(&hasher, string, offset);
6584  }
6585  return hasher.GetHashField();
6586 }
IteratingStringHasher(int len, uint32_t seed)
Definition: objects.h:8402
static ConsString * VisitFlat(Visitor *visitor, String *string, int offset=0)
Definition: objects-inl.h:3416
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 v8::internal::StringHasher::GetHashField(), v8::internal::StringHasher::has_trivial_hash(), v8::internal::String::length(), v8::internal::ConsStringIteratorOp::Next(), NULL, and v8::internal::String::VisitFlat().

Referenced by v8::internal::SerializedCodeData::CheckSum(), and v8::internal::String::ComputeAndSetHash().

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

◆ VisitOneByteString()

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

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

6590  {
6591  AddCharacters(chars, length);
6592 }
void AddCharacters(const Char *chars, int len)
Definition: objects-inl.h:6543

References v8::internal::StringHasher::AddCharacters().

+ Here is the call graph for this function:

◆ VisitTwoByteString()

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

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

6596  {
6597  AddCharacters(chars, length);
6598 }

References v8::internal::StringHasher::AddCharacters().

+ Here is the call graph for this function:

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