Don't do closure optimization for NAME accesses to non-outer functions, bug 728342. r=dvander a=jst
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 24 Feb 2012 05:56:16 -0800
changeset 87249 74efe408346a38b50f4c1983631e5e1e9cd03a52
parent 87248 5da86f8addbb7d3e781c42f88cee2be03e504dce
child 87250 856dfbcebb26d18a18ea13bb9a5abb3d8ee0c0c6
push id904
push userbhackett@mozilla.com
push dateFri, 24 Feb 2012 13:56:41 +0000
treeherdermozilla-aurora@74efe408346a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, jst
bugs728342
milestone12.0a2
Don't do closure optimization for NAME accesses to non-outer functions, bug 728342. r=dvander a=jst
js/src/jsinfer.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -3326,16 +3326,19 @@ ScriptAnalysis::resolveNameAccess(JSCont
                 /*
                  * Record the dependency which compiled code has on the outer
                  * function being non-reentrant.
                  */
                 if (TypeSet::HasObjectFlags(cx, obj, OBJECT_FLAG_REENTRANT_FUNCTION))
                     return access;
             }
 
+            if (!script->isOuterFunction)
+                return access;
+
             access.script = script;
             access.nesting = script->nesting();
             access.slot = (kind == ARGUMENT) ? ArgSlot(index) : LocalSlot(script, index);
             access.arg = (kind == ARGUMENT);
             access.index = index;
             return access;
         } else if (kind != NONE) {
             return access;