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

Public Member Functions

 StringsKey (Handle< FixedArray > strings)
 
bool IsMatch (Object *strings) OVERRIDE
 
uint32_t Hash () OVERRIDE
 
uint32_t HashForObject (Object *obj) OVERRIDE
 
Handle< ObjectAsHandle (Isolate *isolate) OVERRIDE
 
- Public Member Functions inherited from v8::internal::HashTableKey
virtual ~HashTableKey ()
 

Private Attributes

Handle< FixedArraystrings_
 

Detailed Description

Definition at line 14843 of file objects.cc.

Constructor & Destructor Documentation

◆ StringsKey()

v8::internal::StringsKey::StringsKey ( Handle< FixedArray strings)
inlineexplicit

Definition at line 14845 of file objects.cc.

14845 : strings_(strings) { }
Handle< FixedArray > strings_
Definition: objects.cc:14872

Member Function Documentation

◆ AsHandle()

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

Implements v8::internal::HashTableKey.

Definition at line 14869 of file objects.cc.

14869 { return strings_; }

◆ Hash()

uint32_t v8::internal::StringsKey::Hash ( )
inlinevirtual

Implements v8::internal::HashTableKey.

Definition at line 14857 of file objects.cc.

14857 { return HashForObject(*strings_); }
uint32_t HashForObject(Object *obj) OVERRIDE
Definition: objects.cc:14859

Referenced by v8::internal::MapCache::Put().

+ Here is the caller graph for this function:

◆ HashForObject()

uint32_t v8::internal::StringsKey::HashForObject ( Object obj)
inlinevirtual

Implements v8::internal::HashTableKey.

Definition at line 14859 of file objects.cc.

14859  {
14860  FixedArray* strings = FixedArray::cast(obj);
14861  int len = strings->length();
14862  uint32_t hash = 0;
14863  for (int i = 0; i < len; i++) {
14864  hash ^= String::cast(strings->get(i))->Hash();
14865  }
14866  return hash;
14867  }

References v8::internal::FixedArray::get(), and v8::internal::FixedArrayBase::length().

+ Here is the call graph for this function:

◆ IsMatch()

bool v8::internal::StringsKey::IsMatch ( Object strings)
inlinevirtual

Implements v8::internal::HashTableKey.

Definition at line 14847 of file objects.cc.

14847  {
14848  FixedArray* o = FixedArray::cast(strings);
14849  int len = strings_->length();
14850  if (o->length() != len) return false;
14851  for (int i = 0; i < len; i++) {
14852  if (o->get(i) != strings_->get(i)) return false;
14853  }
14854  return true;
14855  }

References v8::internal::FixedArray::get(), and v8::internal::FixedArrayBase::length().

+ Here is the call graph for this function:

Member Data Documentation

◆ strings_

Handle<FixedArray> v8::internal::StringsKey::strings_
private

Definition at line 14872 of file objects.cc.


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