From 18452c67d007b1459d06a3050d4c8caa76db9e2d Mon Sep 17 00:00:00 2001 From: Marty Rosenberg Date: Thu, 10 Jan 2013 20:21:26 -0500 Subject: [PATCH] When merging add nodes, a truncated node and an untraced node should be untruncated (fix oranges, no bug, r=dvander) --- js/src/ion/MIR.cpp | 12 +++++++++--- js/src/ion/MIR.h | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index b27e0fb925e..888b29e4154 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -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; } diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index fa271ba2c3c..f3ca7bc6b1d 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -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;