Merge pull request #4767 from lambdageek/bug-55681
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Fri, 28 Apr 2017 21:44:27 +0000 (17:44 -0400)
committerGitHub <noreply@github.com>
Fri, 28 Apr 2017 21:44:27 +0000 (17:44 -0400)
[sre-save] Handle ConstructorBuilder custom attribute constructors

66 files changed:
.gitmodules
configure.ac
external/api-snapshot [new submodule]
external/bockbuild
external/corefx
external/corert
mcs/.gitignore
mcs/Makefile
mcs/class/Facades/System.Collections.NonGeneric/AssemblyInfo.cs
mcs/class/Facades/System.Diagnostics.StackTrace/AssemblyInfo.cs
mcs/class/Facades/System.Reflection.DispatchProxy/Assembly/AssemblyInfo.cs [new file with mode: 0644]
mcs/class/Facades/System.Reflection.DispatchProxy/Makefile [new file with mode: 0644]
mcs/class/Facades/System.Reflection.DispatchProxy/System.Reflection.DispatchProxy.dll.sources [new file with mode: 0644]
mcs/class/Facades/System.Reflection.DispatchProxy/System.Reflection/DispatchProxy.cs [new file with mode: 0644]
mcs/class/Facades/System.Runtime.InteropServices.RuntimeInformation/Assembly/AssemblyInfo.cs
mcs/class/Facades/System.Runtime.Serialization.Formatters/AssemblyInfo.cs
mcs/class/Facades/System.ServiceModel.Duplex/AssemblyInfo.cs
mcs/class/Facades/System.ServiceModel.Http/AssemblyInfo.cs
mcs/class/Facades/System.ServiceModel.NetTcp/AssemblyInfo.cs
mcs/class/Facades/System.ServiceModel.Primitives/AssemblyInfo.cs
mcs/class/Facades/System.ServiceModel.Security/AssemblyInfo.cs
mcs/class/Facades/System.Text.Encoding.CodePages/AssemblyInfo.cs
mcs/class/Facades/System.Xml.ReaderWriter/AssemblyInfo.cs
mcs/class/Facades/subdirs.make
mcs/class/Makefile
mcs/class/System.Data/System.Data-net_4_x.csproj
mcs/class/System.Data/corefx.common.sources
mcs/class/System.Reflection.DispatchProxy/Assembly/AssemblyInfo.cs [deleted file]
mcs/class/System.Reflection.DispatchProxy/Makefile [deleted file]
mcs/class/System.Reflection.DispatchProxy/System.Reflection.DispatchProxy.dll.sources [deleted file]
mcs/class/System.Reflection.DispatchProxy/System.Reflection/DispatchProxy.cs [deleted file]
mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs
mcs/class/System/Mono.Btls/MonoBtlsProvider.cs
mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Apple.cs [deleted file]
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Droid.cs [deleted file]
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs
mcs/class/System/monodroid_System.dll.sources
mcs/class/System/monotouch_System.dll.sources
mcs/class/System/monotouch_watch_System.dll.exclude.sources
mcs/class/System/xammac_System.dll.sources
mcs/class/System/xammac_net_4_5_System.dll.sources
mcs/class/corlib/corlib-net_4_x.csproj
mcs/class/corlib/corlib.dll.sources
mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
mcs/class/referencesource/System.Data/System/Data/Sql/invalidudtexception.cs
mcs/diff.html.in [new file with mode: 0644]
mcs/tools/mkbundle/mkbundle.cs
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/metadata-internals.h
mono/metadata/metadata.c
mono/mini/driver.c
mono/mini/interp/interp-internals.h
mono/mini/interp/interp.c
mono/mini/interp/mintops.def
mono/mini/interp/transform.c
mono/mini/method-to-ir.c
mono/mini/mini-runtime.c
mono/mini/mini.h
mono/mini/objects.cs
mono/tests/Makefile.am
mono/tests/bug-10127.cs
scripts/ci/run-test-default.sh
scripts/ci/util.sh [new file with mode: 0644]

index 52dd2e7d5b2e23bfad4e2868ab9848bdf5c77650..73d55a0a9b903a2f261f9a60b0dfee03b66f0a3c 100644 (file)
@@ -58,3 +58,6 @@
 [submodule "external/api-doc-tools"]
        path = external/api-doc-tools
        url = git://github.com/mono/api-doc-tools.git
+[submodule "external/api-snapshot"]
+       path = external/api-snapshot
+       url = git://github.com/mono/api-snapshot.git
index 49ff006923b4396c36183c27e891717807631273..8be5513adce089829731a928695ebebaebbdf6aa 100644 (file)
@@ -1049,7 +1049,7 @@ fi
 
 AC_ARG_ENABLE(minimal, [  --enable-minimal=LIST      drop support for LIST subsystems.
      LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier, 
-     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting,
+     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
         security, lldb, mdb, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
 [
        for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
@@ -1170,9 +1170,10 @@ if test "x$mono_feature_disable_normalization" = "xyes"; then
        AC_MSG_NOTICE([Disabled String normalization support.])
 fi
 
-if test "x$mono_feature_disable_assembly_remapping" = "xyes"; then
-       AC_DEFINE(DISABLE_ASSEMBLY_REMAPPING, 1, [Disable assembly remapping.])
-       AC_MSG_NOTICE([Disabled Assembly remapping.])
+#TODO: remove assembly_remapping feature name once everyone is using desktop_loader
+if test "x$mono_feature_disable_assembly_remapping" = "xyes" || "x$mono_feature_disable_desktop_loader" = "xyes"; then
+       AC_DEFINE(DISABLE_DESKTOP_LOADER, 1, [Disable desktop assembly loader semantics.])
+       AC_MSG_NOTICE([Disabled desktop assembly loader semantics.])
 fi
 
 if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then
diff --git a/external/api-snapshot b/external/api-snapshot
new file mode 160000 (submodule)
index 0000000..d6eb25e
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit d6eb25eb492847b8c2634d0b01829a17e6226258
index fd1d6c404d763c98b6f0e64e98ab65f92e808245..c4212c9701f7aaa6fb53aff071c8832f2df43aa3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit fd1d6c404d763c98b6f0e64e98ab65f92e808245
+Subproject commit c4212c9701f7aaa6fb53aff071c8832f2df43aa3
index 2f070ea5c26c4093b1bcdf5fbdc6fbfdb688d419..76767209e09be647a5c7e0d272c3f22b87adfd6b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 2f070ea5c26c4093b1bcdf5fbdc6fbfdb688d419
+Subproject commit 76767209e09be647a5c7e0d272c3f22b87adfd6b
index a84847cb307985f2a0cfcdf124d68ec0626704b7..814f76de6a972c5c3dd3ec6b10dc900fd73d08d2 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a84847cb307985f2a0cfcdf124d68ec0626704b7
+Subproject commit 814f76de6a972c5c3dd3ec6b10dc900fd73d08d2
index 95c3b1615e6d84a226ad253408dfe4c87aa3ca62..ac21fbc31e58122816e8f9194fdf215b1cba8d95 100644 (file)
@@ -11,6 +11,7 @@ TestResult-*.log
 TestResult-*.xml
 TestResult*.xml
 .dep_dirs-*
+apidiff/*
 errors/*.log
 errors/dummy.xml
 class/Mono.Data.Sqlite/test.db
index 54cb4574e240760f8eaf3545bd4bd76021132c3f..eeda3d38bbea49e906b809faf5ab43ec719e8d04 100644 (file)
@@ -159,3 +159,29 @@ monocharge-lite:
        $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
        tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
        rm -rf "$$chargedir"
+
+# Targets for creating API diffs of the framework
+
+MONO_API_SNAPSHOT_PATH := $(topdir)../external/api-snapshot/
+GENAPI := $(MONO_API_SNAPSHOT_PATH)tools/genapi/GenAPI.exe
+MONO_API_SNAPSHOT_PROFILE_PATH := $(MONO_API_SNAPSHOT_PATH)profiles/$(PROFILE)/
+MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
+MONO_API_ASSEMBLIES := $(filter-out $(MONO_API_ASSEMBLIES_IGNORED), $(wildcard $(topdir)class/lib/$(PROFILE)/*.dll)) $(wildcard $(topdir)class/lib/$(PROFILE)/Facades/*.dll)
+MONO_API_ASSEMBLIES_CS := $(MONO_API_ASSEMBLIES:$(topdir)class/lib/$(PROFILE)/%.dll=$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs)
+
+$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs: $(topdir)class/lib/$(PROFILE)/%.dll $(GENAPI) $(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt
+       @mkdir -p $(dir $@)
+       $(Q) MONO_PATH=$(topdir)class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(GENAPI) -libPath:$(topdir)class/lib/$(PROFILE),$(topdir)class/lib/$(PROFILE)/Facades -out:$(dir $@) -headerFile:$(MONO_API_SNAPSHOT_PATH)profiles/license-header.txt -assemblyAttributes -typeForwardedTo -assemblyVersion -assembly:$< || echo "Couldn't process assembly." > $@
+
+mono-api-current: $(MONO_API_ASSEMBLIES_CS)
+
+mono-api-diff:
+       @echo "Regenerating API snapshot..."
+       $(Q) rm -rf "$(MONO_API_SNAPSHOT_PROFILE_PATH)"
+       $(Q) $(MAKE) mono-api-current
+       @echo "Checking public API differences..."
+       $(Q) cd $(MONO_API_SNAPSHOT_PATH); git add -A .
+       $(Q) cd $(MONO_API_SNAPSHOT_PATH); git diff --no-renames HEAD > $(abspath $(topdir))/temp.patch
+       @mkdir -p apidiff
+       $(Q) sed -e "/@diffdata@/r temp.patch" -e "/@diffdata@/d" -e "s/@title@/Public API Diff/g" -e "s/@description@/If the changes are intentional, run <code>make -C mcs mono-api-diff<\/code> locally and commit changes in external\/api-snapshot./g" diff.html.in > apidiff/index.html
+       $(Q) if [ -s temp.patch ]; then echo "Error: Found public API differences, see mcs/apidiff/index.html. If the changes are intentional, please go to external/api-snapshot and commit them."; rm -f temp.patch; exit 1; else echo "No differences found."; rm -f temp.patch; fi
index dc7beb6e6657e5410efc50688377a25816632fb9..fef6ff714f34d92593392fd1294347ff9a2d2e21 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyVersion ("4.0.1.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index fa5b9f81d529ea655e5da7f07a6560b70229b3fb..74545a8a222a372e587cfe45912e1c0ab9b3de88 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.1.0")]
+[assembly: AssemblyVersion ("4.0.2.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
diff --git a/mcs/class/Facades/System.Reflection.DispatchProxy/Assembly/AssemblyInfo.cs b/mcs/class/Facades/System.Reflection.DispatchProxy/Assembly/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..b31d2d3
--- /dev/null
@@ -0,0 +1,35 @@
+// 
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// 
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle ("System.Reflection.DispatchProxy.dll")]
+[assembly: AssemblyDescription ("System.Reflection.DispatchProxy.dll")]
+[assembly: AssemblyDefaultAlias ("System.Reflection.DispatchProxy.dll")]
+[assembly: AssemblyCompany ("Xamarin, Inc.")]
+[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
+[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
+[assembly: AssemblyVersion ("4.0.2.0")]
+[assembly: AssemblyInformationalVersion ("4.0.0.0")]
+[assembly: AssemblyFileVersion ("4.0.0.0")]
diff --git a/mcs/class/Facades/System.Reflection.DispatchProxy/Makefile b/mcs/class/Facades/System.Reflection.DispatchProxy/Makefile
new file mode 100644 (file)
index 0000000..0dab068
--- /dev/null
@@ -0,0 +1,19 @@
+MCS_BUILD_DIR = ../../../build
+
+thisdir = class/Facades/System.Reflection.DispatchProxy
+SUBDIRS = 
+include $(MCS_BUILD_DIR)/rules.make
+
+LIBRARY_SUBDIR = Facades
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
+
+LIBRARY = System.Reflection.DispatchProxy.dll
+
+KEY_FILE = ../../msfinal.pub
+SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
+LIB_REFS = System
+LIB_MCS_FLAGS = $(SIGN_FLAGS) /unsafe
+
+NO_TEST = yes
+
+include $(MCS_BUILD_DIR)/library.make
diff --git a/mcs/class/Facades/System.Reflection.DispatchProxy/System.Reflection.DispatchProxy.dll.sources b/mcs/class/Facades/System.Reflection.DispatchProxy/System.Reflection.DispatchProxy.dll.sources
new file mode 100644 (file)
index 0000000..2da8fa6
--- /dev/null
@@ -0,0 +1,3 @@
+../../../build/common/MonoTODOAttribute.cs
+Assembly/AssemblyInfo.cs
+System.Reflection/DispatchProxy.cs
diff --git a/mcs/class/Facades/System.Reflection.DispatchProxy/System.Reflection/DispatchProxy.cs b/mcs/class/Facades/System.Reflection.DispatchProxy/System.Reflection/DispatchProxy.cs
new file mode 100644 (file)
index 0000000..540e525
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// DispatchProxy.cs
+//
+// Author:
+//   Alexander Köplinger (alexander.koeplinger@xamarin.com)
+//
+// (C) 2016 Xamarin, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Reflection
+{
+       public abstract class DispatchProxy
+       {
+               [MonoTODO]
+               protected DispatchProxy()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static T Create<T, TProxy> () where TProxy : DispatchProxy
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected abstract object Invoke (MethodInfo targetMethod, object[] args);
+       }
+}
index f929501b658f35962be8e247112f09a24be4a02c..c0542a288f6a3711f878485bbb17934a5ea7b8fc 100644 (file)
@@ -39,7 +39,7 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyVersion ("4.0.1.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
 
index b717fe3b09e3d52492986173b5f44e117cea398a..667e977c2744b63f73004b0cd3cac8cda87bb521 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.0.0")]
+[assembly: AssemblyVersion ("4.0.1.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index cc10b1648328e8e6470aa26b1b91be4fcb169405..00ca00c3593324cfbd45a43c309952f259fc5b76 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.1.0")]
+[assembly: AssemblyVersion ("4.0.2.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index a62721f42289dbb376ff4d09800fd15adfa187b2..a6ac477d56154ec886368075f24a005e409a0d27 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.1.0.0")]
+[assembly: AssemblyVersion ("4.1.1.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index a62721f42289dbb376ff4d09800fd15adfa187b2..a6ac477d56154ec886368075f24a005e409a0d27 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.1.0.0")]
+[assembly: AssemblyVersion ("4.1.1.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index d3a2d80f6ce7317d00c5a851195cf05bd2f7a192..9c4769a3681be41d9c23cdbda6766dee9d1299f7 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.1.0.0")]
+[assembly: AssemblyVersion ("4.1.1.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index d2c637450732b3eaa7b19e8df20916103815e4ad..0f5d98318c4caa8e2e91823d85b344ff0248736d 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.1.0")]
+[assembly: AssemblyVersion ("4.0.2.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index dde53209d5ab881b4b7ba206e83684b544e3a94b..d89864256b475977be0c032ad5f720c344cf3096 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.1.0")]
+[assembly: AssemblyVersion ("4.0.2.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index 1f288e75f862530dbe71dd1ef997d8875be8a707..5f03c156274dafa9eaf0dd5754584042a82158fe 100644 (file)
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyCompany ("Xamarin, Inc.")]
 [assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
 [assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
-[assembly: AssemblyVersion ("4.0.10.0")]
+[assembly: AssemblyVersion ("4.1.0.0")]
 [assembly: AssemblyInformationalVersion ("4.0.0.0")]
 [assembly: AssemblyFileVersion ("4.0.0.0")]
index 800e22b891b47fc63aaa9973a2d353989a375d2a..d1dd9c4f6b98115dcdf049f431fbcdfb61a57f34 100644 (file)
@@ -60,7 +60,7 @@ System.Runtime.Numerics System.Xml.XDocument System.Reflection.Extensions System
 System.Diagnostics.FileVersionInfo System.Security.Cryptography.Primitives System.Security.Cryptography.Algorithms System.ValueTuple \
 System.Text.Encoding.CodePages
 
-build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS)
+build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS) System.Text.RegularExpressions System.Diagnostics.Contracts
 
 monodroid_SUBDIRS = $(monotouch_SUBDIRS)
 monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
@@ -84,7 +84,7 @@ orbis_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS) $(mobile_o
 orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
 
 mobile_only_SUBDIRS = System.Net.Ping System.Runtime.Serialization.Formatters System.Security.Cryptography.Csp System.Security.Cryptography.Pkcs \
-System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument
+System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy
 
 mobile_only_DEPS_SUBDIRS = System.Security.Cryptography.OpenSsl
 
index c5e3b0cf41c9e2975cd8b9b254e51756868836ab..a9610f239c370c8fce0ce666b39e40cec19a8c08 100644 (file)
@@ -81,7 +81,6 @@ mobile_common_dirs := \
        System.Xml.Serialization \
        Mono.CSharp     \
        Microsoft.CSharp \
-       System.Reflection.DispatchProxy \
        System.Reflection.Context       \
        System.Net.Http.WinHttpHandler
 
index bc05fc70beb16e9cafc0b06148e3c9af2617ea7b..51f6624d7999e201996c0613ad676bebc7504fa6 100644 (file)
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbMetaDataFactory.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\WrappedIUnknown.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\IBinarySerialize.cs" />\r
+    <Compile Include="..\referencesource\System.Data\System\Data\Sql\invalidudtexception.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\SqlDataSourceEnumerator.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\SqlFacetAttribute.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\SqlFunctionAttribute.cs" />\r
index 60ff760b0762a58e80510a6b1b8fdc4202cf3e06..354c30b591574210c9898f87caadaaa115dd7038 100644 (file)
 ../referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
 ../referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
 ../referencesource/System.Data/System/Data/Sql/IBinarySerialize.cs
+../referencesource/System.Data/System/Data/Sql/invalidudtexception.cs
 ../referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
 ../referencesource/System.Data/System/Data/Sql/SqlFacetAttribute.cs
 ../referencesource/System.Data/System/Data/Sql/SqlFunctionAttribute.cs
diff --git a/mcs/class/System.Reflection.DispatchProxy/Assembly/AssemblyInfo.cs b/mcs/class/System.Reflection.DispatchProxy/Assembly/AssemblyInfo.cs
deleted file mode 100644 (file)
index 993d77c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// AssemblyInfo.cs
-//
-// Author:
-//   Alexander Köplinger (alexander.koeplinger@xamarin.com)
-//
-// (C) 2016 Xamarin, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the assembly
-
-[assembly: AssemblyTitle ("System.Reflection.DispatchProxy.dll")]
-[assembly: AssemblyDescription ("System.Reflection.DispatchProxy.dll")]
-[assembly: AssemblyDefaultAlias ("System.Reflection.DispatchProxy.dll")]
-
-[assembly: AssemblyCompany (Consts.MonoCompany)]
-[assembly: AssemblyProduct (Consts.MonoProduct)]
-[assembly: AssemblyCopyright (Consts.MonoCopyright)]
-[assembly: AssemblyVersion (Consts.FxVersion)]
-[assembly: SatelliteContractVersion (Consts.FxVersion)]
-[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
-
-[assembly: NeutralResourcesLanguage ("en-US")]
-[assembly: CLSCompliant (true)]
-[assembly: AssemblyDelaySign (true)]
-
-[assembly: AssemblyKeyFile("../msfinal.pub")]
-
-[assembly: SecurityCritical]
-
-[assembly: ComVisible (false)]
\ No newline at end of file
diff --git a/mcs/class/System.Reflection.DispatchProxy/Makefile b/mcs/class/System.Reflection.DispatchProxy/Makefile
deleted file mode 100644 (file)
index ddc8396..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-thisdir = class/System.Reflection.DispatchProxy
-SUBDIRS = 
-include ../../build/rules.make
-
-LIBRARY = System.Reflection.DispatchProxy.dll
-LIB_REFS = System
-LIB_MCS_FLAGS =
-
-NO_TEST = yes
-
-include ../../build/library.make
diff --git a/mcs/class/System.Reflection.DispatchProxy/System.Reflection.DispatchProxy.dll.sources b/mcs/class/System.Reflection.DispatchProxy/System.Reflection.DispatchProxy.dll.sources
deleted file mode 100644 (file)
index da5d484..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-Assembly/AssemblyInfo.cs
-System.Reflection/DispatchProxy.cs
diff --git a/mcs/class/System.Reflection.DispatchProxy/System.Reflection/DispatchProxy.cs b/mcs/class/System.Reflection.DispatchProxy/System.Reflection/DispatchProxy.cs
deleted file mode 100644 (file)
index 540e525..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// DispatchProxy.cs
-//
-// Author:
-//   Alexander Köplinger (alexander.koeplinger@xamarin.com)
-//
-// (C) 2016 Xamarin, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Reflection
-{
-       public abstract class DispatchProxy
-       {
-               [MonoTODO]
-               protected DispatchProxy()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               public static T Create<T, TProxy> () where TProxy : DispatchProxy
-               {
-                       throw new NotImplementedException ();
-               }
-
-               [MonoTODO]
-               protected abstract object Invoke (MethodInfo targetMethod, object[] args);
-       }
-}
index cf774bf9ba35280e6f26dd93b88bc2ee26334d77..4fdabfd3ae3d22b8658a5a86dd5db672cc0edcd1 100644 (file)
@@ -31,14 +31,12 @@ namespace Mono.AppleTls
 {
        class AppleTlsProvider : MonoTlsProvider
        {
-               static readonly Guid id = new Guid ("981af8af-a3a3-419a-9f01-a518e3a17c1c");
-
                public override string Name {
                        get { return "apple-tls"; }
                }
 
                public override Guid ID {
-                       get { return id; }
+                       get { return MNS.MonoTlsProviderFactory.AppleTlsId; }
                }
 
                public override IMonoSslStream CreateSslStream (
index 6f132e1c7efc4a26bb8354545238ba867c2d55d2..bd979345e0debc693cfe43b9c5db0c7ca096277e 100644 (file)
@@ -50,10 +50,8 @@ namespace Mono.Btls
 {
        class MonoBtlsProvider : MonoTlsProvider
        {
-               static readonly Guid id = new Guid ("432d18c9-9348-4b90-bfbf-9f2a10e1f15b");
-
                public override Guid ID {
-                       get { return id; }
+                       get { return MNS.MonoTlsProviderFactory.BtlsId; }
                }
                public override string Name {
                        get { return "btls"; }
index 7d1369ee860ded993e78de32eaac014e2f27decf..a67b1ff069e9c67c83a61f73e65c04165ad54af6 100644 (file)
@@ -48,10 +48,8 @@ namespace Mono.Net.Security
         */
        class LegacyTlsProvider : MSI.MonoTlsProvider
        {
-               static readonly Guid id = new Guid ("809e77d5-56cc-4da8-b9f0-45e65ba9cceb");
-
                public override Guid ID {
-                       get { return id; }
+                       get { return MonoTlsProviderFactory.LegacyId; }
                }
 
                public override string Name {
diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Apple.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
deleted file mode 100644 (file)
index e5f2f0c..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// MonoTlsProviderFactory.cs
-//
-// Author:
-//      Chris Hamons  <chris.hamons@xamarin.com>
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#if !ONLY_APPLETLS
-#error Use MonoTlsProviderFactory.cs instead
-#endif
-
-#if SECURITY_DEP
-
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MSI = MonoSecurity::Mono.Security.Interface;
-using MX = MonoSecurity::Mono.Security.X509;
-#else
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-#endif
-using System.Security.Cryptography.X509Certificates;
-using Mono.AppleTls;
-
-using System;
-using System.Net;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
-
-namespace Mono.Net.Security
-{
-       /*
-        * Keep in sync with Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs.
-        * Simple implementation that does hard codes only a single provider
-        */
-       static partial class MonoTlsProviderFactory
-       {
-               #region Internal API
-
-               /*
-                * APIs in this section are for consumption within System.dll only - do not access via
-                * reflection or from friend assemblies.
-                * 
-                */
-               internal static MSI.MonoTlsProvider GetProviderInternal ()
-               {
-                       return GetTlsProvider ();
-               }
-               
-               #endregion
-
-               static object locker = new object ();
-               static MSI.MonoTlsProvider provider;
-               static MSI.MonoTlsProvider GetTlsProvider ()
-               {
-                       lock (locker) {
-                               if (provider == null)
-                                       provider = new AppleTlsProvider ();
-                               return provider;
-                       }
-               }
-
-
-               #region Mono.Security visible API
-
-               /*
-                * "Public" section, intended to be consumed via reflection.
-                * 
-                * Mono.Security.dll provides a public wrapper around these.
-                */
-
-               internal static MSI.MonoTlsProvider GetProvider ()
-               {
-                       return GetTlsProvider ();
-               }
-
-               internal static bool IsProviderSupported (string name)
-               {
-                       return true;
-               }
-
-               internal static MSI.MonoTlsProvider GetProvider (string name)
-               {
-                       return GetTlsProvider ();
-               }
-
-               internal static bool IsInitialized => true;
-
-               internal static void Initialize ()
-               {
-               }
-
-               internal static void Initialize (string provider)
-               {
-               }
-               #endregion
-       }
-}
-#endif
-
diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Droid.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Droid.cs
deleted file mode 100644 (file)
index 49ac9fd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015 Xamarin Inc. All rights reserved.
-#if SECURITY_DEP
-
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MSI = MonoSecurity::Mono.Security.Interface;
-#else
-using MSI = Mono.Security.Interface;
-#endif
-
-#if MONO_FEATURE_BTLS
-using Mono.Btls;
-#endif
-
-using System;
-
-namespace Mono.Net.Security
-{
-       static partial class MonoTlsProviderFactory
-       {
-               static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
-               {
-                       MSI.MonoTlsProvider provider = null;
-                       var type = Environment.GetEnvironmentVariable ("XA_TLS_PROVIDER");
-                       switch (type) {
-                       case null:
-                       case "default":
-                       case "legacy":
-                               return new LegacyTlsProvider ();
-#if MONO_FEATURE_BTLS
-                       case "btls":
-                               if (!IsBtlsSupported ())
-                                       throw new NotSupportedException ("BTLS in not supported!");
-                               return new MonoBtlsProvider ();
-#endif
-                       default:
-                               throw new NotSupportedException (string.Format ("Invalid TLS Provider: `{0}'.", provider));
-                       }
-               }
-       }
-}
-#endif
index b9185964572f6c861442843fb937e13dde8072e4..4d6f2a62fdc30c0496d6c7f69551f682457da95f 100644 (file)
@@ -24,7 +24,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#if SECURITY_DEP && !ONLY_APPLETLS // ONLY_APPLETLS uses MonoTlsProviderFactory.Apple.cs instead
+#if SECURITY_DEP
 
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
@@ -41,6 +41,14 @@ using System.Net;
 using System.Collections.Generic;
 using System.Runtime.CompilerServices;
 
+#if MONO_FEATURE_BTLS
+using Mono.Btls;
+#endif
+
+#if MONO_FEATURE_APPLETLS
+using Mono.AppleTls;
+#endif
+
 #if !MOBILE
 using System.Reflection;
 #endif
@@ -53,7 +61,7 @@ namespace Mono.Net.Security
         */
        static partial class MonoTlsProviderFactory
        {
-               #region Internal API
+#region Internal API
 
                /*
                 * APIs in this section are for consumption within System.dll only - do not access via
@@ -85,6 +93,11 @@ namespace Mono.Net.Security
                                if (provider == null)
                                        throw new NotSupportedException ("TLS Support not available.");
 
+                               if (!providerCache.ContainsKey (provider.ID))
+                                       providerCache.Add (provider.ID, provider);
+
+                               X509Helper2.Initialize ();
+
                                defaultProvider = provider;
                                initialized = true;
                        }
@@ -97,76 +110,162 @@ namespace Mono.Net.Security
                                        throw new NotSupportedException ("TLS Subsystem already initialized.");
 
                                defaultProvider = LookupProvider (provider, true);
+
+                               X509Helper2.Initialize ();
                                initialized = true;
                        }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
-               internal extern static bool IsBtlsSupported ();
-
                static object locker = new object ();
                static bool initialized;
 
                static MSI.MonoTlsProvider defaultProvider;
 
-               #endregion
-
-               static Dictionary<string,string> providerRegistration;
+               /*
+                * @providerRegistration maps provider names to a tuple containing its ID and full type name.
+                * On non-reflection enabled systems (such as XI and XM), we can use the Guid to uniquely
+                * identify the provider.
+                *
+                * @providerCache maps the provider's Guid to the MSI.MonoTlsProvider instance.
+                *
+                */
+               static Dictionary<string,Tuple<Guid,string>> providerRegistration;
+               static Dictionary<Guid,MSI.MonoTlsProvider> providerCache;
 
+#if !ONLY_APPLETLS && !MONOTOUCH && !XAMMAC
                static Type LookupProviderType (string name, bool throwOnError)
                {
                        lock (locker) {
                                InitializeProviderRegistration ();
-                               string typeName;
-                               if (!providerRegistration.TryGetValue (name, out typeName)) {
+                               Tuple<Guid,string> entry;
+                               if (!providerRegistration.TryGetValue (name, out entry)) {
                                        if (throwOnError)
                                                throw new NotSupportedException (string.Format ("No such TLS Provider: `{0}'.", name));
                                        return null;
                                }
-                               var type = Type.GetType (typeName, false);
+                               var type = Type.GetType (entry.Item2, false);
                                if (type == null && throwOnError)
-                                       throw new NotSupportedException (string.Format ("Could not find TLS Provider: `{0}'.", typeName));
+                                       throw new NotSupportedException (string.Format ("Could not find TLS Provider: `{0}'.", entry.Item2));
                                return type;
                        }
                }
+#endif
 
                static MSI.MonoTlsProvider LookupProvider (string name, bool throwOnError)
                {
-                       var type = LookupProviderType (name, throwOnError);
-                       if (type == null)
-                               return null;
-
-                       try {
-                               return (MSI.MonoTlsProvider)Activator.CreateInstance (type, true);
-                       } catch (Exception ex) {
-                               throw new NotSupportedException (string.Format ("Unable to instantiate TLS Provider `{0}'.", type), ex);
+                       lock (locker) {
+                               InitializeProviderRegistration ();
+                               Tuple<Guid,string> entry;
+                               if (!providerRegistration.TryGetValue (name, out entry)) {
+                                       if (throwOnError)
+                                               throw new NotSupportedException (string.Format ("No such TLS Provider: `{0}'.", name));
+                                       return null;
+                               }
+
+                               // Check cache before doing the reflection lookup.
+                               MSI.MonoTlsProvider provider;
+                               if (providerCache.TryGetValue (entry.Item1, out provider))
+                                       return provider;
+
+#if !ONLY_APPLETLS && !MONOTOUCH && !XAMMAC
+                               var type = Type.GetType (entry.Item2, false);
+                               if (type == null && throwOnError)
+                                       throw new NotSupportedException (string.Format ("Could not find TLS Provider: `{0}'.", entry.Item2));
+
+                               try {
+                                       provider = (MSI.MonoTlsProvider)Activator.CreateInstance (type, true);
+                               } catch (Exception ex) {
+                                       throw new NotSupportedException (string.Format ("Unable to instantiate TLS Provider `{0}'.", type), ex);
+                               }
+#endif
+
+                               if (provider == null) {
+                                       if (throwOnError)
+                                               throw new NotSupportedException (string.Format ("No such TLS Provider: `{0}'.", name));
+                                       return null;
+                               }
+
+                               providerCache.Add (entry.Item1, provider);
+                               return provider;
                        }
                }
 
+#endregion
+
+               internal static readonly Guid AppleTlsId = new Guid ("981af8af-a3a3-419a-9f01-a518e3a17c1c");
+               internal static readonly Guid BtlsId = new Guid ("432d18c9-9348-4b90-bfbf-9f2a10e1f15b");
+               internal static readonly Guid LegacyId = new Guid ("809e77d5-56cc-4da8-b9f0-45e65ba9cceb");
+
                static void InitializeProviderRegistration ()
                {
                        lock (locker) {
                                if (providerRegistration != null)
                                        return;
-                               providerRegistration = new Dictionary<string,string> ();
-                               providerRegistration.Add ("legacy", "Mono.Net.Security.LegacyTlsProvider");
-                       
+                               providerRegistration = new Dictionary<string,Tuple<Guid,string>> ();
+                               providerCache = new Dictionary<Guid,MSI.MonoTlsProvider> ();
+
+                               var appleTlsEntry = new Tuple<Guid,String> (AppleTlsId, "Mono.AppleTls.AppleTlsProvider");
+
+#if ONLY_APPLETLS || MONOTOUCH || XAMMAC
+                               providerRegistration.Add ("default", appleTlsEntry);
+                               providerRegistration.Add ("apple", appleTlsEntry);
+#else
+                               var legacyEntry = new Tuple<Guid,String> (BtlsId, "Mono.Net.Security.LegacyTlsProvider");
+#if MONO_FEATURE_BTLS
+                               var btlsEntry = new Tuple<Guid,String> (LegacyId, "Mono.Btls.MonoBtlsProvider");
+#endif
+
+                               providerRegistration.Add ("legacy", legacyEntry);
+
                                if (Platform.IsMacOS)
-                                       providerRegistration.Add ("default", "Mono.AppleTls.AppleTlsProvider");
+                                       providerRegistration.Add ("default", appleTlsEntry);
                                else
-                                       providerRegistration.Add ("default", "Mono.Net.Security.LegacyTlsProvider");
+                                       providerRegistration.Add ("default", legacyEntry);
 
+#if MONO_FEATURE_BTLS
                                if (IsBtlsSupported ())
-                                       providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider");
-                       
-                               providerRegistration.Add ("apple", "Mono.AppleTls.AppleTlsProvider");
-                               
-                               X509Helper2.Initialize ();
+                                       providerRegistration.Add ("btls", btlsEntry);
+#endif
+
+                               providerRegistration.Add ("apple", appleTlsEntry);
+#endif
                        }
                }
 
-#if !MONODROID && !MONOTOUCH && !XAMMAC
-               static MSI.MonoTlsProvider TryDynamicLoad ()
+#region Platform-Specific code
+
+#if MONO_FEATURE_BTLS
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               internal extern static bool IsBtlsSupported ();
+#endif
+
+#if MONODROID
+               static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
+               {
+                       MSI.MonoTlsProvider provider = null;
+                       var type = Environment.GetEnvironmentVariable ("XA_TLS_PROVIDER");
+                       switch (type) {
+                       case null:
+                       case "default":
+                       case "legacy":
+                               return new LegacyTlsProvider ();
+#if MONO_FEATURE_BTLS
+                       case "btls":
+                               if (!IsBtlsSupported ())
+                                       throw new NotSupportedException ("BTLS in not supported!");
+                               return new MonoBtlsProvider ();
+#endif
+                       default:
+                               throw new NotSupportedException (string.Format ("Invalid TLS Provider: `{0}'.", provider));
+                       }
+               }
+#elif ONLY_APPLETLS || MONOTOUCH || XAMMAC
+               static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
+               {
+                       return new AppleTlsProvider ();
+               }
+#else
+               static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
                {
                        var variable = Environment.GetEnvironmentVariable ("MONO_TLS_PROVIDER");
                        if (string.IsNullOrEmpty (variable))
@@ -174,18 +273,11 @@ namespace Mono.Net.Security
 
                        return LookupProvider (variable, true);
                }
-
-               static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
-               {
-                       var provider = TryDynamicLoad ();
-                       if (provider != null)
-                               return provider;
-
-                       return new LegacyTlsProvider ();
-               }
 #endif
 
-               #region Mono.Security visible API
+#endregion
+
+#region Mono.Security visible API
 
                /*
                 * "Public" section, intended to be consumed via reflection.
@@ -204,7 +296,10 @@ namespace Mono.Net.Security
 
                internal static bool IsProviderSupported (string name)
                {
-                       return LookupProvider (name, false) != null;
+                       lock (locker) {
+                               InitializeProviderRegistration ();
+                               return providerRegistration.ContainsKey (name);
+                       }
                }
 
                internal static MSI.MonoTlsProvider GetProvider (string name)
@@ -229,7 +324,7 @@ namespace Mono.Net.Security
                {
                        InitializeInternal (provider);
                }
-               #endregion
+#endregion
        }
 }
 #endif
index c2950c536caf33f5d6f337df9463118118f248e8..c6769c373a7eac6f111f5342562e19c338835c9c 100644 (file)
@@ -1,4 +1,3 @@
 #include mobile_System.dll.sources
 System/AndroidPlatform.cs
-Mono.Net.Security/MonoTlsProviderFactory.Droid.cs
 Mono.Btls/MonoBtlsX509LookupAndroid.cs
index 8d2f2fdbbc49f35167282c102740833693c5cf95..e478e8894eb5696c35639010f27ac26b0ef445cd 100644 (file)
@@ -1,5 +1,2 @@
 #include mobile_System.dll.sources
 
-System.Net/MacProxy.cs
-
-Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
index c7317052010936abeedd43400c3c7673b60e458f..650f8849d531c7ff7b49c3d8f4817698d38e8826 100644 (file)
@@ -8,7 +8,6 @@ Mono.Net.Security/LegacyTlsProvider.cs
 Mono.Net.Security/LegacyTlsProvider.cs
 Mono.Net.Security/MobileAuthenticatedStream.cs
 Mono.Net.Security/MobileTlsContext.cs
-Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
 Mono.Net.Security/MonoTlsProviderFactory.cs
 Mono.Net.Security/MonoTlsProviderImpl.cs
 Mono.Net.Security/MonoTlsStream.cs
index 73405e102667f3ff0b2206a456a1a2cdef234b89..70a77a6dbff401e4d973b5d5f8ce11321a969f9a 100644 (file)
@@ -1,2 +1 @@
 #include mobile_System.dll.sources
-Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
index fe68fff758f91170508456245fee3a8f194fabee..beb6f2415cf1c7c2da9e4ba40f1a04757013f3b9 100644 (file)
@@ -1,2 +1 @@
 #include net_4_x_System.dll.sources
-Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
index f601b6674bf4271dbb246f04645cac6d9fcae7c8..c59dd62bb8f44fab92f771edecf5eeeab8bcc8e1 100644 (file)
@@ -73,7 +73,9 @@
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Collections\Generic\KeyValuePair.cs" />\r
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Diagnostics\Debug.cs" />\r
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\IO\Win32Marshal.cs" />\r
+    <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\CompilerServices\IsReadOnlyAttribute.cs" />\r
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\CompilerServices\ITuple.cs" />\r
+    <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\CompilerServices\RuntimeFeature.cs" />\r
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Runtime\CompilerServices\TupleElementNamesAttribute.cs" />\r
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\Threading\DeferredDisposableLifetime.cs" />\r
     <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\shared\System\TupleExtensions.cs" />\r
index d22d10957634e4da637fd261c7d9be125cf1b80b..c4af3f5b553037fedd3d8c19a405c27763e5145e 100644 (file)
@@ -1657,7 +1657,9 @@ corert/ThreadPoolBoundHandle.cs
 
 ../../../external/corert/src/System.Private.CoreLib/shared/System/Diagnostics/Debug.cs
 
+../../../external/corert/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/IsReadOnlyAttribute.cs
 ../../../external/corert/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ITuple.cs
+../../../external/corert/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/RuntimeFeature.cs
 ../../../external/corert/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs
 
 ../../../external/corert/src/System.Private.CoreLib/shared/System/Threading/DeferredDisposableLifetime.cs
index 4801e47b5a514fb88120ee7d63ea91a39d80babe..6f8b649c6fe72b692e23b42edeb7efded7a17761 100644 (file)
@@ -83,6 +83,11 @@ namespace System.Data.Common {
 
         static internal Task<bool> s_falseTask = Task.FromResult<bool>(false);
         
+#if MONO
+        static internal Task<bool> TrueTask => s_trueTask;
+        static internal Task<bool> FalseTask => s_falseTask;
+#endif
+
         [BidMethod] // this method accepts BID format as an argument, this attribute allows FXCopBid rule to validate calls to it
         static private void TraceException(
                 string trace,
index 657bed3dc7a3478b6bb7ed88b6ac80d0179e9a89..908dec7ecbcb31fd2803552059a67e3127767cca 100644 (file)
@@ -26,7 +26,9 @@ namespace System.Data.Sql {
         internal const string InstanceName   = "InstanceName";
         internal const string IsClustered    = "IsClustered";
         internal const string Version        = "Version";
+#if !MONO
         private  const int    timeoutSeconds = ADP.DefaultCommandTimeout;
+#endif
         private long timeoutTime;                                // variable used for timeout computations, holds the value of the hi-res performance counter at which this request should expire
 
         private SqlDataSourceEnumerator() : base() {
index 527832fdb4f87b3c6e47024e54b1d1e9799424b5..2f30f15241cde8e1ef2a059984073e410d3a746a 100644 (file)
@@ -15,7 +15,11 @@ namespace Microsoft.SqlServer.Server {
     
     [Serializable]
     public sealed class InvalidUdtException : SystemException {
-     
+#if MONO
+        class HResults {
+            internal const int InvalidUdt = unchecked((int)0x80131937);
+        }
+#endif
         internal InvalidUdtException() : base() {
             HResult = HResults.InvalidUdt;
         }
diff --git a/mcs/diff.html.in b/mcs/diff.html.in
new file mode 100644 (file)
index 0000000..370a279
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
+    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+    <title>@title@</title>
+    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/github.min.css">
+    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html.min.css">
+    <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans' />
+  </head>
+  <body style="font-family: 'Open Sans'">
+    <h1>@title@</h1>
+    <p>@description@</p>
+    <div id="diff"><!--<![CDATA[
+@diffdata@
+]]>-->
+    </div>
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/languages/cs.min.js"></script>
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html.min.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html-ui.min.js"></script>
+
+    <script>
+    $(document).ready(function() {
+        var diff2htmlUi = new Diff2HtmlUI({diff: $("#diff")[0].childNodes[0].nodeValue});
+        diff2htmlUi.draw('#diff', {showFiles: true, matching: 'lines'});
+        diff2htmlUi.highlightCode('#diff');
+    });
+    </script>
+  </body>
+</html>
index 5c6e6e895ef0ea61eb001dffbb889469d7788d35..a76e9f88c92a1440897c007e92937f4d16b89311 100755 (executable)
@@ -49,6 +49,7 @@ class MakeBundle {
        static string machine_config_file = null;
        static string config_dir = null;
        static string style = "linux";
+       static bool bundled_header = false;
        static string os_message = "";
        static bool compress;
        static bool nomain;
@@ -347,6 +348,9 @@ class MakeBundle {
                                else
                                        environment.Add (env.Substring (0, p), env.Substring (p+1));
                                break;
+                       case "--bundled-header":
+                               bundled_header = true;
+                               break;
                        default:
                                sources.Add (args [i]);
                                break;
@@ -700,10 +704,10 @@ class MakeBundle {
                        using (StreamWriter tc = new StreamWriter (File.Create (temp_c))) {
                        string prog = null;
 
-#if XAMARIN_ANDROID
-                       tc.WriteLine ("/* This source code was produced by mkbundle, do not edit */");
-                       tc.WriteLine ("\n#ifndef NULL\n#define NULL (void *)0\n#endif");
-                       tc.WriteLine (@"
+                       if (bundled_header) {
+                               tc.WriteLine ("/* This source code was produced by mkbundle, do not edit */");
+                               tc.WriteLine ("\n#ifndef NULL\n#define NULL (void *)0\n#endif");
+                               tc.WriteLine (@"
 typedef struct {
        const char *name;
        const unsigned char *data;
@@ -712,10 +716,10 @@ typedef struct {
 void          mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
 void          mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
 ");
-#else
-                       tc.WriteLine ("#include <mono/metadata/mono-config.h>");
-                       tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
-#endif
+                       } else {
+                               tc.WriteLine ("#include <mono/metadata/mono-config.h>");
+                               tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
+                       }
 
                        if (compress) {
                                tc.WriteLine ("typedef struct _compressed_data {");
@@ -1238,6 +1242,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                   "    --skip-scan          Skip scanning assemblies that could not be loaded (but still embed them).\n" +
                                   "    --i18n ENCODING      none, all or comma separated list of CJK, MidWest, Other, Rare, West.\n" +
                                   "    -v                   Verbose output\n" + 
+                                  "    --bundled-header     Do not attempt to include 'mono-config.h'. Define the entry points directly in the generated code\n" +
                                   "\n" + 
                                   "--simple   Simple mode does not require a C toolchain and can cross compile\n" + 
                                   "    --cross TARGET       Generates a binary for the given TARGET\n"+
index 0d57ff8b745aed6f8a0b6ff50e96aea505bf19b4..8a86bc3dea3fa38c1ce8994444b54e6cd4bde260 100644 (file)
@@ -2002,6 +2002,14 @@ mono_domain_assembly_preload (MonoAssemblyName *aname,
 
        set_domain_search_path (domain);
 
+       MonoAssemblyCandidatePredicate predicate = NULL;
+       void* predicate_ud = NULL;
+#if !defined(DISABLE_DESKTOP_LOADER)
+       if (G_LIKELY (mono_loader_get_strict_strong_names ())) {
+               predicate = &mono_assembly_candidate_predicate_sn_same_name;
+               predicate_ud = aname;
+       }
+#endif
        if (domain->search_path && domain->search_path [0] != NULL) {
                if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY)) {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Domain %s search path is:", domain->friendly_name);
@@ -2011,11 +2019,11 @@ mono_domain_assembly_preload (MonoAssemblyName *aname,
                        }
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "End of domain %s search path.", domain->friendly_name);                    
                }
-               result = real_load (domain->search_path, aname->culture, aname->name, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
+               result = real_load (domain->search_path, aname->culture, aname->name, refonly, predicate, predicate_ud);
        }
 
        if (result == NULL && assemblies_path && assemblies_path [0] != NULL) {
-               result = real_load (assemblies_path, aname->culture, aname->name, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
+               result = real_load (assemblies_path, aname->culture, aname->name, refonly, predicate, predicate_ud);
        }
 
        return result;
index 3575258d576b7917bec04aad5c3bfa41492dd3f1..afcd5990b52a9c43c86541d7ec523f9cf4291f95 100644 (file)
@@ -89,7 +89,7 @@ static char **assemblies_path = NULL;
 /* Contains the list of directories that point to auxiliary GACs */
 static char **extra_gac_paths = NULL;
 
-#ifndef DISABLE_ASSEMBLY_REMAPPING
+#ifndef DISABLE_DESKTOP_LOADER
 
 #define FACADE_ASSEMBLY(str) {str, 0, NULL, FALSE, TRUE}
 
@@ -968,7 +968,7 @@ mono_assemblies_init (void)
        mono_os_mutex_init_recursive (&assemblies_mutex);
        mono_os_mutex_init (&assembly_binding_mutex);
 
-#ifndef DISABLE_ASSEMBLY_REMAPPING
+#ifndef DISABLE_DESKTOP_LOADER
        assembly_remapping_table = g_hash_table_new (g_str_hash, g_str_equal);
 
        int i;
@@ -1258,7 +1258,7 @@ mono_assembly_remap_version (MonoAssemblyName *aname, MonoAssemblyName *dest_ana
                return dest_aname;
        }
        
-#ifndef DISABLE_ASSEMBLY_REMAPPING
+#ifndef DISABLE_DESKTOP_LOADER
        const AssemblyVersionMap *vmap = (AssemblyVersionMap *)g_hash_table_lookup (assembly_remapping_table, aname->name);
        if (vmap) {
                const AssemblyVersionSet* vset;
@@ -3534,7 +3534,7 @@ mono_assembly_load_corlib (const MonoRuntimeInfo *runtime, MonoImageOpenStatus *
        g_free (corlib_file);
 
 return_corlib_and_facades:
-       if (corlib)
+       if (corlib && !strcmp (runtime->framework_version, "4.5"))  // FIXME: stop hardcoding 4.5 here
                default_path [1] = g_strdup_printf ("%s/Facades", corlib->basedir);
                
        return corlib;
@@ -3601,7 +3601,7 @@ exact_sn_match (MonoAssemblyName *wanted_name, MonoAssemblyName *candidate_name)
 gboolean
 framework_assembly_sn_match (MonoAssemblyName *wanted_name, MonoAssemblyName *candidate_name)
 {
-#ifndef DISABLE_ASSEMBLY_REMAPPING
+#ifndef DISABLE_DESKTOP_LOADER
        const AssemblyVersionMap *vmap = (AssemblyVersionMap *)g_hash_table_lookup (assembly_remapping_table, wanted_name->name);
        if (vmap) {
                if (!vmap->framework_facade_assembly) {
@@ -3658,6 +3658,15 @@ mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
                return mono_assembly_load_corlib (mono_get_runtime_info (), status);
        }
 
+       MonoAssemblyCandidatePredicate predicate = NULL;
+       void* predicate_ud = NULL;
+#if !defined(DISABLE_DESKTOP_LOADER)
+       if (G_LIKELY (mono_loader_get_strict_strong_names ())) {
+               predicate = &mono_assembly_candidate_predicate_sn_same_name;
+               predicate_ud = aname;
+       }
+#endif
+
        len = strlen (aname->name);
        for (ext_index = 0; ext_index < 2; ext_index ++) {
                ext = ext_index == 0 ? ".dll" : ".exe";
@@ -3677,7 +3686,7 @@ mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
 
                if (basedir) {
                        fullpath = g_build_filename (basedir, filename, NULL);
-                       result = mono_assembly_open_predicate (fullpath, refonly, FALSE, &mono_assembly_candidate_predicate_sn_same_name, aname, status);
+                       result = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, predicate_ud, status);
                        g_free (fullpath);
                        if (result) {
                                result->in_gac = FALSE;
@@ -3686,7 +3695,7 @@ mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
                        }
                }
 
-               result = load_in_path (filename, default_path, status, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
+               result = load_in_path (filename, default_path, status, refonly, predicate, predicate_ud);
                if (result)
                        result->in_gac = FALSE;
                g_free (filename);
index b1613fddc6faa72a156b6361486e9ab9d3a282a2..a6a936758e66e1794a69b848902a47c722075e89 100644 (file)
@@ -944,5 +944,11 @@ mono_assembly_is_problematic_version (const char *name, guint16 major, guint16 m
 void
 mono_ginst_get_desc (GString *str, MonoGenericInst *ginst);
 
+void
+mono_loader_set_strict_strong_names (gboolean enabled);
+
+gboolean
+mono_loader_get_strict_strong_names (void);
+
 #endif /* __MONO_METADATA_INTERNALS_H__ */
 
index 54699c48ed7d833a7622464169ef23d2eb29489f..78dece0b24e910d5f458ca2842e47afe6d883305 100644 (file)
@@ -519,6 +519,13 @@ mono_tables_names [] = {
 
 #endif
 
+/* If TRUE (but also see DISABLE_STICT_STRONG_NAMES #define), Mono will check
+ * that the public key token and version of a candidate assembly matches the
+ * requested strong name.  If FALSE, as long as the name matches, the candidate
+ * will be allowed.
+ */
+static gboolean check_strong_names_strictly = TRUE;
+
 // Amount initially reserved in each imageset's mempool.
 // FIXME: This number is arbitrary, a more practical number should be found
 #define INITIAL_IMAGE_SET_SIZE    1024
@@ -6919,3 +6926,15 @@ mono_find_image_set_owner (void *ptr)
 
        return owner;
 }
+
+void
+mono_loader_set_strict_strong_names (gboolean enabled)
+{
+       check_strong_names_strictly = enabled;
+}
+
+gboolean
+mono_loader_get_strict_strong_names (void)
+{
+       return check_strong_names_strictly;
+}
index 7b2d9ef53b81577e0c2dbb710581335ddacb275b..43aa7219f2311f86aca7307dd2f8a5004ae88210 100644 (file)
@@ -1941,6 +1941,14 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
                        nacl_null_checks_off = TRUE;
 #endif
+               } else if (strncmp (argv [i], "--assembly-loader=", strlen("--assembly-loader=")) == 0) {
+                       gchar *arg = argv [i] + strlen ("--assembly-loader=");
+                       if (strcmp (arg, "strict") == 0)
+                               mono_loader_set_strict_strong_names (TRUE);
+                       else if (strcmp (arg, "legacy") == 0)
+                               mono_loader_set_strict_strong_names (FALSE);
+                       else
+                               fprintf (stderr, "Warning: unknown argument to --assembly-loader. Should be \"strict\" or \"legacy\"\n");
                } else if (strncmp (argv [i], MONO_HANDLERS_ARGUMENT, MONO_HANDLERS_ARGUMENT_LEN) == 0) {
                        //Install specific custom handlers.
                        if (!mono_runtime_install_custom_handlers (argv[i] + MONO_HANDLERS_ARGUMENT_LEN)) {
@@ -2063,9 +2071,6 @@ mono_main (int argc, char* argv[])
        }
 
        mono_set_defaults (mini_verbose, opt);
-#ifdef ENABLE_INTERPRETER
-       mono_interp_init ();
-#endif
        domain = mini_init (argv [i], forced_version);
 
        mono_gc_set_stack_end (&domain);
index bda0b457e8520bfd76f4702efef447fe904a9fb0..9769855efac02efd040d90d6e8e1a3ac1125080c 100644 (file)
@@ -108,6 +108,7 @@ struct _MonoInvocation {
 
 typedef struct {
        MonoDomain *domain;
+       MonoDomain *original_domain;
        MonoInvocation *base_frame;
        MonoInvocation *current_frame;
        MonoInvocation *env_frame;
index 8d2a26859053f0830db1a8e3416508db811b7a86..0c0b651f563c3665e203acbd56013d220fdc17ab 100644 (file)
@@ -57,6 +57,7 @@
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-debug.h>
+#include <mono/utils/atomic.h>
 
 #include "interp.h"
 #include "interp-internals.h"
@@ -106,7 +107,7 @@ void ves_exec_method (MonoInvocation *frame);
 static char* dump_stack (stackval *stack, stackval *sp);
 static char* dump_frame (MonoInvocation *inv);
 static MonoArray *get_trace_ips (MonoDomain *domain, MonoInvocation *top);
-static void ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context);
+static void ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception);
 
 typedef void (*ICallMethod) (MonoInvocation *frame);
 
@@ -529,9 +530,16 @@ stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
                } else
                        mono_value_copy (data, val->data.vt, type->data.klass);
                return;
-       case MONO_TYPE_GENERICINST:
+       case MONO_TYPE_GENERICINST: {
+               MonoClass *container_class = type->data.generic_class->container_class;
+
+               if (container_class->valuetype && !container_class->enumtype) {
+                       mono_value_copy (data, val->data.vt, mono_class_from_mono_type (type));
+                       return;
+               }
                stackval_to_data (&type->data.generic_class->container_class->byval_arg, val, data, pinvoke);
                return;
+       }
        default:
                g_warning ("got type %x", type->type);
                g_assert_not_reached ();
@@ -700,6 +708,9 @@ interp_walk_stack_with_ctx (MonoInternalStackWalk func, MonoContext *ctx, MonoUn
        MonoError error;
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
 
+       if (!context)
+               return;
+
        MonoInvocation *frame = context->current_frame;
 
        while (frame) {
@@ -1416,7 +1427,7 @@ handle_enum:
        if (exc)
                frame.invoke_trap = 1;
        context->managed_code = 1;
-       ves_exec_method_with_context (&frame, context);
+       ves_exec_method_with_context (&frame, context, NULL, NULL);
        context->managed_code = 0;
        if (context == &context_struct)
                mono_native_tls_set_value (thread_context_id, NULL);
@@ -1572,7 +1583,7 @@ interp_entry (InterpEntryData *data)
                break;
        }
 
-       ves_exec_method_with_context (&frame, context);
+       ves_exec_method_with_context (&frame, context, NULL, NULL);
        context->managed_code = 0;
        if (context == &context_struct)
                mono_native_tls_set_value (thread_context_id, NULL);
@@ -1903,8 +1914,9 @@ mono_interp_create_method_pointer (MonoMethod *method, MonoError *error)
        MonoMethod *wrapper;
        RuntimeMethod *rmethod;
 
-       if (method->wrapper_type && method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE)
-               return NULL;
+       /* HACK: method_ptr of delegate should point to a runtime method*/
+       if (method->wrapper_type && method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
+               return mono_interp_get_runtime_method (mono_domain_get (), method, error);
 
        rmethod = mono_interp_get_runtime_method (mono_domain_get (), method, error);
        if (rmethod->jit_entry)
@@ -2001,11 +2013,8 @@ static int opcode_counts[512];
 #define MINT_IN_DEFAULT default:
 #endif
 
-static void
-ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context);
-
 static void 
-ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception)
+ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception)
 {
        MonoInvocation child_frame;
        GSList *finally_ips = NULL;
@@ -2257,7 +2266,7 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
                                }
                        }
 
-                       ves_exec_method_with_context (&child_frame, context);
+                       ves_exec_method_with_context (&child_frame, context, NULL, NULL);
 
                        context->current_frame = frame;
 
@@ -2341,7 +2350,7 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 
-                       ves_exec_method_with_context (&child_frame, context);
+                       ves_exec_method_with_context (&child_frame, context, NULL, NULL);
 
                        context->current_frame = frame;
 
@@ -2381,7 +2390,7 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 
-                       ves_exec_method_with_context (&child_frame, context);
+                       ves_exec_method_with_context (&child_frame, context, NULL, NULL);
 
                        context->current_frame = frame;
 
@@ -2631,7 +2640,7 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
                                sp [0].data.p = unboxed;
                        }
 
-                       ves_exec_method_with_context (&child_frame, context);
+                       ves_exec_method_with_context (&child_frame, context, NULL, NULL);
 
                        context->current_frame = frame;
 
@@ -2678,7 +2687,7 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
                                sp [0].data.p = unboxed;
                        }
 
-                       ves_exec_method_with_context (&child_frame, context);
+                       ves_exec_method_with_context (&child_frame, context, NULL, NULL);
 
                        context->current_frame = frame;
 
@@ -3090,6 +3099,11 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
                        sp -= 2;
                        * (double *) sp->data.p = sp[1].data.f;
                        MINT_IN_BREAK;
+               MINT_IN_CASE(MINT_MONO_ATOMIC_STORE_I4)
+                       ++ip;
+                       sp -= 2;
+                       InterlockedWrite ((gint32 *) sp->data.p, sp [1].data.i);
+                       MINT_IN_BREAK;
 #define BINOP(datamem, op) \
        --sp; \
        sp [-1].data.datamem = sp [-1].data.datamem op sp [0].data.datamem; \
@@ -3463,7 +3477,7 @@ ves_exec_method_with_context_with_ip (MonoInvocation *frame, ThreadContext *cont
 
                        g_assert (csig->call_convention == MONO_CALL_DEFAULT);
 
-                       ves_exec_method_with_context (&child_frame, context);
+                       ves_exec_method_with_context (&child_frame, context, NULL, NULL);
 
                        context->current_frame = frame;
 
@@ -3989,6 +4003,7 @@ array_constructed:
                MINT_IN_CASE(MINT_STELEM_I1) /* fall through */ 
                MINT_IN_CASE(MINT_STELEM_U1) /* fall through */
                MINT_IN_CASE(MINT_STELEM_I2) /* fall through */
+               MINT_IN_CASE(MINT_STELEM_U2) /* fall through */
                MINT_IN_CASE(MINT_STELEM_I4) /* fall through */
                MINT_IN_CASE(MINT_STELEM_I8) /* fall through */
                MINT_IN_CASE(MINT_STELEM_R4) /* fall through */
@@ -4020,6 +4035,9 @@ array_constructed:
                        case MINT_STELEM_I2:
                                mono_array_set ((MonoArray *)o, gint16, aindex, sp [2].data.i);
                                break;
+                       case MINT_STELEM_U2:
+                               mono_array_set ((MonoArray *)o, guint16, aindex, sp [2].data.i);
+                               break;
                        case MINT_STELEM_I4:
                                mono_array_set ((MonoArray *)o, gint32, aindex, sp [2].data.i);
                                break;
@@ -4289,6 +4307,13 @@ array_constructed:
                MINT_IN_CASE(MINT_ICALL_PPP_V)
                MINT_IN_CASE(MINT_ICALL_PPI_V)
                        sp = do_icall (context, *ip, sp, rtm->data_items [*(guint16 *)(ip + 1)]);
+                       if (*mono_thread_interruption_request_flag ()) {
+                               MonoException *exc = mono_thread_interruption_checkpoint ();
+                               if (exc) {
+                                       frame->ex = exc;
+                                       context->search_for_handler = 1;
+                               }
+                       }
                        if (frame->ex != NULL)
                                goto handle_exception;
                        ip += 2;
@@ -4318,6 +4343,28 @@ array_constructed:
                        if (sp > frame->stack)
                                g_warning ("retobj: more values on stack: %d", sp-frame->stack);
                        goto exit_frame;
+               MINT_IN_CASE(MINT_MONO_TLS) {
+                       MonoTlsKey key = *(gint32 *)(ip + 1);
+                       sp->data.p = ((gpointer (*)()) mono_tls_get_tls_getter (key, FALSE)) ();
+                       sp++;
+                       ip += 3;
+                       MINT_IN_BREAK;
+               }
+               MINT_IN_CASE(MINT_MONO_JIT_ATTACH) {
+                       ++ip;
+
+                       context->original_domain = NULL;
+                       MonoDomain *tls_domain = (MonoDomain *) ((gpointer (*)()) mono_tls_get_tls_getter (TLS_KEY_DOMAIN, FALSE)) ();
+                       gpointer tls_jit = ((gpointer (*)()) mono_tls_get_tls_getter (TLS_KEY_DOMAIN, FALSE)) ();
+
+                       if (tls_domain != context->domain || !tls_jit)
+                               context->original_domain = mono_jit_thread_attach (context->domain);
+                       MINT_IN_BREAK;
+               }
+               MINT_IN_CASE(MINT_MONO_JIT_DETACH)
+                       ++ip;
+                       mono_jit_set_domain (context->original_domain);
+                       MINT_IN_BREAK;
 
 #define RELOP(datamem, op) \
        --sp; \
@@ -4572,7 +4619,7 @@ array_constructed:
                        sp [-1].data.p = alloca (len);
                        MonoMethodHeader *header = mono_method_get_header_checked (frame->runtime_method->method, &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       if (header->init_locals)
+                       if (header && header->init_locals)
                                memset (sp [-1].data.p, 0, len);
                        ++ip;
                        MINT_IN_BREAK;
@@ -4692,7 +4739,7 @@ array_constructed:
                                        stackval retval;
                                        memcpy (&dup_frame, inv, sizeof (MonoInvocation));
                                        dup_frame.retval = &retval;
-                                       ves_exec_method_with_context_with_ip (&dup_frame, context, inv->runtime_method->code + clause->data.filter_offset, frame->ex);
+                                       ves_exec_method_with_context (&dup_frame, context, inv->runtime_method->code + clause->data.filter_offset, frame->ex);
                                        if (dup_frame.retval->data.i) {
 #if DEBUG_INTERP
                                                if (tracing)
@@ -4840,12 +4887,6 @@ exit_frame:
        DEBUG_LEAVE ();
 }
 
-static void
-ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
-{
-       ves_exec_method_with_context_with_ip (frame, context, NULL, NULL);
-}
-
 void
 ves_exec_method (MonoInvocation *frame)
 {
@@ -4876,7 +4917,7 @@ ves_exec_method (MonoInvocation *frame)
        frame->runtime_method = mono_interp_get_runtime_method (context->domain, frame->method, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
        context->managed_code = 1;
-       ves_exec_method_with_context (frame, context);
+       ves_exec_method_with_context (frame, context, NULL, NULL);
        context->managed_code = 0;
        if (frame->ex) {
                if (context != &context_struct && context->current_env) {
index 39330d479f7eea4098161b4560d21350b6d289db..6e3e4dbd9e17adfddc57cc1da259a2d607a77933 100644 (file)
@@ -307,6 +307,7 @@ OPDEF(MINT_STELEM_I, "stelem.i", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_I1, "stelem.i1", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_U1, "stelem.u1", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_I2, "stelem.i2", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_U2, "stelem.u2", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_I4, "stelem.i4", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_I8, "stelem.i8", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_R4, "stelem.r4", 1, MintOpNoArgs)
@@ -507,9 +508,13 @@ OPDEF(MINT_ICALL_PI_P, "mono_icall_pi_p", 2, MintOpClassToken)
 OPDEF(MINT_ICALL_PPP_V, "mono_icall_ppp_v", 2, MintOpClassToken)
 OPDEF(MINT_ICALL_PPI_V, "mono_icall_ppi_v", 2, MintOpClassToken)
 OPDEF(MINT_MONO_LDPTR, "mono_ldptr", 2, MintOpClassToken) 
+OPDEF(MINT_MONO_TLS, "mono_tls", 2, MintOpInt)
 OPDEF(MINT_MONO_NEWOBJ, "mono_newobj", 2, MintOpClassToken)
 OPDEF(MINT_MONO_RETOBJ, "mono_retobj", 1, MintOpNoArgs)
 OPDEF(MINT_MONO_FREE, "mono_free", 1, MintOpNoArgs)
+OPDEF(MINT_MONO_ATOMIC_STORE_I4, "mono_atomic.store.i4", 1, MintOpNoArgs)
+OPDEF(MINT_MONO_JIT_ATTACH, "mono_jit_attach", 1, MintOpNoArgs)
+OPDEF(MINT_MONO_JIT_DETACH, "mono_jit_detach", 1, MintOpNoArgs)
 
 // FIXME: MintOp
 OPDEF(MINT_JIT_CALL, "mono_jit_call", 2, MintOpNoArgs)
index e23969c79d15ee4c92d496d666289f52f8760836..d76c9af55a7106f54ad06fd220174e5a14bdf4fd 100644 (file)
@@ -916,6 +916,22 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
        }
 }
 
+static MonoClassField *
+interp_field_from_token (MonoMethod *method, guint32 token, MonoClass **klass, MonoGenericContext *generic_context)
+{
+       MonoClassField *field = NULL;
+       if (method->wrapper_type != MONO_WRAPPER_NONE) {
+               field = (MonoClassField *) mono_method_get_wrapper_data (method, token);
+               *klass = field->parent;
+       } else {
+               MonoError error;
+               error_init (&error);
+               field = mono_field_from_token_checked (method->klass->image, token, klass, generic_context, &error);
+               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+       }
+       return field;
+}
+
 static void
 generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, MonoGenericContext *generic_context)
 {
@@ -1943,7 +1959,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_CASTCLASS:
                        CHECK_STACK (&td, 1);
                        token = read32 (td.ip + 1);
-                       klass = mono_class_get_full (image, token, generic_context);
+                       klass = mini_get_class (method, token, generic_context);
                        ADD_CODE(&td, MINT_CASTCLASS);
                        ADD_CODE(&td, get_data_item_index (&td, klass));
                        td.sp [-1].klass = klass;
@@ -1952,7 +1968,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_ISINST:
                        CHECK_STACK (&td, 1);
                        token = read32 (td.ip + 1);
-                       klass = mono_class_get_full (image, token, generic_context);
+                       klass = mini_get_class (method, token, generic_context);
                        ADD_CODE(&td, MINT_ISINST);
                        ADD_CODE(&td, get_data_item_index (&td, klass));
                        td.ip += 5;
@@ -1995,10 +2011,10 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        CHECK_STACK (&td, 1);
                        token = read32 (td.ip + 1);
 
-                       g_assert (method->wrapper_type == MONO_WRAPPER_NONE);
-                       klass = mono_class_get_full (image, token, generic_context);
+                       klass = mini_get_class (method, token, generic_context);
 
                        if (mini_type_is_reference (&klass->byval_arg)) {
+                               int mt = mint_type (&klass->byval_arg);
                                ADD_CODE (&td, MINT_CASTCLASS);
                                ADD_CODE (&td, get_data_item_index (&td, klass));
                                SET_TYPE (td.sp - 1, stack_type [mt], klass);
@@ -2033,7 +2049,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_LDFLDA:
                        CHECK_STACK (&td, 1);
                        token = read32 (td.ip + 1);
-                       field = mono_field_from_token (image, token, &klass, generic_context);
+                       field = interp_field_from_token (method, token, &klass, generic_context);
                        gboolean is_static = !!(field->type->attrs & FIELD_ATTRIBUTE_STATIC);
                        mono_class_init (klass);
                        if (is_static) {
@@ -2056,7 +2072,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_LDFLD: {
                        CHECK_STACK (&td, 1);
                        token = read32 (td.ip + 1);
-                       field = mono_field_from_token (image, token, &klass, generic_context);
+                       field = interp_field_from_token (method, token, &klass, generic_context);
                        gboolean is_static = !!(field->type->attrs & FIELD_ATTRIBUTE_STATIC);
                        mono_class_init (klass);
 
@@ -2097,7 +2113,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_STFLD: {
                        CHECK_STACK (&td, 2);
                        token = read32 (td.ip + 1);
-                       field = mono_field_from_token (image, token, &klass, generic_context);
+                       field = interp_field_from_token (method, token, &klass, generic_context);
                        gboolean is_static = !!(field->type->attrs & FIELD_ATTRIBUTE_STATIC);
                        mono_class_init (klass);
                        mt = mint_type(field->type);
@@ -2129,7 +2145,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                }
                case CEE_LDSFLDA:
                        token = read32 (td.ip + 1);
-                       field = mono_field_from_token (image, token, &klass, generic_context);
+                       field = interp_field_from_token (method, token, &klass, generic_context);
                        ADD_CODE(&td, MINT_LDSFLDA);
                        ADD_CODE(&td, get_data_item_index (&td, field));
                        td.ip += 5;
@@ -2137,7 +2153,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        break;
                case CEE_LDSFLD:
                        token = read32 (td.ip + 1);
-                       field = mono_field_from_token (image, token, &klass, generic_context);
+                       field = interp_field_from_token (method, token, &klass, generic_context);
                        mt = mint_type(field->type);
                        ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
                        ADD_CODE(&td, get_data_item_index (&td, field));
@@ -2158,7 +2174,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_STSFLD:
                        CHECK_STACK (&td, 1);
                        token = read32 (td.ip + 1);
-                       field = mono_field_from_token (image, token, &klass, generic_context);
+                       field = interp_field_from_token (method, token, &klass, generic_context);
                        mt = mint_type(field->type);
                        ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
                        ADD_CODE(&td, get_data_item_index (&td, field));
@@ -2178,7 +2194,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
-                               klass = mono_class_get_full (image, token, generic_context);
+                               klass = mini_get_class (method, token, generic_context);
 
                        ADD_CODE(&td, td.sp [-1].type == STACK_TYPE_VT ? MINT_STOBJ_VT : MINT_STOBJ);
                        ADD_CODE(&td, get_data_item_index (&td, klass));
@@ -2247,7 +2263,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
-                               klass = mono_class_get_full (image, token, generic_context);
+                               klass = mini_get_class (method, token, generic_context);
 
                        if (mono_class_is_nullable (klass)) {
                                MonoMethod *target_method = mono_class_get_method_from_name (klass, "Box", 1);
@@ -2278,7 +2294,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
-                               klass = mono_class_get_full (image, token, generic_context);
+                               klass = mini_get_class (method, token, generic_context);
 
                        unsigned char lentype = (td.sp - 1)->type;
                        if (lentype == STACK_TYPE_I8) {
@@ -2308,7 +2324,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        if (method->wrapper_type != MONO_WRAPPER_NONE)
                                klass = (MonoClass *) mono_method_get_wrapper_data (method, token);
                        else
-                               klass = mono_class_get_full (image, token, generic_context);
+                               klass = mini_get_class (method, token, generic_context);
 
                        if (!klass->valuetype && method->wrapper_type == MONO_WRAPPER_NONE && !readonly) {
                                ADD_CODE (&td, MINT_LDELEMA_TC);
@@ -2404,7 +2420,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                case CEE_LDELEM:
                        CHECK_STACK (&td, 2);
                        token = read32 (td.ip + 1);
-                       klass = mono_class_get_full (image, token, generic_context);
+                       klass = mini_get_class (method, token, generic_context);
                        switch (mint_type (&klass->byval_arg)) {
                                case MINT_TYPE_I1:
                                        ENSURE_I4 (&td, 1);
@@ -2534,11 +2550,14 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        CHECK_STACK (&td, 3);
                        ENSURE_I4 (&td, 2);
                        token = read32 (td.ip + 1);
-                       klass = mono_class_get_full (image, token, generic_context);
+                       klass = mini_get_class (method, token, generic_context);
                        switch (mint_type (&klass->byval_arg)) {
                                case MINT_TYPE_U1:
                                        SIMPLE_OP (td, MINT_STELEM_U1);
                                        break;
+                               case MINT_TYPE_U2:
+                                       SIMPLE_OP (td, MINT_STELEM_U2);
+                                       break;
                                case MINT_TYPE_I4:
                                        SIMPLE_OP (td, MINT_STELEM_I4);
                                        break;
@@ -2966,6 +2985,21 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                g_assert(klass->valuetype);
                                SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
                                break;
+                       case CEE_MONO_TLS: {
+                               gint32 key = read32 (td.ip + 1);
+                               td.ip += 5;
+                               g_assert (key < TLS_KEY_NUM);
+                               ADD_CODE (&td, MINT_MONO_TLS);
+                               WRITE32 (&td, &key);
+                               PUSH_SIMPLE_TYPE (&td, STACK_TYPE_MP);
+                               break;
+                       }
+                       case CEE_MONO_ATOMIC_STORE_I4:
+                               CHECK_STACK (&td, 2);
+                               SIMPLE_OP (td, MINT_MONO_ATOMIC_STORE_I4);
+                               td.sp -= 2;
+                               td.ip++;
+                               break;
                        case CEE_MONO_SAVE_LMF:
                        case CEE_MONO_RESTORE_LMF:
                        case CEE_MONO_NOT_TAKEN:
@@ -2977,6 +3011,14 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                PUSH_TYPE (&td, STACK_TYPE_MP, NULL);
                                ++td.ip;
                                break;
+                       case CEE_MONO_JIT_ATTACH:
+                               ADD_CODE (&td, MINT_MONO_JIT_ATTACH);
+                               ++td.ip;
+                               break;
+                       case CEE_MONO_JIT_DETACH:
+                               ADD_CODE (&td, MINT_MONO_JIT_DETACH);
+                               ++td.ip;
+                               break;
                        default:
                                g_error ("transform.c: Unimplemented opcode: 0xF0 %02x at 0x%x\n", *td.ip, td.ip-header->code);
                        }
@@ -3138,7 +3180,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        case CEE_INITOBJ:
                                CHECK_STACK(&td, 1);
                                token = read32 (td.ip + 1);
-                               klass = mono_class_get_full (image, token, generic_context);
+                               klass = mini_get_class (method, token, generic_context);
                                if (klass->valuetype) {
                                        ADD_CODE (&td, MINT_INITOBJ);
                                        i32 = mono_class_value_size (klass, NULL);
@@ -3163,7 +3205,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                break;
                        case CEE_CONSTRAINED_:
                                token = read32 (td.ip + 1);
-                               constrained_class = mono_class_get_full (image, token, generic_context);
+                               constrained_class = mini_get_class (method, token, generic_context);
                                mono_class_init (constrained_class);
                                td.ip += 5;
                                break;
@@ -3193,7 +3235,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                        size = mono_type_size (type, &align);
                                } else {
                                        int align;
-                                       MonoClass *szclass = mono_class_get_full (image, token, generic_context);
+                                       MonoClass *szclass = mini_get_class (method, token, generic_context);
                                        mono_class_init (szclass);
 #if 0
                                        if (!szclass->valuetype)
@@ -3427,7 +3469,7 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                        break;
                case MonoInlineType:
                        if (method->wrapper_type == MONO_WRAPPER_NONE) {
-                               class = mono_class_get_full (image, read32 (ip + 1), generic_context);
+                               class = mini_get_class (method, read32 (ip + 1), generic_context);
                                mono_class_init (class);
                                /* quick fix to not do this for the fake ptr classes - probably should not be getting the vtable at all here */
 #if 0
index c47792226c4e983bd2eb1332ff5495c43292e7a1..42cfa1b7bcbe5bec782d576aaae349515b70bd4b 100644 (file)
@@ -6780,7 +6780,7 @@ mini_get_method (MonoCompile *cfg, MonoMethod *m, guint32 token, MonoClass *klas
        return method;
 }
 
-static inline MonoClass*
+MonoClass*
 mini_get_class (MonoMethod *method, guint32 token, MonoGenericContext *context)
 {
        MonoError error;
index 9efd7c34929b2b4f6766b183085e4852a9b83289..719dceaf97e39dbfe0b39739584e9c85dfc23c60 100644 (file)
@@ -3730,6 +3730,10 @@ mini_init (const char *filename, const char *runtime_version)
        }
 #endif
 
+#ifdef ENABLE_INTERPRETER
+       mono_interp_init ();
+#endif
+
        mono_os_mutex_init_recursive (&jit_mutex);
 
        mono_cross_helpers_run ();
index 98714bd220097cd5d8fc5c8f008c8b665e1cca7d..e33dcf85d7f6e355d000bf3be5e818a2c6d59c93 100644 (file)
@@ -3061,6 +3061,7 @@ MonoGenericContext* mini_class_get_context (MonoClass *klass);
 
 MonoType* mini_get_underlying_type (MonoType *type) MONO_LLVM_INTERNAL;
 MonoType* mini_type_get_underlying_type (MonoType *type);
+MonoClass* mini_get_class (MonoMethod *method, guint32 token, MonoGenericContext *context);
 MonoMethod* mini_get_shared_method (MonoMethod *method);
 MonoMethod* mini_get_shared_method_to_register (MonoMethod *method);
 MonoMethod* mini_get_shared_method_full (MonoMethod *method, gboolean all_vt, gboolean is_gsharedvt);
index d8a7edd6dd8483d3628e9f99d80ab45bed0d35d6..8d0cf336b8c96281d5670973cad0a1133cccb9fe 100644 (file)
@@ -1035,6 +1035,19 @@ class Tests {
                return 0;
        }
 
+       static Nullable<bool> s_nullb;
+       static AStruct s_struct1;
+
+       /* test if VES uses correct sizes for value type write to static field */
+       public static int test_0_static_nullable_bool () {
+               s_struct1 = new AStruct (0x1337dead);
+               s_nullb = true;
+               /* make sure that the write to s_nullb didn't smash the value after it */
+               if (s_struct1.i != 0x1337dead)
+                       return 2;
+               return 0;
+       }
+
        public static int test_71_long_shift_right () {
                ulong value = 38654838087;
                int x = 0;
index abdbce8bd9d002dfed0fa40056d3adaf5507e3c1..f8946b03be7cbd909b4c31d8b448741bcf8a01b3 100644 (file)
@@ -1046,21 +1046,9 @@ INTERP_DISABLED_TESTS = \
        call_missing_method.exe \
        calliGenericTest.exe \
        cominterop.exe \
-       constant-division.exe \
-       context-static.exe \
        cross-domain.exe \
-       delegate-async-exit.exe \
-       delegate-delegate-exit.exe \
-       delegate-exit.exe \
        delegate-with-null-target.exe \
-       delegate1.exe \
-       delegate3.exe \
-       delegate5.exe \
-       delegate8.exe \
        delegate9.exe \
-       dynamic-method-access.2.exe \
-       dynamic-method-finalize.2.exe \
-       dynamic-method-resurrection.exe \
        dynamic-method-stack-traces.exe \
        even-odd.exe \
        exception18.exe \
index 4662ff6fa8054d9a7b634f068a86550f53df88de..389616e4088c0929a40d3abbf37bb2515f18094c 100644 (file)
@@ -33,7 +33,7 @@ namespace WeakReferenceTest
        }
 
        public class Tester {
-               static readonly int seed = unchecked(DateTime.Now.Ticks.GetHashCode());
+               public static readonly int seed = unchecked(DateTime.Now.Ticks.GetHashCode());
 
                Random rand = new Random(seed);
 
@@ -88,6 +88,7 @@ namespace WeakReferenceTest
                public static void Main (string[] args)
                {
                        Console.WriteLine("Starting cache testers");
+                       Console.WriteLine("Thread seed: " + Tester.seed);
                        List<Tester> testers = new List<Tester>();
                        for (int count = 0; count < 10; count++) {
                                testers.Add(new Tester());
index 2e7c807d924477595bac23801ed61ab09b77f99c..9b418f5adc0b1eacd6c4cf2b35858c121a5cef7e 100755 (executable)
@@ -97,4 +97,12 @@ if [[ ${label} == osx-* ]]
 then ${TESTCMD} --label=ms-test-suite --timeout=30m make -w -C acceptance-tests check-ms-test-suite
 else ${TESTCMD} --label=ms-test-suite --skip;
 fi
+if [[ ${label} == 'ubuntu-1404-amd64' ]]; then
+    source ${MONO_REPO_ROOT}/scripts/ci/util.sh
+    if ${TESTCMD} --label=apidiff --timeout=15m --fatal make -w -C mcs -j4 mono-api-diff
+    then report_github_status "success" "API Diff" "No public API changes found."
+    else report_github_status "error" "API Diff" "The public API changed." "$BUILD_URL/Public_API_Diff/"
+    fi
+else ${TESTCMD} --label=apidiff --skip
+fi
 rm -fr /tmp/jenkins-temp-aspnet*
diff --git a/scripts/ci/util.sh b/scripts/ci/util.sh
new file mode 100644 (file)
index 0000000..d4b09e8
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash -e
+
+function report_github_status {
+    if [ -z "$1" ]; then echo "No status specified. Skipping GitHub manual status report."; return 1; fi;
+    if [ -z "$2" ]; then echo "No context specified. Skipping GitHub manual status report."; return 1; fi;
+    if [ -z "$3" ]; then echo "No description specified. Skipping GitHub manual status report."; return 1; fi;
+    if [ -z "${ghprbActualCommit}" ]; then echo "Not a pull request. Skipping GitHub manual status report."; return 1; fi;
+    if [ -z "${GITHUB_STATUS_AUTH_TOKEN}" ]; then echo "No auth token specified. Skipping GitHub manual status report."; return 1; fi;
+
+    wget -qO- --header "Content-Type: application/json" --post-data "{\"state\": \"$1\", \"context\":\"$2\", \"description\": \"$3\", \"target_url\": \"$4\"}" "https://api.github.com/repos/mono/mono/statuses/${ghprbActualCommit}?access_token=${GITHUB_STATUS_AUTH_TOKEN}"
+}