Bug 1627618 - Part 17: Remove MBinaryBitwiseInstruction which handles non-number specialisations. r=jandem
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 07 Apr 2020 08:41:47 +0000
changeset 522645 e3738b70e2704d8186cc3da20e8948d0250fb098
parent 522644 1d50b0cf715856e5e86535040bbf8cf883c01920
child 522646 7a74700f4e86e4d61f2d2045f968002afacb62d4
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 17: Remove MBinaryBitwiseInstruction which handles non-number specialisations. r=jandem 'MBinaryBitwiseInstruction` is now only used for number specialisations, so we can remove any non-number specialisation code. Differential Revision: https://phabricator.services.mozilla.com/D69797
js/src/jit/MIR.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -4469,30 +4469,20 @@ class MBinaryBitwiseInstruction : public
   MDefinition* foldsTo(TempAllocator& alloc) override;
   MDefinition* foldUnnecessaryBitop();
   virtual MDefinition* foldIfZero(size_t operand) = 0;
   virtual MDefinition* foldIfNegOne(size_t operand) = 0;
   virtual MDefinition* foldIfEqual() = 0;
   virtual MDefinition* foldIfAllBitsSet(size_t operand) = 0;
   void collectRangeInfoPreTrunc() override;
 
-  void setInt32Specialization() {
-    specialization_ = MIRType::Int32;
-    setResultType(MIRType::Int32);
-  }
-
   bool congruentTo(const MDefinition* ins) const override {
     return binaryCongruentTo(ins);
   }
-  AliasSet getAliasSet() const override {
-    if (specialization_ >= MIRType::Object) {
-      return AliasSet::Store(AliasSet::Any);
-    }
-    return AliasSet::None();
-  }
+  AliasSet getAliasSet() const override { return AliasSet::None(); }
 
   TruncateKind operandTruncateKind(size_t index) const override;
 };
 
 class MBitAnd : public MBinaryBitwiseInstruction {
   MBitAnd(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryBitwiseInstruction(classOpcode, left, right, type) {
     setCommutative();
@@ -4514,19 +4504,17 @@ class MBitAnd : public MBinaryBitwiseIns
   MDefinition* foldIfAllBitsSet(size_t operand) override {
     // e.g. for uint16: x & 0xffff => x;
     return getOperand(1 - operand);
   }
   void computeRange(TempAllocator& alloc) override;
 
   MOZ_MUST_USE bool writeRecoverData(
       CompactBufferWriter& writer) const override;
-  bool canRecoverOnBailout() const override {
-    return specialization_ != MIRType::None;
-  }
+  bool canRecoverOnBailout() const override { return true; }
 
   ALLOW_CLONE(MBitAnd)
 };
 
 class MBitOr : public MBinaryBitwiseInstruction {
   MBitOr(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryBitwiseInstruction(classOpcode, left, right, type) {
     setCommutative();
@@ -4545,19 +4533,17 @@ class MBitOr : public MBinaryBitwiseInst
   }
   MDefinition* foldIfEqual() override {
     return getOperand(0);  // x | x => x
   }
   MDefinition* foldIfAllBitsSet(size_t operand) override { return this; }
   void computeRange(TempAllocator& alloc) override;
   MOZ_MUST_USE bool writeRecoverData(
       CompactBufferWriter& writer) const override;
-  bool canRecoverOnBailout() const override {
-    return specialization_ != MIRType::None;
-  }
+  bool canRecoverOnBailout() const override { return true; }
 
   ALLOW_CLONE(MBitOr)
 };
 
 class MBitXor : public MBinaryBitwiseInstruction {
   MBitXor(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryBitwiseInstruction(classOpcode, left, right, type) {
     setCommutative();
@@ -4572,19 +4558,17 @@ class MBitXor : public MBinaryBitwiseIns
   }
   MDefinition* foldIfNegOne(size_t operand) override { return this; }
   MDefinition* foldIfEqual() override { return this; }
   MDefinition* foldIfAllBitsSet(size_t operand) override { return this; }
   void computeRange(TempAllocator& alloc) override;
 
   MOZ_MUST_USE bool writeRecoverData(
       CompactBufferWriter& writer) const override;
-  bool canRecoverOnBailout() const override {
-    return specialization_ < MIRType::Object;
-  }
+  bool canRecoverOnBailout() const override { return true; }
 
   ALLOW_CLONE(MBitXor)
 };
 
 class MShiftInstruction : public MBinaryBitwiseInstruction {
  protected:
   MShiftInstruction(Opcode op, MDefinition* left, MDefinition* right,
                     MIRType type)
@@ -4608,19 +4592,17 @@ class MLsh : public MShiftInstruction {
     // 0 << x => 0
     // x << 0 => x
     return getOperand(0);
   }
 
   void computeRange(TempAllocator& alloc) override;
   MOZ_MUST_USE bool writeRecoverData(
       CompactBufferWriter& writer) const override;
-  bool canRecoverOnBailout() const override {
-    return specialization_ != MIRType::None;
-  }
+  bool canRecoverOnBailout() const override { return true; }
 
   ALLOW_CLONE(MLsh)
 };
 
 class MRsh : public MShiftInstruction {
   MRsh(MDefinition* left, MDefinition* right, MIRType type)
       : MShiftInstruction(classOpcode, left, right, type) {}
 
@@ -4632,19 +4614,17 @@ class MRsh : public MShiftInstruction {
     // 0 >> x => 0
     // x >> 0 => x
     return getOperand(0);
   }
   void computeRange(TempAllocator& alloc) override;
 
   MOZ_MUST_USE bool writeRecoverData(
       CompactBufferWriter& writer) const override;
-  bool canRecoverOnBailout() const override {
-    return specialization_ < MIRType::Object;
-  }
+  bool canRecoverOnBailout() const override { return true; }
 
   MDefinition* foldsTo(TempAllocator& alloc) override;
 
   ALLOW_CLONE(MRsh)
 };
 
 class MUrsh : public MShiftInstruction {
   bool bailoutsDisabled_;
@@ -4673,19 +4653,17 @@ class MUrsh : public MShiftInstruction {
 
   bool fallible() const;
 
   void computeRange(TempAllocator& alloc) override;
   void collectRangeInfoPreTrunc() override;
 
   MOZ_MUST_USE bool writeRecoverData(
       CompactBufferWriter& writer) const override;
-  bool canRecoverOnBailout() const override {
-    return specialization_ < MIRType::Object;
-  }
+  bool canRecoverOnBailout() const override { return true; }
 
   ALLOW_CLONE(MUrsh)
 };
 
 class MSignExtendInt32 : public MUnaryInstruction, public NoTypePolicy::Data {
  public:
   enum Mode { Byte, Half };