summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Frolov <k.frolov@samsung.com>2019-07-24 13:39:34 +0300
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>2019-08-12 19:37:44 +0900
commit99b5e3e045eebe1768669d4991e2dc228b88dd6d (patch)
treec729e9f2aa6491621d2facbb832a05ac304d70c8
parente7e01962c927683a09894a6dd6cf0c4501b472e4 (diff)
downloadcoreclr-99b5e3e045eebe1768669d4991e2dc228b88dd6d.tar.gz
coreclr-99b5e3e045eebe1768669d4991e2dc228b88dd6d.tar.bz2
coreclr-99b5e3e045eebe1768669d4991e2dc228b88dd6d.zip
[Tizen] Precompile frequently used generic methods.submit/tizen/20190813.035844accepted/tizen/unified/20190813.215958
-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;
+ }
+}
+}