Bug 1133529 - Parametrize MVariadicInstruction to allow for MVariadicControlInstructions. r=luke
authorMarc Nieper-Wißkirchen <marc.nieper@gmail.com>
Fri, 27 Mar 2015 00:28:00 -0400
changeset 266429 bd86bb29b687a27ee47af8942b4014d50b43725c
parent 266428 8126fbd73f26abf3bce8d5b5dd8d2507544b4f57
child 266430 176ade0f680db91f93879209d7ebc3458cecbf96
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1133529
milestone39.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 1133529 - Parametrize MVariadicInstruction to allow for MVariadicControlInstructions. r=luke
js/src/jit/MIR.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1148,17 +1148,18 @@ class MQuaternaryInstruction : public MA
         MDefinition *third = getOperand(2);
         MDefinition *fourth = getOperand(3);
 
         return op() + first->id() + second->id() +
                       third->id() + fourth->id();
     }
 };
 
-class MVariadicInstruction : public MInstruction
+template <class T>
+class MVariadicT : public T
 {
     FixedList<MUse> operands_;
 
   protected:
     bool init(TempAllocator &alloc, size_t length) {
         return operands_.init(alloc, length);
     }
     void initOperand(size_t index, MDefinition *operand) {
@@ -1185,16 +1186,18 @@ class MVariadicInstruction : public MIns
         MOZ_ASSERT(u <= &operands_[numOperands() - 1]);
         return u - &operands_[0];
     }
     void replaceOperand(size_t index, MDefinition *operand) final override {
         operands_[index].replaceProducer(operand);
     }
 };
 
+typedef MVariadicT<MInstruction> MVariadicInstruction;
+
 // Generates an LSnapshot without further effect.
 class MStart : public MNullaryInstruction
 {
   public:
     enum StartType {
         StartType_Default,
         StartType_Osr
     };