From a540e3147168f3dc6fa7147c1e235ce5ff843937 Mon Sep 17 00:00:00 2001 From: "plind44@gmail.com" Date: Wed, 5 Feb 2014 18:58:16 +0000 Subject: [PATCH] MIPS: Avoid embedding x86 NaN constant in code when snapshot is created. Due to a different NaN representation on MIPS, the canonical nan constant embedded in generated code that comes from snapshot will differ from the one used on MIPS hardware. TEST=mozilla/ecma/Array/15.4.4.2.js BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/150663009 Patch from Dusan Milosavljevic . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/lithium-codegen-mips.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index a2df23f..b216a7d 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -4222,8 +4222,8 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { // Only load canonical NaN if the comparison above set the overflow. __ bind(&is_nan); - __ Move(double_scratch, - FixedDoubleArray::canonical_not_the_hole_nan_as_double()); + __ LoadRoot(at, Heap::kNanValueRootIndex); + __ ldc1(double_scratch, FieldMemOperand(at, HeapNumber::kValueOffset)); __ sdc1(double_scratch, MemOperand(scratch, instr->additional_index() << element_size_shift)); __ Branch(&done); -- 2.7.4