зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1637424 - Part 3: Delete an unused argument. r=tcampbell.
Differential Revision: https://phabricator.services.mozilla.com/D76336
This commit is contained in:
Родитель
ef914fb793
Коммит
270e951c44
|
@ -43,7 +43,7 @@ inline bool CanReuseFunctionForClone(JSContext* cx, HandleFunction fun) {
|
|||
|
||||
inline JSFunction* CloneFunctionObjectIfNotSingleton(
|
||||
JSContext* cx, HandleFunction fun, HandleObject enclosingEnv,
|
||||
HandleObject proto = nullptr, NewObjectKind newKind = GenericObject) {
|
||||
HandleObject proto = nullptr) {
|
||||
/*
|
||||
* For attempts to clone functions at a function definition opcode,
|
||||
* try to avoid the the clone if the function has singleton type. This
|
||||
|
@ -71,8 +71,7 @@ inline JSFunction* CloneFunctionObjectIfNotSingleton(
|
|||
gc::AllocKind kind = fun->isExtended() ? extendedFinalizeKind : finalizeKind;
|
||||
|
||||
if (CanReuseScriptForClone(cx->realm(), fun, enclosingEnv)) {
|
||||
return CloneFunctionReuseScript(cx, fun, enclosingEnv, kind, newKind,
|
||||
proto);
|
||||
return CloneFunctionReuseScript(cx, fun, enclosingEnv, kind, proto);
|
||||
}
|
||||
|
||||
RootedScript script(cx, JSFunction::getOrCreateScript(cx, fun));
|
||||
|
|
|
@ -2196,7 +2196,6 @@ static inline JSFunction* NewFunctionClone(JSContext* cx, HandleFunction fun,
|
|||
JSFunction* js::CloneFunctionReuseScript(JSContext* cx, HandleFunction fun,
|
||||
HandleObject enclosingEnv,
|
||||
gc::AllocKind allocKind,
|
||||
NewObjectKind newKind,
|
||||
HandleObject proto) {
|
||||
MOZ_ASSERT(cx->realm() == fun->realm());
|
||||
MOZ_ASSERT(NewFunctionEnvironmentIsWellFormed(cx, enclosingEnv));
|
||||
|
@ -2210,10 +2209,9 @@ JSFunction* js::CloneFunctionReuseScript(JSContext* cx, HandleFunction fun,
|
|||
// derived class constructors will have a type assigned.
|
||||
bool setTypeForFunction = proto && fun->staticPrototype() != proto &&
|
||||
fun->group()->maybeInterpretedFunction();
|
||||
if (setTypeForFunction) {
|
||||
// The function needs to be tenured when used as an object group addendum.
|
||||
newKind = TenuredObject;
|
||||
}
|
||||
|
||||
// The function needs to be tenured when used as an object group addendum.
|
||||
NewObjectKind newKind = setTypeForFunction ? TenuredObject : GenericObject;
|
||||
|
||||
RootedFunction clone(cx,
|
||||
NewFunctionClone(cx, fun, newKind, allocKind, proto));
|
||||
|
|
|
@ -840,7 +840,6 @@ extern bool CanReuseScriptForClone(JS::Realm* realm, HandleFunction fun,
|
|||
extern JSFunction* CloneFunctionReuseScript(JSContext* cx, HandleFunction fun,
|
||||
HandleObject enclosingEnv,
|
||||
gc::AllocKind kind,
|
||||
NewObjectKind newKindArg,
|
||||
HandleObject proto);
|
||||
|
||||
// Functions whose scripts are cloned are always given singleton types.
|
||||
|
|
Загрузка…
Ссылка в новой задаче