Commit 1b096975 authored by verwaest's avatar verwaest Committed by Commit bot

Install the internalized string as flattened version into cons-strings for fast re-internalization.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34585}
parent f9398f46
......@@ -17957,8 +17957,20 @@ void StringTable::EnsureCapacityForDeserialization(Isolate* isolate,
Handle<String> StringTable::LookupString(Isolate* isolate,
Handle<String> string) {
if (string->IsConsString() && string->IsFlat()) {
string = String::Flatten(string);
if (string->IsInternalizedString()) return string;
}
InternalizedStringKey key(string);
return LookupKey(isolate, &key);
Handle<String> result = LookupKey(isolate, &key);
if (string->IsConsString()) {
Handle<ConsString> cons = Handle<ConsString>::cast(string);
cons->set_first(*result);
cons->set_second(isolate->heap()->empty_string());
}
return result;
}
......
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