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
This commit is contained in:
vegorov@chromium.org 2012-04-18 10:42:30 +00:00
parent b635c90792
commit bf2bc0b1db
2 changed files with 11 additions and 7 deletions

View File

@ -3567,14 +3567,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);
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());
// 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));

View File

@ -1733,6 +1733,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(); }
};