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

Public Member Functions

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

Private Attributes

const AstRawStringstring_
 

Detailed Description

Definition at line 54 of file ast-value-factory.cc.

Constructor & Destructor Documentation

◆ AstRawStringInternalizationKey()

v8::internal::AstRawStringInternalizationKey::AstRawStringInternalizationKey ( const AstRawString string)
inlineexplicit

Definition at line 56 of file ast-value-factory.cc.

57  : string_(string) {}

Member Function Documentation

◆ AsHandle()

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

Implements v8::internal::HashTableKey.

Definition at line 74 of file ast-value-factory.cc.

74  {
75  if (string_->is_one_byte_)
76  return isolate->factory()->NewOneByteInternalizedString(
78  return isolate->factory()->NewTwoByteInternalizedString(
80  }
Vector< const byte > literal_bytes_
static Vector< T > cast(Vector< S > input)
Definition: vector.h:98

References v8::internal::AstRawString::hash(), v8::internal::AstRawString::is_one_byte_, v8::internal::AstRawString::literal_bytes_, and string_.

+ Here is the call graph for this function:

◆ Hash()

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

Implements v8::internal::HashTableKey.

Definition at line 66 of file ast-value-factory.cc.

66  {
67  return string_->hash() >> Name::kHashShift;
68  }
static const int kHashShift
Definition: objects.h:8499

References v8::internal::AstRawString::hash(), v8::internal::Name::kHashShift, and string_.

+ Here is the call graph for this function:

◆ HashForObject()

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

Implements v8::internal::HashTableKey.

Definition at line 70 of file ast-value-factory.cc.

70  {
71  return String::cast(key)->Hash();
72  }

◆ IsMatch()

virtual bool v8::internal::AstRawStringInternalizationKey::IsMatch ( Object other)
inlinevirtual

Implements v8::internal::HashTableKey.

Definition at line 59 of file ast-value-factory.cc.

59  {
60  if (string_->is_one_byte_)
61  return String::cast(other)->IsOneByteEqualTo(string_->literal_bytes_);
62  return String::cast(other)->IsTwoByteEqualTo(
64  }

References v8::internal::AstRawString::is_one_byte_, v8::internal::AstRawString::literal_bytes_, and string_.

Member Data Documentation

◆ string_

const AstRawString* v8::internal::AstRawStringInternalizationKey::string_
private

Definition at line 83 of file ast-value-factory.cc.

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


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