V8 Project
v8::internal::StringTableInsertionKey Class Reference
+ Inheritance diagram for v8::internal::StringTableInsertionKey:
+ Collaboration diagram for v8::internal::StringTableInsertionKey:

Public Member Functions

 StringTableInsertionKey (String *string)
 
virtual bool IsMatch (Object *string)
 
virtual uint32_t Hash () OVERRIDE
 
virtual uint32_t HashForObject (Object *key) OVERRIDE
 
virtual MUST_USE_RESULT Handle< ObjectAsHandle (Isolate *isolate) OVERRIDE
 
- Public Member Functions inherited from v8::internal::HashTableKey
virtual ~HashTableKey ()
 

Public Attributes

Stringstring_
 
uint32_t hash_
 

Detailed Description

Definition at line 718 of file serialize.cc.

Constructor & Destructor Documentation

◆ StringTableInsertionKey()

v8::internal::StringTableInsertionKey::StringTableInsertionKey ( String string)
inlineexplicit

Definition at line 720 of file serialize.cc.

721  : string_(string), hash_(HashForObject(string)) {
722  DCHECK(string->IsInternalizedString());
723  }
virtual uint32_t HashForObject(Object *key) OVERRIDE
Definition: serialize.cc:735
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK.

Member Function Documentation

◆ AsHandle()

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

Implements v8::internal::HashTableKey.

Definition at line 739 of file serialize.cc.

740  {
741  return handle(string_, isolate);
742  }
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::handle(), and string_.

+ Here is the call graph for this function:

◆ Hash()

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

Implements v8::internal::HashTableKey.

Definition at line 733 of file serialize.cc.

733 { return hash_; }

References hash_.

◆ HashForObject()

virtual uint32_t v8::internal::StringTableInsertionKey::HashForObject ( Object key)
inlinevirtual

Implements v8::internal::HashTableKey.

Definition at line 735 of file serialize.cc.

735  {
736  return String::cast(key)->Hash();
737  }

Referenced by IsMatch().

+ Here is the caller graph for this function:

◆ IsMatch()

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

Implements v8::internal::HashTableKey.

Definition at line 725 of file serialize.cc.

725  {
726  // We know that all entries in a hash table had their hash keys created.
727  // Use that knowledge to have fast failure.
728  if (hash_ != HashForObject(string)) return false;
729  // We want to compare the content of two internalized strings here.
730  return string_->SlowEquals(String::cast(string));
731  }
bool SlowEquals(String *other)
Definition: objects.cc:8671

References hash_, HashForObject(), v8::internal::String::SlowEquals(), and string_.

+ Here is the call graph for this function:

Member Data Documentation

◆ hash_

uint32_t v8::internal::StringTableInsertionKey::hash_

Definition at line 745 of file serialize.cc.

Referenced by Hash(), and IsMatch().

◆ string_

String* v8::internal::StringTableInsertionKey::string_

Definition at line 744 of file serialize.cc.

Referenced by AsHandle(), and IsMatch().


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