Bug 936993 - IonMonkey: Create the MCheckOverRecursed before unboxing arguments. r=bhackett

This commit is contained in:
Dan Gohman 2013-11-12 05:46:43 -08:00
parent 0ebddaa032
commit e8c1bedeef

View File

@ -596,6 +596,14 @@ IonBuilder::build()
if (instrumentedProfiling()) if (instrumentedProfiling())
current->add(MFunctionBoundary::New(script(), MFunctionBoundary::Enter)); current->add(MFunctionBoundary::New(script(), MFunctionBoundary::Enter));
// Guard against over-recursion. Do this before we start unboxing, since
// this will create an OSI point that will read the incoming argument
// values, which is nice to do before their last real use, to minimize
// register/stack pressure.
MCheckOverRecursed *check = new MCheckOverRecursed;
current->add(check);
check->setResumePoint(current->entryResumePoint());
// Parameters have been checked to correspond to the typeset, now we unbox // Parameters have been checked to correspond to the typeset, now we unbox
// what we can in an infallible manner. // what we can in an infallible manner.
rewriteParameters(); rewriteParameters();
@ -607,11 +615,6 @@ IonBuilder::build()
if (info().needsArgsObj() && !initArgumentsObject()) if (info().needsArgsObj() && !initArgumentsObject())
return false; return false;
// Guard against over-recursion.
MCheckOverRecursed *check = new MCheckOverRecursed;
current->add(check);
check->setResumePoint(current->entryResumePoint());
// Prevent |this| from being DCE'd: necessary for constructors. // Prevent |this| from being DCE'd: necessary for constructors.
if (info().fun()) if (info().fun())
current->getSlot(info().thisSlot())->setGuard(); current->getSlot(info().thisSlot())->setGuard();