When merging add nodes, a truncated node and an untraced node should be untruncated (fix oranges, no bug, r=dvander)

This commit is contained in:
Marty Rosenberg 2013-01-10 20:21:26 -05:00
parent f0d9ffca37
commit e5fca8ca12
2 changed files with 11 additions and 5 deletions

View File

@ -829,8 +829,10 @@ MDiv::updateForReplacement(MDefinition *ins_)
MDiv *ins = ins_->toDiv();
// Since EdgeCaseAnalysis is not being run before GVN, its information does
// not need to be merged here.
if (isTruncated())
if (isTruncated() && ins->isTruncated())
setTruncated(Max(isTruncated(), ins->isTruncated()));
else
setTruncated(0);
return true;
}
@ -866,8 +868,10 @@ MAdd::updateForReplacement(MDefinition *ins_)
{
JS_ASSERT(ins_->isAdd());
MAdd *ins = ins_->toAdd();
if (isTruncated())
if (isTruncated() && ins->isTruncated())
setTruncated(Max(isTruncated(), ins->isTruncated()));
else
setTruncated(0);
return true;
}
@ -896,8 +900,10 @@ MSub::updateForReplacement(MDefinition *ins_)
{
JS_ASSERT(ins_->isSub());
MSub *ins = ins_->toSub();
if (isTruncated())
if (isTruncated() && ins->isTruncated())
setTruncated(Max(isTruncated(), ins->isTruncated()));
else
setTruncated(0);
return true;
}

View File

@ -2595,7 +2595,7 @@ class MSub : public MBinaryArithInstruction
int implicitTruncate_;
MSub(MDefinition *left, MDefinition *right)
: MBinaryArithInstruction(left, right),
implicitTruncate_(false)
implicitTruncate_(0)
{
setResultType(MIRType_Value);
}
@ -2732,7 +2732,7 @@ class MDiv : public MBinaryArithInstruction
canBeNegativeZero_(true),
canBeNegativeOverflow_(true),
canBeDivideByZero_(true),
implicitTruncate_(false)
implicitTruncate_(0)
{
if (type != MIRType_Value)
specialization_ = type;