Bug 980585 - Followup: improve style and comment. (r=me)
authorShu-yu Guo <shu@rfrn.org>
Thu, 13 Mar 2014 22:40:17 -0700
changeset 190715 0a5ec8ab99a295e115e30922f5f6ffea51a07816
parent 190714 8339097d306081f180b0cc621390725dab35f3d3
child 190740 d527230a20321fec0c390502383724d16b7ad846
child 190838 b2e50a5b5eb327a4dd35d18656dc10ee9cab76f1
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs980585
milestone30.0a1
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
Bug 980585 - Followup: improve style and comment. (r=me)
js/src/jscompartment.cpp
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -715,33 +715,30 @@ AddInnerLazyFunctionsFromScript(JSScript
 }
 
 static bool
 CreateLazyScriptsForCompartment(JSContext *cx)
 {
     AutoObjectVector lazyFunctions(cx);
 
     // Find all live lazy scripts in the compartment, and via them all root
-    // lazy functions in the compartment: those which have not been compiled
-    // and which have a source object, indicating that they have a parent.
+    // lazy functions in the compartment: those which have not been compiled,
+    // which have a source object, indicating that they have a parent, and
+    // which do not have an uncompiled enclosing script. The last condition is
+    // so that we don't compile lazy scripts whose enclosing scripts failed to
+    // compile, indicating that the lazy script did not escape the script.
     for (gc::CellIter i(cx->zone(), gc::FINALIZE_LAZY_SCRIPT); !i.done(); i.next()) {
         LazyScript *lazy = i.get<LazyScript>();
         JSFunction *fun = lazy->functionNonDelazifying();
         if (fun->compartment() == cx->compartment() &&
-            lazy->sourceObject() && !lazy->maybeScript())
+            lazy->sourceObject() && !lazy->maybeScript() &&
+            !lazy->hasUncompiledEnclosingScript())
         {
             MOZ_ASSERT(fun->isInterpretedLazy());
             MOZ_ASSERT(lazy == fun->lazyScriptOrNull());
-
-            // Only compile lazy scripts that in fact escaped to script. We
-            // are iterating GC things here, so we might see lazy scripts
-            // whose enclosing scripts were not successfully compiled.
-            if (lazy->hasUncompiledEnclosingScript())
-                continue;
-
             if (!lazyFunctions.append(fun))
                 return false;
         }
     }
 
     // Create scripts for each lazy function, updating the list of functions to
     // process with any newly exposed inner functions in created scripts.
     // A function cannot be delazified until its outer script exists.