Bug 1341951 - Use override keyword for all virtual methods of Recover Instructions. r=Waldo
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 01 Mar 2017 13:36:50 +0000
changeset 374332 109aaf987508596bea32fce8dabf671b2075b7b9
parent 374331 06b3c4468a687e83a8425cd702297b23b3c37f18
child 374333 1bcada51f54b230f9a4f6a0d41ae8695accc2d20
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1341951
milestone54.0a1
Bug 1341951 - Use override keyword for all virtual methods of Recover Instructions. r=Waldo
js/src/jit/Recover.h
--- a/js/src/jit/Recover.h
+++ b/js/src/jit/Recover.h
@@ -155,26 +155,26 @@ class MOZ_NON_PARAM RInstruction
 
 #define RINSTRUCTION_HEADER_(op)                                        \
   private:                                                              \
     friend class RInstruction;                                          \
     explicit R##op(CompactBufferReader& reader);                        \
     explicit R##op(const R##op& src) = default;                         \
                                                                         \
   public:                                                               \
-    Opcode opcode() const {                                             \
+    Opcode opcode() const override {                                    \
         return RInstruction::Recover_##op;                              \
     }                                                                   \
-    virtual void cloneInto(RInstructionStorage* raw) const {            \
+    void cloneInto(RInstructionStorage* raw) const override {           \
         new (raw->addr()) R##op(*this);                                 \
     }
 
 #define RINSTRUCTION_HEADER_NUM_OP_MAIN(op, numOp)                      \
     RINSTRUCTION_HEADER_(op)                                            \
-    virtual uint32_t numOperands() const {                              \
+    uint32_t numOperands() const override {                             \
         return numOp;                                                   \
     }
 
 #ifdef DEBUG
 # define RINSTRUCTION_HEADER_NUM_OP_(op, numOp)                         \
     RINSTRUCTION_HEADER_NUM_OP_MAIN(op, numOp)                          \
     static_assert(M##op::staticNumOperands == numOp, "The recover instructions's numOperands should equal to the MIR's numOperands");
 #else
@@ -189,503 +189,503 @@ class RResumePoint final : public RInstr
     uint32_t numOperands_;        // Number of slots.
 
   public:
     RINSTRUCTION_HEADER_(ResumePoint)
 
     uint32_t pcOffset() const {
         return pcOffset_;
     }
-    virtual uint32_t numOperands() const {
+    uint32_t numOperands() const override {
         return numOperands_;
     }
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RBitNot final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(BitNot, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RBitAnd final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(BitAnd, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RBitOr final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(BitOr, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RBitXor final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(BitXor, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RLsh final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Lsh, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RRsh final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Rsh, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RUrsh final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Ursh, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RSignExtend final : public RInstruction
 {
   private:
     uint8_t mode_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(SignExtend, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RAdd final : public RInstruction
 {
   private:
     bool isFloatOperation_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Add, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RSub final : public RInstruction
 {
   private:
     bool isFloatOperation_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Sub, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RMul final : public RInstruction
 {
   private:
     bool isFloatOperation_;
     uint8_t mode_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Mul, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RDiv final : public RInstruction
 {
   private:
     bool isFloatOperation_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Div, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RMod final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Mod, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RNot final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Not, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RConcat final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Concat, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RStringLength final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(StringLength, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RArgumentsLength final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(ArgumentsLength, 0)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 
 class RFloor final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Floor, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RCeil final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Ceil, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RRound final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Round, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RCharCodeAt final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(CharCodeAt, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RFromCharCode final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(FromCharCode, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RPow final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Pow, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RPowHalf final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(PowHalf, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RMinMax final : public RInstruction
 {
   private:
     bool isMax_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(MinMax, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RAbs final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Abs, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RSqrt final : public RInstruction
 {
   private:
     bool isFloatOperation_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Sqrt, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RAtan2 final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Atan2, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RHypot final : public RInstruction
 {
    private:
      uint32_t numOperands_;
 
    public:
      RINSTRUCTION_HEADER_(Hypot)
 
-     virtual uint32_t numOperands() const {
+     uint32_t numOperands() const override {
          return numOperands_;
      }
 
-     MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+     MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RMathFunction final : public RInstruction
 {
   private:
     uint8_t function_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(MathFunction, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RRandom final : public RInstruction
 {
     RINSTRUCTION_HEADER_NUM_OP_(Random, 0)
   public:
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RStringSplit final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(StringSplit, 3)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RNaNToZero final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(NaNToZero, 1);
 
-    bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RRegExpMatcher final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(RegExpMatcher, 3)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RRegExpSearcher final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(RegExpSearcher, 3)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RRegExpTester final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(RegExpTester, 3)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RStringReplace final : public RInstruction
 {
   private:
     bool isFlatReplacement_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(StringReplace, 3)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RTypeOf final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(TypeOf, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RToDouble final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(ToDouble, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RToFloat32 final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(ToFloat32, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RTruncateToInt32 final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(TruncateToInt32, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RNewObject final : public RInstruction
 {
   private:
     MNewObject::Mode mode_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(NewObject, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RNewTypedArray final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(NewTypedArray, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RNewArray final : public RInstruction
 {
   private:
     uint32_t count_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(NewArray, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RNewDerivedTypedObject final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(NewDerivedTypedObject, 3)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RCreateThisWithTemplate final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(CreateThisWithTemplate, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RLambda final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(Lambda, 2)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RSimdBox final : public RInstruction
 {
   private:
     uint8_t type_;
 
   public:
     RINSTRUCTION_HEADER_NUM_OP_(SimdBox, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RObjectState final : public RInstruction
 {
   private:
     uint32_t numSlots_;        // Number of slots.
 
   public:
     RINSTRUCTION_HEADER_(ObjectState)
 
     uint32_t numSlots() const {
         return numSlots_;
     }
-    virtual uint32_t numOperands() const {
+    uint32_t numOperands() const override {
         // +1 for the object.
         return numSlots() + 1;
     }
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RArrayState final : public RInstruction
 {
   private:
     uint32_t numElements_;
 
   public:
     RINSTRUCTION_HEADER_(ArrayState)
 
     uint32_t numElements() const {
         return numElements_;
     }
-    virtual uint32_t numOperands() const {
+    uint32_t numOperands() const override {
         // +1 for the array.
         // +1 for the initalized length.
         return numElements() + 2;
     }
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RAtomicIsLockFree final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(AtomicIsLockFree, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 class RAssertRecoveredOnBailout final : public RInstruction
 {
   public:
     RINSTRUCTION_HEADER_NUM_OP_(AssertRecoveredOnBailout, 1)
 
-    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const;
+    MOZ_MUST_USE bool recover(JSContext* cx, SnapshotIterator& iter) const override;
 };
 
 #undef RINSTRUCTION_HEADER_
 #undef RINSTRUCTION_HEADER_NUM_OP_
 #undef RINSTRUCTION_HEADER_NUM_OP_MAIN
 
 const RResumePoint*
 RInstruction::toResumePoint() const