Force arguments object allocation on dynamic name accesses

Issue #1547
This commit is contained in:
janekptacijarabaci
2017-12-18 13:11:06 +01:00
committed by Roy Tam
parent 90c491ebc3
commit ee60c0ba2b
14 changed files with 6 additions and 212 deletions
+2 -11
View File
@@ -950,14 +950,8 @@ Parser<FullParseHandler>::checkFunctionArguments()
FunctionBox* funbox = pc->sc->asFunctionBox();
funbox->setArgumentsHasLocalBinding();
/*
* If a script has both explicit mentions of 'arguments' and dynamic
* name lookups which could access the arguments, an arguments object
* must be created eagerly. The SSA analysis used for lazy arguments
* cannot cope with dynamic name accesses, so any 'arguments' accessed
* via a NAME opcode must force construction of the arguments object.
*/
if (pc->sc->bindingsAccessedDynamically() && maybeArgDef)
/* Dynamic scope access destroys all hope of optimization. */
if (pc->sc->bindingsAccessedDynamically())
funbox->setDefinitelyNeedsArgsObj();
/*
@@ -985,9 +979,6 @@ Parser<FullParseHandler>::checkFunctionArguments()
funbox->setDefinitelyNeedsArgsObj();
}
}
/* Watch for mutation of arguments through e.g. eval(). */
if (pc->sc->bindingsAccessedDynamically())
funbox->setDefinitelyNeedsArgsObj();
}
}