Bug 1160535 part 5 - Remove the now bogus !maybeScript check in CreateLazyScriptsForCompartment. r=shu
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 07 May 2015 11:26:37 +0200
changeset 274123 03fa064957fc5c7ac45c8df9795e14580aa125f0
parent 274122 34781ef1be40cf56cf3edf8bdf60514a6f372e72
child 274124 30c6c8f10574f2cd0c50086ed462b56c05e3ee67
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1160535
milestone40.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 1160535 part 5 - Remove the now bogus !maybeScript check in CreateLazyScriptsForCompartment. r=shu
js/src/jscompartment.cpp
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -749,22 +749,25 @@ AddInnerLazyFunctionsFromScript(JSScript
     return true;
 }
 
 static bool
 CreateLazyScriptsForCompartment(JSContext* cx)
 {
     AutoObjectVector lazyFunctions(cx);
 
-    // Find all live root 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.
+    // Find all live root lazy functions in the compartment: those 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.
+    //
+    // Some LazyScripts have a non-null |JSScript* script| pointer. We still
+    // want to delazify in that case: this pointer is weak so the JSScript
+    // could be destroyed at the next GC.
     //
     // Note that while we ideally iterate over LazyScripts, LazyScripts do not
     // currently stand in 1-1 relation with JSScripts; JSFunctions with the
     // same LazyScript may create different JSScripts due to relazification of
     // clones. See bug 1105306.
     for (gc::ZoneCellIter i(cx->zone(), AllocKind::FUNCTION); !i.done(); i.next()) {
         JSFunction* fun = &i.get<JSObject>()->as<JSFunction>();
 
@@ -774,19 +777,17 @@ CreateLazyScriptsForCompartment(JSContex
         if (gc::IsAboutToBeFinalizedUnbarriered(&fun) ||
             fun->compartment() != cx->compartment())
         {
             continue;
         }
 
         if (fun->isInterpretedLazy()) {
             LazyScript* lazy = fun->lazyScriptOrNull();
-            if (lazy && lazy->sourceObject() && !lazy->maybeScript() &&
-                !lazy->hasUncompiledEnclosingScript())
-            {
+            if (lazy && lazy->sourceObject() && !lazy->hasUncompiledEnclosingScript()) {
                 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.