[JAEGER] Fixed bug where DEFLOCALFUN didn't emit DEFUPVAR.
authorDavid Anderson <dvander@alliedmods.net>
Sat, 10 Jul 2010 12:26:27 -0700
changeset 53111 dd5b8f4405c51d61b69b9205b08ab8f1af89bcfd
parent 53110 a87d82c04b565e3fa827b5a5782bb714841055a6
child 53112 bf21c969da4f51f6d82afb57731f4e270875fde6
push id15660
push userrsayre@mozilla.com
push dateSat, 11 Sep 2010 19:16:24 +0000
treeherdermozilla-central@f1bd314e64ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b2pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
[JAEGER] Fixed bug where DEFLOCALFUN didn't emit DEFUPVAR.
js/src/jsemit.cpp
--- a/js/src/jsemit.cpp
+++ b/js/src/jsemit.cpp
@@ -4515,16 +4515,21 @@ js_EmitTree(JSContext *cx, JSCodeGenerat
 #ifdef DEBUG
             JSLocalKind localKind =
 #endif
                 js_LookupLocal(cx, cg->fun, fun->atom, &slot);
             JS_ASSERT(localKind == JSLOCAL_VAR || localKind == JSLOCAL_CONST);
             JS_ASSERT(index < JS_BIT(20));
             pn->pn_index = index;
             op = FUN_FLAT_CLOSURE(fun) ? JSOP_DEFLOCALFUN_FC : JSOP_DEFLOCALFUN;
+            if ((pn->pn_dflags & PND_CLOSED) && !(cg->flags & TCF_FUN_USES_EVAL)) {
+                CG_SWITCH_TO_PROLOG(cg);
+                EMIT_UINT16_IMM_OP(JSOP_DEFUPVAR, pn->pn_cookie.asInteger());
+                CG_SWITCH_TO_MAIN(cg);
+            }
             if (!EmitSlotIndexOp(cx, op, slot, index, cg))
                 return JS_FALSE;
         }
         break;
       }
 
       case TOK_ARGSBODY:
         ok = js_EmitTree(cx, cg, pn->last());