Bug 1320408 - Part 10: Change LazyScript::functionDelazifying to static method. r=jandem
authorTooru Fujisawa <arai_a@mac.com>
Sat, 21 Jan 2017 17:25:45 +0900
changeset 377816 81f6417e94c4bfc6812225a22d8599a09c5cd8ce
parent 377815 43ac5e5b71937a4cbad6dcc525be975a37f84a95
child 377817 6d8daa94965062c56622fdcc646e0d1d3442f382
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1320408
milestone53.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 1320408 - Part 10: Change LazyScript::functionDelazifying to static method. r=jandem
js/src/jsfun.cpp
js/src/jsscript.h
js/src/jsscriptinlines.h
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -1402,17 +1402,17 @@ JSFunction::createScriptForLazilyInterpr
             // Remember the lazy script on the compiled script, so it can be
             // stored on the function again in case of re-lazification.
             if (canRelazify)
                 script->setLazyScript(lazy);
             return true;
         }
 
         if (fun != lazy->functionNonDelazifying()) {
-            if (!lazy->functionDelazifying(cx))
+            if (!LazyScript::functionDelazifying(cx, lazy))
                 return false;
             script = lazy->functionNonDelazifying()->nonLazyScript();
             if (!script)
                 return false;
 
             fun->setUnlazifiedScript(script);
             return true;
         }
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -2012,17 +2012,17 @@ class LazyScript : public gc::TenuredCel
     static LazyScript* Create(ExclusiveContext* cx, HandleFunction fun,
                               HandleScript script, HandleScope enclosingScope,
                               HandleScript enclosingScript,
                               uint64_t packedData, uint32_t begin, uint32_t end,
                               uint32_t lineno, uint32_t column);
 
     void initRuntimeFields(uint64_t packedFields);
 
-    inline JSFunction* functionDelazifying(JSContext* cx) const;
+    static inline JSFunction* functionDelazifying(JSContext* cx, Handle<LazyScript*>);
     JSFunction* functionNonDelazifying() const {
         return function_;
     }
 
     void initScript(JSScript* script);
     void resetScript();
 
     JSScript* maybeScript() {
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -69,24 +69,23 @@ ScriptAndCounts::ScriptAndCounts(ScriptA
     scriptCounts(Move(sac.scriptCounts))
 {
 }
 
 void
 SetFrameArgumentsObject(JSContext* cx, AbstractFramePtr frame,
                         HandleScript script, JSObject* argsobj);
 
-inline JSFunction*
-LazyScript::functionDelazifying(JSContext* cx) const
+/* static */ inline JSFunction*
+LazyScript::functionDelazifying(JSContext* cx, Handle<LazyScript*> script)
 {
-    Rooted<const LazyScript*> self(cx, this);
-    RootedFunction fun(cx, self->function_);
-    if (self->function_ && !JSFunction::getOrCreateScript(cx, fun))
+    RootedFunction fun(cx, script->function_);
+    if (script->function_ && !JSFunction::getOrCreateScript(cx, fun))
         return nullptr;
-    return self->function_;
+    return script->function_;
 }
 
 } // namespace js
 
 inline JSFunction*
 JSScript::functionDelazifying() const
 {
     JSFunction* fun = function();