diff --git a/src/objects.cc b/src/objects.cc index 37827033a8..c20069f2d9 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -17232,6 +17232,16 @@ Handle StringTable::LookupString(Isolate* isolate, Handle cons = Handle::cast(string); cons->set_first(*result); cons->set_second(isolate->heap()->empty_string()); + } else if (string->IsSlicedString()) { + STATIC_ASSERT(ConsString::kSize == SlicedString::kSize); + DisallowHeapAllocation no_gc; + bool one_byte = result->IsOneByteRepresentation(); + Handle map = one_byte ? isolate->factory()->cons_one_byte_string_map() + : isolate->factory()->cons_string_map(); + string->set_map(*map); + Handle cons = Handle::cast(string); + cons->set_first(*result); + cons->set_second(isolate->heap()->empty_string()); } return result; }