60a8731b35
Add a 'register-protocols' optimization that: Improves static registrar to: * Generate a new table of protocol -> managed wrapper type. This is required to find the wrapper type without having the `[Protocol]` attribute around. * Make the generated code implement protocols from [Adopts] attributes. This makes it possible to link away the `[Protocol]` attribute, because the native implementation of `conformsToProtocol:` does the right thing (we might even be able to link away our complete `ConformsToProtocol` logic when we remove the dynamic registrar). Improves linker to: * Not mark protocol interfaces by the mere virtue of having a type that implements them. This is implemented by not marking protocol interfaces when they're implementing a class, but instead when a method implementation is found to implement a method from a protocol interface. * Mark the wrapper type for protocols (this allows us to remove the Protocol attribute, since that's the link between the protocol and its wrapper type). * Remove the [Protocol], [ProtocolMember] and [Adopts] attributes (but only if optimizing protocols). The static registrar still needs some of the information linked away, so a few changes are required to make it available post linker. Benchmark --------- I've compared the size of entire apps built for device: |test | Before | After | Diff | % | |:-----------------------------|-------:|-------:|-------:|------:| |[monotouch-test/Debug][1] | 101mb | 100mb | -888kb | -0.9% | |[monotouch-test/Release][2] | 99.2mb | 95.4mb | -830kb | -0.9% | |[minimalistic app/Debug][3] | 10.8mb | 10.4mb | -443kb | -4.1% | |[minimalistic app/Release][4] | 4.7mb | 4.55mb | -157kb | -3.3% | [1]: https://gist.github.com/rolfbjarne/0181ab8abe436c34cf4ee68ecfb8cd18#monotouch-test-debug [2]: https://gist.github.com/rolfbjarne/0181ab8abe436c34cf4ee68ecfb8cd18#monotouch-test-release [3]: https://gist.github.com/rolfbjarne/0181ab8abe436c34cf4ee68ecfb8cd18#minimal-xi-app-debug [4]: https://gist.github.com/rolfbjarne/0181ab8abe436c34cf4ee68ecfb8cd18#minimal-xi-app-release |
||
---|---|---|
.. | ||
apidiff | ||
common | ||
install-source | ||
linker | ||
mmp | ||
mtouch | ||
.gitignore | ||
Makefile | ||
compare-commits.sh | ||
diff-to-html |