Commit bf2bc0b1 authored by vegorov@chromium.org's avatar vegorov@chromium.org

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=

Review URL: https://chromiumcodereview.appspot.com/10071004
Patch from Daniel Kalmar <kalmard@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b635c907
...@@ -3567,14 +3567,16 @@ void LCodeGen::DoStoreKeyedFastDoubleElement( ...@@ -3567,14 +3567,16 @@ void LCodeGen::DoStoreKeyedFastDoubleElement(
Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag));
} }
Label is_nan; if (instr->NeedsCanonicalization()) {
// Check for NaN. All NaNs must be canonicalized. Label is_nan;
__ BranchF(NULL, &is_nan, eq, value, value); // Check for NaN. All NaNs must be canonicalized.
__ Branch(&not_nan); __ BranchF(NULL, &is_nan, eq, value, value);
__ Branch(&not_nan);
// Only load canonical NaN if the comparison above set the overflow.
__ bind(&is_nan); // Only load canonical NaN if the comparison above set the overflow.
__ Move(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double()); __ bind(&is_nan);
__ Move(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double());
}
__ bind(&not_nan); __ bind(&not_nan);
__ sdc1(value, MemOperand(scratch)); __ sdc1(value, MemOperand(scratch));
......
...@@ -1733,6 +1733,8 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> { ...@@ -1733,6 +1733,8 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
LOperand* elements() { return inputs_[0]; } LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; } LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; } LOperand* value() { return inputs_[2]; }
bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment