summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-12-14 12:25:42 (GMT)
committerGitHub <noreply@github.com>2016-12-14 12:25:42 (GMT)
commitd4792dc98dfca29849bedc21519d9cf9ae6f2cb6 (patch)
treed63399bcc3c99abf141944ebd4f8ff15b32b2f6f /Xamarin.Forms.Core
parentf2fe64ac235871dbed5f1f09812cb5cfc11864e3 (diff)
downloadxamarin-forms-d4792dc98dfca29849bedc21519d9cf9ae6f2cb6.zip
xamarin-forms-d4792dc98dfca29849bedc21519d9cf9ae6f2cb6.tar.gz
xamarin-forms-d4792dc98dfca29849bedc21519d9cf9ae6f2cb6.tar.bz2
[XamlC] Allow compilation of IValueProviders (#622)
* [XamlC] Allow compilation of IValueProviders `IValueProvider`s tagged with the appropriate attribute will be bypassed and the compiled version, if found, will be used. This first version contains a compiled version of Setter's IValueProvider and it already reduces the amount of generated IL by 39% in, e.g. StyleTests. It's a huge gain because XamlC no longer have to generate ServiceProviders for those, so the methodbody is smaller, takes less time to jit, less time to execute and nothing is invoked at runtime, which probably saves a tons of time as well, as most IValueProvider implementation heavily uses reflection. * name bool parameters
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/Setter.cs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/Setter.cs b/Xamarin.Forms.Core/Setter.cs
index b260e8f..ea58d4f 100644
--- a/Xamarin.Forms.Core/Setter.cs
+++ b/Xamarin.Forms.Core/Setter.cs
@@ -8,6 +8,7 @@ using Xamarin.Forms.Xaml;
namespace Xamarin.Forms
{
[ContentProperty("Value")]
+ [ProvideCompiled("Xamarin.Forms.Core.XamlC.SetterValueProvider")]
public sealed class Setter : IValueProvider
{
readonly ConditionalWeakTable<BindableObject, object> _originalValues = new ConditionalWeakTable<BindableObject, object>();