Bug 1627618 - Part 6: Remove no longer used MBinaryArithInstruction sub-class constructors without a specialisation type. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 07 Apr 2020 08:37:30 +0000
changeset 522634 45396902c72426c9f4cd35e055c8e4c517aff45b
parent 522633 fba058bb22041241369a9fbf8273c2a067bac7ab
child 522635 f37a78d235334c76a30bfb208f79646bc434027e
push id37293
push userapavel@mozilla.com
push dateTue, 07 Apr 2020 21:44:02 +0000
treeherdermozilla-central@de63e64b9090 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1627618
milestone77.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1627618 - Part 6: Remove no longer used MBinaryArithInstruction sub-class constructors without a specialisation type. r=jandem `MAdd`, `MSub`, `MMul`, `MDiv`, and `MMod` are no longer called without a number specialisation, so we can remove these constructors. Differential Revision: https://phabricator.services.mozilla.com/D69785
js/src/jit/MIR.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -5347,23 +5347,18 @@ class MMathFunction : public MUnaryInstr
         return false;
     }
   }
 
   ALLOW_CLONE(MMathFunction)
 };
 
 class MAdd : public MBinaryArithInstruction {
-  MAdd(MDefinition* left, MDefinition* right)
+  MAdd(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryArithInstruction(classOpcode, left, right) {
-    setResultType(MIRType::Value);
-  }
-
-  MAdd(MDefinition* left, MDefinition* right, MIRType type)
-      : MAdd(left, right) {
     specialization_ = type;
     setResultType(type);
   }
 
   MAdd(MDefinition* left, MDefinition* right, TruncateKind truncateKind)
       : MAdd(left, right, MIRType::Int32) {
     setTruncateKind(truncateKind);
     setCommutative();
@@ -5398,23 +5393,18 @@ class MAdd : public MBinaryArithInstruct
   bool canRecoverOnBailout() const override {
     return specialization_ < MIRType::Object;
   }
 
   ALLOW_CLONE(MAdd)
 };
 
 class MSub : public MBinaryArithInstruction {
-  MSub(MDefinition* left, MDefinition* right)
+  MSub(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryArithInstruction(classOpcode, left, right) {
-    setResultType(MIRType::Value);
-  }
-
-  MSub(MDefinition* left, MDefinition* right, MIRType type)
-      : MSub(left, right) {
     specialization_ = type;
     setResultType(type);
   }
 
  public:
   INSTRUCTION_HEADER(Sub)
   TRIVIAL_NEW_WRAPPERS
 
@@ -5466,28 +5456,23 @@ class MMul : public MBinaryArithInstruct
       // This implements the required behavior for Math.imul, which
       // can never fail and always truncates its output to int32.
       canBeNegativeZero_ = false;
       setTruncateKind(Truncate);
       setCommutative();
     }
     MOZ_ASSERT_IF(mode != Integer, mode == Normal);
 
-    if (type != MIRType::Value) {
-      specialization_ = type;
-    }
+    specialization_ = type;
     setResultType(type);
   }
 
  public:
   INSTRUCTION_HEADER(Mul)
-  static MMul* New(TempAllocator& alloc, MDefinition* left,
-                   MDefinition* right) {
-    return new (alloc) MMul(left, right, MIRType::Value, MMul::Normal);
-  }
+
   static MMul* New(TempAllocator& alloc, MDefinition* left, MDefinition* right,
                    MIRType type, Mode mode = Normal) {
     return new (alloc) MMul(left, right, type, mode);
   }
   static MMul* NewWasm(TempAllocator& alloc, MDefinition* left,
                        MDefinition* right, MIRType type, Mode mode,
                        bool mustPreserveNaN) {
     auto* ret = new (alloc) MMul(left, right, type, mode);
@@ -5566,28 +5551,23 @@ class MDiv : public MBinaryArithInstruct
   MDiv(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryArithInstruction(classOpcode, left, right),
         canBeNegativeZero_(true),
         canBeNegativeOverflow_(true),
         canBeDivideByZero_(true),
         canBeNegativeDividend_(true),
         unsigned_(false),
         trapOnError_(false) {
-    if (type != MIRType::Value) {
-      specialization_ = type;
-    }
+    specialization_ = type;
     setResultType(type);
   }
 
  public:
   INSTRUCTION_HEADER(Div)
-  static MDiv* New(TempAllocator& alloc, MDefinition* left,
-                   MDefinition* right) {
-    return new (alloc) MDiv(left, right, MIRType::Value);
-  }
+
   static MDiv* New(TempAllocator& alloc, MDefinition* left, MDefinition* right,
                    MIRType type) {
     return new (alloc) MDiv(left, right, type);
   }
   static MDiv* New(TempAllocator& alloc, MDefinition* left, MDefinition* right,
                    MIRType type, bool unsignd, bool trapOnError = false,
                    wasm::BytecodeOffset bytecodeOffset = wasm::BytecodeOffset(),
                    bool mustPreserveNaN = false) {
@@ -5693,28 +5673,23 @@ class MMod : public MBinaryArithInstruct
 
   MMod(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryArithInstruction(classOpcode, left, right),
         unsigned_(false),
         canBeNegativeDividend_(true),
         canBePowerOfTwoDivisor_(true),
         canBeDivideByZero_(true),
         trapOnError_(false) {
-    if (type != MIRType::Value) {
-      specialization_ = type;
-    }
+    specialization_ = type;
     setResultType(type);
   }
 
  public:
   INSTRUCTION_HEADER(Mod)
-  static MMod* New(TempAllocator& alloc, MDefinition* left,
-                   MDefinition* right) {
-    return new (alloc) MMod(left, right, MIRType::Value);
-  }
+
   static MMod* New(TempAllocator& alloc, MDefinition* left, MDefinition* right,
                    MIRType type) {
     return new (alloc) MMod(left, right, type);
   }
   static MMod* New(
       TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type,
       bool unsignd, bool trapOnError = false,
       wasm::BytecodeOffset bytecodeOffset = wasm::BytecodeOffset()) {