summaryrefslogtreecommitdiff
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
commit2f282f729eb3ae17d396682102c890c7d4cd77c4 (patch)
tree8d00c00753db4cdddf584e0a0c061a39f13583cc
parent02a53c4889ad8af5f58a2ca81e3cf98735f8135b (diff)
downloadaura-central-2f282f729eb3ae17d396682102c890c7d4cd77c4.tar.gz
1320408 - Part 10: Change LazyScript::functionDelazifying to static method.
-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