Skip to content

Commit 45eb42c

Browse files
isheludkoV8 LUCI CQ
authored andcommitted
[turbofan] Convert Smi to Word64 using zero extension
... when a known type range contains only positive values. Bug: 420637585 Change-Id: I8d9bb3f2fe2e5268e1659bb4ea7bbf97bfb52288 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6594731 Reviewed-by: Nico Hartmann <[email protected]> Commit-Queue: Igor Sheludko <[email protected]> Cr-Commit-Position: refs/heads/main@{#100538}
1 parent fa169a6 commit 45eb42c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/compiler/representation-change.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,12 @@ Node* RepresentationChanger::GetWord64RepresentationFor(
13941394
}
13951395
} else if (output_rep == MachineRepresentation::kTaggedSigned) {
13961396
if (output_type.Is(Type::SignedSmall())) {
1397-
op = simplified()->ChangeTaggedSignedToInt64();
1397+
if (output_type.IsRange() && output_type.AsRange()->Min() >= 0) {
1398+
node = InsertChangeTaggedSignedToInt32(node);
1399+
op = machine()->ChangeUint32ToUint64();
1400+
} else {
1401+
op = simplified()->ChangeTaggedSignedToInt64();
1402+
}
13981403
} else {
13991404
return TypeError(node, output_rep, output_type,
14001405
MachineRepresentation::kWord64);

0 commit comments

Comments
 (0)