Skip to content

Commit

Permalink
[tools] Enable the register-protocols optimization when the interpret…
Browse files Browse the repository at this point in the history
…er is enabled. Fixes #21782.

In .NET we don't support loading assemblies at runtime (from outside the app
bundle), which means that we should also be able to enable the
register-protocol optimization when the interpreter is enabled (because we
know all the relevant assemblies at built time).

Fixes #21782.
  • Loading branch information
rolfbjarne committed Dec 9, 2024
1 parent f29834a commit af4f6a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/common/Optimizations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ public void Initialize (Application app, out List<ProductException> messages)
OptimizeBlockLiteralSetupBlock = app.Registrar == RegistrarMode.Static || app.Registrar == RegistrarMode.ManagedStatic;
}

// We will register protocols if the static registrar is enabled and loading assemblies is not possible
// We will register protocols if the static registrar is enabled
if (!RegisterProtocols.HasValue) {
if (app.Platform != ApplePlatform.MacOSX || app.XamarinRuntime == XamarinRuntime.NativeAOT) {
RegisterProtocols = (app.Registrar == RegistrarMode.Static || app.Registrar == RegistrarMode.ManagedStatic) && !app.UseInterpreter;
RegisterProtocols = (app.Registrar == RegistrarMode.Static || app.Registrar == RegistrarMode.ManagedStatic);
} else {
RegisterProtocols = false;
}
Expand Down

0 comments on commit af4f6a3

Please sign in to comment.