Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 796e61d6717e35825682ca705a8ad138742e61e9..010b8aa94196b63816124aa7c0a4024e8813d83d 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -3816,6 +3816,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
void LCodeGen::EmitNumberUntagD(Register input_reg, |
DoubleRegister result_reg, |
bool deoptimize_on_undefined, |
+ bool deoptimize_on_minus_zero, |
LEnvironment* env) { |
Register scratch = scratch0(); |
@@ -3845,6 +3846,12 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
} |
// Heap number to double register conversion. |
__ ldc1(result_reg, FieldMemOperand(input_reg, HeapNumber::kValueOffset)); |
+ if (deoptimize_on_minus_zero) { |
+ __ mfc1(at, result_reg.low()); |
+ __ Branch(&done, ne, at, Operand(zero_reg)); |
+ __ mfc1(scratch, result_reg.high()); |
+ DeoptimizeIf(eq, env, scratch, Operand(HeapNumber::kSignMask)); |
+ } |
__ Branch(&done); |
// Smi to double register conversion |
@@ -3976,6 +3983,7 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
EmitNumberUntagD(input_reg, result_reg, |
instr->hydrogen()->deoptimize_on_undefined(), |
+ instr->hydrogen()->deoptimize_on_minus_zero(), |
instr->environment()); |
} |