Bug 879727: IonMonkey: During UCE remove corresponding MPassArgs when removing calls, r=jandem

This commit is contained in:
Hannes Verschore 2013-06-12 21:46:19 +02:00
parent 498bf9b7c7
commit 29223a2c06

View File

@ -235,6 +235,22 @@ UnreachableCodeElimination::removeUnmarkedBlocksAndClearDominators()
}
}
// When we remove a call, we can't leave the corresponding MPassArg in the graph.
// Since lowering will fail. Replace it with the argument for the exceptional
// case when it is kept alive in a ResumePoint.
// DCE will remove the unused MPassArg instruction.
for (MInstructionIterator iter(block->begin()); iter != block->end(); iter++) {
if (iter->isCall()) {
MCall *call = iter->toCall();
for (size_t i = 0; i < call->numStackArgs(); i++) {
JS_ASSERT(call->getArg(i)->isPassArg());
JS_ASSERT(call->getArg(i)->defUseCount() == 1);
MPassArg *arg = call->getArg(i)->toPassArg();
arg->replaceAllUsesWith(arg->getArgument());
}
}
}
graph_.removeBlock(block);
}
}