Bug 1209515 part 2 - Ensure that MPhi removal considers removed uses. r=bhackett

This commit is contained in:
Nicolas B. Pierron 2015-11-12 10:57:27 +00:00
parent ba054b65a3
commit 4443f4632a
2 changed files with 12 additions and 2 deletions

View File

@ -496,7 +496,7 @@ jit::EliminateDeadResumePointOperands(MIRGenerator* mir, MIRGraph& graph)
// If the instruction's behavior has been constant folded into a
// separate instruction, we can't determine precisely where the
// instruction becomes dead and can't eliminate its uses.
if (ins->isImplicitlyUsed())
if (ins->isImplicitlyUsed() || ins->isUseRemoved())
continue;
// Check if this instruction's result is only used within the
@ -609,7 +609,7 @@ IsPhiObservable(MPhi* phi, Observability observe)
{
// If the phi has uses which are not reflected in SSA, then behavior in the
// interpreter may be affected by removing the phi.
if (phi->isImplicitlyUsed())
if (phi->isImplicitlyUsed() || phi->isUseRemoved())
return true;
// Check for uses of this phi node outside of other phi nodes.

View File

@ -602,6 +602,11 @@ MDefinition::justReplaceAllUsesWith(MDefinition* dom)
MOZ_ASSERT(dom != nullptr);
MOZ_ASSERT(dom != this);
// Carry over the fact the value has uses which are no longer inspectable
// with the graph.
if (isUseRemoved())
dom->setUseRemovedUnchecked();
for (MUseIterator i(usesBegin()), e(usesEnd()); i != e; ++i)
i->setProducerUnchecked(dom);
dom->uses_.takeElements(uses_);
@ -613,6 +618,11 @@ MDefinition::justReplaceAllUsesWithExcept(MDefinition* dom)
MOZ_ASSERT(dom != nullptr);
MOZ_ASSERT(dom != this);
// Carry over the fact the value has uses which are no longer inspectable
// with the graph.
if (isUseRemoved())
dom->setUseRemovedUnchecked();
// Move all uses to new dom. Save the use of the dominating instruction.
MUse *exceptUse = nullptr;
for (MUseIterator i(usesBegin()), e(usesEnd()); i != e; ++i) {