Bug 1788977 - Consolidate methods for finishing off-thread JS parse/decode. r=arai
Off-thread parse and decode all generate JS::Stencils so the various specializations are not needed for methods that collect the results back to main-thread. Depends on D156335 Differential Revision: https://phabricator.services.mozilla.com/D156336
This commit is contained in:
@@ -149,18 +149,9 @@ nsresult ModuleLoader::CompileFetchedModule(
|
||||
ModuleLoadRequest* aRequest, JS::MutableHandle<JSObject*> aModuleOut) {
|
||||
if (aRequest->GetScriptLoadContext()->mWasCompiledOMT) {
|
||||
JS::Rooted<JS::InstantiationStorage> storage(aCx);
|
||||
|
||||
RefPtr<JS::Stencil> stencil;
|
||||
if (aRequest->IsTextSource()) {
|
||||
stencil = JS::FinishCompileModuleToStencilOffThread(
|
||||
aCx, aRequest->GetScriptLoadContext()->mOffThreadToken,
|
||||
storage.address());
|
||||
} else {
|
||||
MOZ_ASSERT(aRequest->IsBytecode());
|
||||
stencil = JS::FinishDecodeStencilOffThread(
|
||||
aCx, aRequest->GetScriptLoadContext()->mOffThreadToken,
|
||||
storage.address());
|
||||
}
|
||||
RefPtr<JS::Stencil> stencil = JS::FinishOffThreadStencil(
|
||||
aCx, aRequest->GetScriptLoadContext()->mOffThreadToken,
|
||||
storage.address());
|
||||
|
||||
aRequest->GetScriptLoadContext()->mOffThreadToken = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user