Remove some unnecessary vector from LICM (Bug 678598, r=ascheff)
authorRyan Pearl <rpearl@mozilla.com>
Fri, 12 Aug 2011 12:52:09 -0700
changeset 108718 e8ce2d102fdaacf14c0418bac846494f846807d0
parent 108717 c34b8613959d3bdb6875035e311af549ba453432
child 108719 f82e7d7508f8d11b8fbaecfe769a965f48a25053
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersascheff
bugs678598
milestone8.0a1
Remove some unnecessary vector from LICM (Bug 678598, r=ascheff)
js/src/ion/LICM.cpp
--- a/js/src/ion/LICM.cpp
+++ b/js/src/ion/LICM.cpp
@@ -155,17 +155,17 @@ Loop::optimize()
             fprintf(IonSpewFile, " <- ");
             ins->printOpcode(IonSpewFile);
             fprintf(IonSpewFile, ":  ");
         }
 
         if (isLoopInvariant(ins)) {
             // Flag this instruction as loop invariant.
             ins->setLoopInvariant();
-            if (!invariantInstructions.insert(invariantInstructions.begin(), ins))
+            if (!invariantInstructions.append(ins))
                 return false;
 
             // Loop through uses of invariant instruction and add back to work list.
             for (MUseDefIterator iter(ins->toDefinition()); iter; iter++) {
                 MDefinition *consumer = iter.def();
 
                 if (consumer->isInWorklist())
                     continue;
@@ -187,18 +187,18 @@ Loop::optimize()
         return false;
     return true;
 }
 
 bool
 Loop::hoistInstructions(InstructionQueue &toHoist)
 {
     // Move all instructions to the preLoop_ block just before the control instruction.
-    while (!toHoist.empty()) {
-        MInstruction *ins = toHoist.popCopy();
+    for (size_t i = 0; i < toHoist.length(); i++) {
+        MInstruction *ins = toHoist[i];
         if (checkHotness(ins->block())) {
             ins->block()->remove(ins);
             preLoop_->insertBefore(preLoop_->lastIns(), ins);
             ins->setNotLoopInvariant();
         }
     }
     return true;
 }