summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Frolov <k.frolov@samsung.com>2019-07-24 13:39:34 +0300
committerKonstantin Baladurin <k.baladurin@samsung.com>2019-09-26 00:24:34 +0300
commit04a84fd4a6375ab6e4e80912a9c66de0e518c9b8 (patch)
tree67c5ce2c1e31b4df5d527f4f68a001b33988e7d4
parentf5096f5678507c9ce94fbaa67f3549080be61328 (diff)
downloadcoreclr-04a84fd4a6375ab6e4e80912a9c66de0e518c9b8.tar.gz
coreclr-04a84fd4a6375ab6e4e80912a9c66de0e518c9b8.tar.bz2
coreclr-04a84fd4a6375ab6e4e80912a9c66de0e518c9b8.zip
[Tizen] Precompile frequently used generic methods.
-rw-r--r--clr.featuredefines.props3
-rw-r--r--src/System.Private.CoreLib/System.Private.CoreLib.csproj7
-rw-r--r--src/System.Private.CoreLib/src/Tizen/Precompile.cs38
3 files changed, 48 insertions, 0 deletions
diff --git a/clr.featuredefines.props b/clr.featuredefines.props
index 929768fdbd..f365fc03cd 100644
--- a/clr.featuredefines.props
+++ b/clr.featuredefines.props
@@ -11,6 +11,9 @@
<FeatureBasicFreeze>true</FeatureBasicFreeze>
<FeatureDefaultInterfaces>true</FeatureDefaultInterfaces>
<ProfilingSupportedBuild>true</ProfilingSupportedBuild>
+ <!--
+ This is Tizen-specific option: precompile frequently used instantiations of generics. -->
+ <PrecompileCommonGenerics>true</PrecompileCommonGenerics>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetsUnix)' == 'true'">
diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj
index 6b2b4e8875..0806b8fc80 100644
--- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -453,4 +453,11 @@
</ItemGroup>
<Import Project="ILLink.targets" />
+
+ <!--
+ This is Tizen-specific option: precompile frequently used instantiations of generics. -->
+ <ItemGroup Condition="'$(PrecompileCommonGenerics)' == 'true'">
+ <Compile Include="$(BclSourcesRoot)\Tizen\Precompile.cs" />
+ </ItemGroup>
+
</Project>
diff --git a/src/System.Private.CoreLib/src/Tizen/Precompile.cs b/src/System.Private.CoreLib/src/Tizen/Precompile.cs
new file mode 100644
index 0000000000..a314349e1f
--- /dev/null
+++ b/src/System.Private.CoreLib/src/Tizen/Precompile.cs
@@ -0,0 +1,38 @@
+// Copyright (C) 2019 Samsung Electronics Co., Ltd.
+// Licensed under the MIT License.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace Tizen
+{
+ public static class Precompile
+ {
+ public static void precompile()
+ {
+ new Lazy<double>();
+ new Lazy<int>();
+ new Lazy<object>();
+
+ new System.Threading.Tasks.TaskCompletionSource<bool>();
+
+ object? r;
+
+ var v1 = new System.Collections.Generic.Dictionary<System.IntPtr, object>();
+ System.IntPtr i = System.IntPtr.Zero;
+ v1.Remove(i);
+ v1.TryGetValue(i, out r);
+
+ var v2 = new System.Collections.Generic.Dictionary<object, object>();
+ object k = "";
+ v2.Remove(k);
+ v2.TryGetValue(k, out r);
+
+ var v3 = new System.Collections.Generic.List<object>();
+ object[] a = { "" };
+ v3.CopyTo(a, 0);
+ var t = v3.Count;
+ v3.Capacity = 0;
+ }
+}
+}