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

Public Member Functions

 RegExpKey (Handle< String > string, JSRegExp::Flags flags)
 
bool IsMatch (Object *obj) OVERRIDE
 
uint32_t Hash () OVERRIDE
 
Handle< ObjectAsHandle (Isolate *isolate) OVERRIDE
 
uint32_t HashForObject (Object *obj) OVERRIDE
 
- Public Member Functions inherited from v8::internal::HashTableKey
virtual ~HashTableKey ()
 

Static Public Member Functions

static uint32_t RegExpHash (String *string, Smi *flags)
 

Public Attributes

Handle< Stringstring_
 
Smiflags_
 

Detailed Description

Definition at line 13637 of file objects.cc.

Constructor & Destructor Documentation

◆ RegExpKey()

v8::internal::RegExpKey::RegExpKey ( Handle< String string,
JSRegExp::Flags  flags 
)
inline

Definition at line 13639 of file objects.cc.

13640  : string_(string),
13641  flags_(Smi::FromInt(flags.value())) { }
Handle< String > string_
Definition: objects.cc:13672
static Smi * FromInt(int value)
Definition: objects-inl.h:1321

Member Function Documentation

◆ AsHandle()

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

Implements v8::internal::HashTableKey.

Definition at line 13655 of file objects.cc.

13655  {
13656  // Plain hash maps, which is where regexp keys are used, don't
13657  // use this function.
13658  UNREACHABLE();
13659  return MaybeHandle<Object>().ToHandleChecked();
13660  }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

◆ Hash()

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

Implements v8::internal::HashTableKey.

Definition at line 13653 of file objects.cc.

13653 { return RegExpHash(*string_, flags_); }
static uint32_t RegExpHash(String *string, Smi *flags)
Definition: objects.cc:13668

Referenced by v8::internal::CompilationCacheTable::PutRegExp().

+ Here is the caller graph for this function:

◆ HashForObject()

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

Implements v8::internal::HashTableKey.

Definition at line 13662 of file objects.cc.

13662  {
13663  FixedArray* val = FixedArray::cast(obj);
13664  return RegExpHash(String::cast(val->get(JSRegExp::kSourceIndex)),
13665  Smi::cast(val->get(JSRegExp::kFlagsIndex)));
13666  }
static const int kFlagsIndex
Definition: objects.h:7777
static const int kSourceIndex
Definition: objects.h:7776

References v8::internal::FixedArray::get(), v8::internal::JSRegExp::kFlagsIndex, and v8::internal::JSRegExp::kSourceIndex.

+ Here is the call graph for this function:

◆ IsMatch()

bool v8::internal::RegExpKey::IsMatch ( Object obj)
inlinevirtual

Implements v8::internal::HashTableKey.

Definition at line 13647 of file objects.cc.

13647  {
13648  FixedArray* val = FixedArray::cast(obj);
13649  return string_->Equals(String::cast(val->get(JSRegExp::kSourceIndex)))
13650  && (flags_ == val->get(JSRegExp::kFlagsIndex));
13651  }

References v8::internal::FixedArray::get(), v8::internal::JSRegExp::kFlagsIndex, and v8::internal::JSRegExp::kSourceIndex.

+ Here is the call graph for this function:

◆ RegExpHash()

static uint32_t v8::internal::RegExpKey::RegExpHash ( String string,
Smi flags 
)
inlinestatic

Definition at line 13668 of file objects.cc.

13668  {
13669  return string->Hash() + flags->value();
13670  }

References v8::internal::anonymous_namespace{flags.cc}::flags.

Member Data Documentation

◆ flags_

Smi* v8::internal::RegExpKey::flags_

Definition at line 13673 of file objects.cc.

◆ string_

Handle<String> v8::internal::RegExpKey::string_

Definition at line 13672 of file objects.cc.


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