Bug 1734098 - Part 7: Add JS::CompileModuleToStencilOffThread. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D133048
This commit is contained in:
@@ -250,7 +250,16 @@ nsresult ModuleLoader::CreateModuleScript(ModuleLoadRequest* aRequest) {
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (aRequest->mWasCompiledOMT) {
|
||||
module = JS::FinishOffThreadModule(cx, aRequest->mOffThreadToken);
|
||||
JS::Rooted<JS::InstantiationStorage> storage(cx);
|
||||
|
||||
RefPtr<JS::Stencil> stencil = JS::FinishCompileModuleToStencilOffThread(
|
||||
cx, aRequest->mOffThreadToken, storage.address());
|
||||
if (stencil) {
|
||||
JS::InstantiateOptions instantiateOptions(options);
|
||||
module = JS::InstantiateModuleStencil(cx, instantiateOptions, stencil,
|
||||
storage.address());
|
||||
}
|
||||
|
||||
aRequest->mOffThreadToken = nullptr;
|
||||
rv = module ? NS_OK : NS_ERROR_FAILURE;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user