Reviewers: Vyacheslav Egorov, danno, Paul Lind, kisg,

Description:
MIPS: Skip canonicalization check in LStoreKeyedFastDoubleElement when it is not
needed

Port r11278 (e5dc7ebd).

Original commit message:

Skip canonicalization check in LStoreKeyedFastDoubleElement when it is not
needed:

- if value is a result of integer32 to double conversion (can't be NaN);

- if value was loaded from fast double backing store (already canonicalized).

BUG=
TEST=


Please review this at http://codereview.chromium.org/10071004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/mips/lithium-codegen-mips.cc
  M src/mips/lithium-mips.h


Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 34bdef069ef33b867dd822a8ee017d3c5af6bbdf..14a56c9d3cc3118ffbdc188ebdbeff5d6960c8e5 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -3546,14 +3546,16 @@ void LCodeGen::DoStoreKeyedFastDoubleElement(
             Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag));
   }

-  Label is_nan;
-  // Check for NaN. All NaNs must be canonicalized.
-  __ BranchF(NULL, &is_nan, eq, value, value);
-  __ Branch(&not_nan);
-
-  // Only load canonical NaN if the comparison above set the overflow.
-  __ bind(&is_nan);
-  __ Move(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double());
+  if (instr->NeedsCanonicalization()) {
+    Label is_nan;
+    // Check for NaN. All NaNs must be canonicalized.
+    __ BranchF(NULL, &is_nan, eq, value, value);
+    __ Branch(&not_nan);
+
+    // Only load canonical NaN if the comparison above set the overflow.
+    __ bind(&is_nan);
+ __ Move(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double());
+  }

   __ bind(&not_nan);
   __ sdc1(value, MemOperand(scratch));
Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index 46e9eaff742e52ab046c85d4e11f57796086c5f1..41296e4f5b23f154da5db9187b76d46d1d5cee25 100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -1732,6 +1732,8 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
   LOperand* elements() { return inputs_[0]; }
   LOperand* key() { return inputs_[1]; }
   LOperand* value() { return inputs_[2]; }
+
+ bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
 };




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to