chore: cherry-pick 45eb42cd398e from v8 (#47356)

* chore: cherry-pick 45eb42cd398e from v8

* chore: update patches
This commit is contained in:
Keeley Hammond
2025-06-04 17:46:54 +02:00
committed by GitHub
parent 2fb2cc030d
commit c382d4c875
2 changed files with 33 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
chore_allow_customizing_microtask_policy_per_context.patch
cherry-pick-7bc0a67ebfbf.patch
cherry-pick-45eb42cd398e.patch

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Igor Sheludko <ishell@chromium.org>
Date: Tue, 27 May 2025 21:34:45 +0200
Subject: 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 <nicohartmann@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#100538}
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index a05b47e602e9707c17ba0ddcc9cfc071b95db168..116dcb6ce9a10e8fd3c681292ceaa2894db55052 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -1394,7 +1394,12 @@ Node* RepresentationChanger::GetWord64RepresentationFor(
}
} else if (output_rep == MachineRepresentation::kTaggedSigned) {
if (output_type.Is(Type::SignedSmall())) {
- op = simplified()->ChangeTaggedSignedToInt64();
+ if (output_type.IsRange() && output_type.AsRange()->Min() >= 0) {
+ node = InsertChangeTaggedSignedToInt32(node);
+ op = machine()->ChangeUint32ToUint64();
+ } else {
+ op = simplified()->ChangeTaggedSignedToInt64();
+ }
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kWord64);