[TurboFan] Do not use NumberConstant as immediate in x86

Bug: chromium:1254189
Change-Id: I77854c767cf5c5748999fdd40a4a42e25dff3f79
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3236989
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77516}
This commit is contained in:
Nico Hartmann 2021-10-25 10:58:59 +02:00 committed by V8 LUCI CQ
parent 520dc0d3de
commit bdf31d5883

View File

@ -99,11 +99,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<double>(node->op());
return bit_cast<int64_t>(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