Remove some unnecessary vector from LICM (
Bug 678598, r=ascheff)
--- 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;
}