Bug 1591747 - Remove redundant initScript call in DelazifyCanonicalScriptedFunction r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Mon, 28 Oct 2019 08:04:47 +0000
changeset 499680 a9d7651009089ec16b5fe2d978604994183c2d04
parent 499679 93cc053b18b91019ae88d76fbc12d90267911335
child 499681 e53af14c60890ca102e6ddf0912f75af35438c1c
push id99134
push usertcampbell@mozilla.com
push dateTue, 29 Oct 2019 18:36:57 +0000
treeherderautoland@e53af14c6089 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1591747
milestone72.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 1591747 - Remove redundant initScript call in DelazifyCanonicalScriptedFunction r=jandem The LazyScript -> JSScript link is already set during JSScript::fullyInitFromEmitter. Depends on D50718 Differential Revision: https://phabricator.services.mozilla.com/D50719
js/src/vm/JSFunction.cpp
--- a/js/src/vm/JSFunction.cpp
+++ b/js/src/vm/JSFunction.cpp
@@ -1591,22 +1591,17 @@ static bool DelazifyCanonicalScriptedFun
         MOZ_ASSERT(fun->lazyScript() == lazy);
         MOZ_ASSERT(!lazy->hasScript());
         return false;
       }
     }
   }
 
   RootedScript script(cx, fun->nonLazyScript());
-
-  // Remember the compiled script on the lazy script itself, in case
-  // there are clones of the function still pointing to the lazy script.
-  if (!lazy->maybeScript()) {
-    lazy->initScript(script);
-  }
+  MOZ_ASSERT(lazy->maybeScript() == script);
 
   if (lazy->canRelazify()) {
     // Remember the lazy script on the compiled script, so it can be
     // stored on the function again in case of re-lazification.
     // Only functions without inner functions are re-lazified.
     script->setLazyScript(lazy);
   } else if (lazy->isWrappedByDebugger()) {
     // Associate the LazyScript with the JSScript even though the latter