summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 19:52:00 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:24 -0400
commit4d88f48fdb51a29fd66001e87a74e2d6a130fe1f (patch)
tree8d00c00753db4cdddf584e0a0c061a39f13583cc /js/src
parent1d0ab1c752c583c153b850af339edb86d23f6cc8 (diff)
downloadUXP-4d88f48fdb51a29fd66001e87a74e2d6a130fe1f.tar
UXP-4d88f48fdb51a29fd66001e87a74e2d6a130fe1f.tar.gz
UXP-4d88f48fdb51a29fd66001e87a74e2d6a130fe1f.tar.lz
UXP-4d88f48fdb51a29fd66001e87a74e2d6a130fe1f.tar.xz
UXP-4d88f48fdb51a29fd66001e87a74e2d6a130fe1f.zip
1320408 - Part 10: Change LazyScript::functionDelazifying to static method.
Diffstat (limited to 'js/src')
-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 5a253217b..ea64aabe2 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 c3298a884..2f962ab94 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 65abb5cb7..205a37f24 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