Commit bcf43eb7 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

[string] Add additional ThinString test

Add a test for the case where SlicedStrings of ThinStrings are looked up
in the string table, testing the path that the original string's length
differs from the actual string's length.

Bug: chromium:1309767
Change-Id: I909c64397bf28ec33c3324d94882fbfe81ac4109
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3549837Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79610}
parent c7ce7c7c
......@@ -94,3 +94,18 @@ cc2(t);
cc2(t);
%OptimizeFunctionOnNextCall(cc2);
cc2(t);
function string_table_lookup_sliced_thin_string(a, b) {
// Make a ConsString.
var s = a + b;
// Slice a substring out of it.
var slice = s.substring(0, 20);
// Make the original string thin.
var o = {};
o[s];
// Try to internalize the SlicedString.
o[slice];
}
string_table_lookup_sliced_thin_string(
'abcdefghijklmnopqrstuvwxyz', '0123456789');
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