зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1687973 - Part 8: Cleanup ParseTask::parse code flow. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D131362
This commit is contained in:
Родитель
4887469061
Коммит
6b1a90a4ea
|
@ -637,18 +637,21 @@ void ScriptParseTask<Unit>::parse(JSContext* cx) {
|
|||
options.nonSyntacticScope ? ScopeKind::NonSyntactic : ScopeKind::Global;
|
||||
|
||||
stencilInput_ = cx->make_unique<frontend::CompilationInput>(options);
|
||||
|
||||
if (stencilInput_) {
|
||||
extensibleStencil_ = frontend::CompileGlobalScriptToExtensibleStencil(
|
||||
cx, *stencilInput_, data, scopeKind);
|
||||
if (!stencilInput_) {
|
||||
return;
|
||||
}
|
||||
|
||||
extensibleStencil_ = frontend::CompileGlobalScriptToExtensibleStencil(
|
||||
cx, *stencilInput_, data, scopeKind);
|
||||
|
||||
if (!extensibleStencil_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (extensibleStencil_) {
|
||||
frontend::BorrowingCompilationStencil borrowingStencil(*extensibleStencil_);
|
||||
if (!frontend::PrepareForInstantiate(cx, *stencilInput_, borrowingStencil,
|
||||
gcOutput_)) {
|
||||
extensibleStencil_ = nullptr;
|
||||
}
|
||||
extensibleStencil_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -677,12 +680,13 @@ void CompileToStencilTask<Unit>::parse(JSContext* cx) {
|
|||
options.nonSyntacticScope ? ScopeKind::NonSyntactic : ScopeKind::Global;
|
||||
|
||||
stencilInput_ = cx->make_unique<frontend::CompilationInput>(options);
|
||||
if (!stencilInput_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stencilInput_) {
|
||||
extensibleStencil_ = frontend::CompileGlobalScriptToExtensibleStencil(
|
||||
cx, *stencilInput_, data, scopeKind);
|
||||
}
|
||||
}
|
||||
|
||||
bool ParseTask::instantiateStencils(JSContext* cx) {
|
||||
MOZ_ASSERT(kind != ParseTaskKind::ScriptStencil);
|
||||
|
@ -728,18 +732,20 @@ void ModuleParseTask<Unit>::parse(JSContext* cx) {
|
|||
options.setModule();
|
||||
|
||||
stencilInput_ = cx->make_unique<frontend::CompilationInput>(options);
|
||||
|
||||
if (stencilInput_) {
|
||||
extensibleStencil_ =
|
||||
frontend::ParseModuleToExtensibleStencil(cx, *stencilInput_, data);
|
||||
if (!stencilInput_) {
|
||||
return;
|
||||
}
|
||||
|
||||
extensibleStencil_ =
|
||||
frontend::ParseModuleToExtensibleStencil(cx, *stencilInput_, data);
|
||||
if (!extensibleStencil_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (extensibleStencil_) {
|
||||
frontend::BorrowingCompilationStencil borrowingStencil(*extensibleStencil_);
|
||||
if (!frontend::PrepareForInstantiate(cx, *stencilInput_, borrowingStencil,
|
||||
gcOutput_)) {
|
||||
extensibleStencil_ = nullptr;
|
||||
}
|
||||
extensibleStencil_.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче