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

[string] DCHECK instead of test that ThinString's actuals have same length

ThinStrings always forward to internalized strings that have the same
character contents and thus the same length.

Change-Id: I5929d266f96b23029f4786baf993a431cf4ad38d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541522Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79582}
parent ffae028b
......@@ -719,9 +719,8 @@ Address StringTable::TryStringToIndexOrLookupExisting(Isolate* isolate,
}
if (source.IsThinString()) {
source = ThinString::cast(source).actual();
if (string.length() == source.length()) {
return source.ptr();
}
DCHECK_EQ(string.length(), source.length());
return source.ptr();
}
if (source.IsOneByteRepresentation()) {
......
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