mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 18:51:28 +00:00
Deoptimize upvar-for-eval if in for-in loop LHS position (520513, r=mrbkap).
This commit is contained in:
parent
e7d0b959b4
commit
4f33d707bc
@ -2157,9 +2157,9 @@ BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
|
||||
if (op != JSOP_NAME)
|
||||
return JS_TRUE;
|
||||
|
||||
#ifdef DEBUG
|
||||
JSStackFrame *caller = cg->compiler->callerFrame;
|
||||
JS_ASSERT(caller);
|
||||
JS_ASSERT(caller->script);
|
||||
|
||||
JSTreeContext *tc = cg;
|
||||
while (tc->staticLevel != level)
|
||||
@ -2168,10 +2168,14 @@ BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
|
||||
|
||||
JSCodeGenerator *evalcg = (JSCodeGenerator *) tc;
|
||||
JS_ASSERT(evalcg->flags & TCF_COMPILE_N_GO);
|
||||
JS_ASSERT(!(evalcg->flags & TCF_IN_FOR_INIT));
|
||||
JS_ASSERT(caller->script);
|
||||
JS_ASSERT(caller->fun && caller->varobj == evalcg->scopeChain);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't generate upvars on the left side of a for loop. See
|
||||
* bug 470758 and bug 520513.
|
||||
*/
|
||||
if (evalcg->flags & TCF_IN_FOR_INIT)
|
||||
return JS_TRUE;
|
||||
|
||||
if (cg->staticLevel == level) {
|
||||
pn->pn_op = JSOP_GETUPVAR;
|
||||
|
Loading…
Reference in New Issue
Block a user