mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00
Bug 1833464: Apply delazify strategy to off thread module compilations r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D178579
This commit is contained in:
parent
aa7d062ad8
commit
f535ded6d3
@ -1623,17 +1623,6 @@ nsresult ScriptLoader::StartOffThreadCompilation(
|
||||
nsresult rv = aRequest->GetScriptSource(aCx, &maybeSource);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aRequest->IsModuleRequest()) {
|
||||
auto compile = [&](auto& source) {
|
||||
return JS::CompileModuleToStencilOffThread(aCx, aOptions, source,
|
||||
callback, aRunnable);
|
||||
};
|
||||
|
||||
MOZ_ASSERT(!maybeSource.empty());
|
||||
*aTokenOut = maybeSource.mapNonEmpty(compile);
|
||||
return CompileResultForToken(*aTokenOut);
|
||||
}
|
||||
|
||||
if (ShouldApplyDelazifyStrategy(aRequest)) {
|
||||
ApplyDelazifyStrategy(&aOptions);
|
||||
mTotalFullParseSize +=
|
||||
@ -1648,6 +1637,17 @@ nsresult ScriptLoader::StartOffThreadCompilation(
|
||||
mTotalFullParseSize));
|
||||
}
|
||||
|
||||
if (aRequest->IsModuleRequest()) {
|
||||
auto compile = [&](auto& source) {
|
||||
return JS::CompileModuleToStencilOffThread(aCx, aOptions, source,
|
||||
callback, aRunnable);
|
||||
};
|
||||
|
||||
MOZ_ASSERT(!maybeSource.empty());
|
||||
*aTokenOut = maybeSource.mapNonEmpty(compile);
|
||||
return CompileResultForToken(*aTokenOut);
|
||||
}
|
||||
|
||||
if (StaticPrefs::dom_expose_test_interfaces()) {
|
||||
switch (aOptions.eagerDelazificationStrategy()) {
|
||||
case JS::DelazificationOption::OnDemandOnly:
|
||||
|
Loading…
x
Reference in New Issue
Block a user