Bug 1425580 part 14 - Devirtualize LNode::setOperand. r=nbp
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 02 Mar 2018 10:54:49 +0100
changeset 461304 1a74aee7c5498625d7f6ddc9676bf931a225503b
parent 461303 f15ab7984211cc4252982b3e61bc75543e70a9a3
child 461305 4780be3c03b490e2f1d7d0acb4f998cb729901dd
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1425580
milestone60.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 1425580 part 14 - Devirtualize LNode::setOperand. r=nbp
js/src/jit/LIR.h
js/src/jit/shared/LIR-shared.h
--- a/js/src/jit/LIR.h
+++ b/js/src/jit/LIR.h
@@ -729,17 +729,16 @@ class LNode
     // Returns the number of outputs of this instruction. If an output is
     // unallocated, it is an LDefinition, defining a virtual register.
     size_t numDefs() const {
         return numDefs_;
     }
 
     // Returns information about operands.
     virtual LAllocation* getOperand(size_t index) = 0;
-    virtual void setOperand(size_t index, const LAllocation& a) = 0;
 
     bool isCall() const {
         return isCall_;
     }
 
     // Does this call preserve the given register?
     // By default, it is assumed that all registers are clobbered by a call.
     inline bool isCallPreserved(AnyRegister reg) const;
@@ -825,16 +824,19 @@ class LInstruction
     }
 
   public:
     inline LDefinition* getDef(size_t index);
 
     void setDef(size_t index, const LDefinition& def) {
         *getDef(index) = def;
     }
+    void setOperand(size_t index, const LAllocation& a) {
+        *getOperand(index) = a;
+    }
 
     // Returns information about temporary registers needed. Each temporary
     // register is an LDefinition with a fixed or virtual register and
     // either GENERAL, FLOAT32, or DOUBLE type.
     size_t numTemps() const {
         return numTemps_;
     }
     inline LDefinition* getTemp(size_t index);
@@ -964,17 +966,17 @@ class LPhi final : public LNode
     }
     size_t numOperands() const {
         return mir_->toPhi()->numOperands();
     }
     LAllocation* getOperand(size_t index) override {
         MOZ_ASSERT(index < numOperands());
         return &inputs_[index];
     }
-    void setOperand(size_t index, const LAllocation& a) override {
+    void setOperand(size_t index, const LAllocation& a) {
         MOZ_ASSERT(index < numOperands());
         inputs_[index] = a;
     }
 
     // Phis don't have temps, so calling numTemps/getTemp is pointless.
     size_t numTemps() const = delete;
     LDefinition* getTemp(size_t index) = delete;
 };
@@ -1161,17 +1163,17 @@ class LInstructionHelper : public detail
     LInstructionHelper()
       : details::LInstructionFixedDefsTempsHelper<Defs, Temps>(Operands)
     {}
 
   public:
     LAllocation* getOperand(size_t index) final {
         return &operands_[index];
     }
-    void setOperand(size_t index, const LAllocation& a) final {
+    void setOperand(size_t index, const LAllocation& a) {
         operands_[index] = a;
     }
     void setBoxOperand(size_t index, const LBoxAllocation& alloc) {
 #ifdef JS_NUNBOX32
         operands_[index + TYPE_INDEX] = alloc.type();
         operands_[index + PAYLOAD_INDEX] = alloc.payload();
 #else
         operands_[index] = alloc.value();
@@ -1207,17 +1209,17 @@ class LVariadicInstruction : public deta
 
   public:
     MOZ_MUST_USE bool init(TempAllocator& alloc) {
         return operands_.init(alloc, this->nonPhiNumOperands_);
     }
     LAllocation* getOperand(size_t index) final {
         return &operands_[index];
     }
-    void setOperand(size_t index, const LAllocation& a) final {
+    void setOperand(size_t index, const LAllocation& a) {
         operands_[index] = a;
     }
     void setBoxOperand(size_t index, const LBoxAllocation& a) {
 #ifdef JS_NUNBOX32
         operands_[index + TYPE_INDEX] = a.type();
         operands_[index + PAYLOAD_INDEX] = a.payload();
 #else
         operands_[index] = a.value();
--- a/js/src/jit/shared/LIR-shared.h
+++ b/js/src/jit/shared/LIR-shared.h
@@ -6934,17 +6934,17 @@ class LGetPropertyPolymorphicV : public 
         setOperand(0, obj);
     }
     const LAllocation* obj() {
         return getOperand(0);
     }
     const MGetPropertyPolymorphic* mir() const {
         return mir_->toGetPropertyPolymorphic();
     }
-    virtual const char* extraName() const {
+    const char* extraName() const {
         return PropertyNameToExtraName(mir()->name());
     }
 };
 
 // Emit code to load a typed value from an object's slots if its shape matches
 // one of the shapes observed by the baseline IC, else bails out.
 class LGetPropertyPolymorphicT : public LInstructionHelper<1, 1, 1>
 {
@@ -6959,17 +6959,17 @@ class LGetPropertyPolymorphicT : public 
         return getOperand(0);
     }
     const LDefinition* temp() {
         return getTemp(0);
     }
     const MGetPropertyPolymorphic* mir() const {
         return mir_->toGetPropertyPolymorphic();
     }
-    virtual const char* extraName() const {
+    const char* extraName() const {
         return PropertyNameToExtraName(mir()->name());
     }
 };
 
 // Emit code to store a boxed value to an object's slots if its shape matches
 // one of the shapes observed by the baseline IC, else bails out.
 class LSetPropertyPolymorphicV : public LInstructionHelper<0, 1 + BOX_PIECES, 1>
 {