зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1558604 - Keep interpreted and interpretedLazy on FunctionBox r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D34587 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2599f90f55
Коммит
a1b1769aac
|
@ -396,7 +396,7 @@ JS::Result<Ok> BinASTParserPerTokenizer<Tok>::finishLazyFunction(
|
|||
lazy->setStrict();
|
||||
}
|
||||
MOZ_ASSERT(lazy->isBinAST());
|
||||
fun->initLazyScript(lazy);
|
||||
funbox->initLazyScript(lazy);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
|
|
@ -639,7 +639,7 @@ bool frontend::StandaloneFunctionCompiler<Unit>::compile(
|
|||
MutableHandleFunction fun, StandaloneFunctionInfo& info,
|
||||
FunctionNode* parsedFunction) {
|
||||
FunctionBox* funbox = parsedFunction->funbox();
|
||||
if (funbox->function()->isInterpreted()) {
|
||||
if (funbox->isInterpreted()) {
|
||||
MOZ_ASSERT(fun == funbox->function());
|
||||
|
||||
if (!createFunctionScript(info, funbox->toStringStart,
|
||||
|
|
|
@ -1736,6 +1736,7 @@ bool PerHandlerParser<SyntaxParseHandler>::finishFunction(
|
|||
PropagateTransitiveParseFlags(funbox, lazy);
|
||||
|
||||
fun->initLazyScript(lazy);
|
||||
funbox->setIsInterpretedLazy(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -7011,7 +7012,7 @@ bool GeneralParser<ParseHandler, Unit>::finishClassConstructor(
|
|||
}
|
||||
|
||||
// Set the same information, but on the lazyScript.
|
||||
if (ctorbox->function()->isInterpretedLazy()) {
|
||||
if (ctorbox->isInterpretedLazy()) {
|
||||
ctorbox->function()->lazyScript()->setToStringEnd(classEndOffset);
|
||||
|
||||
if (numFields > 0) {
|
||||
|
|
|
@ -161,6 +161,8 @@ FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
|
|||
isGetter_(fun->isGetter()),
|
||||
isSetter_(fun->isSetter()),
|
||||
isMethod_(fun->isMethod()),
|
||||
isInterpreted_(fun->isInterpreted()),
|
||||
isInterpretedLazy_(fun->isInterpretedLazy()),
|
||||
kind_(fun->kind()),
|
||||
explicitName_(fun->explicitName()) {
|
||||
// Functions created at parse time may be set singleton after parsing and
|
||||
|
|
|
@ -394,6 +394,9 @@ class FunctionBox : public ObjectBox, public SharedContext {
|
|||
bool isSetter_ : 1;
|
||||
bool isMethod_ : 1;
|
||||
|
||||
bool isInterpreted_ : 1;
|
||||
bool isInterpretedLazy_ : 1;
|
||||
|
||||
JSFunction::FunctionKind kind_;
|
||||
JSAtom* explicitName_;
|
||||
|
||||
|
@ -431,14 +434,20 @@ class FunctionBox : public ObjectBox, public SharedContext {
|
|||
HasHeritage hasHeritage);
|
||||
|
||||
inline bool isLazyFunctionWithoutEnclosingScope() const {
|
||||
return function()->isInterpretedLazy() &&
|
||||
return isInterpretedLazy() &&
|
||||
!function()->lazyScript()->hasEnclosingScope();
|
||||
}
|
||||
void setEnclosingScopeForInnerLazyFunction(Scope* enclosingScope);
|
||||
void finish();
|
||||
|
||||
JSFunction* function() const { return &object()->as<JSFunction>(); }
|
||||
void clobberFunction(JSFunction* function) { gcThing = function; }
|
||||
|
||||
void clobberFunction(JSFunction* function) {
|
||||
gcThing = function;
|
||||
// After clobbering, these flags need to be updated
|
||||
setIsInterpreted(function->isInterpreted());
|
||||
setIsInterpretedLazy(function->isInterpretedLazy());
|
||||
}
|
||||
|
||||
Scope* compilationEnclosingScope() const override {
|
||||
// This method is used to distinguish the outermost SharedContext. If
|
||||
|
@ -450,7 +459,7 @@ class FunctionBox : public ObjectBox, public SharedContext {
|
|||
// from the lazy function at the beginning of delazification and should
|
||||
// keep pointing the same scope.
|
||||
MOZ_ASSERT_IF(
|
||||
function()->isInterpretedLazy() &&
|
||||
isInterpretedLazy() &&
|
||||
function()->lazyScript()->hasEnclosingScope(),
|
||||
enclosingScope_ == function()->lazyScript()->enclosingScope());
|
||||
|
||||
|
@ -524,6 +533,16 @@ class FunctionBox : public ObjectBox, public SharedContext {
|
|||
bool isSetter() const { return isSetter_; }
|
||||
bool isMethod() const { return isMethod_; }
|
||||
|
||||
bool isInterpreted() const { return isInterpreted_; }
|
||||
void setIsInterpreted(bool interpreted) { isInterpreted_ = interpreted; }
|
||||
bool isInterpretedLazy() const { return isInterpretedLazy_; }
|
||||
void setIsInterpretedLazy(bool interpretedLazy) { isInterpretedLazy_ = interpretedLazy; }
|
||||
|
||||
void initLazyScript(LazyScript* script) {
|
||||
function()->initLazyScript(script);
|
||||
setIsInterpretedLazy(function()->isInterpretedLazy());
|
||||
}
|
||||
|
||||
JSFunction::FunctionKind kind() { return kind_; }
|
||||
|
||||
JSAtom* explicitName() const { return explicitName_; }
|
||||
|
|
|
@ -7107,7 +7107,7 @@ static bool DoCompileAsmJS(JSContext* cx, AsmJSParser<Unit>& parser,
|
|||
// asm.js module function. Special cases in the bytecode emitter avoid
|
||||
// generating bytecode for asm.js functions, allowing this asm.js module
|
||||
// function to be the finished result.
|
||||
MOZ_ASSERT(funbox->function()->isInterpreted());
|
||||
MOZ_ASSERT(funbox->isInterpreted());
|
||||
funbox->clobberFunction(moduleFun);
|
||||
|
||||
// Success! Write to the console with a "warning" message indicating
|
||||
|
|
Загрузка…
Ссылка в новой задаче