Skip to content

Commit

Permalink
[mmp] Restrict the blockliterla-setupblock optimization to Unified. F…
Browse files Browse the repository at this point in the history
…ixes maccore xamarin#636.

XamMac.dll is not built anymore, so it doesn't have the new managed API to make the optimization work.

Fixes xamarin/maccore#636.
  • Loading branch information
rolfbjarne committed Feb 13, 2018
1 parent da7fbcb commit 70c147b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/common/Optimizations.cs
Expand Up @@ -94,8 +94,14 @@ public void Initialize (Application app)
#endif

// We try to optimize calls to BlockLiteral.SetupBlock if the static registrar is enabled
if (!OptimizeBlockLiteralSetupBlock.HasValue)
if (!OptimizeBlockLiteralSetupBlock.HasValue) {
#if MONOMAC
// Restrict to Unified, since XamMac.dll doesn't have the new managed block API (SetupBlockImpl) to make the block optimization work.
OptimizeBlockLiteralSetupBlock = app.Registrar == RegistrarMode.Static && Driver.IsUnified;
#else
OptimizeBlockLiteralSetupBlock = app.Registrar == RegistrarMode.Static;
#endif
}

if (Driver.Verbosity > 3)
Driver.Log (4, "Enabled optimizations: {0}", string.Join (", ", values.Select ((v, idx) => v == true ? opt_names [idx] : string.Empty).Where ((v) => !string.IsNullOrEmpty (v))));
Expand Down

0 comments on commit 70c147b

Please sign in to comment.