Bug 1058095 - IonMonkey: Remove VirtualRegisters' block field r=bhackett
authorDan Gohman <sunfish@mozilla.com>
Fri, 10 Oct 2014 21:21:36 -0700
changeset 209957 8843395921bfeaf27453e7215301de90c95c536d
parent 209956 bd25766ac048d86c68a01896f827d5effce193b5
child 209958 ba2a7e2ec1a072a198ee416bd4db9aa56523b4e3
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbhackett
bugs1058095
milestone35.0a1
Bug 1058095 - IonMonkey: Remove VirtualRegisters' block field r=bhackett
js/src/jit/LiveRangeAllocator.cpp
js/src/jit/LiveRangeAllocator.h
--- a/js/src/jit/LiveRangeAllocator.cpp
+++ b/js/src/jit/LiveRangeAllocator.cpp
@@ -522,32 +522,32 @@ LiveRangeAllocator<VREG, forLSRA>::init(
             return false;
 
         LBlock *block = graph.getBlock(i);
         for (LInstructionIterator ins = block->begin(); ins != block->end(); ins++) {
             for (size_t j = 0; j < ins->numDefs(); j++) {
                 LDefinition *def = ins->getDef(j);
                 if (def->isBogusTemp())
                     continue;
-                if (!vregs[def].init(alloc(), block, *ins, def, /* isTemp */ false))
+                if (!vregs[def].init(alloc(), *ins, def, /* isTemp */ false))
                     return false;
             }
 
             for (size_t j = 0; j < ins->numTemps(); j++) {
                 LDefinition *def = ins->getTemp(j);
                 if (def->isBogusTemp())
                     continue;
-                if (!vregs[def].init(alloc(), block, *ins, def, /* isTemp */ true))
+                if (!vregs[def].init(alloc(), *ins, def, /* isTemp */ true))
                     return false;
             }
         }
         for (size_t j = 0; j < block->numPhis(); j++) {
             LPhi *phi = block->getPhi(j);
             LDefinition *def = phi->getDef(0);
-            if (!vregs[def].init(alloc(), block, phi, def, /* isTemp */ false))
+            if (!vregs[def].init(alloc(), phi, def, /* isTemp */ false))
                 return false;
         }
     }
 
     return true;
 }
 
 static void
--- a/js/src/jit/LiveRangeAllocator.h
+++ b/js/src/jit/LiveRangeAllocator.h
@@ -421,48 +421,46 @@ class LiveInterval
 
 /*
  * Represents all of the register allocation state associated with a virtual
  * register, including all associated intervals and pointers to relevant LIR
  * structures.
  */
 class VirtualRegister
 {
-    LBlock *block_;
     LInstruction *ins_;
     LDefinition *def_;
     Vector<LiveInterval *, 1, IonAllocPolicy> intervals_;
 
     // Whether def_ is a temp or an output.
     bool isTemp_ : 1;
 
     void operator=(const VirtualRegister &) MOZ_DELETE;
     VirtualRegister(const VirtualRegister &) MOZ_DELETE;
 
   protected:
     explicit VirtualRegister(TempAllocator &alloc)
       : intervals_(alloc)
     {}
 
   public:
-    bool init(TempAllocator &alloc, LBlock *block, LInstruction *ins, LDefinition *def,
+    bool init(TempAllocator &alloc, LInstruction *ins, LDefinition *def,
               bool isTemp)
     {
-        MOZ_ASSERT(block && !block_);
-        block_ = block;
+        MOZ_ASSERT(ins && !ins_);
         ins_ = ins;
         def_ = def;
         isTemp_ = isTemp;
         LiveInterval *initial = LiveInterval::New(alloc, def->virtualRegister(), 0);
         if (!initial)
             return false;
         return intervals_.append(initial);
     }
     LBlock *block() {
-        return block_;
+        return ins_->block();
     }
     LInstruction *ins() {
         return ins_;
     }
     LDefinition *def() const {
         return def_;
     }
     LDefinition::Type type() const {