Reviewers: Yang,
Message:
PTAL
Description:
Handlify RegExpKey.
This fixed mjsunit/unicode-case-overoptimization after r20578.
BUG=
Please review this at https://codereview.chromium.org/228483004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+5, -5 lines):
M src/objects.cc
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
62502aff3a29b93192c27635d60fed1672a7e390..98a7237dead7f0d44923c5c74b4cd483023f15f6
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13831,7 +13831,7 @@ class StringSharedKey : public HashTableKey {
// RegExpKey carries the source and flags of a regular expression as key.
class RegExpKey : public HashTableKey {
public:
- RegExpKey(String* string, JSRegExp::Flags flags)
+ RegExpKey(Handle<String> string, JSRegExp::Flags flags)
: string_(string),
flags_(Smi::FromInt(flags.value())) { }
@@ -13845,7 +13845,7 @@ class RegExpKey : public HashTableKey {
&& (flags_ == val->get(JSRegExp::kFlagsIndex));
}
- uint32_t Hash() { return RegExpHash(string_, flags_); }
+ uint32_t Hash() { return RegExpHash(*string_, flags_); }
Object* AsObject(Heap* heap) {
// Plain hash maps, which is where regexp keys are used, don't
@@ -13864,7 +13864,7 @@ class RegExpKey : public HashTableKey {
return string->Hash() + flags->value();
}
- String* string_;
+ Handle<String> string_;
Smi* flags_;
};
@@ -15048,7 +15048,7 @@ Handle<Object>
CompilationCacheTable::LookupRegExp(Handle<String> src,
JSRegExp::Flags flags) {
Isolate* isolate = GetIsolate();
DisallowHeapAllocation no_allocation;
- RegExpKey key(*src, flags);
+ RegExpKey key(src, flags);
int entry = FindEntry(&key);
if (entry == kNotFound) return isolate->factory()->undefined_value();
return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
@@ -15092,7 +15092,7 @@ Handle<CompilationCacheTable>
CompilationCacheTable::PutEval(
Handle<CompilationCacheTable> CompilationCacheTable::PutRegExp(
Handle<CompilationCacheTable> cache, Handle<String> src,
JSRegExp::Flags flags, Handle<FixedArray> value) {
- RegExpKey key(*src, flags);
+ RegExpKey key(src, flags);
cache = EnsureCapacityFor(cache, 1, &key);
int entry = cache->FindInsertionEntry(key.Hash());
// We store the value in the key slot, and compare the search key
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.