Commit f9398f46 authored by verwaest's avatar verwaest Committed by Commit bot

Flatten strings before internalization

BUG=chromium:592707
LOG=n

Review URL: https://codereview.chromium.org/1775913002

Cr-Commit-Position: refs/heads/master@{#34584}
parent 232cd81a
...@@ -17087,7 +17087,7 @@ bool SeqOneByteSubStringKey::IsMatch(Object* string) { ...@@ -17087,7 +17087,7 @@ bool SeqOneByteSubStringKey::IsMatch(Object* string) {
class InternalizedStringKey : public HashTableKey { class InternalizedStringKey : public HashTableKey {
public: public:
explicit InternalizedStringKey(Handle<String> string) explicit InternalizedStringKey(Handle<String> string)
: string_(string) { } : string_(String::Flatten(string)) {}
bool IsMatch(Object* string) override { bool IsMatch(Object* string) override {
return String::cast(string)->Equals(*string_); return String::cast(string)->Equals(*string_);
...@@ -17949,7 +17949,7 @@ void StringTable::EnsureCapacityForDeserialization(Isolate* isolate, ...@@ -17949,7 +17949,7 @@ void StringTable::EnsureCapacityForDeserialization(Isolate* isolate,
int expected) { int expected) {
Handle<StringTable> table = isolate->factory()->string_table(); Handle<StringTable> table = isolate->factory()->string_table();
// We need a key instance for the virtual hash function. // 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); table = StringTable::EnsureCapacity(table, expected, &dummy_key);
isolate->heap()->SetRootStringTable(*table); isolate->heap()->SetRootStringTable(*table);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment