Flatten strings before internalization
BUG=chromium:592707 LOG=n Review URL: https://codereview.chromium.org/1775913002 Cr-Commit-Position: refs/heads/master@{#34584}
This commit is contained in:
parent
232cd81aba
commit
f9398f4672
@ -17087,7 +17087,7 @@ bool SeqOneByteSubStringKey::IsMatch(Object* string) {
|
||||
class InternalizedStringKey : public HashTableKey {
|
||||
public:
|
||||
explicit InternalizedStringKey(Handle<String> string)
|
||||
: string_(string) { }
|
||||
: string_(String::Flatten(string)) {}
|
||||
|
||||
bool IsMatch(Object* string) override {
|
||||
return String::cast(string)->Equals(*string_);
|
||||
@ -17949,7 +17949,7 @@ void StringTable::EnsureCapacityForDeserialization(Isolate* isolate,
|
||||
int expected) {
|
||||
Handle<StringTable> table = isolate->factory()->string_table();
|
||||
// We need a key instance for the virtual hash function.
|
||||
InternalizedStringKey dummy_key(Handle<String>::null());
|
||||
InternalizedStringKey dummy_key(isolate->factory()->empty_string());
|
||||
table = StringTable::EnsureCapacity(table, expected, &dummy_key);
|
||||
isolate->heap()->SetRootStringTable(*table);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user