Граф коммитов

179 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot a9f8d7b379
[mtouch][mmp] Add control over the the linker new `BeforeFieldInit` optimization (#5820)
Add an mtouch/mmp optimization flag to control this new optimization since
3rd party code (in particular binaries) might depend on this side effect.
2019-04-01 21:21:56 -05:00
Sebastien Pouliot 5c321ac89d
[mtouch] Update validations around --interpreter (#5772)
This also centralize other interpreter checks and options in the same
location (making it easier to read / update).

* Warn and switch the REPL if the interpreter is enabled on simulator

Why ? It's confusing to build the same code using different options for
simulator and devices. This is what happens if you try to use features
like `dynamic` or `System.Reflection.Emit`.

So instead of an error, we warn that the interpreter is not supported
and switch to the existing REPL mode.

The JIT remains the only option for the simulator but it allows testing
features without a device.

* Fail early if the interpreter is used on 32bits [1]

The current interpreter only works on 64 bits (so ARM64). However the
error won't be reported, back to the developer, until deployment time.

This temporary [1] fix spot the condition very early and report an error

```
error MT0099 : Internal error : The interpreter is currently only available for 64 bits.
```

instead of the current one at deploy time

```
IncorrectArchitecture: Failed to find matching arch for 32-bit Mach-O input file /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.tNKDlx/extracted/X.app/X
error MT1006: Could not install the application 'X.app' on the device 'Mercure': AMDeviceSecureInstallApplicationBundle returned: 0xe8000087 (kAMDIncorrectArchitectureError).

Application could not be uploaded to the device.
```

[1] https://github.com/mono/mono/issues/9871

* [tests] Fix/renumbered MT0138

The test was using simulator + interpreter which is not _really_
possible, we use REPL in that case - so we're now checking if
assemblies were specified with `--interpreter` to cover both cases.

Also 0138 was already used by `mmp` and the warning was **not**
registered or documented in the errors documents. To avoid
confusion it has been renumbered to 0142 and documented.
2019-03-19 08:22:39 -05:00
Sebastien Pouliot ea96b2299a
[mtouch] Make the SealerSubStep a configurable optimization (#5766)
document it and adjust the optimization tests.

This allows the optimization to be:
* disabled (if ever needed) on fully AOT'ed applications
* re-enabled for the interpreter (at your own risk)
2019-03-14 08:12:17 -05:00
Rolf Bjarne Kvinge 590524243c
Improve MachO support to read LC_BUILD_VERSION and static libraries. (#5685)
* MachO.cs: Support reading LC_BUILD_VERSION

Newer SDKs set this instead of LC_VERSION_MIN_*

* MachO.cs: Add support for reading Mach-O files inside ar archives.

* [tests] Augment ProductTests.MinOSVersion to test static libraries as well.

* Adjust enum field names to match our naming scheme.
2019-03-01 08:00:53 +01:00
Rolf Bjarne Kvinge ffda8b93ba
[mtouch] Remove MT0028, since it's only applicable if iOS deployment target is < 4.2. (#5625) 2019-02-20 06:29:52 +01:00
Rolf Bjarne Kvinge d02c9bc8e0
Add a Runtime.IsARM64CallingConvention property. (#5569)
* Add a Runtime.IsARM64CallingConvention property.

Determining whether we should use the ARM64 calling convention in P/Invokes
gets more complicated with ARM64_32 (which for our purposes is a 32-bit
architecture).

So add a property on the Runtime class to avoid code duplication, and teach
the linker to optimize any calls to this property to a constant value whenever
possible (and the method is marked as optimizable).

Also change our code to use this new property, and make the corresponding
methods optimizable.

Some shuffling in mmp was required, which meant a little bit more code is now
shared between mtouch and mmp.

* Coding style.

* Test tweaks.

* Improve comment.

* Document new optimization

* Move ILReader to shared linker test code location.

* Disable inlining on armv7k.

* Change IsARM64CallingConvention to a read-only field.

We can give the AOT compiler a constant value for a read-only field, so that
the AOT compiler optimizes away the call to the field by using the constant
value.

This commit does not implement this change for the AOT compiler, but using a
read-only field makes it easy to implement it in the future.
2019-02-11 17:29:13 +01:00
Rolf Bjarne Kvinge 135507957f
[linker] Remove non-bitcode compatible code, and show a warning. (#5551)
* [linker] Remove non-bitcode compatible code, and show a warning.

Remove code not currently compatible with bitcode and replace it with an
exception instead (otherwise we'll assert at runtime).

Also show a warning when we detect this.

This is quite helpful when looking at watch device test runs to filter out
failures we already know about.

This fixes point #2 in #4763.

* Improve documentation.

* Simplify linker code by using a substep.

* Fix whitespace issues.

* Improve reporting.

* Add support for reporting more than one MT2105 at the same time when making
  the errors instead of warnings.
* Only report MT2105 for methods that haven't been linked away.
* Format the error message nicer for properties.

* Tweak a bit for warning tests to pass.

* Use ExceptionalSubStep to provide better error information.

* Adjust where linker warnings/errors are reported from to avoid a NullReferenceException.
2019-02-07 07:57:01 +01:00
Rolf Bjarne Kvinge 22c8ca5090
[docs] Make PreserveSmartEnumConversionsSubStep use unique error codes and improve ExceptionalSubStep error documentation. (#5555)
* Make PreserveSmartEnumConversionsSubStep use error codes that are not
  already used elsewhere: this isn't obvious at first, but all
  ExceptionalSubStep errors use a range of error numbers (10 numbers from NNN0
  to NNN9), so we need to reserve that entire range. In this case there were
  other errors using some of the numbers of the range for PreserveSmartEnumConversionsSubStep.
* Make sure there are anchor links for all the variations of each ExceptionalSubStep error.
2019-02-06 15:31:49 +01:00
Sebastien Pouliot 1c881549a3
[generator] Warn if [NullAllowed] is used on methods. Fixes #4416 (#5464)
The `[NullAllowed]` attribute should not be allowed on methods but it
could break existing binding projects.

Historically it was used on property setters. However using the attribute
on _other_ methods can be misleading, e.g. should it apply to all
parameters, the return value... and its presence/action can be
misinterpreted in code reviews leading to binding bugs.

reference: https://github.com/xamarin/xamarin-macios/issues/5416
2019-01-24 08:57:46 -05:00
Sebastien Pouliot 974617d144
[mtouch] Provide a better (and single) error message when the interpreter is enabled in simulator builds. (#5376)
Before

```
clang : error : no such file or directory: '/Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmono-ee-interp.a'
clang : error : no such file or directory: '/Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmono-icall-table.a'
clang : error : no such file or directory: '/Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmono-ilgen.a'
error MT5209 : Native linking error : clang: error: no such file or directory: '/Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmono-ee-interp.a'
error MT5209 : Native linking error : clang: error: no such file or directory: '/Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmono-icall-table.a'
error MT5209 : Native linking error : clang: error: no such file or directory: '/Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libmono-ilgen.a'
MTOUCH : error MT5202: Native linking failed. Please review the build log.
    0 Warning(s)
    7 Error(s)
```

After

```
MTOUCH : error MT0141: The interpreter is not supported in the simulator. Do not pass --interpreter when building for the simulator.
    0 Warning(s)
    1 Error(s)
```
2019-01-11 11:38:22 -05:00
Filip Navara 50f43f5059 Update binding_types_reference_guide.md (#5287)
Fix function name to match code - trampolines in runtime code are prefixed with `xamarin` since the unification of Xamarin.iOS and Xamarin.Mac.
2018-12-18 14:38:30 +01:00
Alex Soto 8bb5ab52b1
[registrar] Validate input to Adopts attribute (#5191)
Fixes xamarin/xamarin-macios#4107

We currently generate invalid registrar code when we get invalid input
in 'Adopts' attribute, this can happen because 'Adopts' can take a
plain string. We now generate a better error MT4177 instead of
generating invalid registrar.m/h code.
2018-11-28 10:06:36 -05:00
Chris Hamons e91ba9f93a
[mmp] Fix typo (#5123)
- https://github.com/xamarin/xamarin-macios/issues/5121
2018-11-13 17:56:05 -05:00
Sebastien Pouliot d2a9a57bb9
[mtouch] Display a specific error is a .framework binary is invalid. Fixes #5028 (#5031)
Instead of a generic `MT0000` caused by an exception reading the magic
numbers of the binary framework file.

This was caused be uncompressing an archive, with a symlink, into a
file system that does not support symlinks (on Windows).

ref: https://github.com/xamarin/xamarin-macios/issues/5028
2018-10-23 14:15:58 -04:00
Jeffrey Stedfast 0cbf9609a1
Update mtouch-errors.md 2018-10-22 10:22:52 -04:00
Jeffrey Stedfast 502d811c43
Update mtouch-errors.md 2018-10-22 10:20:57 -04:00
Rolf Bjarne Kvinge 45d2ade35e
[docs] Improve documentation for MT5216. Fixes #4445. (#4956)
Fixes https://github.com/xamarin/xamarin-macios/issues/4445.
2018-10-10 08:52:05 +02:00
Chris Hamons c41673dce8
Add mmp error when combining partial static registrar and linking (#4932)
- https://github.com/xamarin/xamarin-macios/issues/4825
2018-10-05 09:43:53 -05:00
Chris Hamons 3119129ab7 Remove references to bugzilla and replace with github (#4920)
https://github.com/xamarin/xamarin-macios/issues/3647
2018-10-04 09:43:55 -04:00
Chris Hamons 2b85512509
Update MM0134 with url to fix #3577 (#4879) 2018-09-26 10:24:22 -05:00
Rolf Bjarne Kvinge 11d9fe68db
[mtouch/mmp/docs] Improve MT0091 to include how to enable the linker. Fixes #4549. (#4852)
Fixes https://github.com/xamarin/xamarin-macios/issues/4549.
2018-09-21 16:51:23 +02:00
Vincent Dondain dbb151c63e [docs] Fix errors after broken merge 2018-09-19 11:03:56 -04:00
Vincent Dondain 2174ec41a2 Merge branch 'xcode10' 2018-09-18 14:12:39 -04:00
Rolf Bjarne Kvinge ab50c94add
[XM] Only use bgen, not bmac[-mobile-mono]. Fixes #3675. (#4785)
We don't need to use a custom mono to run the generator anymore, so stop doing
it.

Unfortunately we can't remove the custom mono, since we're now using it for
another purpose (AOT-compiling XM apps).

Fixes https://github.com/xamarin/xamarin-macios/issues/3675.
2018-09-13 15:27:34 +02:00
Rolf Bjarne Kvinge 385592b128
[runtime] Throw a managed exception instead of trying to call a null function pointer if the runtime tries to call a function that has been linked away. (#4770)
* [runtime] Throw a managed exception instead of trying to call a null function pointer if the runtime tries to call a function that has been linked away.

* [tests] Add new file for Xamarin.Mac tests.

* Direct people to file issues in github.
2018-09-10 10:56:02 +02:00
Rolf Bjarne Kvinge bd32b74347
Add support for delegates as return values in protocol members. Fixes #4102. (#4758)
* Add support for delegates as return values in protocol members. Fixes #4102.

This required a few changes:

* The generator now emits the DelegateProxy attribute for property getters in
  protocol interfaces.
* The generator now emits the DelegateProxy attribute in ProtocolMember
  attributes (and the ProtocolMember attribute has been extended with
  additional properties for this purpose).
* The generator now emits the BlockProxy attribute for the parameter in
  property setters.
* The generator now emits the BlockProxy attribute in ProtocolMember
  attributes for property setters.
* The static registrar now emits the metadata token for the
  DelegateProxy.DelegateType property into the generated code so that the
  DelegateProxy attribute itself isn't needed at runtime. This is required
  when the dynamic registrar has been optimized away.

Fixes https://github.com/xamarin/xamarin-macios/issues/4102.

* [tests] Update MX4105 test to expect new warnings.
2018-09-06 16:20:23 +02:00
Rolf Bjarne Kvinge 5da88bfbc7
[mmp] Show an error if trying to build a 32-bit app with Xcode 10. Fixes #4569. (#4684)
Fixes https://github.com/xamarin/xamarin-macios/issues/4569.
2018-08-24 12:28:10 +02:00
Vincent Dondain eec95e881c Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
Rolf Bjarne Kvinge fd05ba6a79
[mtouch] Show warnings when we can't find referenced assemblies. (#4511)
* [mtouch] Show warnings when we can't find referenced assemblies.

This would have helped track down #4235.

* Improve MT0137 warning to indicate the type of the attribute causing the warning.
2018-07-30 10:55:23 +02:00
Rolf Bjarne Kvinge e110612118
[registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360)
* Convert it into a MM8027/MT8027 error (with documentation).
* Add information about the selector and managed method that triggered the error.

Now the problem reported in issue #4254 shows up as:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).
> Additional information:
> 	Selector: popoverController:willRepositionPopoverToRect:inView:
> 	Method: UIKit.UIPopoverController+_UIPopoverControllerDelegate.WillReposition(UIKit.UIPopoverController, CoreGraphics.CGRect ByRef, UIKit.UIView ByRef)

instead of just:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).

which makes it much easier to understand, track down, and fix/work around,
both for customers and ourselves.
2018-06-29 14:38:28 +02:00
Rolf Bjarne Kvinge a28fa8b56f
[docs] Fix bugzilla link to file bugs for Xamarin.Mac for mmp errors. (#4358) 2018-06-29 09:47:14 +02:00
Rolf Bjarne Kvinge a88a79cfc0
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073)
* [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072.

BlockProxy attributes may have types we don't expect, so handle those cases
gracefully by showing a warning when we encounter them:

    testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method).

instead of an ugly MT0000:

    MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
    System.InvalidOperationException: Sequence contains no matching element
      at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30
      at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121
      at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065
      at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683
      at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963

Fixes #4072.

* [docs] Improve text for MT4175.

* [registrar] Comment some code.
2018-05-11 14:42:27 +02:00
Rolf Bjarne Kvinge a54b471713
[docs] Fix MT -> MM prefix for Xamarin.Mac errors. (#4054) 2018-05-10 07:40:48 +02:00
Rolf Bjarne Kvinge 3c2f87abc5
[docs] Update optimizations document with upstream changes. (#4043)
Ref: https://github.com/MicrosoftDocs/xamarin-docs-pr/pull/204
2018-05-08 07:24:23 +02:00
Brad Umbaugh 334473b50b Removed an unnecessary period (#3967) 2018-04-20 16:20:04 -04:00
Sebastien Pouliot c80edcea02
Synchronize back docs moved to https://docs.microsoft.com (#3771) 2018-04-17 09:02:42 -04:00
Rolf Bjarne Kvinge 256a3f57f1
[docs] Document recent changes to ModelAttribute in the generator. (#3900) 2018-04-09 19:32:45 +02:00
Vincent Dondain 7edc4d24f4
[mtouch-errors] Update MT1108 DeveloperDiskImage.dmg full path (#3891)
Path changed and it has /Platforms now. Also added /Applications at the beginning.
2018-04-08 16:03:36 -04:00
Chris Hamons 3627e87344 [mmp][mtouch] Better guard framework SDK checks (#3757) (#3796)
- https://github.com/xamarin/xamarin-macios/issues/3725
- These frameworks "CoreAudioKit Metal MetalKit MetalPerformanceShaders CoreNFC DeviceCheck"
 were special cased, but that special case did do an SDK check.
- Create a helper method to share check
- Add test for MM0135
2018-03-21 21:00:23 -04:00
Chris Hamons ab7ba02fe7
Move MM2100 to a 2109 as mtouch collided with it (#3773) 2018-03-20 09:28:06 -05:00
Chris Hamons a73b200f59
[mmp][mtouch] Better guard framework SDK checks (#3757)
- https://github.com/xamarin/xamarin-macios/issues/3725
- These frameworks "CoreAudioKit Metal MetalKit MetalPerformanceShaders CoreNFC DeviceCheck"
 were special cased, but that special case did do an SDK check.
- Create a helper method to share check
- Add test for MM0135
2018-03-20 09:26:25 -05:00
Vincent Dondain 97ef51bf8b
[msbuild] Use a response file in 'MTouchTaskBase' (#3635)
The main cause of the warning: "warning MSB6002: The command-line for the 'MTouch' task is too long" was the number of references that can be passed to `mtouch`.
Now all the arguments are written in a response file which in turn is passed to `mtouch`.

- Fixes bug #56501: MSB6002 command-line for MTouch task is too long, > 32000 characters
(https://bugzilla.xamarin.com/show_bug.cgi?id=56501)
- The response file is created in the device specific folder, as `response-file.rsp`. It is re-created every time.
- Added an msbuild test to ensure the response file is created by `GenerateCommandLineCommands` and that it includes all the references.
- Introduce `AddLine` and `AddQuotedLine` which we use to populate the response file (and go to the next line).
- Move to C# 7 syntax for string replacement.
- Update all tests in `MTouchTaskTests` to use the response file since the arguments are no longer passed directly to `mtouch`.
- Update MT0018's documentation for response files.
2018-03-05 11:59:53 -05:00
Rolf Bjarne Kvinge 835f65897f
[static registrar] Optimize creation of delegates for blocks. (#3623) (#3644)
* [static registrar] Optimize creation of delegates for blocks.

Optimize creation of delegates for blocks so that it doesn't require the
dynamic registrar.

This is done by getting the metadata token for the Create method that creates
the delegate, and embed that metadata token in the generated code from the
static registrar.

Also add tests, since this scenario was not covered by tests already.

* [mmptest] Fix test after recent changes.

* [test-libraries] Avoid duplicate symbols.

* [tests] Update according to changes.
2018-03-05 07:41:28 +01:00
Chris Hamons cabc4fbe2c [mmp] Add stripping of 32-bit dylibs to work with new App Store restrictions (#3387) (#3633)
- https://github.com/xamarin/xamarin-macios/issues/3367
- App Store will now fail builds if you add in a 32-bit dylib
- If you are a 32-bit app you don't need the 64-bit part of your fat
dylib anyway
- Add --optimize=-trim-architectures to allow customization of behavior, as not everyone
uses app store

In addition, while writing tests for this is was noticed that mmp tests did not "really" run Release configuration correctly in most cases. Fixing this turned out to be a bit of a pain, but necessary to correctly test this (and other things).

- Turns out that /p:configuration:debug is not sufficient to tell mmp to
do the right thing
- That, in most projects, sets the DebugSymbols property, which really
is what is checked.
- However, two of our projects did not have that, so we always did
release mmp work.
- Removed configuration property for tests and added real "Release"
configuration option
2018-03-02 14:33:27 +01:00
Rolf Bjarne Kvinge b131a54be5
[static registrar] Optimize creation of delegates for blocks. (#3623)
* [static registrar] Optimize creation of delegates for blocks.

Optimize creation of delegates for blocks so that it doesn't require the
dynamic registrar.

This is done by getting the metadata token for the Create method that creates
the delegate, and embed that metadata token in the generated code from the
static registrar.

Also add tests, since this scenario was not covered by tests already.

* [mmptest] Fix test after recent changes.

* [test-libraries] Avoid duplicate symbols.

* [tests] Update according to changes.
2018-03-02 14:30:18 +01:00
Chris Hamons ca4360116c
[mmp] Add stripping of 32-bit dylibs to work with new App Store restrictions (#3387)
- https://github.com/xamarin/xamarin-macios/issues/3367
- App Store will now fail builds if you add in a 32-bit dylib
- If you are a 32-bit app you don't need the 64-bit part of your fat
dylib anyway
- Add --optimize=-trim-architectures to allow customization of behavior, as not everyone
uses app store

In addition, while writing tests for this is was noticed that mmp tests did not "really" run Release configuration correctly in most cases. Fixing this turned out to be a bit of a pain, but necessary to correctly test this (and other things).

- Turns out that /p:configuration:debug is not sufficient to tell mmp to
do the right thing
- That, in most projects, sets the DebugSymbols property, which really
is what is checked.
- However, two of our projects did not have that, so we always did
release mmp work.
- Removed configuration property for tests and added real "Release"
configuration option
2018-03-01 09:36:06 -06:00
Chris Hamons ceac49f5ee Warn when building 32-bit macOS applications (#3564) (#3579)
- https://github.com/xamarin/xamarin-macios/issues/3325
2018-02-22 22:38:32 +01:00
Chris Hamons 040461ba0a
Warn when building 32-bit macOS applications (#3564)
- https://github.com/xamarin/xamarin-macios/issues/3325
2018-02-22 12:47:28 -06:00
Rolf Bjarne Kvinge c838a11c4d
Merge pull request #3495 (Implement support for optimizing away the dynamic registrar) from rolfbjarne/full-static-registrar
Implement support for optimizing away the dynamic registrar.

* Add a new property (Runtime.DynamicRegistrationSupported) that indicates at
  runtime whether dynamic registration is available.

* Check this new property whenever we need dynamic registration.

* Add an optimization to mtouch/mmp that detects whether dynamic registration
  is required, and if not, changes Runtime.DynamicRegistrationSupported to
  return false.

* Add an optimization to mtouch/mmp that inlines
  Runtime.DynamicRegistrationSupported as a constant value.

The end result is that the linker will link away the dynamic registrar if
mtouch/mmp detects that it's not needed.

Benchmark
---------

I've compared the size of entire apps built for device:

|test                          | Before |  After |   Diff |     % |
|:-----------------------------|-------:|-------:|-------:|------:|
|[monotouch-test/Release][1]   | 95.7mb | 95.0mb | -680kb | -0.7% |
|[link sdk/Release][2]         | 21.2mb | 20.9mb | -245kb | -1.2% |
|[minimalistic app/Release][3] | 4.58mb | 4.32mb | -259kb | -5.7% |

[1]: https://gist.github.com/rolfbjarne/3871e36d2de8db1a8eee1d9f9276d3d2#monotouch-test-release-wall-optimizations-enabled
[2]: https://gist.github.com/rolfbjarne/3871e36d2de8db1a8eee1d9f9276d3d2#link-sdk
[3]: https://gist.github.com/rolfbjarne/3871e36d2de8db1a8eee1d9f9276d3d2#minimalistic-app
2018-02-15 23:56:00 +01:00
Vincent Dondain 94ec17e875
[xamarin-analysis] Add XIA0007 to docs/website/xamarin-ios-analysis.md (#3498) 2018-02-15 14:14:35 -05:00