Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 82134b45c1b2b8252b2cc906719b3a06a3a91cc8..ec63d8460b0dc63a660189babc68564acaa77731 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -4431,18 +4431,14 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
} |
if (instr->NeedsCanonicalization()) { |
- // Check for NaN. All NaNs must be canonicalized. |
- __ VFPCompareAndSetFlags(value, value); |
- Label after_canonicalization; |
- |
- // Only load canonical NaN if the comparison above set the overflow. |
- __ b(vc, &after_canonicalization); |
- __ Vmov(value, |
- FixedDoubleArray::canonical_not_the_hole_nan_as_double()); |
- |
- __ bind(&after_canonicalization); |
+ // Force a canonical NaN. |
+ if (masm()->emit_debug_code()) { |
+ __ vmrs(ip); |
+ __ tst(ip, Operand(kVFPDefaultNaNModeControlBit)); |
+ __ Assert(ne, "Default NaN mode not set"); |
+ } |
+ __ VFPCanonicalizeNaN(value); |
} |
- |
__ vstr(value, scratch, instr->additional_index() << element_size_shift); |
} |
@@ -4864,16 +4860,13 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
DwVfpRegister input_reg = ToDoubleRegister(instr->value()); |
__ VFPCompareAndSetFlags(input_reg, input_reg); |
__ b(vc, &no_special_nan_handling); |
- __ vmov(reg, scratch0(), input_reg); |
- __ cmp(scratch0(), Operand(kHoleNanUpper32)); |
- Label canonicalize; |
- __ b(ne, &canonicalize); |
+ __ vmov(scratch, input_reg.high()); |
+ __ cmp(scratch, Operand(kHoleNanUpper32)); |
+ // If not the hole NaN, force the NaN to be canonical. |
+ __ VFPCanonicalizeNaN(input_reg, ne); |
+ __ b(ne, &no_special_nan_handling); |
__ Move(reg, factory()->the_hole_value()); |
__ b(&done); |
- __ bind(&canonicalize); |
- __ Vmov(input_reg, |
- FixedDoubleArray::canonical_not_the_hole_nan_as_double(), |
- no_reg); |
} |
__ bind(&no_special_nan_handling); |