[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: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50873}
This commit is contained in:
Sigurd Schneider 2018-01-25 17:54:58 +01:00 committed by Commit Bot
parent 084b0e763e
commit 71758a597e
2 changed files with 5 additions and 14 deletions

View File

@ -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);
}
// TODO(turbofan): Allow builtins to return untagged values.
VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineRepresentation::kTaggedSigned);
return;
}
case IrOpcode::kStringFromCharCode: {

View File

@ -259,7 +259,8 @@ test(function stringCharCodeAt() {
}, 10);
test(function stringCodePointAt() {
assertSame(65533, "äϠ<C3A4>".codePointAt(2));
assertSame(65533, "äϠ<C3A4>𝌆".codePointAt(2));
assertSame(119558, "äϠ<C3A4>𝌆".codePointAt(3));
assertSame(undefined, "äϠ<C3A4>".codePointAt(-1));
assertSame(undefined, "äϠ<C3A4>".codePointAt(4));
assertSame(992, "äϠ<C3A4>".codePointAt(1.1));