Commit 9c04ff91 authored by Iain Ireland's avatar Iain Ireland
Browse files

Bug 1686702: Fold to MToNumberInt32 r=jandem

Depends on D101825

Differential Revision: https://phabricator.services.mozilla.com/D101857
parent a4c4772b
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
for (var j = 0; j < 100; j++) {
    +(Math.fround(1) && 0);
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -1703,6 +1703,13 @@ MDefinition* MUnbox::foldsTo(TempAllocator& alloc) {


      return MToDouble::New(alloc, unboxed);
      return MToDouble::New(alloc, unboxed);
    }
    }

    // MUnbox<Int32>(MBox<Double>(x)) will always fail, even if x can be
    // represented as an Int32. Fold to avoid unnecessary bailouts.
    if (type() == MIRType::Int32 && unboxed->type() == MIRType::Double) {
      return MToNumberInt32::New(alloc, unboxed,
                                 IntConversionInputKind::NumbersOnly);
    }
  }
  }


  return this;
  return this;