Index: src/compiler/x64/code-generator-x64.cc |
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
index 2105d66e4714ba709efc1c1efca36ef31625bf1a..b4d200b39d8056c9b05a83eb7a7a110a94caed0a 100644 |
--- a/src/compiler/x64/code-generator-x64.cc |
+++ b/src/compiler/x64/code-generator-x64.cc |
@@ -38,7 +38,12 @@ class X64OperandConverter : public InstructionOperandConverter { |
Operand OutputOperand() { return ToOperand(instr_->Output()); } |
Immediate ToImmediate(InstructionOperand* operand) { |
- return Immediate(ToConstant(operand).ToInt32()); |
+ Constant constant = ToConstant(operand); |
+ if (constant.type() == Constant::kFloat64) { |
+ DCHECK_EQ(0, bit_cast<int64_t>(constant.ToFloat64())); |
+ return Immediate(0); |
+ } |
+ return Immediate(constant.ToInt32()); |
} |
Operand ToOperand(InstructionOperand* op, int extra = 0) { |