summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/src/jsfun.cpp2
-rw-r--r--js/src/jsscript.h2
-rw-r--r--js/src/jsscriptinlines.h11
3 files changed, 7 insertions, 8 deletions
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp
index 5a253217b7..ea64aabe2d 100644
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -1366,7 +1366,7 @@ JSFunction::createScriptForLazilyInterpretedFunction(JSContext* cx, HandleFuncti
}
if (fun != lazy->functionNonDelazifying()) {
- if (!lazy->functionDelazifying(cx))
+ if (!LazyScript::functionDelazifying(cx, lazy))
return false;
script = lazy->functionNonDelazifying()->nonLazyScript();
if (!script)
diff --git a/js/src/jsscript.h b/js/src/jsscript.h
index c3298a8848..2f962ab942 100644
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -2034,7 +2034,7 @@ class LazyScript : public gc::TenuredCell
void initRuntimeFields(uint64_t packedFields);
- inline JSFunction* functionDelazifying(JSContext* cx) const;
+ static inline JSFunction* functionDelazifying(JSContext* cx, Handle<LazyScript*>);
JSFunction* functionNonDelazifying() const {
return function_;
}
diff --git a/js/src/jsscriptinlines.h b/js/src/jsscriptinlines.h
index 65abb5cb7c..205a37f244 100644
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -74,14 +74,13 @@ 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