From 2d11c8319baf670537a3dad4da5277f976f5812f Mon Sep 17 00:00:00 2001 From: caroline Date: Thu, 12 Mar 2020 22:26:55 +0000 Subject: [PATCH] Bug 1619445 - Remove isDefaultClassConstructor immutable flag. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D65274 --HG-- extra : moz-landing-system : lando --- js/src/vm/JSScript.cpp | 1 - js/src/vm/JSScript.h | 2 -- js/src/vm/SelfHosting.cpp | 2 -- js/src/vm/SharedStencil.h | 25 ++++++++++++------------- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index df2b36e4075d..51ae151676de 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -1401,7 +1401,6 @@ void JSScript::setDefaultClassConstructorSpan( js::ScriptSourceObject* sourceObject, uint32_t start, uint32_t end, unsigned line, unsigned column) { MOZ_ASSERT(compartment() == sourceObject->compartment()); - MOZ_ASSERT(isDefaultClassConstructor()); sourceObject_ = sourceObject; extent_.toStringStart = start; extent_.toStringEnd = end; diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index cd17793e027a..e1bcf7da5956 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -2229,8 +2229,6 @@ setterLevel: \ IMMUTABLE_FLAG_GETTER_SETTER_PUBLIC(needsHomeObject, NeedsHomeObject) IMMUTABLE_FLAG_GETTER_SETTER_PUBLIC(isDerivedClassConstructor, IsDerivedClassConstructor) - IMMUTABLE_FLAG_GETTER_SETTER_PUBLIC(isDefaultClassConstructor, - IsDefaultClassConstructor) IMMUTABLE_FLAG_GETTER_SETTER_PUBLIC(isLikelyConstructorWrapper, IsLikelyConstructorWrapper) IMMUTABLE_FLAG_GETTER(isGenerator, IsGenerator) diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index ea254cb3dc8d..71fd2c898f6f 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -532,8 +532,6 @@ static bool intrinsic_MakeDefaultConstructor(JSContext* cx, unsigned argc, RootedFunction ctor(cx, &args[0].toObject().as()); - ctor->baseScript()->setIsDefaultClassConstructor(); - // Because self-hosting code does not allow top-level lexicals, // class constructors are class expressions in top-level vars. // Because of this, we give them an inferred atom. Since they diff --git a/js/src/vm/SharedStencil.h b/js/src/vm/SharedStencil.h index 4e2d36934eae..b802e9c396ad 100644 --- a/js/src/vm/SharedStencil.h +++ b/js/src/vm/SharedStencil.h @@ -99,45 +99,44 @@ enum class ImmutableScriptFlagsEnum : uint32_t { NeedsHomeObject = 1 << 13, IsDerivedClassConstructor = 1 << 14, - IsDefaultClassConstructor = 1 << 15, // 'this', 'arguments' and f.apply() are used. This is likely to be a // wrapper. - IsLikelyConstructorWrapper = 1 << 16, + IsLikelyConstructorWrapper = 1 << 15, // Set if this function is a generator function or async generator. - IsGenerator = 1 << 17, + IsGenerator = 1 << 16, // Set if this function is an async function or async generator. - IsAsync = 1 << 18, + IsAsync = 1 << 17, // Set if this function has a rest parameter. - HasRest = 1 << 19, + HasRest = 1 << 18, // See comments below. - ArgumentsHasVarBinding = 1 << 20, + ArgumentsHasVarBinding = 1 << 19, // Script came from eval(). - IsForEval = 1 << 21, + IsForEval = 1 << 20, // Whether this is a top-level module script. - IsModule = 1 << 22, + IsModule = 1 << 21, // Whether this function needs a call object or named lambda environment. - NeedsFunctionEnvironmentObjects = 1 << 23, + NeedsFunctionEnvironmentObjects = 1 << 22, // Whether the Parser declared 'arguments'. - ShouldDeclareArguments = 1 << 24, + ShouldDeclareArguments = 1 << 23, // Script is for function. - IsFunction = 1 << 25, + IsFunction = 1 << 24, // Whether this script contains a direct eval statement. - HasDirectEval = 1 << 26, + HasDirectEval = 1 << 25, // Whether this BaseScript is a LazyScript. This flag will be removed after // LazyScript and JSScript are merged in Bug 1529456. - IsLazyScript = 1 << 27, + IsLazyScript = 1 << 26, }; class ImmutableScriptFlags : public ScriptFlagBase {