1320403 - Move JSFunction::EXPR_BODY to JSScript, LazyScript, and FunctionBox.

This commit is contained in:
Gaming4JC 2019-06-08 15:12:00 -04:00 committed by Roy Tam
commit d451930d58
9 changed files with 55 additions and 26 deletions

View file

@ -1021,6 +1021,7 @@ class JSScript : public js::gc::TenuredCell
bool isAsync_:1;
bool hasRest_:1;
bool isExprBody_:1;
// Add padding so JSScript is gc::Cell aligned. Make padding protected
// instead of private to suppress -Wunused-private-field compiler warnings.
@ -1329,6 +1330,13 @@ class JSScript : public js::gc::TenuredCell
hasRest_ = true;
}
bool isExprBody() const {
return isExprBody_;
}
void setIsExprBody() {
isExprBody_ = true;
}
void setNeedsHomeObject() {
needsHomeObject_ = true;
}
@ -1936,7 +1944,7 @@ class LazyScript : public gc::TenuredCell
#endif
private:
static const uint32_t NumClosedOverBindingsBits = 21;
static const uint32_t NumClosedOverBindingsBits = 20;
static const uint32_t NumInnerFunctionsBits = 20;
struct PackedView {
@ -1946,7 +1954,12 @@ class LazyScript : public gc::TenuredCell
uint32_t shouldDeclareArguments : 1;
uint32_t hasThisBinding : 1;
uint32_t isAsync : 1;
uint32_t isExprBody : 1;
uint32_t numClosedOverBindings : NumClosedOverBindingsBits;
// -- 32bit boundary --
uint32_t numInnerFunctions : NumInnerFunctionsBits;
uint32_t generatorKindBits : 2;
@ -2104,6 +2117,13 @@ class LazyScript : public gc::TenuredCell
p_.hasRest = true;
}
bool isExprBody() const {
return p_.isExprBody;
}
void setIsExprBody() {
p_.isExprBody = true;
}
bool strict() const {
return p_.strict;
}