summaryrefslogtreecommitdiff
path: root/js/src/jsscript.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 15:12:00 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:15 -0400
commitf4577065beca25b55b5db9455f7f48eb5d1c048c (patch)
treef13ff8d145308b0f5581732e55dc331ad2551901 /js/src/jsscript.cpp
parent57a3f47ca973c633098635f6605ef72814c2fe62 (diff)
downloadaura-central-f4577065beca25b55b5db9455f7f48eb5d1c048c.tar.gz
1320403 - Move JSFunction::EXPR_BODY to JSScript, LazyScript, and FunctionBox.
Diffstat (limited to 'js/src/jsscript.cpp')
-rw-r--r--js/src/jsscript.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp
index 33ae56d6f..899820a0d 100644
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -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);