diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 6f16f1d4c0..57c083cc95 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -23,7 +23,8 @@ namespace internal { MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) : Assembler(arg_isolate, buffer, size), generating_stub_(false), - has_frame_(false) { + has_frame_(false), + has_double_zero_reg_set_(false) { if (isolate() != NULL) { code_object_ = Handle(isolate()->heap()->undefined_value(), isolate()); @@ -1530,10 +1531,9 @@ void MacroAssembler::Move(FPURegister dst, double imm) { static const DoubleRepresentation zero(0.0); DoubleRepresentation value_rep(imm); // Handle special values first. - bool force_load = dst.is(kDoubleRegZero); - if (value_rep == zero && !force_load) { + if (value_rep == zero && has_double_zero_reg_set_) { mov_d(dst, kDoubleRegZero); - } else if (value_rep == minus_zero && !force_load) { + } else if (value_rep == minus_zero && has_double_zero_reg_set_) { neg_d(dst, kDoubleRegZero); } else { uint32_t lo, hi; @@ -1554,6 +1554,7 @@ void MacroAssembler::Move(FPURegister dst, double imm) { } else { Mthc1(zero_reg, dst); } + if (dst.is(kDoubleRegZero)) has_double_zero_reg_set_ = true; } } diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index 62d3aa81d4..c6b00efa90 100644 --- a/src/mips/macro-assembler-mips.h +++ b/src/mips/macro-assembler-mips.h @@ -1665,6 +1665,7 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT bool generating_stub_; bool has_frame_; + bool has_double_zero_reg_set_; // This handle will be patched with the code object on installation. Handle code_object_;