зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1587950 - Use HasInnerFunctions flag for LazyScript. r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D48904 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
af2451e030
Коммит
6ca3ab075b
|
@ -1555,7 +1555,7 @@ bool JSFunction::createScriptForLazilyInterpretedFunction(JSContext* cx,
|
|||
// requires a non-lazy script. Note that if this ever changes,
|
||||
// XDRRelazificationInfo will have to be fixed.
|
||||
bool isBinAST = lazy->scriptSource()->hasBinASTSource();
|
||||
bool canRelazify = !lazy->numInnerFunctions() && !lazy->hasDirectEval();
|
||||
bool canRelazify = !lazy->hasInnerFunctions() && !lazy->hasDirectEval();
|
||||
|
||||
if (script) {
|
||||
// This function is non-canonical function, and the canonical
|
||||
|
|
|
@ -268,7 +268,7 @@ static XDRResult XDRRelazificationInfo(XDRState<mode>* xdr, HandleFunction fun,
|
|||
HandleScope enclosingScope,
|
||||
MutableHandle<LazyScript*> lazy) {
|
||||
MOZ_ASSERT_IF(mode == XDR_ENCODE, script->maybeLazyScript());
|
||||
MOZ_ASSERT_IF(mode == XDR_ENCODE, !lazy->numInnerFunctions());
|
||||
MOZ_ASSERT_IF(mode == XDR_ENCODE, !lazy->hasInnerFunctions());
|
||||
|
||||
JSContext* cx = xdr->cx();
|
||||
|
||||
|
@ -295,7 +295,7 @@ static XDRResult XDRRelazificationInfo(XDRState<mode>* xdr, HandleFunction fun,
|
|||
// We can assert we have no inner functions because we don't
|
||||
// relazify scripts with inner functions. See
|
||||
// JSFunction::createScriptForLazilyInterpretedFunction.
|
||||
MOZ_ASSERT(lazy->numInnerFunctions() == 0);
|
||||
MOZ_ASSERT(!lazy->hasInnerFunctions());
|
||||
if (fun->kind() == FunctionFlags::FunctionKind::ClassConstructor) {
|
||||
numFieldInitializers =
|
||||
(uint32_t)lazy->getFieldInitializers().numFieldInitializers;
|
||||
|
@ -5283,6 +5283,9 @@ LazyScript* LazyScript::Create(
|
|||
if (parseGoal == frontend::ParseGoal::Module) {
|
||||
immutableFlags |= uint32_t(ImmutableFlags::IsModule);
|
||||
}
|
||||
if (!innerFunctionBoxes.empty()) {
|
||||
immutableFlags |= uint32_t(ImmutableFlags::HasInnerFunctions);
|
||||
}
|
||||
|
||||
LazyScript* res = LazyScript::CreateRaw(
|
||||
cx, closedOverBindings.length(), innerFunctionBoxes.length(), fun,
|
||||
|
|
Загрузка…
Ссылка в новой задаче