mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
1320403 - Move JSFunction::EXPR_BODY to JSScript, LazyScript, and FunctionBox.
This commit is contained in:
parent
7f7b0a029c
commit
d451930d58
9 changed files with 55 additions and 26 deletions
|
|
@ -319,6 +319,7 @@ js::XDRScript(XDRState<mode>* xdr, HandleScope scriptEnclosingScope, HandleScrip
|
|||
IsStarGenerator,
|
||||
IsAsync,
|
||||
HasRest,
|
||||
IsExprBody,
|
||||
OwnSource,
|
||||
ExplicitUseStrict,
|
||||
SelfHosted,
|
||||
|
|
@ -436,6 +437,8 @@ js::XDRScript(XDRState<mode>* xdr, HandleScope scriptEnclosingScope, HandleScrip
|
|||
scriptBits |= (1 << IsAsync);
|
||||
if (script->hasRest())
|
||||
scriptBits |= (1 << HasRest);
|
||||
if (script->isExprBody())
|
||||
scriptBits |= (1 << IsExprBody);
|
||||
if (script->hasSingletons())
|
||||
scriptBits |= (1 << HasSingleton);
|
||||
if (script->treatAsRunOnce())
|
||||
|
|
@ -589,6 +592,8 @@ js::XDRScript(XDRState<mode>* xdr, HandleScope scriptEnclosingScope, HandleScrip
|
|||
script->setAsyncKind(AsyncFunction);
|
||||
if (scriptBits & (1 << HasRest))
|
||||
script->setHasRest();
|
||||
if (scriptBits & (1 << IsExprBody))
|
||||
script->setIsExprBody();
|
||||
}
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(jsbytecode) == 1);
|
||||
|
|
@ -2660,6 +2665,8 @@ JSScript::initFromFunctionBox(ExclusiveContext* cx, HandleScript script,
|
|||
script->setAsyncKind(funbox->asyncKind());
|
||||
if (funbox->hasRest())
|
||||
script->setHasRest();
|
||||
if (funbox->isExprBody())
|
||||
script->setIsExprBody();
|
||||
|
||||
PositionalFormalParameterIter fi(script);
|
||||
while (fi && !fi.closedOver())
|
||||
|
|
@ -3320,6 +3327,7 @@ js::detail::CopyScript(JSContext* cx, HandleScript src, HandleScript dst,
|
|||
dst->isDefaultClassConstructor_ = src->isDefaultClassConstructor();
|
||||
dst->isAsync_ = src->asyncKind() == AsyncFunction;
|
||||
dst->hasRest_ = src->hasRest_;
|
||||
dst->isExprBody_ = src->isExprBody_;
|
||||
|
||||
if (nconsts != 0) {
|
||||
GCPtrValue* vector = Rebase<GCPtrValue>(dst, src, src->consts()->vector);
|
||||
|
|
@ -4059,6 +4067,7 @@ LazyScript::Create(ExclusiveContext* cx, HandleFunction fun,
|
|||
p.hasThisBinding = false;
|
||||
p.isAsync = false;
|
||||
p.hasRest = false;
|
||||
p.isExprBody = false;
|
||||
p.numClosedOverBindings = closedOverBindings.length();
|
||||
p.numInnerFunctions = innerFunctions.length();
|
||||
p.generatorKindBits = GeneratorKindAsBits(NotGenerator);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue