Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 37827033a8c66f317f40854928964963413d8934..c20069f2d931feee4615ddcb81083433ae10f2c1 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -17232,6 +17232,16 @@ Handle<String> StringTable::LookupString(Isolate* isolate, |
Handle<ConsString> cons = Handle<ConsString>::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> map = one_byte ? isolate->factory()->cons_one_byte_string_map() |
+ : isolate->factory()->cons_string_map(); |
+ string->set_map(*map); |
+ Handle<ConsString> cons = Handle<ConsString>::cast(string); |
+ cons->set_first(*result); |
+ cons->set_second(isolate->heap()->empty_string()); |
} |
return result; |
} |