V8 Project
v8::internal::Utf8StringKey Class Reference

#include <objects-inl.h>

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

Public Member Functions

 Utf8StringKey (Vector< const char > string, uint32_t seed)
 
virtual bool IsMatch (Object *string) OVERRIDE
 
virtual uint32_t Hash () OVERRIDE
 
virtual uint32_t HashForObject (Object *other) OVERRIDE
 
virtual Handle< ObjectAsHandle (Isolate *isolate) OVERRIDE
 
- Public Member Functions inherited from v8::internal::HashTableKey
virtual ~HashTableKey ()
 

Public Attributes

Vector< const char > string_
 
uint32_t hash_field_
 
int chars_
 
uint32_t seed_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Utf8StringKey()

v8::internal::Utf8StringKey::Utf8StringKey ( Vector< const char >  string,
uint32_t  seed 
)
inlineexplicit

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

588  : string_(string), hash_field_(0), seed_(seed) { }
Vector< const char > string_
Definition: objects-inl.h:612

Member Function Documentation

◆ AsHandle()

virtual Handle<Object> v8::internal::Utf8StringKey::AsHandle ( Isolate isolate)
inlinevirtual

Implements v8::internal::HashTableKey.

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

606  {
607  if (hash_field_ == 0) Hash();
608  return isolate->factory()->NewInternalizedStringFromUtf8(
610  }
virtual uint32_t Hash() OVERRIDE
Definition: objects-inl.h:594

References chars_, Hash(), hash_field_, and string_.

+ Here is the call graph for this function:

◆ Hash()

virtual uint32_t v8::internal::Utf8StringKey::Hash ( )
inlinevirtual

Implements v8::internal::HashTableKey.

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

594  {
595  if (hash_field_ != 0) return hash_field_ >> String::kHashShift;
598  DCHECK(result != 0); // Ensure that the hash value of 0 is never computed.
599  return result;
600  }
static const int kHashShift
Definition: objects.h:8499
static uint32_t ComputeUtf8Hash(Vector< const char > chars, uint32_t seed, int *utf16_length_out)
Definition: objects.cc:8956
#define DCHECK(condition)
Definition: logging.h:205

References chars_, v8::internal::StringHasher::ComputeUtf8Hash(), DCHECK, hash_field_, v8::internal::Name::kHashShift, seed_, and string_.

Referenced by AsHandle().

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

◆ HashForObject()

virtual uint32_t v8::internal::Utf8StringKey::HashForObject ( Object other)
inlinevirtual

Implements v8::internal::HashTableKey.

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

602  {
603  return String::cast(other)->Hash();
604  }

◆ IsMatch()

virtual bool v8::internal::Utf8StringKey::IsMatch ( Object string)
inlinevirtual

Implements v8::internal::HashTableKey.

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

590  {
591  return String::cast(string)->IsUtf8EqualTo(string_);
592  }

References string_.

Member Data Documentation

◆ chars_

int v8::internal::Utf8StringKey::chars_

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

Referenced by AsHandle(), and Hash().

◆ hash_field_

uint32_t v8::internal::Utf8StringKey::hash_field_

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

Referenced by AsHandle(), and Hash().

◆ seed_

uint32_t v8::internal::Utf8StringKey::seed_

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

Referenced by Hash().

◆ string_

Vector<const char> v8::internal::Utf8StringKey::string_

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

Referenced by AsHandle(), Hash(), and IsMatch().


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