Bug 995077 - Preserve phis whose slots are arguments object inside functions that need it. (r=jandem)

This commit is contained in:
Shu-yu Guo 2014-04-14 22:00:07 -07:00
parent 0ef001388a
commit 5e373d94d6

View File

@ -223,11 +223,15 @@ IsPhiObservable(MPhi *phi, Observability observe)
if (fun && slot == info.thisSlot())
return true;
// If the function may need an arguments object, then make sure to preserve
// the scope chain, because it may be needed to construct the arguments
// object during bailout.
if (fun && info.hasArguments() && slot == info.scopeChainSlot())
// If the function may need an arguments object, then make sure to
// preserve the scope chain, because it may be needed to construct the
// arguments object during bailout. If we've already created an arguments
// object (or got one via OSR), preserve that as well.
if (fun && info.hasArguments() &&
(slot == info.scopeChainSlot() || slot == info.argsObjSlot()))
{
return true;
}
// If the Phi is one of the formal argument, and we are using an argument
// object in the function. The phi might be observable after a bailout.