Bug 1734098 - Part 3: Use JS::CompileToStencilOffThread instead of JS::CompileOffThread in ScriptLoader. r=nbp

Differential Revision: https://phabricator.services.mozilla.com/D133044
This commit is contained in:
Tooru Fujisawa
2021-12-09 18:21:10 +00:00
parent e5ec02dfb6
commit 620be45766
4 changed files with 31 additions and 10 deletions

View File

@@ -1904,12 +1904,14 @@ nsresult ScriptLoader::AttemptAsyncScriptCompile(ScriptLoadRequest* aRequest,
nsresult rv = aRequest->GetScriptSource(cx, &maybeSource);
NS_ENSURE_SUCCESS(rv, rv);
options.allocateInstantiationStorage = true;
aRequest->mOffThreadToken =
maybeSource.constructed<SourceText<char16_t>>()
? JS::CompileOffThread(
? JS::CompileToStencilOffThread(
cx, options, maybeSource.ref<SourceText<char16_t>>(),
OffThreadScriptLoaderCallback, static_cast<void*>(runnable))
: JS::CompileOffThread(
: JS::CompileToStencilOffThread(
cx, options, maybeSource.ref<SourceText<Utf8Unit>>(),
OffThreadScriptLoaderCallback, static_cast<void*>(runnable));
if (!aRequest->mOffThreadToken) {