Commit 71758a59 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[turbofan] Disable incorrect fast-path of String.p.codePointAt

For M65 I added a fast-path for String.p.charCodeAt, which behaves
incorrectly for wide characters. This patch disables the incorrect
fast-path. This is likely no performance regression against M64,
as M64 did not have a fast path for String.p.charCodeAt.

Bug: v8:7371
Change-Id: I8ea9c5da5a583138d87ccb8ffe6d61eba16630b9
Reviewed-on: https://chromium-review.googlesource.com/886782
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50873}
parent 084b0e76
......@@ -2358,19 +2358,9 @@ class RepresentationSelector {
return;
}
case IrOpcode::kStringCodePointAt: {
Type* string_type = TypeOf(node->InputAt(0));
if (string_type->Is(Type::SeqString())) {
VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
NodeProperties::ChangeOp(node,
simplified()->SeqStringCodePointAt());
}
} else {
// TODO(turbofan): Allow builtins to return untagged values.
VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineRepresentation::kTaggedSigned);
}
return;
}
case IrOpcode::kStringFromCharCode: {
......
......@@ -259,7 +259,8 @@ test(function stringCharCodeAt() {
}, 10);
test(function stringCodePointAt() {
assertSame(65533, "äϠ�".codePointAt(2));
assertSame(65533, "äϠ�𝌆".codePointAt(2));
assertSame(119558, "äϠ�𝌆".codePointAt(3));
assertSame(undefined, "äϠ�".codePointAt(-1));
assertSame(undefined, "äϠ�".codePointAt(4));
assertSame(992, "äϠ�".codePointAt(1.1));
......
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