From daa220f84e4b5cb607bd6710ec0e87192b3aeca6 Mon Sep 17 00:00:00 2001 From: Pedro Pontes Date: Wed, 24 Nov 2021 21:53:18 +0100 Subject: [PATCH] chore: cherry-pick 5d2b5e7c006c from v8 (#31912) * chore: cherry-pick 5d2b5e7c006c from v8 * chore: update patches Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> --- patches/v8/.patches | 1 + patches/v8/cherry-pick-5d2b5e7c006c.patch | 39 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 patches/v8/cherry-pick-5d2b5e7c006c.patch diff --git a/patches/v8/.patches b/patches/v8/.patches index d2c28be29fb92..245e6313305af 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -21,3 +21,4 @@ cherry-pick-6de4e210688e.patch merged_cppgc_fix_marking_of_ephemerons_with_keys_in_construction.patch cherry-pick-feef10137b16.patch cherry-pick-014e1f857c33.patch +cherry-pick-5d2b5e7c006c.patch diff --git a/patches/v8/cherry-pick-5d2b5e7c006c.patch b/patches/v8/cherry-pick-5d2b5e7c006c.patch new file mode 100644 index 0000000000000..2cfcf5f5e598a --- /dev/null +++ b/patches/v8/cherry-pick-5d2b5e7c006c.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nico Hartmann +Date: Mon, 25 Oct 2021 10:58:59 +0200 +Subject: Merged: [TurboFan] Do not use NumberConstant as immediate in x86 + +Bug: chromium:1254189 +(cherry picked from commit bdf31d5883607db4377b519d7308fb1e639a0448) + +Change-Id: I1d4426fee8392c7a680ad67af4bf2745d04b2e52 +No-Try: true +No-Presubmit: true +No-Tree-Checks: true +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3268905 +Commit-Queue: Nico Hartmann +Reviewed-by: Maya Lekova +Cr-Commit-Position: refs/branch-heads/9.6@{#22} +Cr-Branched-From: 0b7bda016178bf438f09b3c93da572ae3663a1f7-refs/heads/9.6.180@{#1} +Cr-Branched-From: 41a5a247d9430b953e38631e88d17790306f7a4c-refs/heads/main@{#77244} + +diff --git a/src/compiler/backend/ia32/instruction-selector-ia32.cc b/src/compiler/backend/ia32/instruction-selector-ia32.cc +index 033a566e1138fd366a33d76b30a4b12cbcde78f2..573e720a982bdfd5767f1f5c3776db178e13e633 100644 +--- a/src/compiler/backend/ia32/instruction-selector-ia32.cc ++++ b/src/compiler/backend/ia32/instruction-selector-ia32.cc +@@ -98,11 +98,14 @@ class IA32OperandGenerator final : public OperandGenerator { + bool CanBeImmediate(Node* node) { + switch (node->opcode()) { + case IrOpcode::kInt32Constant: +- case IrOpcode::kNumberConstant: + case IrOpcode::kExternalConstant: + case IrOpcode::kRelocatableInt32Constant: + case IrOpcode::kRelocatableInt64Constant: + return true; ++ case IrOpcode::kNumberConstant: { ++ const double value = OpParameter(node->op()); ++ return bit_cast(value) == 0; ++ } + case IrOpcode::kHeapConstant: { + // TODO(bmeurer): We must not dereference handles concurrently. If we + // really have to this here, then we need to find a way to put this