Merge pull request #2200 from xmcclure/image-audit-oops
authorAndi McClure <andi.mcclure@xamarin.com>
Mon, 9 Nov 2015 17:04:57 +0000 (12:04 -0500)
committerAndi McClure <andi.mcclure@xamarin.com>
Mon, 9 Nov 2015 17:04:57 +0000 (12:04 -0500)
Fix --with-checked-build build on GCC/Linux

176 files changed:
acceptance-tests/.gitignore
acceptance-tests/GCStressTests/AssemblyExtensions.cs [new file with mode: 0644]
acceptance-tests/GCStressTests/AssemblyLoadContext.cs [new file with mode: 0644]
acceptance-tests/Makefile.am
acceptance-tests/SUBMODULES.json
acceptance-tests/versions.mk
configure.ac
man/mono.1
mcs/class/Facades/Makefile
mcs/class/Facades/System.IO.Compression/AssemblyInfo.cs [deleted file]
mcs/class/Facades/System.IO.Compression/Makefile [deleted file]
mcs/class/Facades/System.IO.Compression/System.IO.Compression-net_4_x.csproj [deleted file]
mcs/class/Facades/System.IO.Compression/System.IO.Compression.dll.sources [deleted file]
mcs/class/Facades/System.IO.Compression/TypeForwarders.cs [deleted file]
mcs/class/Makefile
mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetTlsProvider.cs
mcs/class/Mono.Security.Providers.OldTls/Makefile [new file with mode: 0644]
mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls.dll.sources [new file with mode: 0644]
mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs [new file with mode: 0644]
mcs/class/Mono.Security.Providers.OldTls/Properties/AssemblyInfo.cs [new file with mode: 0644]
mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs
mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_5.csproj
mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj
mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryObjectNotFoundException.cs [new file with mode: 0644]
mcs/class/System.DirectoryServices/System.DirectoryServices.dll.sources
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/ChangeLog [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/JsonReaderTest.cs [new file with mode: 0644]
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/JsonWriterTest.cs [new file with mode: 0644]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/ChangeLog [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializerSettings.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationWriter.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs [deleted file]
mcs/class/System.ServiceModel.Web/System.ServiceModel.Web_test.dll.sources
mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/ChangeLog [deleted file]
mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs [deleted file]
mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/JsonReaderTest.cs [deleted file]
mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/JsonWriterTest.cs [deleted file]
mcs/class/System/Assembly/AssemblyInfo.cs
mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
mcs/class/System/Mono.Net.Security/LegacySslStream.cs
mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs
mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs
mcs/class/System/Mono.Net.Security/MonoTlsStream.cs
mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs
mcs/class/System/Mono.Net.Security/SystemCertificateValidator.cs [new file with mode: 0644]
mcs/class/System/ReferenceSources/SSPIConfiguration.cs
mcs/class/System/ReferenceSources/SSPIWrapper.cs
mcs/class/System/ReferenceSources/SslStream.cs
mcs/class/System/System.Diagnostics/Process.cs
mcs/class/System/System.Net.Security/SslStream.cs
mcs/class/System/System.Net/EndPointListener.cs
mcs/class/System/System.Net/EndPointManager.cs
mcs/class/System/System.Net/HttpConnection.cs
mcs/class/System/System.Net/HttpListener.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/System.Net/WebConnection.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs
mcs/class/System/System.dll.sources
mcs/class/System/System/AndroidPlatform.cs
mcs/class/System/Test/System.Net/HttpListener2Test.cs
mcs/class/System/mobile_System.dll.sources
mcs/class/corlib/System/Exception.cs
mcs/class/corlib/Test/System.Threading/ThreadTest.cs
mcs/class/corlib/Test/System/MathTest.cs
mcs/mcs/cs-tokenizer.cs
mcs/mcs/statement.cs
mcs/tests/gtest-409.cs
mcs/tests/test-930.cs [new file with mode: 0644]
mcs/tests/test-null-operator-19.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs
mcs/tools/mdoc/Mono.Documentation/preserver.cs
mcs/tools/xbuild/Makefile
mono/arch/s390x/s390x-codegen.h
mono/dis/get.c
mono/dis/main.c
mono/io-layer/processes.c
mono/metadata/boehm-gc.c
mono/metadata/class.c
mono/metadata/debug-mono-ppdb.c
mono/metadata/gc-internal.h
mono/metadata/gc.c
mono/metadata/loader.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/metadata-internals.h
mono/metadata/metadata.c
mono/metadata/mono-hash.c
mono/metadata/remoting.c
mono/metadata/sgen-mono.c
mono/metadata/sgen-stw.c
mono/metadata/sgen-toggleref.c
mono/metadata/socket-io.c
mono/metadata/threadpool-ms-io.c
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/branch-opts.c
mono/mini/cpu-ia64.md
mono/mini/cpu-mips.md
mono/mini/cpu-ppc.md
mono/mini/cpu-ppc64.md
mono/mini/cpu-s390x.md
mono/mini/cpu-sparc.md
mono/mini/debugger-agent.c
mono/mini/driver.c
mono/mini/emitnunit.pl
mono/mini/jit.h
mono/mini/llvm-runtime.cpp
mono/mini/llvm-runtime.h
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-codegen.c
mono/mini/mini-exceptions.c
mono/mini/mini-ia64.c
mono/mini/mini-llvm.c
mono/mini/mini-mips.c
mono/mini/mini-ops.h
mono/mini/mini-ppc.c
mono/mini/mini-runtime.c
mono/mini/mini-s390x.c
mono/mini/mini-s390x.h
mono/mini/mini-sparc.c
mono/mini/mini-x86.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/test_op_il_seq_point.sh
mono/mini/test_op_il_seq_point_headerfooter.sh
mono/mini/trace.c
mono/profiler/proflog.c
mono/profiler/ptestrunner.pl
mono/sgen/sgen-cardtable.c
mono/sgen/sgen-gc.c
mono/sgen/sgen-gc.h
mono/sgen/sgen-gchandles.c
mono/sgen/sgen-marksweep-drain-gray-stack.h
mono/sgen/sgen-marksweep-scan-object-concurrent.h
mono/sgen/sgen-marksweep.c
mono/sgen/sgen-workers.c
mono/sgen/sgen-workers.h
mono/tests/Makefile.am
mono/tests/finalizer-wait.cs
mono/tests/libtest.c
mono/tests/pinvoke3.cs
mono/tests/test-runner.cs
mono/utils/mono-threads-api.h
mono/utils/mono-threads-coop.c
mono/utils/mono-threads-coop.h
mono/utils/mono-threads-mach-abort-syscall.c
mono/utils/mono-threads-mach.c
mono/utils/mono-threads-posix-abort-syscall.c
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-windows-abort-syscall.c
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
msvc/mono.def
msvc/monosgen.def

index f95738367938d50084684581e7a937fcb7aa0dd8..b250046de4a28991caf458738188b5ef31a6ddc6 100644 (file)
@@ -3,3 +3,4 @@ Makefile
 *.exe
 *.dll
 *.mdb
+coreclr-testlist.txt
diff --git a/acceptance-tests/GCStressTests/AssemblyExtensions.cs b/acceptance-tests/GCStressTests/AssemblyExtensions.cs
new file mode 100644 (file)
index 0000000..418d5db
--- /dev/null
@@ -0,0 +1,14 @@
+using System;
+using System.IO;
+using System.Reflection;
+
+namespace System.Runtime.Loader
+{
+    public static class AssemblyExtensions
+    {
+        public static Type[] GetTypes(this Assembly assembly)
+        {
+            return assembly.GetTypes ();
+        }
+    }
+}
diff --git a/acceptance-tests/GCStressTests/AssemblyLoadContext.cs b/acceptance-tests/GCStressTests/AssemblyLoadContext.cs
new file mode 100644 (file)
index 0000000..b3a2c48
--- /dev/null
@@ -0,0 +1,41 @@
+using System;
+using System.IO;
+using System.Reflection;
+
+namespace System.Runtime.Loader
+{
+    public abstract class AssemblyLoadContext
+    {
+        protected abstract Assembly Load(AssemblyName assemblyName);
+
+        protected Assembly LoadFromAssemblyPath(string assemblyPath)
+        {
+            if (assemblyPath == null)
+                throw new ArgumentNullException("assemblyPath");
+
+            if (!Path.IsPathRooted(assemblyPath))
+                throw new ArgumentException("Gimme an absolute path " + assemblyPath + " XXX " + Path.GetPathRoot(assemblyPath), "assemblyPath");
+
+            return Assembly.LoadFrom (assemblyPath);
+        }
+
+        public Assembly LoadFromAssemblyName(AssemblyName assemblyName)
+        {
+            // AssemblyName is mutable. Cache the expected name before anybody gets a chance to modify it.
+            string requestedSimpleName = assemblyName.Name;
+
+            Assembly assembly = Load(assemblyName);
+            if (assembly == null)
+                throw new FileLoadException("File not found", requestedSimpleName);
+
+            return assembly;
+        }
+
+        public static AssemblyName GetAssemblyName(string assemblyPath)
+        {
+            if (!File.Exists (assemblyPath))
+                throw new Exception ("file not found");
+            return new AssemblyName (Path.GetFileName (assemblyPath));
+        }
+    }
+}
index 8642c2b896bd12bfaa47a5950087e7f8d87483e7..2129dee140ebc39301e4c4e6e028ba84c8ab9cc4 100644 (file)
@@ -26,56 +26,72 @@ check-ms-test-suite:
                echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
        fi
 
-# Roslyn require some aditional files in the mono installation to build.
-# Those files can be copied from roslyn mono toolset archive that is downloaded by cibuild.sh
 check-roslyn:
        @$(MAKE) validate-roslyn RESET_VERSIONS=1
        @if [ -z $$PREFIX ]; then echo "You need to set PREFIX to the prefix of the Mono installation that should be used for testing Roslyn." && exit 1; fi
        export MSBuildExtensionsPath=$$PREFIX/lib/mono/xbuild; \
-       MONO_TOOLSET_NAME=mono.mac.3; \
-       MONO_NUGET_DIR=$$PREFIX/lib/mono/xbuild/Microsoft/NuGet; \
        MONO_DOTNET_PORTABLE_DIR=$$PREFIX/lib/mono/xbuild-frameworks/.NETPortable/; \
-       pushd /tmp; \
-       if [ ! -d "$$MONO_NUGET_DIR" ]; then \
-               echo "Mono installation is missing $$MONO_NUGET_DIR"; \
-               ROSLYN_MONO_TOOLSET_REQUIRED=yes; \
+       MONO_NUGET_TARGETS_DIR=$$PREFIX/lib/mono/xbuild/Microsoft/NuGet/; \
+       MONO_PORTABLE_TARGETS_DIR=$$PREFIX/lib/mono/xbuild/Microsoft/Portable/v5.0; \
+       if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR/v5.0" ]; then \
+               mkdir -p $$MONO_DOTNET_PORTABLE_DIR; \
+               mkdir -p $$MONO_NUGET_TARGETS_DIR; \
+               mkdir -p $$MONO_PORTABLE_TARGETS_DIR; \
+               curl -SL "http://storage.bos.internalx.com/bot-provisioning/RoslynBuildDependencies.zip" > /tmp/RoslynBuildDependencies.zip; \
+               unzip -o /tmp/RoslynBuildDependencies.zip -d /tmp/RoslynBuildDependencies; \
+               cp -r /tmp/RoslynBuildDependencies/PortableReferenceAssemblies/* $$MONO_DOTNET_PORTABLE_DIR; \
+               cp /tmp/RoslynBuildDependencies/NuGetTargets/* $$MONO_NUGET_TARGETS_DIR; \
+               cp /tmp/RoslynBuildDependencies/PortableTargets/* $$MONO_PORTABLE_TARGETS_DIR; \
        fi; \
-       if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR" ]; then \
-               echo "Mono installation is missing $$MONO_DOTNET_PORTABLE_DIR"; \
-               ROSLYN_MONO_TOOLSET_REQUIRED=yes; \
-       fi; \
-       if [[ $$ROSLYN_MONO_TOOLSET_REQUIRED ]]; then \
-               if [ ! -d "$$MONO_TOOLSET_NAME" ]; then \
-                       echo "Downloading roslyn mono tool set"; \
-                       curl -O https://dotnetci.blob.core.windows.net/roslyn/$$MONO_TOOLSET_NAME.tar.bz2; \
-                       tar -jxf $$MONO_TOOLSET_NAME.tar.bz2; \
-               fi; \
-       fi; \
-       if [ ! -d "$$MONO_NUGET_DIR" ]; then \
-               mkdir $$MONO_NUGET_DIR; \
-               cp -r $$MONO_TOOLSET_NAME/lib/mono/xbuild/Microsoft/NuGet/* $$MONO_NUGET_DIR; \
-       fi; \
-       if [ ! -d "$$MONO_DOTNET_PORTABLE_DIR" ]; then \
-               mkdir $$MONO_DOTNET_PORTABLE_DIR; \
-               cp -r $$MONO_TOOLSET_NAME/lib/mono/xbuild-frameworks/.NETPortable/* $$MONO_DOTNET_PORTABLE_DIR; \
-       fi; \
-       popd; \
        cd $(ROSLYN_PATH) && ./cibuild.sh --mono-path $$PREFIX/bin
 
 coreclr-validate:
        $(MAKE) validate-coreclr RESET_VERSIONS=1
 
 coreclr-compile-tests: coreclr-validate
-       $(MAKE) -j4 $(CORECLR_TESTSI_CS) $(CORECLR_TESTSI_IL)
+       $(MAKE) -j4 $(CORECLR_TESTSI_CS) $(CORECLR_COREMANGLIB_TESTSI_CS) $(CORECLR_TESTSI_IL)
+
+# the CoreCLR IL tests use the System.Console facade, we need to copy it to the test directory
+# all the other tests rely on the coreclr-testlibrary.dll
+coreclr-runtest-basic: coreclr-validate test-runner.exe $(CORECLR_TESTSI_CS) $(CORECLR_TESTSI_IL)
+       @rm -f coreclr-testlist.txt
+       @$(call dumpvariabletofile, coreclr-testlist.txt, $(CORECLR_TESTSI_CS))
+       @$(call dumpvariabletofile, coreclr-testlist.txt, $(CORECLR_TESTSI_IL))
+       @for var in $(sort $(dir $(CORECLR_TESTSI_CS))); do ln -sf $(abspath coreclr-testlibrary.dll) "$$var"; done
+       @for var in $(sort $(dir $(CORECLR_TESTSI_IL))); do ln -sf "$(abspath $(CLASS)/Facades/System.Console.dll)" "$$var"; done
+       $(RUNTIME) ./test-runner.exe -j a --testsuite-name "coreclr" --expected-exit-code 100 --input-file coreclr-testlist.txt
+       @rm -f coreclr-testlist.txt
+
+coreclr-runtest-coremanglib: coreclr-validate test-runner.exe $(CORECLR_COREMANGLIB_TESTSI_CS)
+       @rm -f coreclr-testlist.txt
+       @$(call dumpvariabletofile, coreclr-testlist.txt, $(CORECLR_COREMANGLIB_TESTSI_CS))
+       @for var in $(sort $(dir $(CORECLR_COREMANGLIB_TESTSI_CS))); do ln -sf $(abspath coreclr-testlibrary.dll) "$$var"; done
+       $(RUNTIME) ./test-runner.exe -j a --testsuite-name "coreclr-coremanglib" --expected-exit-code 100 --input-file coreclr-testlist.txt
+       @rm -f coreclr-testlist.txt
+
+check-coreclr: coreclr-compile-tests coreclr-runtest-basic coreclr-runtest-coremanglib
 
-coreclr-runtest-managed: coreclr-validate test-runner.exe $(CORECLR_TESTSI_CS) $(CORECLR_TESTSI_IL)
-       @$(RUNTIME) ./test-runner.exe -j a --testsuite-name "coreclr" --expected-exit-code 100 $(CORECLR_TESTSI_CS) $(CORECLR_TESTSI_IL)
+coreclr-gcstress: coreclr-validate GCStressTests.exe $(CORECLR_STRESSTESTSI_CS)
+       BVT_ROOT=$(realpath $(CORECLR_PATH)/tests/src/GC/Stress/Tests) $(RUNTIME) GCStressTests.exe $(CORECLR_PATH)/tests/src/GC/Stress/testmix_gc.config; if [ $$? -ne 100 ]; then exit 1; fi
 
-check-coreclr: coreclr-compile-tests coreclr-runtest-managed
+# Output a variable in $(2) to the file $(1), separated by newline characters
+# we need to do it in groups of 100 entries to make sure we don't exceed shell char limits
+# note: the variable is appended to the file
+define dumpvariabletofile
+echo $(wordlist 1, 100, $(2)) | tr " " "\n" >> $(1)
+$(if $(word 101, $(2)), $(call dumpvariabletofile, $(1), $(wordlist 101, $(words $(2)), $(2))))
+endef
 
 CORECLR_TEST_CS_SRC=           \
+       $(CORECLR_PATH)/tests/src/GC/Coverage/LargeObjectAlloc.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Coverage/LargeObjectAlloc2.cs      \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-beta1/149926/149926.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-beta1/289745/289745.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-beta2/426480/426480.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-beta2/471729/471729.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-rtm/494226/494226.cs      \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-rtm/544701/544701.cs      \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Add1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/addref.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/And1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/AndRef.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Args4.cs      \
@@ -109,13 +125,7 @@ CORECLR_TEST_CS_SRC=               \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/DblSub.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/DblSubConst.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/DblVar.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/div1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/div2.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/divref.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Eq1.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FactorialRec.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FibLoop.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FiboRec.cs    \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FPAdd.cs      \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FPAddConst.cs \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FPArea.cs     \
@@ -144,6 +154,9 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FPSub.cs      \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FPSubConst.cs \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FPVar.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FactorialRec.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FibLoop.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/FiboRec.cs    \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Gcd.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Ge1.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Gt1.cs        \
@@ -152,7 +165,6 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/InstanceCalls.cs      \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/IntArraySum.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/IntConv.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Jmp1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/JTrue1.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/JTrueEqDbl.cs \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/JTrueEqFP.cs  \
@@ -172,6 +184,7 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/JTrueNeDbl.cs \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/JTrueNeFP.cs  \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/JTrueNeInt1.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Jmp1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Le1.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/LeftShift.cs  \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/LngConv.cs    \
@@ -179,10 +192,6 @@ CORECLR_TEST_CS_SRC=               \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/LocallocLarge.cs      \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/LongArgsAndReturn.cs  \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Lt1.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul2.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul3.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul4.cs       \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Ne1.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/NegRMW.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/NestedCall.cs \
@@ -192,8 +201,8 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/OpMembersOfStructLocal.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Or1.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/OrRef.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/rem1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/RightShiftRef.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Rotate.cs     \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/StaticCalls.cs        \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/StaticValueField.cs   \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/StructFldAddr.cs      \
@@ -205,6 +214,15 @@ CORECLR_TEST_CS_SRC=               \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Unbox.cs      \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/Xor1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/XorRef.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/addref.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/div1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/div2.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/divref.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul2.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul3.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/mul4.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/CodeGenBringUpTests/rem1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Directed/Arrays/complex1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Directed/Arrays/complex2.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Directed/Arrays/simple1.cs        \
@@ -227,6 +245,26 @@ CORECLR_TEST_CS_SRC=               \
        $(CORECLR_PATH)/tests/src/JIT/Directed/CheckedCtor/Test_CSharp_Peer_2.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Directed/CheckedCtor/Test_CSharp_Peer_3.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Directed/CheckedCtor/Test_CSharp_Peer_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess1.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess2.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess3.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess4.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1a.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1a2.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1b.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1c.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1d.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2a.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2b.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2c.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SpAddr.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SpAddrAT.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/TypedReference/TypedReference.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/UnrollLoop/Dev10_846218.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/UnrollLoop/loop1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/UnrollLoop/loop4.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Directed/cmov/Bool_And_Op.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Directed/cmov/Bool_No_Op.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Directed/cmov/Bool_Or_Op.cs       \
@@ -252,9 +290,9 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lclfldmul.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lclfldrem.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Directed/coverage/oldtests/lclfldsub.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/cmpxchg.cs \
        $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/cse_cmpxchg.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/nullchecksuppress.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/regalloc1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Directed/intrinsic/interlocked/regalloc2.cs       \
@@ -269,30 +307,12 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Directed/shift/int16.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Directed/shift/int32.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Directed/shift/int64.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/shift/uint8.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Directed/shift/uint16.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Directed/shift/uint32.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Directed/shift/uint64.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess1.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess2.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess3.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StrAccess/straccess4.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1a.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1a2.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1b.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1c.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP1d.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2a.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2b.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SP2c.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SpAddr.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/StructPromote/SpAddrAT.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/TypedReference/TypedReference.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/UnrollLoop/Dev10_846218.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/UnrollLoop/loop1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Directed/UnrollLoop/loop4.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/shift/uint8.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/Struct01.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/Struct01_instance.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/class01.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/class01_instance.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/class01_static.cs \
@@ -310,8 +330,6 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/struct05.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/struct06.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/struct07.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/Struct01.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/Jagged/Struct01_instance.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/MultiDim/class01.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/MultiDim/class01_Instance.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Arrays/ConstructedTypes/MultiDim/class01_static.cs       \
@@ -371,11 +389,11 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Fields/static_equalnull_struct01.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Fields/static_passing_class01.cs \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Fields/static_passing_struct01.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/Baseclass04.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/Baseclass05.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/BaseClass01.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/BaseClass02.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/BaseClass03.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/Baseclass04.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/Baseclass05.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/class01.cs \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/class02.cs \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Instantiation/Classes/class03.cs \
@@ -424,6 +442,9 @@ CORECLR_TEST_CS_SRC=                \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Parameters/static_equalnull_struct01.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Parameters/static_passing_class01.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Parameters/static_passing_struct01.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/TypeParameters/default_class01.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/TypeParameters/default_struct01.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/Struct02.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/class01.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/class02.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/class03.cs        \
@@ -432,160 +453,7 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/refTypesdynamic.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/struct01.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/struct03.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/Struct02.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Generics/Typeof/valueTypeBoxing.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/TypeParameters/default_class01.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Generics/TypeParameters/default_struct01.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/9_and_alloca2.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/9param.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/148343.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/eh1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/fgtest1.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/fgtest2.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/funclet.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/gcparaminreg.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/ret_struct_test1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/ret_struct_test4.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/simple1.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1_4.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1_5.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_4.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_5.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_5_2.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3_4.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3_5.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4_4.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4_5.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5_4.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5_5.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6_4.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6_5.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct7_1.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct8.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct9.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct9_2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_2.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_3.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_4.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_5.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_6.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_2.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_3.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_4.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp3_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp4_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp5_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp6_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfpseh5_1.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfpseh6_1.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structref1_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret1_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret1_2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret1_3.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret2_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret2_2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret2_3.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret3_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret3_2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret3_3.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret4_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret4_2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret4_3.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret5_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret5_2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret5_3.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret6_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret6_2.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret6_3.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structva1_1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test1.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test2.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test3.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test_noalloca.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/vbil.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/regress/vswhidbey/143837.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/regress/vswhidbey/339415.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAC.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseACA.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseACC.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress1.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress2.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress3.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/arrayexpr1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/arrayexpr2.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldexpr1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldexpr1_1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldexpr2.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldExprUnchecked1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeArray.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeArray1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/hugeexpr1.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField2.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/hugeSimpleExpr1.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/mixedexpr1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/pointerexpr1.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/pointerexpr1_1.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr1.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr1_1.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr2.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr3.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr4.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/staticFieldExpr1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/staticFieldExpr1_1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/staticFieldExprUnchecked1.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/volatilefield.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/volatilestaticfield.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/inl/caninline.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/lim/lim_002.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/lur/lur_02.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/osr/osr001.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/ArrayBound.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/ArrayWith2Loops.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/ArrayWithFunc.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/BadMatrixMul.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/JaggedArray.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/MatrixMul.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/RngchkStress1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/RngchkStress2.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/RngchkStress3.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/SimpleArray_01.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/asurt/143616/foo.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/103087/103087.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/113574/113574.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/132977/132977.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ndpw/160545/simple.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ndpw/21015/interior_pointer.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/102964/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/329169/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/373472/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/471729/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/517867/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/524070/test1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/524070/test2.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/528315/simple-repro.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/538615/test1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/539509/test1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/541067/test1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/543229/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/549880/test.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/601425/stret.cs \
-       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/610378/BigFrame.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcs.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcs2.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/Arrays/lcs/lcsbas.cs   \
@@ -608,6 +476,80 @@ CORECLR_TEST_CS_SRC=               \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/Boxing/misc/enum.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/Boxing/misc/nestval.cs \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/Boxing/misc/tailjump.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Coverage/b433189.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/FPtrunc/convr4a.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/FPtrunc/convr8a.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param1a.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param2a.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param3a.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfinally.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfinally_tail.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/callvirt/test1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/ctor/val_ctor.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/deep/deep.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/fptr/recurse.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/obj.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/bool.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/byte.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/char.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/decimal.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/double.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/float.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/int.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/long.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/sbyte.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/short.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/uint.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/ulong.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/ushort.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/classarr.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/jaggedarr.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/plainarr.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/structarr.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/classarr.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/doublearr.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/intarr.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/jaggedarr.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/stringarr.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/structarr.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/classarr.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/doublearr.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/jaggedarr.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/stringarr.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/structarr.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/arithm32.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/arithm64.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNadd.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNdiv.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNmul.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNrem.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNsub.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNadd.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNdiv.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNmul.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNrem.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNsub.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Overflow/FloatInfinitiesToInt.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/Overflow/FloatOvfToInt2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/call.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/jumper.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/jumps.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/vtret.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/ctor_recurse.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/gc_nested.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han2.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han3.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han3_ctor.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han3_ref.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/hanoi.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/knight.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/nested.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/identity/accum.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/identity/vcall.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/port/lcs.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/port/lcs_gcref.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/SEH/cast_throw.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/SEH/throw.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/coverage/castclass_call.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/coverage/castclass_ldarg.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/coverage/castclass_ldloc.cs      \
@@ -618,13 +560,10 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/coverage/isinst_newobj.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/iface/iface1.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/ilseq/commonBase.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/SEH/cast_throw.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/casts/SEH/throw.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/precise1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/precise1b.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/precise2.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/cctor/simple/precise4.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Coverage/b433189.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/divrem/div/decimaldiv.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/divrem/div/i4div.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/divrem/div/i8div.cs    \
@@ -672,14 +611,12 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/bug647189/ssa_tuIsAddr.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug675304/arrayDim.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug675304/osrAddovershot.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679008/castClassEH.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679008/GCOverReporting.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679008/castClassEH.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679008/sealedCastVariance.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679008/singleRefField.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug679008/zeroInitStackSlot.cs \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/flowgraph/dev10_bug723489/qMarkColon.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/FPtrunc/convr4a.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/FPtrunc/convr8a.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/inlining/bug505642/test.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/int64/arrays/lcs_long.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/int64/arrays/lcs_ulong.cs      \
@@ -703,64 +640,12 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/int64/unsigned/ldsfld_mul.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/int64/unsigned/ldsfld_mulovf.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/int64/unsigned/muldiv.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param1a.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param2a.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/25params/25param3a.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/callvirt/test1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/ctor/val_ctor.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/deep/deep.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/fptr/recurse.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/implicit/obj.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfinally.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Invoke/SEH/catchfinally_tail.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/classarr.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/doublearr.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/jaggedarr.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/stringarr.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/basics/structarr.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/bool.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/byte.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/char.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/decimal.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/double.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/float.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/int.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/long.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/sbyte.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/short.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/uint.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/ulong.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/DataTypes/ushort.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/classarr.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/jaggedarr.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/plainarr.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/GaussJordan/structarr.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/classarr.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/doublearr.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/intarr.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/jaggedarr.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/stringarr.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/MDArray/InnerProd/structarr.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/arithm32.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/arithm64.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNadd.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNdiv.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNmul.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNrem.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r4NaNsub.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNadd.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNdiv.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNmul.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNrem.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/NaN/r8NaNsub.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/classic.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/delegate.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/generics.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/generics2.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/tailcall.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/nonvirtualcall/valuetype.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Overflow/FloatInfinitiesToInt.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/Overflow/FloatOvfToInt2.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array1.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/refany/array2.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/refany/format.cs       \
@@ -769,95 +654,13 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/refany/native.cs       \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/refany/virtcall.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/tailcall_v4/delegateParamCallTarget.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/call.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/jumper.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/jumps.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/callconv/vtret.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/ctor_recurse.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/gc_nested.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han2.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han3.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han3_ctor.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/han3_ref.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/hanoi.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/knight.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/etc/nested.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/identity/accum.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/identity/vcall.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/port/lcs.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Methodical/VT/port/lcs_gcref.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/xxobj/operand/refanyval.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Methodical/xxobj/operand/unbox.cs \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/args1.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/args2.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/args3.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/array.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/ArrayOfStructs.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/debug.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/deepcall.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/DelegInstanceFtn.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/DelegStaticFtn.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/GenericStructs.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/ifelse.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/indexer.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/inline.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_DelegateStruct.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_GenericMethods.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_Handler.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/inline_Many.cs \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_MultipleReturn.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_NewObj.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_NormalizeStack.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/inline_Recursion.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_RecursiveMethod.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_RecursiveMethod21.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_SideAffects.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_STARG.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/InlineThrow.cs \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_Vars.cs \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/interfaceCall.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/interfaceProperty.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/mathfunc.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/mthdimpl.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/property.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/ReturnStruct_Method.cs \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/size.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/StructAsParam_Method.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/StructInClass.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Struct_Opcodes.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/throwTest.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/trycatch.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/clr-x64-JIT/v4.0/DevDiv34372/overRepLocalOpt.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M09.5-PDC/b12008/b12008.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b40089/b40089.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b40138/b40138.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b45679/b45679.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b46847/b46847.cs     \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b392262/b392262.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b400791/b400971.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b402658/b402658.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev11/DevDiv_376412/DevDiv_376412.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b119294/b119294.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b130333/byteshift.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b140711/b140711.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b102879/dblinf.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b124232/genisinst.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b169333/b169333.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b178119/hugemthfrm.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b178128/hugestruct.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b180381/constrained1.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b191926/ParamLimit.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b219940/struct01_gen.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b00735/b00735.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b02345/b02345.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07211/byteshift.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07900/rpPasses.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b08020/bbHndIndex.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b11762/b11762.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16386/gtnop.cs   \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16399/gtIsValid64RsltMul.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b19171/jmp2blk.cs \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b30251/b578931.cs \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b11490/b11490.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12399/b12399.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12624/b12624.cs      \
@@ -1084,6 +887,27 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M14-SP1/b119538/b119538a.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-M14-SP1/b119538/b119538b.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1-QFE/b148815/testclass.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b119294/b119294.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b130333/byteshift.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b140711/b140711.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b102879/dblinf.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b124232/genisinst.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b169333/b169333.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b178119/hugemthfrm.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b178128/hugestruct.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b180381/constrained1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b191926/ParamLimit.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b219940/struct01_gen.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b00735/b00735.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b02345/b02345.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07211/byteshift.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07900/rpPasses.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b08020/bbHndIndex.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b11762/b11762.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16386/gtnop.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16399/gtIsValid64RsltMul.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b19171/jmp2blk.cs \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b30251/b578931.cs \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b102533/DeadBlock.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b268908/vars2.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b320147/1086745236.cs   \
@@ -1092,6 +916,17 @@ CORECLR_TEST_CS_SRC=              \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b405223/b405223.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b416667/b416667.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b369916/b369916.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b392262/b392262.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b400791/b400971.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b402658/b402658.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/dev11/DevDiv_376412/DevDiv_376412.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b121938/ConstToString.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b151497/NullCheckBoxedValuetypeReturn.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b158861/b158861.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b163200/b163200.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b170362/b170362.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b33183/b33183.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b49778/b49778.cs  \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b106272/b106272.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b152292/b152292.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b565808/b565808.cs    \
@@ -1107,22 +942,15 @@ CORECLR_TEST_CS_SRC=             \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b610750/b610750.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b611219/b611219.cs    \
        $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/b72218/b72218.cs      \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b121938/ConstToString.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b151497/NullCheckBoxedValuetypeReturn.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b158861/b158861.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b163200/b163200.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b170362/b170362.cs        \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b33183/b33183.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b49778/b49778.cs  \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/dev10_94677/loopvt.cs    \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/dev11_13912/dev11_13912.cs       \
-       $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/dev11_165544/seqpts.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_457559/Dev11_457559.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_5437/Dev11_5437.cs \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_617302/Dev11_617302.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/Dev11_646049/Dev11_646049.cs     \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/DevDiv2_10623/DevDiv2_10623.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/DevDiv2_8863/DevDiv2_8863.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/dev10_94677/loopvt.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/dev11_13912/dev11_13912.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/Dev11/dev11_165544/seqpts.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Regression/Dev14/DevDiv_876169/DevDiv_876169.cs   \
        $(CORECLR_PATH)/tests/src/JIT/Regression/JitBlue/DevDiv_794115/DevDiv_794115.cs \
        $(CORECLR_PATH)/tests/src/JIT/Regression/JitBlue/DevDiv_794631/DevDiv_794631.cs \
@@ -1168,53 +996,2786 @@ CORECLR_TEST_CS_SRC=           \
        $(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b311420/b311420.cs      \
        $(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b360587/repro.cs        \
        $(CORECLR_PATH)/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b539509/b539509.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/Regression/clr-x64-JIT/v4.0/DevDiv34372/overRepLocalOpt.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/148343.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/9_and_alloca2.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/9param.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/eh1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/fgtest1.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/fgtest2.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/funclet.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/gcparaminreg.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/ret_struct_test1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/ret_struct_test4.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/simple1.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct1_5.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_5.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct2_5_2.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct3_5.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct4_5.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct5_5.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6_4.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct6_5.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct7_1.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct8.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct9.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/struct9_2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_2.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_3.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_4.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_5.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp1_6.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_2.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_3.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp2_4.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp3_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp4_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp5_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfp6_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfpseh5_1.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structfpseh6_1.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structref1_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret1_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret1_2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret1_3.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret2_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret2_2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret2_3.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret3_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret3_2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret3_3.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret4_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret4_2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret4_3.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret5_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret5_2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret5_3.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret6_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret6_2.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structret6_3.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/structva1_1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test1.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test2.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test3.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/test_noalloca.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/misc/vbil.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/regress/vswhidbey/143837.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/gc/regress/vswhidbey/339415.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAA.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseAAC.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseACA.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/CGRecurse/CGRecurseACC.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress1.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress2.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cg/cgstress/CgStress3.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeArray.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeArray1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/HugeField2.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/arrayexpr1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/arrayexpr2.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldExprUnchecked1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldexpr1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldexpr1_1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/fieldexpr2.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/hugeSimpleExpr1.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/hugeexpr1.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/mixedexpr1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/pointerexpr1.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/pointerexpr1_1.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr1.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr1_1.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr2.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr3.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/simpleexpr4.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/staticFieldExpr1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/staticFieldExpr1_1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/staticFieldExprUnchecked1.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/volatilefield.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/cse/volatilestaticfield.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/inl/caninline.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/lim/lim_002.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/lur/lur_02.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/osr/osr001.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/ArrayBound.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/ArrayWith2Loops.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/ArrayWithFunc.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/BadMatrixMul.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/JaggedArray.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/MatrixMul.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/RngchkStress1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/RngchkStress2.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/RngchkStress3.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/opt/rngchk/SimpleArray_01.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/asurt/143616/foo.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/103087/103087.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/113574/113574.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ddb/132977/132977.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ndpw/160545/simple.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/ndpw/21015/interior_pointer.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/102964/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/329169/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/373472/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/471729/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/517867/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/524070/test1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/524070/test2.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/528315/simple-repro.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/538615/test1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/539509/test1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/541067/test1.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/543229/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/549880/test.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/601425/stret.cs \
+       $(CORECLR_PATH)/tests/src/JIT/jit64/regress/vsw/610378/BigFrame.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/ArrayOfStructs.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/DelegInstanceFtn.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/DelegStaticFtn.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/GenericStructs.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/InlineThrow.cs \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_DelegateStruct.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_GenericMethods.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_Handler.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_MultipleReturn.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_NewObj.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_NormalizeStack.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_RecursiveMethod.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_RecursiveMethod21.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_STARG.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_SideAffects.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Inline_Vars.cs \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/ReturnStruct_Method.cs \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/StructAsParam_Method.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/StructInClass.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/Struct_Opcodes.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/args1.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/args2.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/args3.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/array.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/debug.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/deepcall.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/ifelse.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/indexer.cs     \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/inline.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/inline_Many.cs \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/inline_Recursion.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/interfaceCall.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/interfaceProperty.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/mathfunc.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/mthdimpl.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/property.cs    \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/size.cs        \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/throwTest.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/opt/Inline/trycatch.cs    \
        $(CORECLR_PATH)/tests/src/Loader/regressions/classloader/main.cs        \
        $(CORECLR_PATH)/tests/src/Loader/regressions/classloader/vsw307137.cs   \
-       $(CORECLR_PATH)/tests/src/Loader/regressions/classloader-generics/repro237932.cs        \
-       $(CORECLR_PATH)/tests/src/Loader/regressions/classloader-generics/StaticsProblem5.cs    \
-       $(CORECLR_PATH)/tests/src/Loader/regressions/classloader-generics/vsw514968.cs  \
-       $(CORECLR_PATH)/tests/src/Loader/typeinitialization/circularcctorthreethreads03.cs      \
-       $(CORECLR_PATH)/tests/src/managed/Compilation/HelloWorld.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/common/AboveStackLimit.cs \
        $(CORECLR_PATH)/tests/src/Regressions/common/ArrayCopy.cs       \
+       $(CORECLR_PATH)/tests/src/Regressions/common/CompEx.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/common/DisableTransparencyEnforcement.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/common/Marshal.cs \
+       $(CORECLR_PATH)/tests/src/Regressions/common/ThreadCulture.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/common/ToLower.cs \
        $(CORECLR_PATH)/tests/src/Regressions/common/avtest.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/common/date.cs    \
        $(CORECLR_PATH)/tests/src/Regressions/common/interlock.cs       \
+       $(CORECLR_PATH)/tests/src/Regressions/common/pow3.cs    \
        $(CORECLR_PATH)/tests/src/Regressions/common/test1307.cs        \
        $(CORECLR_PATH)/tests/src/Regressions/common/testClass.cs       \
        $(CORECLR_PATH)/tests/src/Regressions/common/testInterface.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/common/unsafe.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0014/avtest.cs    \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0028/thread08-simplified.cs       \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0044/nullable.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0046/istype.cs    \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0069/date.cs      \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0075/largearraytest.cs    \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0077/interlock.cs \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0080/delete_next_card_table.cs    \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0099/abovestacklimit.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0138/pow3.cs      \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0198/compex.cs    \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0202/threadculture.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0211/genrecur.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0275/marshal.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0308/tolower.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0342/unsafe.cs    \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0416/hello.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0487/test.cs      \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0570/test570.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0576/test0576.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0582/csgen.1.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0583/test583.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0584/test584.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0792/test0792.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0828/test0828.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0829/test0829.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0857/override.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0939/test0939.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0968/test968.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1307/test1307.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1333/testclass.cs \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1333/testinterface.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1337/test1337.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1386/co1727ctor_oo.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1402/test1402.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1514/interlockexchange.cs \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1534/test1534.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1535/test1535.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1549/test1549.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/72162/test72162.cs        \
        $(CORECLR_PATH)/tests/src/Threading/ThreadStatics/ThreadStatic01.cs     \
        $(CORECLR_PATH)/tests/src/Threading/ThreadStatics/ThreadStatic02.cs     \
        $(CORECLR_PATH)/tests/src/Threading/ThreadStatics/ThreadStatic03.cs     \
        $(CORECLR_PATH)/tests/src/Threading/ThreadStatics/ThreadStatic05.cs     \
-       $(CORECLR_PATH)/tests/src/Threading/ThreadStatics/ThreadStatic06.cs
+       $(CORECLR_PATH)/tests/src/Threading/ThreadStatics/ThreadStatic06.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/compilerservices/dynamicobjectproperties/dev10_535767.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/compilerservices/dynamicobjectproperties/test448035.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions01.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions02.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions03.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions04.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions05.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions06.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions07.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/genericexceptions08.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch01.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch02.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch03.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch04.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch05.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch06.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch07.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch08.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch09.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/nested-try-catch10.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-finally-struct01.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-finally-struct02.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-finally-struct03.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-finally01.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-finally02.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-finally03.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct01.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct02.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct03.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct04.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct05.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct06.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct07.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct08.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch-struct09.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch01.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch02.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch03.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch04.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch05.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch06.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch07.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch08.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-catch09.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-finally-struct01.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-finally-struct02.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-finally-struct03.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-finally01.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-finally02.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-finally03.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter001.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter002.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter003.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter004.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter005.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter006.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter007.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter008.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter009.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter010.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter011.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter012.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter013.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter014.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter015.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter016.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter017.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/typeparameter018.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeybeta2/366085/366085.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/simple/finally.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/returnfromcatch.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_threadpoolnullchecks/cs_threadpoolnullchecks.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/currentculture/culturechangesecurity.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread01.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread02.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread03.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread04.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread05.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread06.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread07.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread08.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread09.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread10.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread11.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread12.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread13.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread14.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread15.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread16.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread17.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread18.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread19.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread20.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread21.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread22.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread23.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread24.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread25.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread26.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread27.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread28.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread29.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/syncdelegate/thread30.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread01.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread02.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread03.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread04.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread05.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread06.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread07.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread08.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread09.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread10.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread11.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread12.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread13.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread14.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread15.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread16.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread17.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread18.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread19.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread20.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread21.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread22.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread23.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread24.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread25.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread26.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread27.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread28.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread29.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/generics/threadstart/thread30.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/exchange/exchangeint.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/exchange/exchangelong.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/exchange/exchangetclass.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/exchange/exchangetstring.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/enter/enternull.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/exit/exitnull.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/pulse/pulsenull.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/pulseall/pulseallnull.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/unownedlock/enterexitexit.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/unownedlock/noenterobject.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/unownedlock/noenterobjectnew.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/monitor/unownedlock/noentervaltype.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/readerwriterlockslim/singlereleasewriteddbug71632.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/readerwriterlockslim/tryenterfailureddbugs124485.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/readerwriterlockslim/upgrader.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/regressions/576463/576463.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/regressions/6906/repro.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/threadstatic/threadstatic01.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/threadstatic/threadstatic02.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/threadstatic/threadstatic03.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/threadstatic/threadstatic05.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/threadstatic/threadstatic06.cs \
+       $(CORECLR_PATH)/tests/src/hosting/coreclr/activation/sxshost/usercode.cs        \
+       $(CORECLR_PATH)/tests/src/hosting/stress/testset1/csgen.1.cs    \
+       $(CORECLR_PATH)/tests/src/hosting/stress/testset1/csgen.2.cs    \
+       $(CORECLR_PATH)/tests/src/hosting/stress/testset1/simple1.cs    \
+       $(CORECLR_PATH)/tests/src/managed/Compilation/HelloWorld.cs     \
+       $(CORECLR_PATH)/tests/src/reflection/regression/dev10bugs/dev10_629953.cs       \
+       $(CORECLR_PATH)/tests/src/reflection/regression/dev10bugs/dev10_630880.cs
+
+CORECLR_COREMANGLIB_TEST_CS_SRC=               \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/components/stopwatch/co9600ctor.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/components/stopwatch/co9604get_isrunning.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/action/actionctor.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/action/actioninvoke.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/activator/activatorcreateinstance2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentexception/argumentexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentexception/argumentexceptionmessage.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentnullexception/argumentnullexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentnullexception/argumentnullexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentoutofrangeexception/argumentoutofrangeexceptionctor.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentoutofrangeexception/argumentoutofrangeexceptionctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/argumentoutofrangeexception/argumentoutofrangeexceptionmessage.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/arithmeticexception/arithmeticexceptionctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch1b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch2b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch3b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch4b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch5b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraybinarysearch6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayclear.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayclone.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycopy1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycopy2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycopyto.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycreateinstance1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycreateinstance1b.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycreateinstance2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraycreateinstance2b.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetenumerator.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetlength.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetlowerbound.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetupperbound.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetvalue1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetvalue2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraygetvalue2b.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayicollectionget_count.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistadd.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistclear.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistcontains.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistget_item.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistindexof.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistinsert.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistremove.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistremoveat.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayilistset_item.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof1b.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof2b.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof3b.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof4.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayindexof4b.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayinitialize.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof1b.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof2b.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof3b.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylastindexof4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraylength.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayrank.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayreserse1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayreserse2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayreverse1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arrayreverse2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysetvalue1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysetvalue1b.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysetvalue2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysetvalue2b.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort10.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort11.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort12.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort13.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort14.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort1b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort2b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort3b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort7.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/array/arraysort9.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/arraytypemismatchexception/arraytypemismatchexceptionctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/arraytypemismatchexception/arraytypemismatchexceptionctor2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/arraytypemismatchexception/arraytypemismatchexceptionctor3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attribute/ddb125472_gethashcode.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attribute/gethashcode.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsall.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsassembly.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsclass.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsconstructor.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsdelegate.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsenum.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsevent.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsfield.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsgenericparameter.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsinterface.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsmethod.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsmodule.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsparameter.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsproperty.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsreturnvalue.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributetargets/attributetargetsstruct.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributeusageattribute/attributeusageattributeallowmultiple.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/attributeusageattribute/attributeusageattributector.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/badimageformatexception/badimageformatexceptionctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/badimageformatexception/badimageformatexceptionctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/badimageformatexception/badimageformatexceptionctor3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/badimageformatexception/badimageformatexceptionmessage.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/badimageformatexception/badimageformatexceptiontostring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleancompareto_boolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleanequals_boolean.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleanequals_object.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleanfalsestring.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleangethashcode.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletoboolean.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletobyte.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletochar.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletodatetime.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletodecimal.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletodouble.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletoint16.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletoint32.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletoint64.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletosbyte.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletosingle.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletotype.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletouint16.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletouint32.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleaniconvertibletouint64.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleanparse.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleantostring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleantruestring.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/boolean/booleantryparse.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteequals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteequals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytegethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletoboolean.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletobyte.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletochar.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletodatetime.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletodecimal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletodouble.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletoint16.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletoint32.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletoint64.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletosbyte.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletosingle.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletotype.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletouint16.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletouint32.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteiconvertibletouint64.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytemaxvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteminvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteparse1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/byteparse3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytetostring1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytetostring2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytetostring3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytetostring4.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/byte/bytetryparse.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charcompateto1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charequals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charequals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chargethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletoboolean.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletobyte.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletochar.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletodatetime.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletodecimal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletodouble.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletoint16.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletoint32.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletoint64.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletosbyte.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletosingle.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletotype.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletouint16.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletouint32.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariconvertibletouint64.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariscontrol1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariscontrol2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisdigit1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisdigit2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisletter1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisletter2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisletterordigit1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisletterordigit2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charislower1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charislower2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisnumber1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisnumber2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charispunctuation2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisseparator1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisseparator2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charissurrogate1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charissurrogate2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charissurrogatepair1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charissurrogatepair2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charissymbol1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisupper1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charisupper2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariswhitespace1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chariswhitespace2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charmaxvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/charminvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chartolower1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chartostring1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chartostring2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chartoupper1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/char/chartryparse.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/charenumerator/charenumeratorcurrent.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/charenumerator/charenumeratorienumeratorcurrent.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/charenumerator/charenumeratorienumgetcurrent.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/charenumerator/charenumeratormovenext.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/charenumerator/charenumeratorreset.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/clscompliantattribute/clscompliantattributector.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/clscompliantattribute/clscompliantattributeiscompliant.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/dictionaryentry/dictionaryentryctor.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/dictionaryentry/dictionaryentrykey.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/dictionaryentry/dictionaryentryvalue.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/comparer/comparercompare1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/comparer/comparercompare2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/comparer/comparerctor.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/comparer/comparerdefault.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryadd.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryclear.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionarycomparer.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionarycontainskey.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionarycontainsvalue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionarycount.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryctor4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryctor5.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryctor6.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionarygetenumerator.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionadd.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectioncontains.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectioncopyto.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectioncopyto2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionisreadonly.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionisreadonly2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionissynchronized.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionissynchronized2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionremove.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionsyncroot.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryicollectionsyncroot2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryadd.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionarycontains.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionarygetenumerator.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryisfixedsize.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryisfixedsize2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryisreadonly.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryisreadonly2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryitem.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryitem2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionarykeys.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionarykeys2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionarykeys3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionarykeys4.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryremove.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryvalue2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryvalue3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryvalue4.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryidictionaryvalues.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryienumerablegetenumerator.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryienumerablegetenumerator2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionaryremove.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionary/dictionarytrygetvalue.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratorcurrent.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratordispose.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratoridictionaryenumeratorget_entry.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratoridictionaryenumeratorget_key.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratoridictionaryenumeratorget_value.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratorienumeratorget_current.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratorienumeratorreset.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryenumerator/dictionaryenumeratormovenext.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/keycollectioncopyto.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/keycollectioncount.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/keycollectionctor.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/keycollectiongetenumerator.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsgenericicollectionadd.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsgenericicollectionclear.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsgenericicollectioncontains.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsgenericicollectionisreadonly.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsgenericicollectionremove.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsgenericienumerablegetenumerator.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsicollectioncopyto.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsicollectionissynchronized.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsicollectionsyncroot.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionarykeycollection/systemcollectionsienumerablegetenumerator.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/dictionaryvaluecollectioncopyto.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/dictionaryvaluecollectioncount.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/dictionaryvaluecollectionctor.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/dictionaryvaluecollectiongetenumerator.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/systemcollectionsicollectioncopyto.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/systemcollectionsicollectionissynchronized.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/systemcollectionsicollectionsyncroot.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectiongenericicollectionadd.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectiongenericicollectionclear.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectiongenericicollectioncontains.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectiongenericicollectionisreadonly.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectiongenericicollectionremove.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectiongenericienumerablegetenumerator.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictionaryvaluecollection/valuecollectionienumerablegetenumerator.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionarykeycollectionenumeratorcurrent.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionarykeycollectionenumeratordispose.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionarykeycollectionenumeratormovenext.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionaryvaluecollectionenumeratorcurrent.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionaryvaluecollectionenumeratordispose.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/dictionaryvaluecollectionenumeratormovenext.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/keycollectionenumeratorienumeratorcurrent.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/keycollectionenumeratorienumeratorreset.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/valuecollectionenumeratorienumeratorcurrent.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictkeycollenum/valuecollectionenumeratorienumeratorreset.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictvalcollenum/dictionaryvaluecollectionenumeratorcurrent.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictvalcollenum/dictionaryvaluecollectionenumeratordispose.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictvalcollenum/dictionaryvaluecollectionenumeratormovenext.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictvalcollenum/valuecollectionenumeratorienumeratorcurrent.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/dictvalcollenum/valuecollectionenumeratorienumeratorreset.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/equalitycomparer/equalitycomparerequals.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/equalitycomparer/equalitycomparergethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/equalitycomparer/equlitycomparerdefault.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectionadd.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectionclear.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectioncontains.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectioncopyto.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectioncount.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectionisreadonly.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/icollection/icollectionremove.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/idictionary/idictionarycontainskey.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/idictionary/idictionaryitem.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/idictionary/idictionarykeys.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/idictionary/idictionarytrygetvalue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/idictionary/idictionaryvalues.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/ienumerable/ienumerablegetenumerator.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/ienumerator/ienumeratorcurrent.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/iequalitycomparer/iequalitycomparerequals.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/iequalitycomparer/iequalitycomparergethashcode.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/ilist/ilistindexof.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/ilist/ilistinsert.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/ilist/ilistitem.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/ilist/ilistremoveat.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/keynotfoundexception/keynotfoundexceptionctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/keynotfoundexception/keynotfoundexceptionctor2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/keyvaluepair/keyvaluepairctor.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/keyvaluepair/keyvaluepairkey.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/keyvaluepair/keyvaluepairtostring.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/keyvaluepair/keyvaluepairvalue.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/binarysearch1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/binarysearch2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/binarysearch3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/copyto1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/copyto2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/copyto3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listadd.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listaddrange.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listcapacity.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listclear.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listcontains.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listcount.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listctor2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listctor3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listforeach.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listgetenumerator.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listgetrange.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listicollectioncopyto.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listicollectionisreadonly.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listicollectionissynchronized.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listicollectionsyncroot.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listienumerablegetenumerator.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listienumerablegetenumerator2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistadd.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistcontains.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistindexof.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistinsert.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistisfixedsize.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistisreadonly.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistitem.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listilistremove.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listindexof1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listindexof2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listindexof3.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listinsertrange.cs.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listlastindexof1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listlastindexof2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listlastindexof3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listremoveat.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listremoverange.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listreverse.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listreverse2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listtoarray.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/list/listtrimexcess.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queueclear.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuecontains.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuecopyto.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuecount.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuector1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuector2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuector3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuedequeue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queueenqueue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuegetenumerator.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuepeek.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queue/queuetoarray.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queueenumerator/enumeratorcurrent.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queueenumerator/enumeratordispose.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/queueenumerator/enumeratormovenext.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackclear.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackcontains.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackcopyto.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackcount.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackctor3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackgetenumerator.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackpeek.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackpop.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stackpush.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stack/stacktoarray.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stackenumerator/stackenumeratorcurrent.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stackenumerator/stackenumeratordispose.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/generic/stackenumerator/stackenumeratormovenext.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/icollection/icollectioncopyto.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/icollection/icollectioncount.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/icollection/icollectionissynchronized.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/icollection/icollectionsyncroot.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/icomparer/icomparercompare.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionaryadd.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionaryclear.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionarycontains.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionarygetenumerator.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionaryisfixedsize.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionaryisreadonly.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/idictionary/idictionaryremove.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ienumerator/ienumeratorcurrent.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ienumerator/ienumeratormovenext.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ienumerator/ienumeratorreset.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ilist/ilistisfixedsize.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/collections/ilist/ilistitem.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisonbegininvoke.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisonendinvoke.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/comparison/comparisoninvoke.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/console/consoleseterror.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/console/consolesetout.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/convertchangetype2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/convertfrombase64chararray.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/convertfrombase64string.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobase64chararray.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobase64string1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobase64string2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean4.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean5.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean6.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean7.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoboolean8.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte6.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte7.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttobyte8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar10.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar11.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar12.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar13.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar14.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar15.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar5.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar6.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar7.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttochar9.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodatetime.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal10.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal11.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal12.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal13.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal14.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal15.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal16.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal17.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal18.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal5.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal6.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal8.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodecimal9.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble10.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble11.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble12.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble13.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble14.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble15.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble17.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble7.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttodouble9.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_10.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_11.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_17.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_18.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_7.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint16_9.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_10.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_11.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_17.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_18.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_7.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint32_9.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_10.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_11.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_17.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_18.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_7.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttoint64_9.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte10.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte11.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte5.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte6.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte7.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosbyte9.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosingle.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosingle13.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosingle14.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosingle15.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosingle16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttosingle17.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring10.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring11.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring12.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring13.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring14.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring15.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring17.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring18.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring19.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring20.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring21.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring22.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring23.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring24.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring25.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring26.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring27.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring28.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring29.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring30.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring31.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring32.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring33.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring5.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring6.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring7.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttostring9.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint161.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1610.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1611.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1612.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1613.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1614.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1615.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1616.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1617.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint1618.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint162.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint163.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint164.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint165.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint166.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint167.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint168.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint169.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint321.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3210.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3211.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3212.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3213.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3215.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3216.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3217.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3218.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint3219.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint322.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint323.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint324.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint325.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint326.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint327.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint328.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint329.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint641.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6410.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6411.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6412.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6413.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6414.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6415.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6416.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6417.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint6418.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint642.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint643.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint644.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint645.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint646.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint647.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint648.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/convert/converttouint649.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimecompare.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimecompareto1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimector1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimector3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimector4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimector6.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimector7.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimedate.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimegethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimehour.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimekind.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimemaxvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimemillisecond.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeminute.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeminvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimenow.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeparse1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeparse2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeparse3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeparseexact1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeparseexact2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeparseexact3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimesecond.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimespecifykind.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimesubtract1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimesubtract2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeticks.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetimeofday.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetoday.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetofiletime.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetofiletimeutc.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetolocaltime.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetostring1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetostring2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimetostring3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeutcnow.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetimekind/datetimekindlocal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetimekind/datetimekindunspecified.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetimekind/datetimekindutc.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweekfriday.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweekmonday.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweeksaturday.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweeksunday.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweekthursday.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweektuesday.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dayofweek/dayofweekwednesday.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimafloor.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaladd.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalcompare.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor4.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor5.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor6.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor7.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalctor8.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaldivide.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalequals1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalequals2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalequals3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalgetbits.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalmaxvalue.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalminusone.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalminvalue.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalmultiply.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalnegate.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalone.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalparse.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalparse2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalparse3.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalparse4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalremainder.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalsubtract.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltoboolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltobyte.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltobyte1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltochar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltodatetime.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltodecimal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltodouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltoint16.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltoint32.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltoint64.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltosbyte.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltosingle.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltostring1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltostring2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltostring3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltostring4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltouint16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltouint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltouint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltruncate.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimaltryparse.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/decimal/decimalzero.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegatecombine1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegatecombineimpl.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegateequals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegategetinvocationlist1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegateremove.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/delegateremoveimpl.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/conditionalattribute/conditionalattributeconditionstring.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/conditionalattribute/conditionalattributector.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/debuggingmodes/debuggingmodesdefault.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/debuggingmodes/debuggingmodesdisableoptimizations.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/debuggingmodes/debuggingmodesenableeditandcontinue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/debuggingmodes/debuggingmodesignoresymbolstoresequencepoints.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/diagnostics/debuggingmodes/debuggingmodesnone.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dividebyzeroexception/dividebyzeroexceptionctor.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dividebyzeroexception/dividebyzeroexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dividebyzeroexception/dividebyzeroexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dllnotfoundexception/dllnotfoundexception1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dllnotfoundexception/dllnotfoundexceptionctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/dllnotfoundexception/dllnotfoundexceptionctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublecompareto1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleepsilon.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleequals1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleequals2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublegethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletoboolean.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletobyte.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletodatetime.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletodecimal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletodouble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletoint16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletoint32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletoint64.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletosbyte.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleiconvertibletosingle.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleisinfinity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleisnan.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleisnegativeinfinity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleispositiveinfinity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublemaxvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleminvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublenan.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublenegativeinfinity.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubleparse3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doublepositiveinfinity.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubletostring1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubletostring2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubletostring3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubletostring4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/double/doubletryparse.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumiconvertibletoint64.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumiconvertibletosingle.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumiconvertibletotype.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumiconvertibletouint16.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumiconvertibletouint32.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumiconvertibletouint64.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumisdefined.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumtoobjectb.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumtostring.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/enum/enumtostring3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/environment/environmentnewline.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/environment/environmentprocessorcount.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/environment/environmentprocessorcount_cti.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventargs/eventargsctor.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler/eventhandlerinvoke.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerbegininvoke.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerctor.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerendinvoke.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/eventhandler_generic/eventhandlerinvoke.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/exception/exceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/exception/exceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/exception/exceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/exception/exceptiongetbaseexception.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/flagsattribute/flagsattributector.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/formatexception/formatexceptionctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/formatexception/formatexceptionctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/formatexception/formatexceptionctor3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gccollect.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcgettotalmemory.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcmaxgeneration.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcreregisterforfinalize.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcsuppressfinalize.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/gc/gcwaitforpendingfinalizers.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstday.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstfourdayweek.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/calendarweekrule/calendarweekrulefirstfullweek.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetnumericvalue1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetnumericvalue2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetunicodecategory1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/charunicodeinfo/charunicodeinfogetunicodecategory2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfocompare.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfocompare2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoindexof.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoindexof2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoisprefix.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfoissuffix.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareinfo/compareinfolastindexof.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorecase.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorekanatype.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorenonspace.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignoresymbols.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsignorewidth.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsnone.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsordinal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsordinaligorecase.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/compareoptions/compareoptionsstringsort.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoclone.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfocompareinfo.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoconstructor2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoenglishname.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoequals.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfogetcultureinfo2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfogethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoinvariantculture.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoisneutralculture.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoname.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfonativename.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfoparent.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinforeadonly.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfotextinfo.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfotostring.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/cultureinfo/cultureinfotwoletterisolanguagename.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfoclone.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfocurrentinfo.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfogetabbreviateddayname.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfogetabbreviatedmonthname.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfogetdayname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfogetformat.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfogetinstance.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfogetmonthname.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfoinvariantinfo.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfoisreadonly.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinforeadonly.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinforfc1123pattern.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfosortabledatetimepattern.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimeformatinfo/datetimeformatinfouniversalsortabledatetimepattern.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestyleallowinnerwhite.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesadjusttouniversal.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesallowleadingwhite.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesallowtrailingwhite.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesallowwhitespaces.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesassumelocal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesassumeuniversal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesnocurrentdatedefault.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesnone.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/datetimestyles/datetimestylesroundtripkind.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinfoclone.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinfoctor.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinfocurrencydecimalseparator.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinfocurrencygroupseparator.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinfogetformat.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinfogetinstance.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberformatinfo/numberformatinforeadonly.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowcurrencysymbol.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowdecimalpoint.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowexponent.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowhexspecifier.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowleadingsign.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowleadingwhite.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowparentheses.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowthousands.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowtrailingsign.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesallowtrailingwhite.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesany.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylescurrency.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesfloat.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstyleshexnumber.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesinteger.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesnone.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/numberstyles/numberstylesnumber.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfocurrencysymbol.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfocurrentregion.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfoequals.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfogethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfoismetric.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfoisocurrencysymbol.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfoname.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfotostring.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/regioninfo/regioninfotwoletterisoregionname.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfoctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfoctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfoequals.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfogethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfogetnexttextelement2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfogettextelementenumerator1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfogettextelementenumerator2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfolengthintextelements.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfoparsecombiningcharacters.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/stringinfo/stringinfostring.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textelementenumerator/textelementenumeratorcurrent.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textelementenumerator/textelementenumeratorelementindex.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textelementenumerator/textelementenumeratorgettextelement.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textelementenumerator/textelementenumeratormovenext.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textelementenumerator/textelementenumeratorreset.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfoculturename.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfoequals.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfogethashcode.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfoisreadonly.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfotostring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfotoupper1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/textinfo/textinfotoupper2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryclosepunctuation.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryconnectorpunctuation.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorycontrol.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorydashpunctuation.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorydecimaldigitnumber.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryenclosingmark.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryfinalquotepunctuation.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryformat.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryinitialquotepunctuation.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryletternumber.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorylineseparator.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorylowercaseletter.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorymathsymbol.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorymodifierletter.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorymodifiersymbol.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorynonspacingmark.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryopenpunctuation.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryotherletter.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryothernotassigned.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryothernumber.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryotherpunctuation.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryothersymbol.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryparagraphseparator.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryprivateuse.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryspaceseparator.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryspacingcombiningmark.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorysurrogate.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategorytitlecaseletter.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/globalization/unicodecategory/unicodecategoryuppercaseletter.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidcompareto1_cti.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidcompareto2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidctor1_cti.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidctor2_cti.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidctor3_cti.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidempty.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidequals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidequals1_cti.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidequals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidequals2_cti.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidequals3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidgethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidnewguid.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidtobytearray.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/guid/guidtostring1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/icomparable/icomparablecompareto.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/icomparable_generic/icomparable_genericcompareto.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletoboolean.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletobyte.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletochar.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletodatetime.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletodecimal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletodouble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletoint16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletoint32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iconvertible/iconvertibletoint64.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/idisposable/idisposabledispose.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/iformatable/iformatabletostring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/indexoutofrangeexception/indexoutofrangeexceptionctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/indexoutofrangeexception/indexoutofrangeexceptionctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/indexoutofrangeexception/indexoutofrangeexceptionctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32compareto1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32equals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32equals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32gethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletoboolean.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletobyte.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletochar.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletodatetime.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletodecimal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletodouble.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletoint16.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletoint32.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletoint64.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletosbyte.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletosingle.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletotype.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletouint16.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletouint32.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32iconvertibletouint64.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32maxvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32minvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32parse1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32parse2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32parse3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32parse4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32tostring.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32tostring2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32tostring3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32tostring4.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int/int32tryparse.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16equals1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16equals2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16gethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletoboolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletobyte.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletochar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletodatetime.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletodecimal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletodouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletoint16.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletoint32.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletoint64.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletosbyte.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletosingle.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletotype.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletouint16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletouint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16iconvertibletouint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16maxvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16minvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16parse1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16parse2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16parse3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16tostring.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16tostring2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int16/int16tryparse.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64compareto1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64equals1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64equals2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64gethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletoboolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletobyte.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletochar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletodatetime.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletodecimal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletodouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletoint16.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletoint32.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletoint64.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletosbyte.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletosingle.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletotype.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletouint16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletouint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64iconvertibletouint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64maxvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64minvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64parse1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64parse2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64parse3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64tostring1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64tostring2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64tostring3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/int64/int64tryparse.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrctor_int32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrctor_int64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrctor_void.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrequals.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrgethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrtoint32.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrtoint64.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrtopointer.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrtostring.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/intptr/intptrzero.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidcastexception/invalidcastexceptionctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidcastexception/invalidcastexceptionctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidcastexception/invalidcastexceptionctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidoperationexception/invalidoperationexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidoperationexception/invalidoperationexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidoperationexception/invalidoperationexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidprogramexception/invalidprogramexceptionctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidprogramexception/invalidprogramexceptionctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/invalidprogramexception/invalidprogramexceptionctor3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/binarywriter/binarywriteroutstream.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/directorynotfoundexception/directorynotfoundexceptionctor1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/directorynotfoundexception/directorynotfoundexceptionctor2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/endofstreamexception/endofstreamexceptionctor1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/endofstreamexception/endofstreamexceptionctor2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileaccess/fileaccessenum.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileaccess/fileaccessread.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileaccess/fileaccessreadwrite.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileaccess/fileaccesswrite.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesarchive.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributescompressed.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesdeivce.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesdirectory.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesencrypted.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesenum.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributeshidden.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesnormal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesnotcontentindexed.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesoffline.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesreadonly.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributesreparsepoint.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributessystem.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileattributes/fileattributestemporary.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodeappend.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodecreate.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodecreatenew.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodeenum.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodeopen.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodeopenorcreate.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filemode/filemodetruncate.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filenotfoundexception/filenotfoundexceptionctor.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filenotfoundexception/filenotfoundexceptionctor1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filenotfoundexception/filenotfoundexceptionctor2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filenotfoundexception/filenotfoundexceptiongetmessage.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filenotfoundexception/filenotfoundexceptionmessage.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filenotfoundexception/filenotfoundexceptiontostring.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/fileshareenum.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/filesharenone.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/fileshareread.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/filesharereadwrite.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/fileshare/filesharewrite.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/filestream/filestreamdispose.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/ioexception/ioexceptionctor1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/ioexception/ioexceptionctor2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor4.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor5.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor6.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/memorystream/memorystreamctor7.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathaltdirectoryseparatorchar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathchangeextension.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathcombine.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathdirectoryseparatorchar.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathgetdirectoryname.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathgetextension.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathgetfilename.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathgetfilenamewithoutextension.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathgetfullpath_extended.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathgetinvalidpathchars.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathhasextension.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathispathrooted.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathpathseparator.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/path/pathvolumeseparatorchar.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/pathtoolongexception/pathtoolongexceptionctor1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/pathtoolongexception/pathtoolongexceptionctor2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/seekorigin/seekoriginbegin.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/seekorigin/seekorigincurrent.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/seekorigin/seekoriginend.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/seekorigin/seekoriginenum.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/stream/streamdispose1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/stream/streamdispose2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/stream/streamnull.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/stream/streamreadtimeout.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/stream/streamwritetimeout.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/streamreader/streamreadernull.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/stringwriter/stringwriterencoding.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/textreader/textreadernull.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/io/textwriter/textwriternull.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs3.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs5.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs6.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathabs7.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathceiling.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathcos.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathe.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathexp.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathfloor.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathieeeremainder.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathlog10.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax10.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax11.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax3.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax5.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax6.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax7.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax8.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmax9.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin10.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin11.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin3.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin5.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin6.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin7.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin8.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathmin9.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathpi.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathpow.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathround1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathround2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathround3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathround4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign5.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign6.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsign7.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsin.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsqrt.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/memberaccessexception/memberaccessexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/memberaccessexception/memberaccessexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/memberaccessexception/memberaccessexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/methodaccessexception/methodaccessexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/methodaccessexception/methodaccessexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/methodaccessexception/methodaccessexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingfieldexception/missingfieldexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingfieldexception/missingfieldexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingfieldexception/missingfieldexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingfieldexception/missingfieldexceptionmessage.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmemberexception/missingmemberexceptionctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmemberexception/missingmemberexceptionctor2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmemberexception/missingmemberexceptionctor3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmemberexception/missingmemberexceptionmessage.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmethodexception/missingmethodexceptionctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmethodexception/missingmethodexceptionctor2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmethodexception/missingmethodexceptionctor3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/missingmethodexception/missingmethodexceptionmessage.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/notimplementedexception/notimplementedexceptionctor1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/notimplementedexception/notimplementedexceptionctor2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/notimplementedexception/notimplementedexceptionctor3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/notsupportedexception/notsupportedexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/notsupportedexception/notsupportedexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/notsupportedexception/notsupportedexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablecompare.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablector.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullableequals.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullableequals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablegethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablegetunderlyingtype.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablegetvalueordefault1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablegetvalueordefault2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablehasvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullabletostring.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullable/nullablevalue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/nullreferenceexception/nullreferenceexceptionctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectctor.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectequals1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectequals2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectfinalize.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectgethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectmemberwiseclone.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objectreferenceequals.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/object/objecttostring.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/objectdisposedexception/objectdisposedexceptionmessage.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/objectdisposedexception/objectdisposedexceptionobjectname.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/obsoleteattribute/obsoleteattributector1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/obsoleteattribute/obsoleteattributector2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/obsoleteattribute/obsoleteattributector3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/obsoleteattribute/obsoleteattributeiserror.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/obsoleteattribute/obsoleteattributemessage.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/outofmemoryexception/outofmemoryexceptionctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/outofmemoryexception/outofmemoryexceptionctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/outofmemoryexception/outofmemoryexceptionctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/overflowexception/overflowexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/overflowexception/overflowexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/overflowexception/overflowexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/paramarrayattribute/paramarrayattributector.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/platformnotsupportedexception/platformnotsupportedexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/platformnotsupportedexception/platformnotsupportedexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/platformnotsupportedexception/platformnotsupportedexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicatebegininvoke.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicateendinvoke.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/predicate/predicateinvoke.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomctor1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomctor2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomnext1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomnext2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomnext3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomnextbytes.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomnextdouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/random/randomsample.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/rankexception/rankexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/rankexception/rankexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/rankexception/rankexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/ambiguousmatchexception/ambiguousmatchexceptionctor1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/ambiguousmatchexception/ambiguousmatchexceptionctor2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/ambiguousmatchexception/ambiguousmatchexceptionctor3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyconfigurationattribute/assemblyconfigurationattributeconfiguration.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyconfigurationattribute/assemblyconfigurationattributector.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblydefaultaliasattribute/assemblydefaultaliasattributector.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblydefaultaliasattribute/assemblydefaultaliasattributedefaultalias.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblydelaysignattribute/assemblydelaysignattributector.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblydelaysignattribute/assemblydelaysignattributedelaysign.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblydescriptionattribute/assemblydescriptionattributector.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblydescriptionattribute/assemblydescriptionattributedescription.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblykeyfileattribute/assemblykeyfileattributector.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblykeyfileattribute/assemblykeyfileattributekeyfile.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblykeynameattribute/assemblykeynameattributector.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblykeynameattribute/assemblykeynameattributekeyname.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyname/assemblynamegetpublickey.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyname/assemblynamegetpublickeytoken.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyname/assemblynamesetpublickey.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyname/assemblynamesetpublickeytoken.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblyname/assemblynameversion.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblynameflags/assemblynameflagsenablejitcompileoptimizer.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblynameflags/assemblynameflagsenablejitcompiletracking.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblynameflags/assemblynameflagsnone.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblynameflags/assemblynameflagspublickey.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblynameflags/assemblynameflagsretargetable.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblytitleattribute/assemblytitleattributector.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assemblytitleattribute/assemblytitleattributetitle.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/callingconventions/callingconventionsany.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/callingconventions/callingconventionsexplicitthis.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/callingconventions/callingconventionshasthis.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/callingconventions/callingconventionsstandard.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/callingconventions/callingconventionsvarargs.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/constructorinfo/constructorinfoconstructorname.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/constructorinfo/constructorinfotypeconstructorname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/defaultmemberattribute/defaultmemberattributector.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/defaultmemberattribute/defaultmemberattributemembername.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolbranch.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolcall.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolcond_branch.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolmeta.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolnext.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolreturn.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/flowcontrol/flowcontrolthrow.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodeequals1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodeequals2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodeflowcontrol.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodegethashcode.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodename.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodeopcodetype.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodeoperandtype.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesadd_ovf.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesadd_ovf_un.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesand.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesarglist.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbeq.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbeq_s.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbge.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbge_s.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbge_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbge_un_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbgt.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbgt_s.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbgt_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbgt_un_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesble.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesble_s.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesble_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesble_un_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesblt.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesblt_s.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesblt_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesblt_un_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbne_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbne_un_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbox.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbr.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbr_s.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbreak.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbrfalse.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbrfalse_s.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbrtrue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesbrtrue_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescall.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescalli.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescallvirt.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescastclass.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesceq.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescgt.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescgt_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesckfinite.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesclt.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesclt_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconstrained.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_i.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_i1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_i2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_i4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_i8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i1_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i2_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i4.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i4_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i8.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i8_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_i_un.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u1_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u2_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u4.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u4_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u8.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u8_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_ovf_u_un.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_r4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_r8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_r_un.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_u.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_u1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_u2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_u4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesconv_u8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescpblk.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodescpobj.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesdiv.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesdiv_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesdup.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesendfilter.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesendfinally.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesinitblk.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesinitobj.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesisinst.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesize.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesjmp.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarg.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarg_0.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarg_1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarg_2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarg_3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarg_s.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarga.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldarga_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_0.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_5.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_6.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_7.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_m1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i4_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_i8.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_r4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldc_r8.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_i.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_i1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_i2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_i4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_i8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_r4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_r8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_ref.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_u1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_u2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelem_u4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldelema.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldfld.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldflda.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldftn.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_i.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_i1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_i2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_i4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_i8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_r4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_r8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_ref.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_u1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_u2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldind_u4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldlen.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloc.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloc_0.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloc_1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloc_2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloc_3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloc_s.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloca.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldloca_s.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldnull.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldobj.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldsfld.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldsflda.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldstr.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldtoken.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesldvirtftn.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesleave.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesleave_s.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodeslocalloc.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesmkrefany.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesmul.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesmul_ovf.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesmul_ovf_un.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesneg.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesnewarr.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesnewobj.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesnop.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesnot.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesor.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodespop.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix5.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix6.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefix7.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesprefixref.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesreadonly.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesrefanytype.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesrefanyval.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesrem.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesrem_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesret.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesrethrow.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesshl.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesshr.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesshr_un.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodessizeof.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstarg.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstarg_s.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_i.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_i1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_i2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_i4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_i8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_r4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_r8.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstelem_ref.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstfld.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_i.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_i1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_i2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_i4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_i8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_r4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_r8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstind_ref.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstloc.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstloc_0.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstloc_1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstloc_2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstloc_3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstloc_s.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstobj.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesstsfld.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodessub.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodessub_ovf.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodessub_ovf_un.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesswitch.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodestackbehaviourpop.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodestackbehaviourpush.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodestailcall.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodestakessinglebyteargument.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesthrow.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesunaligned.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesunbox.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesunbox_any.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesvolatile.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodesxor.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodetostring.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodes/opcodevalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodetype/opcodetypemacro.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodetype/opcodetypenternal.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodetype/opcodetypeobjmodel.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodetype/opcodetypeprefix.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/opcodetype/opcodetypeprimitive.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinebrtarget.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinefield.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinei.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinei8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinemethod.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinenone.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinliner.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinesig.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinestring.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlineswitch.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinetok.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinetype.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeinlinevar.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeshortinlinebrtarget.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeshortinlinei.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeshortinliner.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/operandtype/operandtypeshortinlinevar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsize16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsize2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsize4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsizesize1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsizesize128.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsizesize32.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsizesize64.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsizesize8.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/packingsize/packingsizeunspecified.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpop0.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpop1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpop1_pop1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi_pop1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi_popi.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi_popi8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi_popi_popi.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi_popr4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopi_popr8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_pop1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi_pop1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi_popi.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi_popi8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi_popr4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi_popr8.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpopref_popi_popref.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpush0.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpush1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpush1_push1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpushi.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpushi8.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpushr4.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpushr8.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourpushref.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourvarpop.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/emit/stackbehaviour/stackbehaviourvarpush.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/eventattributes/eventattributesnone.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/eventattributes/eventattributesrtspecialname.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/eventattributes/eventattributesspecialname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesassembly.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesfamandassem.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesfamily.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesfamorassem.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesfieldaccessmask.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributeshasdefault.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributeshasfieldrva.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesinitonly.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesliteral.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesnotserialized.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributespinvokeimpl.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesprivate.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesprivatescope.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributespublic.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesrtspecialname.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesspecialname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/fieldattributes/fieldattributesstatic.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesabstract.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesfamandassem.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesfamily.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesfamorassem.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesfinal.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributeshassecurity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributeshidebysig.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesmemberaccessmask.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesnewslot.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributespinvokeimpl.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesprivate.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesprivatescope.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributespublic.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesrequiresecobject.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesreuseslot.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesrtspecialname.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesspecialname.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesstatic.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesunmanagedexport.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesvirtual.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodattributes/methodattributesvtablelayoutmask.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributescodetypemask.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesforwardref.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesil.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesinternalcall.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesmanaged.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesmanagedmask.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesnative.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesnoinlining.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesoptil.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributespreservesig.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesruntime.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributessynchronized.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/methodimplattributes/methodimplattributesunmanaged.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/parameterattributes/parameterattributeshasdefault.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/parameterattributes/parameterattributesin.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/parameterattributes/parameterattributesnone.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/parameterattributes/parameterattributesoptional.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/parameterattributes/parameterattributesout.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/parameterattributes/parameterattributesretval.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/propertyattributes/propertyattributeshasdefault.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/propertyattributes/propertyattributesnone.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/propertyattributes/propertyattributesrtspecialname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/propertyattributes/propertyattributesspecialname.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/targetinvocationexception/targetinvocationexceptionctor1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/targetinvocationexception/targetinvocationexceptionctor2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/targetparametercountexception/targetparametercountexceptionctor1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/targetparametercountexception/targetparametercountexceptionctor2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/targetparametercountexception/targetparametercountexceptionctor3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesabstract.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesansiclass.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesautoclass.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesautolayout.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesbeforefieldinit.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesclass.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesclasssemanticsmask.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesexplicitlayout.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributeshassecurity.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesimport.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesinterface.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributeslayoutmask.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesnestedassembly.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesnestedfamandassem.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesnestedfamily.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesnestedfamorassem.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesnestedprivate.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesnestedpublic.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributespublic.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesrtspecialname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributessealed.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributessequentiallayout.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesserializable.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesspecialname.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesstringformatmask.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesunicodeclass.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattributesvisibilitymask.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/typeattributes/typeattribytesnotpublic.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/missingmanifestresourceexception/missingmanifestresourceexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/missingmanifestresourceexception/missingmanifestresourceexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/missingmanifestresourceexception/missingmanifestresourceexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/neutralresourceslanguageattribute/neutralresourceslanguageattributector.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/neutralresourceslanguageattribute/neutralresourceslanguageattributeculturename.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/satellitecontractversionattribute/satellitecontractversionattributector.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/satellitecontractversionattribute/satellitecontractversionattributeversion.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/accessedthroughpropertyattribute/atpactor.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/accessedthroughpropertyattribute/atpapropertyname.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/compilationrelaxations/compilationrelaxationsattributector1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/compilergeneratedattribute/compilergeneratedattributector.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/customconstantattribute/customconstantattributector.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/indexernameattribute/indexernameattributector.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/internalsvisibletoattribute/internalsvisibletoattributeassemblyname.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/internalsvisibletoattribute/internalsvisibletoattributector.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/methodimploptions/methodimploptionsnoinlining.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/methodimploptions/methodimploptionspreservesig.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimecompatibilityattribute/runtimecompatibilityattributector.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimecompatibilityattribute/runtimecompatibilityattributewrapnonexceptionthrows.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/gethashcode.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/decimalconstantattribute/decimalconstantattributector.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/decimalconstantattribute/decimalconstantattributevalue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/fixedbufferattribute/fixedbufferattributector.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/fixedbufferattribute/fixedbufferattributeelementtype.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/fixedbufferattribute/fixedbufferattributelength.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/callingconvention/callingconventionwinapi.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/charset/charsetunicode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/fieldoffsetattribute/fieldoffsetattributector.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/fieldoffsetattribute/fieldoffsetattributevalue.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandle/gchandleaddrofpinnedobject.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandle/gchandlealloc1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandle/gchandlefree.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandle/gchandletarget.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandletype/gchandletypenormal.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandletype/gchandletypepinned.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandletype/gchandletypeweak.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/gchandletype/gchandletypeweaktrackresurrection.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/inattribute/inattributector.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/layoutkind/layoutkindauto.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/layoutkind/layoutkindsequential.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalgetlastwin32error.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalreadint641.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/marshalsizeof2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributearraysubtype.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributector1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributector2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributemarshalcookie.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributemarshaltype.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributemarshaltyperef.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributesizeconst.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributesizeparamindex.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshalasattribute/marshalasattributevalue.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/outattribute/outattributector.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/preservesigattribute/preservesigattributector.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandlector_cti.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandledangerousaddref.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandledangerousgethandle.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandledangerousrelease.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandledispose1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandledispose2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandlehandle.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandleisclosed.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandleisinvalid.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandlesethandle.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/safehandle/safehandlesethandleasinvalid.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/structlayoutattribute/structlayoutattributecharset.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/structlayoutattribute/structlayoutattributector.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/structlayoutattribute/structlayoutattributepack.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/structlayoutattribute/structlayoutattributesize.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/structlayoutattribute/structlayoutattributevalue.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/unmanagedtype/unmanagedtype.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtimefieldhandle/runtimefieldhandleequals.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtimefieldhandle/runtimefieldhandlegethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtimemethodhandle/runtimemethodhandleequals.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtimemethodhandle/runtimemethodhanldegethashcode.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtimetypehandle/runtimetypehandleequals.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtimetypehandle/runtimetypehandlegethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytecompareto2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteequals1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteequals2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytegethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletoboolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletobyte.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletochar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletodecimal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletodouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletoint16.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletoint32.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletoint64.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletouint16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletouint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteiconvertibletouint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytemaxvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteminvalue.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteparse1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteparse2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbyteparse3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytetostring1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytetostring2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytetostring3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/sbyte/sbytetryparse.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/security/securityexception/securityexceptionctor1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/security/securityexception/securityexceptionctor2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/security/securityexception/securityexceptionctor3.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/security/securityexception/securityexceptiontostring.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleepsilon.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singlegethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleisinfinity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleisnan.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleisnegativeinfinity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleispositiveinfinity.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singlemaxvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleminvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singlenan.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleparse1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singleparse2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletoboolean.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletobyte.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletochar.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletodatetime.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletodecimal.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletodouble.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletoint16.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletoint32.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletoint64.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletosbyte.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletosingle.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletouint16.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletouint32.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletouint64.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/single/singletryparse.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringchars.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare15.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare5.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare6.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompare9.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareordinal1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareordinal2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcompareto1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat4.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat5.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat6.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat7.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringconcat8.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringcopyto.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringctor5.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringctorchar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringempty.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringequals6.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringformat1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringformat2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringgetenumerator.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringgethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletoboolean.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletobyte.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletochar.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletoint16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletoint32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletoint64.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletosbyte.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletouint16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletouint32.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringiconvertibletouint64.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringienumerablegetenumerator.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringindexof10.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringinsert.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringisnullorempty.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringjoin.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringjoin1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringjoin2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringlength.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringpadleft.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringpadleft1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringpadleft2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringpadright.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringpadright1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringpadright2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringremove1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringremove2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringreplace1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringreplace2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringsplit1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringsubstring1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringsubstring2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtochararray.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtostring1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtrim1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtrim1b.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtrim2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtrim3.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/string/stringtrim4.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcompare/stringcomparerctor.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparer/stringcomparercompare2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparer/stringcomparerequals1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparer/stringcomparerequals3.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparer/stringcomparergettype.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparison/stringcomparisoncurrentculture.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparison/stringcomparisoncurrentcultureignorecase.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparison/stringcomparisonordinal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/stringcomparison/stringcomparisonordinalignorecase.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/szarrayhelper/szarrayhelpersetitem.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/decoder/decoderctor.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/decoder/decoderreset.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoder/encoderctor.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingbigendianunicode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingclone.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingconvert1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingconvert2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingctor1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingequals.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytecount.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytecount1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytecount2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytecount3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytes1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytes2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytes3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytes4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetbytes5.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetcharcount.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetcharcount1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetcharcount2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetchars1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetchars2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetchars3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetdecoder.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetencoder.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetencoding2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetmaxbytecount.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetmaxcharcount.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetpreamble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodinggetstring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingunicode.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingutf8.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/encoding/encodingwebname.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend10.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend11.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend12.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend13.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend14.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend15.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend17.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend18.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend19.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend5.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend6.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend7.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend8.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderappend9.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuildercapacity.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuildercapacity_cti.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderchars.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderctor1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderctor2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderctor3.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderctor4.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderctor5.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderctor6.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderinsert.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderinsert3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderinsert4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderlength.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderlength_cti.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderremove.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderreplace1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderreplace2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderreplace3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuilderreplace4.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuildertostring1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/stringbuilder/stringbuildertostring2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodingctor1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodingequals.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetbytecount1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetbytecount2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetbytes2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetcharcount.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetchars.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetdecoder.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetencoder.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggethashcode.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetmaxbytecount.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetmaxcharcount.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetpreamble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/unicodeencoding/unicodeencodinggetstring.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodingctor.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodingctor2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodingctor3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodingequals.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetbytecount1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetbytecount2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetbytes1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetbytes2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetcharcount.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetchars.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetdecoder.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetencoder.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggethashcode.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetmaxbytecount.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetmaxcharcount.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetpreamble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/text/utf8encoding/utf8encodinggetstring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/autoresetevent/autoreseteventctor.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/autoresetevent/autoreseteventreset.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/autoresetevent/autoreseteventset.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedadd1.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedadd2.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedcompareexchange1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedcompareexchange5.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedcompareexchange6.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedcompareexchange7.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockeddecrement1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockeddecrement2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedexchange1.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedexchange5.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedexchange6.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedexchange7.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedincrement1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/interlocked/interlockedincrement2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/manualresetevent/manualreseteventctor.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/timeout/timeoutinfinite.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/waithandle/waithandlector.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/waithandle/waithandledispose1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/threading/waithandle/waithandledispose3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timeoutexception/timeoutexceptionctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timeoutexception/timeoutexceptionctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timeoutexception/timeoutexceptionctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanadd.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespancompare1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespancompareto2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanctor1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanctor2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanctor3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanctor4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanduration.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanequals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanequals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanequals3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanfromticks.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespangethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanmaxvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanminvalue.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespannegate.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanticks.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanticksperday.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanticksperhour.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanticksperminute.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantickspersecond.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantotaldays.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantotalhours.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantotalmilliseconds.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantotalminutes.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantotalseconds.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespanzero.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typeequals1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typeequals2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegetarrayrank.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegetelementtype.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegetgenerictypedefinition.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegettype1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegettype2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typegettypefromhandle.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typehaselementtypeimpl.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typeisbyrefimpl.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typeispointerimpl.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typemakearraytype1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typemakearraytype2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typemakebyreftype.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typemakepointertype.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/type/typetostring.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeboolean.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodebyte.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodechar.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodedatetime.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodedecimal.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodedouble.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeempty.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeint16.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeint32.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeint64.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeobject.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodesbyte.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodesingle.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodestring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeuint16.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeuint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typecode/typecodeuint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typeloadexception/typeloadexceptionctor1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typeloadexception/typeloadexceptionctor2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typeloadexception/typeloadexceptionctor3.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/typeloadexception/typeloadexceptionmessage.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16compareto1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16equals1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16equals2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletoboolean.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletobyte.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletochar.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletodatetime.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletodecimal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletodouble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletoint16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletoint32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletoint64.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletosbyte.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletosingle.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletotype.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletouint16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletouint32.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16iconvertibletouint64.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16parse1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16parse2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16parse3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16tostring1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16tostring2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16tostring3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16tostring4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint16/uint16tryparse.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32compareto2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32equals1.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32equals2.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32gethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletoboolean.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletobyte.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletochar.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletodecimal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletodouble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletoint16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletoint32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletoint64.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletosbyte.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletosingle.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletotype.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletouint16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletouint32.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32iconvertibletouint64.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32maxvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32minvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32parse1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32parse2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32parse3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32tostring1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32tostring2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32tostring3.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32tostring4.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint32/uint32tryparse.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64gethashcode.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletoboolean.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletobyte.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletochar.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletodatetime.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletodecimal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletodouble.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletoint16.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletoint32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletoint64.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletosbyte.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletosingle.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletotype.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletouint16.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletouint32.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64iconvertibletouint64.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64maxvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64minvalue.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64parse1.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64parse2.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64parse3.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64tostring1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64tostring2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uint64/uint64tryparse.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrctor_uint32.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrctor_uint64.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrctor_voidptr.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrequals.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrgethashcode.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrsize.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrtopointer.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrtostring.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrtouint32.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrtouint64.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/uintptr/uintptrzero.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/valuetype/valuetypeequals.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/valuetype/valuetypeequals2.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versionbuild.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versioncompareto2.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versionctor4.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versionequals1.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versionequals2.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versiongethashcode.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versionmajor.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versionrevision.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versiontostring1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/version/versiontostring2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencector1.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencector2b.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisaliveb.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencetargetb.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencetrackresurrection_cti.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/buffer/asurt_99893.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/collections/generic/hashset/regression_dev10_609271.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/collections/generic/hashset/regression_dev10_624201.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/datetime/co7510parseexact_formatarray.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/generics/negativegenerics.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/miscellaneous/co6010delegateequalstwo.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/miscellaneous/co6031gethashcode.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/regressions/devdivbugs/113347/ddb113347.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/guid/guid_parsing.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/lazyt/lazyttf.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/text/encoding/shift_jis.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/version/version_parsing.cs
+
+CORECLR_STRESSTEST_CS_SRC=     \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/573277.cs     \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/MulDimJagAry.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/bestfit-finalize.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/ExpandHeap.cs \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/PlugGaps.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/concurrentspin2.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/GCQueue.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/SingLinkStay.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/GCSimulator.cs        \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/StressAllocator.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/doubLinkStay.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/GCVariant.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/ThdTreeGrowingObj.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/allocationwithpins.cs \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/pinstress.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LeakGenThrd.cs        \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/b115557.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/plug.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LargeObjectAllocPinned.cs     \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LargeObjectAlloc2.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LargeObjectAlloc4.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LargeObjectAlloc.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LargeObjectAlloc1.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/RedBlackTree.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LargeObjectAlloc3.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/DirectedGraph.cs
+
+CORECLR_STRESSTEST_RUNNER_CS_SRC=      \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/ReliabilityConfiguration.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/ReliabilityFramework.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/ReliabilityTest.cs        \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/ReliabilityTestSet.cs     \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/ReliabilityTestSet.cs     \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/RFLogging.cs      \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/DetourHelpers.cs  \
+       $(CORECLR_PATH)/tests/src/GC/Stress/Framework/LoaderClass.cs    \
+       GCStressTests/AssemblyLoadContext.cs    \
+       GCStressTests/AssemblyExtensions.cs
 
-# relies on TestLibrary:
-CORECLR_DISABLED_TEST_CS_SRC =                 \
+CORECLR_TESTLIBRARY_CS_SRC =   \
        $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs    \
        $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Utilities.cs        \
        $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/CalendarHelpers.cs  \
        $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Generator.cs        \
-       $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Env.cs      \
        $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/EndianessChecker.cs \
        $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/GlobLocHelper.cs    \
-       $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Logging.cs  \
-       $(CORECLR_PATH)/tests/src/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs   \
-       $(CORECLR_PATH)/tests/src/Regressions/common/AboveStackLimit.cs \
-       $(CORECLR_PATH)/tests/src/Regressions/common/date.cs    \
-       $(CORECLR_PATH)/tests/src/Regressions/common/CompEx.cs  \
-       $(CORECLR_PATH)/tests/src/Regressions/common/Marshal.cs \
-       $(CORECLR_PATH)/tests/src/Regressions/common/pow3.cs    \
-       $(CORECLR_PATH)/tests/src/Regressions/common/DisableTransparencyEnforcement.cs  \
-       $(CORECLR_PATH)/tests/src/Regressions/common/ThreadCulture.cs   \
-       $(CORECLR_PATH)/tests/src/Regressions/common/ToLower.cs \
-       $(CORECLR_PATH)/tests/src/Regressions/common/unsafe.cs  \
-       $(CORECLR_PATH)/tests/src/Regressions/expl_double/body_double.cs        \
-       $(CORECLR_PATH)/tests/src/Regressions/expl_double/expl_double_1.cs
-
-# the ICastable interface isn't implemented in Mono yet:
-CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/Interop/ICastable/Castable.cs
+       $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Logging.cs
 
 # needs parameters:
-CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/Loader/regressions/polyrec/polyrec.cs
+CORECLR_DISABLED_TEST_CS_SRC = $(CORECLR_PATH)/tests/src/Loader/regressions/polyrec/polyrec.cs
 
 # relies on env vars:
 CORECLR_DISABLED_TEST_CS_SRC +=        \
@@ -1230,32 +3791,13 @@ CORECLR_DISABLED_TEST_CS_SRC +=         \
 CORECLR_DISABLED_TEST_CS_SRC +=        \
        $(CORECLR_PATH)/tests/src/Regressions/assemblyref/assem.cs      \
        $(CORECLR_PATH)/tests/src/Regressions/assemblyref/test.cs               \
-       $(CORECLR_PATH)/tests/src/Interop/NativeCallable/NativeCallableTest.cs  \
        $(CORECLR_PATH)/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.cs
 
 # relies on a define:
 CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/Exceptions/Finalization/Finalizer.cs
 
 # exclude the CoreCLR GC stress framework for now, it needs special integration:
-CORECLR_DISABLED_TEST_CS_SRC +=        \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/plug.cs       \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/SingLinkStay.cs       \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/pinstress.cs  \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/GCQueue.cs    \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/ExpandHeap.cs \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/PlugGaps.cs   \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/concurrentspin2.cs    \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/ThdTreeGrowingObj.cs  \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/573277.cs     \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/GCVariant.cs  \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/bestfit-finalize.cs   \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/allocationwithpins.cs \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/MulDimJagAry.cs       \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/GCSimulator.cs        \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/StressAllocator.cs    \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/doubLinkStay.cs       \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/LeakGenThrd.cs        \
-       $(CORECLR_PATH)/tests/src/GC/Stress/Tests/b115557.cs    \
+CORECLR_DISABLED_TEST_CS_SRC +=        \
        $(CORECLR_PATH)/tests/src/GC/Stress/Framework/RFLogging.cs      \
        $(CORECLR_PATH)/tests/src/GC/Stress/Framework/DetourHelpers.cs  \
        $(CORECLR_PATH)/tests/src/GC/Stress/Framework/ReliabilityTest.cs        \
@@ -1290,6 +3832,206 @@ CORECLR_DISABLED_TEST_CS_SRC +=         \
        $(CORECLR_PATH)/tests/src/JIT/SIMD/CtorFromArray.cs     \
        $(CORECLR_PATH)/tests/src/JIT/SIMD/Haar-likeFeaturesGeneric.cs
 
+# unused files
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/components/fileversioninfo/assembly1.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/regressions/17360/avhelper.cs  \
+       $(CORECLR_PATH)/tests/src/reflection/regression/reflectionrepromasterforsl/helper.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/threadstatic/threadstatic04helper.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/hostedscenario/apunload/mgdhelper.cs       \
+       $(CORECLR_PATH)/tests/src/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/resourcemanager/customculture.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/resources/resourcemanager/customculture.cs
+
+# throws IndexOutOfRange exception even on .NET
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/compareexchange/compareexchangetclass.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/compareexchange/compareexchangetstring.cs
+
+# relies on other .cs files or each other
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/stress/sudoku/isudokugenerator.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/stress/sudoku/isudokuboard.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/stress/sudoku/stack.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/stress/sudoku/isudokusolver.cs \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0041/body_double.cs       \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0041/expl_double_1.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0433/assem.cs     \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0433/test.cs      \
+       $(CORECLR_PATH)/tests/src/Regressions/expl_double/body_double.cs        \
+       $(CORECLR_PATH)/tests/src/Regressions/expl_double/expl_double_1.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeym3.3/302680/data.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.cs
+
+# relies on mathtestlib.cs
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathtestlib.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathlog.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathatan.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathtan.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathsinh.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathacos.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathcosh.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathtanh.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/math/mathatan2.cs
+
+# relies on Trace.cs
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/innerfinally.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/trace.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/throwinfinally.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/baseclass.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/trycatchinfinally.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/rethrowandfinally.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/unittests/throwincatch.cs
+
+# relies on GCUtil.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/GC/Features/HeapExpansion/GCUtil.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Features/HeapExpansion/Finalizer.cs        \
+       $(CORECLR_PATH)/tests/src/GC/Features/HeapExpansion/Handles.cs
+
+# relies on GCUtil.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/GCUtil.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/PinnedMany.cs        \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/PinnedHandle.cs      \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/PinnedMultiple.cs    \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/PinnedObject.cs      \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/PinnedCollect.cs     \
+       $(CORECLR_PATH)/tests/src/GC/Features/Pinning/PinningOther/PinnedInt.cs
+
+# relies on helper.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/baseservices/compilerservices/dynamicobjectproperties/testoverrides.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/compilerservices/dynamicobjectproperties/testapis.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/compilerservices/dynamicobjectproperties/testgc.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/compilerservices/dynamicobjectproperties/helper.cs
+
+# relies on helper.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferencector2.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/helper.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisalive.cs
+
+# relies on cfdatetimetools.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/cfdatetimetools.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/datetime/datetimeisdaylightsavingtime.cs
+       
+# relies on delegatedefinitions.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/multicastdelegatector.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/multicastdelegategethashcode.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/multicastdelegategetinvocationlist.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/multicastdelegatecombineimpl.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/multicastdelegateequals.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/verificationagent.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/multicastdelegate/delegatedefinitions.cs
+
+# relies on timespansupport.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespantostring_str.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/timespan/timespansupport.cs
+
+# relies on common.cs helper
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/generics/ng_standard.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/generics/common.cs
+
+# relies on a define
+CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/baseservices/finalization/finalizer.cs
+
+# requires a command line arg, don't bother with those for now
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartchar.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartdouble.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartfloat.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartshort.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartuint.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartneg1.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartnull.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartsbyte.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartbyte.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartneg4.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartdecimal.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartlong.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartneg3.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartulong.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartstring.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartushort.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartgenerics.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartcast.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartnull2.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartint.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartdelegate.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartbool.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartobject.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/paramthreadstart/threadstartoperations.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/compareexchange/compareexchangelong.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/add/checkaddlong.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/add/interlockedaddlong.cs  \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/add/checkaddint.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/add/interlockedaddint.cs   \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/add/interlockedaddlongwithsubtract.cs
+
+# has no entrypoint or Main method
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/baseservices/visibility/target.cs     \
+       $(CORECLR_PATH)/tests/src/GC/Scenarios/Boxing/doubLink.cs       \
+       $(CORECLR_PATH)/tests/src/GC/Scenarios/DoublinkList/DoubLink.cs \
+       $(CORECLR_PATH)/tests/src/GC/Scenarios/FinalNStruct/strmap.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-beta2/485617/Managed.cs   \
+       $(CORECLR_PATH)/tests/src/GC/Regressions/v2.0-beta2/476725/ManagedTest.cs       \
+       $(CORECLR_PATH)/tests/src/GC/API/GCSettings/ILatencyTest.cs     \
+       $(CORECLR_PATH)/tests/src/GC/API/GCSettings/InducedGen0GC.cs    \
+       $(CORECLR_PATH)/tests/src/GC/API/GCSettings/InducedGen2GC.cs    \
+       $(CORECLR_PATH)/tests/src/GC/API/GCSettings/InducedGen1GC.cs    \
+       $(CORECLR_PATH)/tests/src/hosting/coreclr/activation/sxshost/usercases.cs       \
+       $(CORECLR_PATH)/tests/src/hosting/coreclr/activation/sxshost/delegates.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/fibonacci.cs      \
+       $(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/functional/threadpool/cs_support/foo.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/hostedscenario/apunloadtwo/sample.cs       \
+       $(CORECLR_PATH)/tests/src/baseservices/regression/v1/threads/functional/thread/tculturedll.cs   \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0341/usercode.cs  \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0341/platformcode.cs      \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/1380/forwarder1.cs        \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0694/criticalcode.cs      \
+       $(CORECLR_PATH)/tests/src/Regressions/coreclr/0149/sampleassembly.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/whidbeym3.3/293674/securedispatcher.cs    \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/v4.0/706099/managedcom.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/regressions/v4.0/640474/other2.cs     \
+       $(CORECLR_PATH)/tests/src/baseservices/ilasm_ildasm/regression/dd130885/xlib.cs \
+       $(CORECLR_PATH)/tests/src/baseservices/ilasm_ildasm/regression/vswhidbey267905/267905.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/ilasm_ildasm/regression/vswhidbey395914/395914.cs        \
+       $(CORECLR_PATH)/tests/src/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/platformassembly.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/compilerservices/runtimehelpers/userassembly.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/dllimportattribute/dllimporttest.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/runtime/interopservices/marshal/oleaut32.cs    \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/delegate/testforotherassembly.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assembly/testassembly1.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/reflection/assembly/testtarget.cs      \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/reflection/assembly/testassembly.cs       \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/exception/data_helper.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/reflection/assembly/server4.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/reflection/assembly/server3.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/reflection/assembly/server2.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/reflection/assembly/server1.cs     \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/miscellaneous/central.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/generics/nullabletypes.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/tests/critconstructorclass.cs \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/tests/testclassframeworkinternal.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/public/testclassframeworkinternal.cs  \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/public/testclass.cs   \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/tests/bindingtarget.cs        \
+       $(CORECLR_PATH)/tests/src/CoreMangLib/system/delegate/threatmodel/tests/testclass.cs
+       
+# samples (should probably be removed upstream)
+CORECLR_DISABLED_TEST_CS_SRC +=        \
+       $(CORECLR_PATH)/tests/src/hosting/samples/hosting/usercode/usercode.cs  \
+       $(CORECLR_PATH)/tests/src/hosting/samples/resolveevent/usercodedependency/usercodedependency.cs
+
 CORECLR_TEST_IL_SRC =                  \
        $(CORECLR_PATH)/tests/src/JIT/BBT/Scenario4/Not-Int32.il        \
        $(CORECLR_PATH)/tests/src/JIT/Directed/Convert/implicitConv.il  \
@@ -2360,7 +5102,19 @@ CORECLR_TEST_IL_SRC =                    \
        $(CORECLR_PATH)/tests/src/JIT/opt/JitMinOpts/Perf/LVNumCnt0.il  \
        $(CORECLR_PATH)/tests/src/JIT/opt/JitMinOpts/Perf/LVNumCnt1.il  \
        $(CORECLR_PATH)/tests/src/JIT/opt/JitMinOpts/Perf/LVRefCnt0.il  \
-       $(CORECLR_PATH)/tests/src/JIT/opt/JitMinOpts/Perf/LVRefCnt1.il
+       $(CORECLR_PATH)/tests/src/JIT/opt/JitMinOpts/Perf/LVRefCnt1.il  \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-fault-struct01.il        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-fault-struct02.il        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-fault-struct03.il        \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-fault01.il       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-fault02.il       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-fault03.il       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-filter-finally01.il      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-filter-finally02.il      \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/generics/try-filter-struct02.il       \
+       $(CORECLR_PATH)/tests/src/baseservices/exceptions/simple/fault.il       \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/compareexchange/compareexchangetneg.il     \
+       $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/exchange/exchangetneg.il
 
 # throws syntax error when processing with Mono ilasm:
 CORECLR_DISABLED_TEST_IL_SRC =                 \
@@ -2399,7 +5153,7 @@ CORECLR_UPSTREAM_IL_SRC=$(shell find "$(CORECLR_PATH)/tests" -iname "*.il")
 CORECLR_IL_SRC_MISSING=$(filter-out $(CORECLR_DEFINED_IL_SRC),$(CORECLR_UPSTREAM_IL_SRC))
 
 # find all CoreCLR *.cs test files that aren't mentioned in this file
-CORECLR_DEFINED_CS_SRC = $(CORECLR_TEST_CS_SRC) $(CORECLR_DISABLED_TEST_CS_SRC)
+CORECLR_DEFINED_CS_SRC = $(CORECLR_TEST_CS_SRC) $(CORECLR_COREMANGLIB_TEST_CS_SRC) $(CORECLR_TESTLIBRARY_CS_SRC) $(CORECLR_STRESSTEST_CS_SRC) $(CORECLR_DISABLED_TEST_CS_SRC)
 CORECLR_UPSTREAM_CS_SRC=$(shell find "$(CORECLR_PATH)/tests" -iname "*.cs")
 CORECLR_CS_SRC_MISSING=$(filter-out $(CORECLR_DEFINED_CS_SRC),$(CORECLR_UPSTREAM_CS_SRC))
 
@@ -2412,17 +5166,24 @@ coreclr-list-missing-tests:
        @echo $(CORECLR_CS_SRC_MISSING) | tr " " "\n"
 
 CORECLR_TESTSI_CS=$(CORECLR_TEST_CS_SRC:.cs=.exe)
-CORECLR_TESTSI_IL=$(CORECLR_TEST_IL_SRC:.il=.exe)
+CORECLR_TESTSI_IL=$(CORECLR_TEST_IL_SRC:.il=_il.exe)
 
-# the CoreCLR IL tests use the System.Console facade, we need to copy it to the test directory
-$(CORECLR_PATH)%.exe: $(CORECLR_PATH)%.il
+CORECLR_STRESSTESTSI_CS=$(CORECLR_STRESSTEST_CS_SRC:%.cs=%.exe)
+CORECLR_COREMANGLIB_TESTSI_CS=$(CORECLR_COREMANGLIB_TEST_CS_SRC:.cs=.exe)
+
+$(CORECLR_PATH)%_il.exe: $(CORECLR_PATH)%.il
        $(ILASM) -out:$@ $<
-       [ -f "$(CLASS)/Facades/System.Console.dll" ] && cp -f "$(CLASS)/Facades/System.Console.dll" "$(dir $@)"
 
-$(CORECLR_PATH)%.exe: $(CORECLR_PATH)%.cs
-       $(MCS) -unsafe -debug -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 -nowarn:0197 -out:$@ $<
+coreclr-testlibrary.dll: $(CORECLR_TESTLIBRARY_CS_SRC)
+       $(MCS) -unsafe -debug -target:library -d:WINCORESYS -d:MONO -out:$@ $(CORECLR_TESTLIBRARY_CS_SRC)
+
+$(CORECLR_PATH)%.exe: $(CORECLR_PATH)%.cs coreclr-testlibrary.dll
+       $(MCS) -unsafe -debug -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 -nowarn:0197 -r:coreclr-testlibrary.dll -d:MONO -out:$@ $<
 
 test-runner.exe: $(top_srcdir)/mono/tests/test-runner.cs
        $(MCS) -debug -out:$@ $<
 
-CLEANFILES = $(CORECLR_TESTSI_CS) $(CORECLR_TESTSI_IL) *.dll *.exe *.mdb
+GCStressTests.exe: $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
+       $(MCS) -out:$@ -debug -d:PROJECTK_BUILD $(CORECLR_STRESSTEST_RUNNER_CS_SRC)
+
+CLEANFILES = $(CORECLR_TESTSI_CS) $(CORECLR_COREMANGLIB_TESTSI_CS) $(CORECLR_TESTSI_IL) *.dll *.exe *.mdb $(CORECLR_STRESSTESTSI_CS) GCStressTests.exe coreclr-testlibrary.dll
index 088dd65cef6f2194fe85aeb774a82b1ef6e8c758..baabf314363cc1ed7637eebadc8a02553f854ef2 100644 (file)
@@ -2,17 +2,17 @@
   {
     "name": "roslyn", 
     "url": "git://github.com/dotnet/roslyn.git", 
-    "rev": "2e68ae5e6ec51762296c681aadf57a6f33f2f34f", 
+    "rev": "322bd5b2bbf07df6a67de35cbcb2365484412f70", 
     "remote-branch": "origin/master", 
     "branch": "master", 
     "directory": "roslyn"
   }, 
   {
     "name": "coreclr", 
-    "url": "git://github.com/dotnet/coreclr.git", 
-    "rev": "b9920ebea8d8d77b65d0ca10ffdb840f0cd36f06", 
-    "remote-branch": "origin/master", 
-    "branch": "master", 
+    "url": "git://github.com/mono/coreclr.git", 
+    "rev": "ba86240da16a86505743ef592dc448edb3e5109c", 
+    "remote-branch": "origin/mono", 
+    "branch": "mono", 
     "directory": "coreclr"
   }, 
   {
index 3a16bce02d7a29507db6f070073467254b260be3..7864669b9ecb17fd3e9cd8aaf93c19011cad39b6 100644 (file)
@@ -107,23 +107,20 @@ reset:
 
 __bump-version-%:
        @if [ "$(REV)" = "" ]; then echo "Usage: make bump-version-$* REV=<ref>"; exit 1; fi
-       @if [ "$(COMMIT)" = "1" ]; then git pull; fi
        python versions.py set-rev $* $(REV)
-       @if [ "$(COMMIT)" = "1" ]; then echo "Bump $* to pick up $(REV)." | git commit -F - $(CONFIG); fi
+       @if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $(REV)." | git commit -F - $(CONFIG); fi
 
 __bump-branch-%:
        @if [ "$(BRANCH)" = "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
        @if [ "$(REMOTE_BRANCH)" == "" ]; then echo "Usage: make bump-branch-$* BRANCH=<branch> REMOTE_BRANCH=<remote branch>"; exit 1; fi
-       @if [ "$(COMMIT)" = "1" ]; then git pull; fi
        python versions.py set-branch $* $(BRANCH)
        python versions.py set-remote-branch $* $(REMOTE_BRANCH)
-       @if [ "$(COMMIT)" = "1" ]; then echo "Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(CONFIG); fi
+       @if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(CONFIG); fi
 
 __bump-current-version-%:
-       @if [ "$(COMMIT)" = "1" ]; then git pull; fi
        REV=$(shell cd $(TOP)/../$* && git log -1 --pretty=format:%H); \
        python versions.py set-rev $* $$REV; \
-       if [ "$(COMMIT)" = "1" ]; then echo "Bump $* to pick up $$REV:" | git commit -F - $(CONFIG); fi
+       if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $$REV:" | git commit -F - $(CONFIG); fi
 
 # Bump the given submodule to the revision given by the REV make variable
 # If COMMIT is 1, commit the change
index 81ce8cdfcb2432a31287134c5a33e45205c5c1ac..be1e231bd300cd04cb94c6240fd59b29383a27b2 100644 (file)
@@ -417,7 +417,7 @@ AC_PROG_LD_GNU
 AM_ICONV()
 
 AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h)
-AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h)
+AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h)
 AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
                   [], [], [#include <stddef.h>
                  #include <sys/socket.h>
@@ -546,7 +546,7 @@ if test x"$GCC" = xyes; then
                if test "x$mono_cv_clang" = "xyes"; then
                   # https://bugzilla.samba.org/show_bug.cgi?id=8118
                   WARN="$WARN -Qunused-arguments"
-                  WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign"
+                  WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address"
                fi
 else
        # The Sun Forte compiler complains about inline functions that access static variables
@@ -2583,6 +2583,7 @@ dnl **************
 AC_ARG_ENABLE(llvm,[  --enable-llvm    Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=no)
 AC_ARG_ENABLE(loadedllvm,[  --enable-loadedllvm        Load the LLVM back-end dynamically], enable_llvm=$enableval && enable_loadedllvm=$enableval, enable_loadedllvm=no)
 AC_ARG_ENABLE(llvm-version-check,[  --enable-llvm-version-check Check that the LLVM matches the version expected by mono], enable_llvm_version_check=$enableval, enable_llvm_version_check=no)
+AC_ARG_ENABLE(llvm-runtime,[  --enable-llvm-runtime    Enable runtime support for llvmonly code], enable_llvm_runtime=$enableval, enable_llvm_runtime=no)
 
 AC_ARG_WITH(llvm, [  --with-llvm=<llvm prefix>    Enable the LLVM back-end], enable_llvm=yes,)
 
@@ -2696,6 +2697,14 @@ if test "x$enable_loadedllvm" = "xyes"; then
 fi
 AM_CONDITIONAL(LOADED_LLVM, [test x$enable_loadedllvm = xyes])
 
+if test "x$enable_llvm" = "xyes"; then
+   enable_llvm_runtime=yes
+fi
+if test "x$enable_llvm_runtime" = "xyes"; then
+   AC_DEFINE(ENABLE_LLVM_RUNTIME, 1, [Runtime support code for llvm enabled])
+fi
+AM_CONDITIONAL(ENABLE_LLVM_RUNTIME, [test x$enable_llvm_runtime = xyes])
+
 TARGET="unknown"
 ACCESS_UNALIGNED="yes"
 
index b3e13db1f78152f6d52bc5ab5d14eb196738504b..a9f8641107ddcaeba4f0319336c40da29195bb07 100644 (file)
@@ -1341,12 +1341,13 @@ word, which is checked on each minor collection. Can be used to detect/debug
 heap corruption issues.
 
 .TP
-\fBdo-not-finalize\fR
+\fBdo-not-finalize(=\fIclasses\fB)\fR
 If enabled, finalizers will not be run.  Everything else will be
 unaffected: finalizable objects will still be put into the
 finalization queue where they survive until they're scheduled to
 finalize.  Once they're not in the queue anymore they will be
-collected regularly.
+collected regularly.  If a list of comma-separated class names is
+given, only objects from those classes will not be finalized.
 
 .TP
 \fBlog-finalizers\fR
index 960e47d285c5d65b19d6997c186ae6d122a2c26c..e5a5892a916d764ddc582b344ffaf23af91e14c9 100644 (file)
@@ -14,7 +14,7 @@ monotouch_PARALLEL_SUBDIRS = System.Collections.Concurrent System.Collections Sy
        Microsoft.Win32.Primitives Microsoft.Win32.Registry System.AppContext System.Collections.NonGeneric System.Collections.Specialized System.ComponentModel.Primitives \
        System.ComponentModel.TypeConverter System.Console System.Data.Common System.Data.SqlClient System.Diagnostics.FileVersionInfo \
        System.Diagnostics.Process System.Diagnostics.TextWriterTraceListener System.Diagnostics.TraceEvent System.Diagnostics.TraceSource System.Globalization.Calendars \
-       System.IO.Compression System.IO.Compression.ZipFile System.IO.FileSystem System.IO.FileSystem.DriveInfo System.IO.FileSystem.Primitives \
+       System.IO.Compression.ZipFile System.IO.FileSystem System.IO.FileSystem.DriveInfo System.IO.FileSystem.Primitives \
        System.IO.IsolatedStorage System.IO.MemoryMappedFiles System.IO.UnmanagedMemoryStream System.Net.AuthenticationManager System.Net.Cache \
        System.Net.HttpListener System.Net.Mail System.Net.NameResolution System.Net.Security System.Net.ServicePoint System.Net.Sockets \
        System.Net.Utilities System.Net.WebHeaderCollection System.Net.WebSockets System.Net.WebSockets.Client System.Resources.ReaderWriter System.Runtime.CompilerServices.VisualC \
diff --git a/mcs/class/Facades/System.IO.Compression/AssemblyInfo.cs b/mcs/class/Facades/System.IO.Compression/AssemblyInfo.cs
deleted file mode 100644 (file)
index 47a9c1f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// 
-// Copyright (c) 2015 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.IO.Compression.dll")]
-[assembly: AssemblyDescription ("System.IO.Compression.dll")]
-[assembly: AssemblyDefaultAlias ("System.IO.Compression.dll")]
-[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: AssemblyInformationalVersion ("4.0.0.0")]
-[assembly: AssemblyFileVersion ("4.0.0.0")]
-[assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile ("../../msfinal.pub")]
-
-[assembly: ReferenceAssembly]
-
-
diff --git a/mcs/class/Facades/System.IO.Compression/Makefile b/mcs/class/Facades/System.IO.Compression/Makefile
deleted file mode 100644 (file)
index 282611a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-MCS_BUILD_DIR = ../../../build
-
-thisdir = class/Facades/System.IO.Compression
-SUBDIRS = 
-include $(MCS_BUILD_DIR)/rules.make
-
-LIBRARY_SUBDIR = Facades
-LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
-
-LIBRARY = System.IO.Compression.dll
-
-KEY_FILE = ../../msfinal.pub
-SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
-LIB_REFS = System
-LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.IO.Compression.dll
-
-PLATFORM_DEBUG_FLAGS =
-
-NO_TEST = yes
-
-include $(MCS_BUILD_DIR)/library.make
-
-
diff --git a/mcs/class/Facades/System.IO.Compression/System.IO.Compression-net_4_x.csproj b/mcs/class/Facades/System.IO.Compression/System.IO.Compression-net_4_x.csproj
deleted file mode 100644 (file)
index 4c8cd21..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProductVersion>9.0.30729</ProductVersion>\r
-    <SchemaVersion>2.0</SchemaVersion>\r
-    <ProjectGuid>{DA6DA8FE-0BF4-43C5-9BF8-896409EBDA70}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <NoWarn>1699,1616,1699,1699,1616,1699</NoWarn>\r
-    <OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>\r
-    <NoStdLib>True</NoStdLib>\r
-    <NoConfig>True</NoConfig>\r
-    \r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <RootNamespace>\r
-    </RootNamespace>\r
-    <AssemblyName>System.IO.Compression</AssemblyName>\r
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
-    <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-    <PropertyGroup>\r
-    <SignAssembly>true</SignAssembly>\r
-    <DelaySign>true</DelaySign>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <NoWarn>1699,1616,1699,1699,1616,1699</NoWarn>\r
-    <Optimize>false</Optimize>\r
-    <DefineConstants>DEBUG;TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,1616,1699,1699,1616,1699</NoWarn>\r
-    <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-  </PropertyGroup>\r
-  <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
-  Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
-  is a problem to compile the Mono mscorlib.dll -->\r
-  <PropertyGroup>\r
-    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
-  </PropertyGroup>\r
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
-  <ItemGroup>\r
-    <Compile Include="AssemblyInfo.cs" />\r
-    <Compile Include="TypeForwarders.cs" />\r  </ItemGroup>\r
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
-       Other similar extension points exist, see Microsoft.Common.targets.\r
-  <Target Name="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
-  <PropertyGroup>\r
-    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">\r
-\r
-    </PreBuildEvent>\r
-    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
-    </PreBuildEvent>\r
-\r
-    <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">\r
-\r
-    </PostBuildEvent>\r
-    <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
-    </PostBuildEvent>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <ProjectReference Include="../../corlib/corlib-net_4_x.csproj">\r
-      <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
-      <Name>corlib-net_4_x</Name>\r
-    </ProjectReference>\r
-    <ProjectReference Include="../../corlib/corlib-net_4_x.csproj">\r
-      <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
-      <Name>corlib-net_4_x</Name>\r
-    </ProjectReference>\r
-    <Reference Include="System.IO.Compression.dll">\r
-      <SpecificVersion>False</SpecificVersion>\r
-      <HintPath>System.IO.Compression.dll</HintPath>\r
-      <Private>False</Private>\r
-    </Reference>\r
-    <ProjectReference Include="../../System/System-net_4_x.csproj">\r
-      <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
-      <Name>System-net_4_x</Name>\r
-    </ProjectReference>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Folder Include="Properties\" />\r
-  </ItemGroup>\r
-</Project>\r
-
diff --git a/mcs/class/Facades/System.IO.Compression/System.IO.Compression.dll.sources b/mcs/class/Facades/System.IO.Compression/System.IO.Compression.dll.sources
deleted file mode 100644 (file)
index 8e33d4d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-TypeForwarders.cs
-AssemblyInfo.cs
-
diff --git a/mcs/class/Facades/System.IO.Compression/TypeForwarders.cs b/mcs/class/Facades/System.IO.Compression/TypeForwarders.cs
deleted file mode 100644 (file)
index 6747adb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// 
-// Copyright (c) 2015 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.
-// 
-
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.CompressionLevel))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.CompressionMode))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.DeflateStream))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.GZipStream))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.ZipArchive))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.ZipArchiveEntry))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.ZipArchiveMode))]
-
-
index c55fc42a528529dbe0b3740b52255779cc8912ed..309f3826aabeae5d3680fcdbd03dce6e75a6aa3b 100644 (file)
@@ -53,6 +53,7 @@ mobile_common_dirs := \
        Mono.CSharp     \
        Microsoft.CSharp \
        Mono.Security.Providers.DotNet  \
+       Mono.Security.Providers.OldTls \
        Mono.Security.Providers.NewSystemSource
 
 mobile_static_dirs := \
@@ -127,6 +128,7 @@ xammac_4_5_dirs := \
        System.Data.Linq                \
        System.Net.Http \
        Mono.Security.Providers.DotNet \
+       Mono.Security.Providers.OldTls \
        Mono.Security.Providers.NewSystemSource \
        $(pcl_facade_dirs)
 
@@ -256,6 +258,7 @@ net_4_x_parallel_dirs := \
        System.Windows \
        System.Xml.Serialization \
        Mono.Security.Providers.DotNet \
+       Mono.Security.Providers.OldTls \
        Mono.Security.Providers.NewSystemSource \
        System.DirectoryServices.Protocols      \
        RabbitMQ.Client                 \
index 2fff882880aca7fa6f00a1d5ec37f0dad63a577d..855edfee8921ec63ff431326216166dcd3a817bf 100644 (file)
@@ -67,7 +67,7 @@ namespace Mono.Security.Providers.DotNet
                        LocalCertificateSelectionCallback selection_callback = null;
 
                        if (settings != null) {
-                               validation_callback = ConvertCallback (settings.ServerCertificateValidationCallback);
+                               validation_callback = ConvertCallback (settings.RemoteCertificateValidationCallback);
                                selection_callback = ConvertCallback (settings.ClientCertificateSelectionCallback);
                        }
 
diff --git a/mcs/class/Mono.Security.Providers.OldTls/Makefile b/mcs/class/Mono.Security.Providers.OldTls/Makefile
new file mode 100644 (file)
index 0000000..b3b5c7a
--- /dev/null
@@ -0,0 +1,10 @@
+thisdir = class/Mono.Security.Providers.OldTls
+SUBDIRS = 
+include ../../build/rules.make
+
+LIBRARY = Mono.Security.Providers.OldTls.dll
+LIB_REFS = System Mono.Security
+LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP
+
+include ../../build/library.make
+
diff --git a/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls.dll.sources b/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls.dll.sources
new file mode 100644 (file)
index 0000000..13653b8
--- /dev/null
@@ -0,0 +1,73 @@
+./Properties/AssemblyInfo.cs
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+../../build/common/MonoTODOAttribute.cs
+
+./Mono.Security.Providers.OldTls/OldTlsProvider.cs
+../System/Mono.Net.Security/LegacySslStream.cs
+
+../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
+../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
+../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
+../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
diff --git a/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs b/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs
new file mode 100644 (file)
index 0000000..5754f4f
--- /dev/null
@@ -0,0 +1,73 @@
+//
+// OldTlsProvider.cs
+//
+// Author:
+//       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.
+using System;
+using System.IO;
+using System.Net;
+using System.Net.Security;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+using Mono.Security.Interface;
+using Mono.Net.Security;
+
+namespace Mono.Security.Providers.OldTls
+{
+       public class OldTlsProvider : MonoTlsProvider
+       {
+               public override bool SupportsSslStream {
+                       get { return true; }
+               }
+
+               public override bool SupportsMonoExtensions {
+                       get { return false; }
+               }
+
+               public override bool SupportsTlsContext {
+                       get { return false; }
+               }
+
+               public override SslProtocols SupportedProtocols {
+                       get { return SslProtocols.Tls; }
+               }
+
+               public override MonoSslStream CreateSslStream (
+                       Stream innerStream, bool leaveInnerStreamOpen,
+                       MonoTlsSettings settings = null)
+               {
+                       var impl = new LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
+                       return new MonoSslStreamImpl (impl);
+               }
+
+               public override IMonoTlsContext CreateTlsContext (
+                       string hostname, bool serverMode, TlsProtocols protocolFlags,
+                       X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
+                       bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
+                       MonoTlsSettings settings)
+               {
+                       throw new NotSupportedException ();
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Security.Providers.OldTls/Properties/AssemblyInfo.cs b/mcs/class/Mono.Security.Providers.OldTls/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..923beca
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// AssemblyInfo.cs
+//
+// Author:
+//       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.
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Security;
+using System.Security.Permissions;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about the system assembly
+
+[assembly: AssemblyVersion (Consts.FxVersion)]
+
+[assembly: AssemblyCompany ("MONO development team")]
+[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
+[assembly: AssemblyDescription ("Mono.Security.Providers.OldTls.dll")]
+[assembly: AssemblyProduct ("MONO CLI")]
+[assembly: AssemblyTitle ("Mono.Security.Providers.OldTls.dll")]
+[assembly: CLSCompliant (true)]
+[assembly: ComVisible (false)]
+[assembly: NeutralResourcesLanguage ("en-US")]
+
index 18ada523b25442368a31361778f30e5f1c626d6b..e167286ae693ed55b9903f8f04485d613624b420 100644 (file)
@@ -93,23 +93,34 @@ namespace Mono.Security.Interface
                ValidationResult ValidateChain (string targetHost, X509CertificateCollection certificates);
 
                ValidationResult ValidateClientCertificate (X509CertificateCollection certificates);
+
+               bool InvokeSystemValidator (
+                       string targetHost, bool serverMode, X509CertificateCollection certificates,
+                       ref MonoSslPolicyErrors errors, ref int status11);
        }
-       #endif
 
-       #if !INSIDE_SYSTEM
-       public
-       #endif
-       static class CertificateValidationHelper
+       public static class CertificateValidationHelper
        {
                const string SecurityLibrary = "/System/Library/Frameworks/Security.framework/Security";
                static readonly bool noX509Chain;
+               static readonly bool supportsTrustAnchors;
 
                static CertificateValidationHelper ()
                {
                        #if MONOTOUCH || XAMMAC
                        noX509Chain = true;
+                       supportsTrustAnchors = true;
+                       #elif MONODROID
+                       noX509Chain = true;
+                       supportsTrustAnchors = false;
                        #else
-                       noX509Chain = File.Exists (SecurityLibrary);
+                       if (File.Exists (SecurityLibrary)) {
+                               noX509Chain = true;
+                               supportsTrustAnchors = true;
+                       } else {
+                               noX509Chain = false;
+                               supportsTrustAnchors = false;
+                       }
                        #endif
                }
 
@@ -117,16 +128,30 @@ namespace Mono.Security.Interface
                        get { return !noX509Chain; }
                }
 
-               internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
+               public static bool SupportsTrustAnchors {
+                       get { return supportsTrustAnchors; }
+               }
+
+               static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+               {
+                       return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
+               }
+
+               /*
+                * Internal API, intended to be used by MonoTlsProvider implementations.
+                */
+               public static ICertificateValidator GetValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
-                       return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (settings);
+                       return GetDefaultValidator (provider, settings);
                }
 
-               #if !INSIDE_SYSTEM
+               /*
+                * Use this overloaded version in user code.
+                */
                public static ICertificateValidator GetValidator (MonoTlsSettings settings)
                {
-                       return GetDefaultValidator (settings);
+                       return GetDefaultValidator (null, settings);
                }
-               #endif
        }
+#endif
 }
index 14dc1d440990e198e4f625fccceb8a450636f113..2f0f56ef6e4d25734737927413bb354af051db0a 100644 (file)
@@ -105,6 +105,22 @@ namespace Mono.Security.Interface
 
 #endregion
 
+#region Certificate Validation
+
+               public virtual bool HasCustomSystemCertificateValidator {
+                       get { return false; }
+               }
+
+               public virtual bool InvokeSystemCertificateValidator (
+                       ICertificateValidator validator, string targetHost, bool serverMode,
+                       X509CertificateCollection certificates, ref MonoSslPolicyErrors errors,
+                       ref int status11)
+               {
+                       return false;
+               }
+
+#endregion
+
 #region Manged SSPI
 
                /*
index dc9663632a1ad9084ce6a05d9db2abf7f36f7dea..1c7035addf4cd739bf233fd93aa36ba5197b9232 100644 (file)
@@ -26,6 +26,7 @@
 using System;
 using System.Net;
 using Mono.Net.Security;
+using System.Security.Cryptography.X509Certificates;
 
 namespace Mono.Security.Interface
 {
@@ -91,6 +92,11 @@ namespace Mono.Security.Interface
                {
                        return NoReflectionHelper.CreateHttpsRequest (requestUri, provider, settings);
                }
+
+               public static HttpListener CreateHttpListener (X509Certificate2 certificate, MonoTlsProvider provider = null, MonoTlsSettings settings = null)
+               {
+                       return (HttpListener)NoReflectionHelper.CreateHttpListener (certificate, provider, settings);
+               }
        }
 }
 
index e939b79d3c304a6f41ded90c0d9a24de86b79d4c..077ed335e785ae4f941b514c6e681af996cc3b9a 100644 (file)
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 using System;
+using System.Security.Cryptography.X509Certificates;
 
 namespace Mono.Security.Interface
 {
        public sealed class MonoTlsSettings
        {
-               public MonoRemoteCertificateValidationCallback ServerCertificateValidationCallback {
+               public MonoRemoteCertificateValidationCallback RemoteCertificateValidationCallback {
                        get; set;
                }
 
@@ -62,10 +63,24 @@ namespace Mono.Security.Interface
                        set { callbackNeedsChain = value; }
                }
 
+               /*
+                * This is only supported if CertificateValidationHelper.SupportsTrustAnchors is true.
+                */
+               public X509CertificateCollection TrustAnchors {
+                       get; set;
+               }
+
                public object UserSettings {
                        get; set;
                }
 
+               /*
+                * If you set this here, then it will override 'ServicePointManager.SecurityProtocol'.
+                */
+               public TlsProtocols? EnabledProtocols {
+                       get; set;
+               }
+
                bool cloned = false;
                bool checkCertName = true;
                bool checkCertRevocationStatus = false;
@@ -74,6 +89,10 @@ namespace Mono.Security.Interface
                bool callbackNeedsChain = true;
                ICertificateValidator certificateValidator;
 
+               public MonoTlsSettings ()
+               {
+               }
+
                #region Private APIs
 
                /*
@@ -86,7 +105,6 @@ namespace Mono.Security.Interface
                [Obsolete ("Do not use outside System.dll!")]
                public ICertificateValidator CertificateValidator {
                        get { return certificateValidator; }
-                       set { certificateValidator = value; }
                }
 
                [Obsolete ("Do not use outside System.dll!")]
@@ -97,20 +115,26 @@ namespace Mono.Security.Interface
                                return this;
                        }
 
-                       var copy = new MonoTlsSettings ();
-                       copy.ServerCertificateValidationCallback = ServerCertificateValidationCallback;
-                       copy.ClientCertificateSelectionCallback = ClientCertificateSelectionCallback;
-                       copy.checkCertName = checkCertName;
-                       copy.checkCertRevocationStatus = checkCertRevocationStatus;
-                       copy.UseServicePointManagerCallback = useServicePointManagerCallback;
-                       copy.skipSystemValidators = skipSystemValidators;
-                       copy.callbackNeedsChain = callbackNeedsChain;
-                       copy.UserSettings = UserSettings;
+                       var copy = new MonoTlsSettings (this);
                        copy.certificateValidator = validator;
-                       copy.cloned = true;
                        return copy;
                }
 
+               MonoTlsSettings (MonoTlsSettings other)
+               {
+                       RemoteCertificateValidationCallback = other.RemoteCertificateValidationCallback;
+                       ClientCertificateSelectionCallback = other.ClientCertificateSelectionCallback;
+                       checkCertName = other.checkCertName;
+                       checkCertRevocationStatus = other.checkCertRevocationStatus;
+                       UseServicePointManagerCallback = other.useServicePointManagerCallback;
+                       skipSystemValidators = other.skipSystemValidators;
+                       callbackNeedsChain = other.callbackNeedsChain;
+                       UserSettings = other.UserSettings;
+                       EnabledProtocols = other.EnabledProtocols;
+                       TrustAnchors = other.TrustAnchors;
+                       cloned = true;
+               }
+
                #endregion
        }
 }
index 15d8dd6554f682895a9e91eac26e353cac91c254..6ef5db41018589c964b7a12aeb1559bc4a1a714e 100644 (file)
@@ -56,6 +56,10 @@ namespace Mono.Security.Protocol.Tls.Handshake.Server
                        }
                }
 
+               public bool HasCertificate {
+                       get { return clientCertificates.Count > 0; }
+               }
+
                #endregion
 
                #region Protected Methods
index 31c2547902beeb8bc2fba4d4d4b27b27d7e783e8..b043f7e18cf090fb4ed47da41da29f4437c89086 100644 (file)
@@ -119,7 +119,8 @@ namespace Mono.Security.Protocol.Tls
 
                                case HandshakeType.Finished:
                                        // Certificates are optional, but if provided, they should send a CertificateVerify
-                                       bool check = (cert == null) ? (last == HandshakeType.ClientKeyExchange) : (last == HandshakeType.CertificateVerify);
+                                       bool hasCert = cert != null && cert.HasCertificate;
+                                       bool check = hasCert ? (last == HandshakeType.CertificateVerify) : (last == HandshakeType.ClientKeyExchange);
                                        // ChangeCipherSpecDone is not an handshake message (it's a content type) but still needs to be happens before finished
                                        if (check && context.ChangeCipherSpecDone) {
                                                context.ChangeCipherSpecDone = false;
index 3ef2df472ea22a00a778d53094460a673d7f0d07..976b50109d0c0b4deba28eb9ff0d7e29016a876b 100644 (file)
@@ -243,7 +243,7 @@ namespace MonoTests.System.Linq.Expressions {
                public void CallMethodOnDateTime ()
                {
                        var left = Expression.Call (Expression.Constant (DateTime.Now), typeof(DateTime).GetMethod ("AddDays"), Expression.Constant (-5.0));
-                       var right = Expression.Constant (DateTime.Today);
+                       var right = Expression.Constant (DateTime.Today.AddDays (1));
                        var expr = Expression.GreaterThan (left, right);
 
                        var eq = Expression.Lambda<Func<bool>> (expr).Compile ();
index 32eee55bf4923c4aae3e65465c76ed78b72f89db..9d9d16292902c6507642ff04dd05144bf2b6e878 100644 (file)
@@ -48,7 +48,8 @@
     <Compile Include="..\..\build\common\Consts.cs.in" />\r
     <Compile Include="..\..\build\common\Locale.cs" />\r
     <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
-    <Compile Include="Assembly\AssemblyInfo.cs" />\r
+    <Compile Include="Assembly\AssemblyInfo.cs" />
+    <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryObjectNotFoundException.cs" />\r
     <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryOperationException.cs" />\r
     <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryPartition.cs" />\r
     <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryReplicationMetadata.cs" />\r
index 7a37d13b054ba82e40ac9c8023a6e194990f8c7e..924e26d9036ee105dbde9ea63e75cf81a4adaa08 100644 (file)
@@ -49,6 +49,7 @@
     <Compile Include="..\..\build\common\Locale.cs" />\r
     <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
+    <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryObjectNotFoundException.cs" />
     <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryOperationException.cs" />\r
     <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryPartition.cs" />\r
     <Compile Include="System.DirectoryServices.ActiveDirectory\ActiveDirectoryReplicationMetadata.cs" />\r
diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryObjectNotFoundException.cs b/mcs/class/System.DirectoryServices/System.DirectoryServices.ActiveDirectory/ActiveDirectoryObjectNotFoundException.cs
new file mode 100644 (file)
index 0000000..11a796e
--- /dev/null
@@ -0,0 +1,82 @@
+/******************************************************************************
+* The MIT License
+*
+* 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.Runtime.Serialization;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+       [Serializable]
+       public class ActiveDirectoryObjectNotFoundException : Exception, ISerializable
+       {
+               [MonoTODO]
+               public ActiveDirectoryObjectNotFoundException (string message, Type type, string name) : base(message)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public ActiveDirectoryObjectNotFoundException (string message, Exception inner) : base(message, inner)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public ActiveDirectoryObjectNotFoundException (string message) : base(message)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public ActiveDirectoryObjectNotFoundException () : base("DSUnknownFailure")
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected ActiveDirectoryObjectNotFoundException (SerializationInfo info, StreamingContext context) : base(info, context)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
+               [MonoTODO]
+               public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public string Name {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public Type Type {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+       }
+}
index 0c18dadf88dde6d43525590b73ecb4f772a77605..acaf20cac11e7d6f21ba27ecd88aa28c7f419b8f 100644 (file)
@@ -40,6 +40,7 @@ System.DirectoryServices/SortDirection.cs
 System.DirectoryServices/SortOption.cs
 ../../build/common/MonoTODOAttribute.cs
 System.DirectoryServices.Design/DirectoryEntryConverter.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryObjectNotFoundException.cs
 System.DirectoryServices.ActiveDirectory/ActiveDirectoryOperationException.cs
 System.DirectoryServices.ActiveDirectory/ActiveDirectoryPartition.cs
 System.DirectoryServices.ActiveDirectory/ActiveDirectoryReplicationMetadata.cs
index 448ad85b32e790964e536cfc48b3989be6bd9a37..3e9d83e63d7f2d506c08d41f757fcd8c63a9b8fc 100644 (file)
@@ -1,3 +1,6 @@
+System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs
+System.Runtime.Serialization.Json/JsonReaderTest.cs
+System.Runtime.Serialization.Json/JsonWriterTest.cs
 System.Runtime.Serialization/Bug11916Test.cs
 System.Runtime.Serialization/Bug666333Test.cs
 System.Runtime.Serialization/Bug675144Test.cs
diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/ChangeLog b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/ChangeLog
new file mode 100644 (file)
index 0000000..532e123
--- /dev/null
@@ -0,0 +1,125 @@
+2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : add test for bug #615800.
+
+2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : add test for bug #615801.
+
+2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : don't use ToUniversalTime()
+         which makes test results timezone dependent.
+
+2010-03-10  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : oops, the test was careless.
+         Use fixed date.
+
+2010-03-09  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : add test for bug #586169.
+       * JsonWriterTest.cs : add standalone write case for "\/".
+
+2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs :
+         enable TypeIsNotPartsOfKnownTypes(), and add more related tests.
+
+2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : make some tests narrow down
+         possible cause of errors to detect expected errors more precisely.
+
+2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : null-string case is working.
+
+2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : invalidate previous non-working
+         tests.
+
+2010-01-25  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * DataContractJsonSerializerTest.cs: Add non-working test cases
+       for null-string, known types and handling floating point special
+       values
+
+2009-12-11  Chris Toshok  <toshok@ximian.com>
+
+       * DataContractJsonSerializerTest.cs: add a test case for
+       non-public properties.
+
+2009-12-11  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * JsonReaderTest.cs : another number parse case.
+
+2009-11-20  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : added ignored test case that
+         verifies 2.1 behavior (with another case that justifies removal
+         of the previous hack).
+
+2009-10-08  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : added test for
+         alwaysEmitTypeInformation argument.
+
+2009-09-07  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : fix non-datacontract
+         serialization test. It depended on IPAddress field internals
+         (runtime serialization incompatibility).
+
+2009-03-13  Andreia Gaita  <avidigal@novell.com>
+
+       * JsonReaderTest.cs: test for skip and depth (if depth fails, skip is affected)
+
+2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : fixed some tests to match
+         .NET RTM behavior. Added read-only collection case, (but [Ignore]d).
+
+2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : added test for contract-less
+         serialization.
+
+2008-02-18  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : added couple of DBNull tests.
+
+2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : added deserialization tests
+         for typed object with "__type".
+
+2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * JsonReaderTest.cs : test GetAttribute() for "__type".
+
+2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * JsonReaderTest.cs : added tests for "__type" attributes (some of
+         them are not working yet).
+
+2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * JsonReaderTest.cs : test "type" attribute in several nodes.
+
+2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs : some more deserialization tests.
+
+2008-01-22  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * JsonWriterTest.cs : added test for writing __type attribute.
+       * DataContractJsonSerializerTest.cs : added more random-ish tests.
+
+2007-12-05  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DataContractJsonSerializerTest.cs :
+         moved from Test/System.Runtime.Serialization and fixed some.
+       * JsonReaderTest.cs, JsonWriterTest.cs : moved from Test/System.Xml.
+
diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs
new file mode 100644 (file)
index 0000000..96e7b26
--- /dev/null
@@ -0,0 +1,2812 @@
+//
+// DataContractJsonSerializerTest.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//     Ankit Jain <JAnkit@novell.com>
+//     Antoine Cailliau <antoinecailliau@gmail.com>
+//
+// Copyright (C) 2005-2007 Novell, Inc.  http://www.novell.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.
+//
+
+//
+// This test code contains tests for DataContractJsonSerializer, which is
+// imported from DataContractSerializerTest.cs.
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Net;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Json;
+using System.Text;
+using System.Xml;
+using NUnit.Framework;
+
+namespace MonoTests.System.Runtime.Serialization.Json
+{
+       [TestFixture]
+       public class DataContractJsonSerializerTest
+       {
+               static readonly XmlWriterSettings settings;
+
+               static DataContractJsonSerializerTest ()
+               {
+                       settings = new XmlWriterSettings ();
+                       settings.OmitXmlDeclaration = true;
+               }
+
+               [DataContract]
+               class Sample1
+               {
+                       [DataMember]
+                       public string Member1;
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorTypeNull ()
+               {
+                       new DataContractJsonSerializer (null);
+               }
+
+               [Test]
+               public void ConstructorKnownTypesNull ()
+               {
+                       // null knownTypes is allowed.
+                       new DataContractJsonSerializer (typeof (Sample1), (IEnumerable<Type>) null);
+                       new DataContractJsonSerializer (typeof (Sample1), "Foo", null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorNameNull ()
+               {
+                       new DataContractJsonSerializer (typeof (Sample1), (string) null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentOutOfRangeException))]
+               public void ConstructorNegativeMaxObjects ()
+               {
+                       new DataContractJsonSerializer (typeof (Sample1), "Sample1",
+                               null, -1, false, null, false);
+               }
+
+               [Test]
+               public void ConstructorMisc ()
+               {
+                       new DataContractJsonSerializer (typeof (JsonGlobalSample1)).WriteObject (new MemoryStream (), new JsonGlobalSample1 ());
+               }
+
+               [Test]
+               public void WriteObjectContent ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter xw = XmlWriter.Create (sw, settings)) {
+                               DataContractJsonSerializer ser =
+                                       new DataContractJsonSerializer (typeof (string));
+                               xw.WriteStartElement ("my-element");
+                               ser.WriteObjectContent (xw, "TEST STRING");
+                               xw.WriteEndElement ();
+                       }
+                       Assert.AreEqual ("<my-element>TEST STRING</my-element>",
+                               sw.ToString ());
+               }
+
+               // int
+
+               [Test]
+               public void SerializeIntXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeInt (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">1</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeIntJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeInt (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "1",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeInt (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (int));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, 1);
+                       }
+               }
+
+               // int, with rootName
+
+               [Test]
+               public void SerializeIntXmlWithRootName ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeIntWithRootName (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<myroot type=""number"">1</myroot>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               // since JsonWriter supports only "root" as the root name, using
+               // XmlWriter from JsonReaderWriterFactory will always fail with
+               // an explicit rootName.
+               [ExpectedException (typeof (SerializationException))]
+               public void SerializeIntJsonWithRootName ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeIntWithRootName (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "1",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeIntWithRootName (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (int), "myroot");
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, 1);
+                       }
+               }
+
+               // pass typeof(DCEmpty), serialize int
+
+               [Test]
+               public void SerializeIntForDCEmptyXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeIntForDCEmpty (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">1</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeIntForDCEmptyJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeIntForDCEmpty (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "1",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeIntForDCEmpty (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (DCEmpty));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, 1);
+                       }
+               }
+
+               // DCEmpty
+
+               [Test]
+               public void SerializeEmptyClassXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeEmptyClass (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object"" />",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeEmptyClassJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeEmptyClass (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "{}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeEmptyClass (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (DCEmpty));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new DCEmpty ());
+                       }
+               }
+
+               // string (primitive)
+
+               [Test]
+               public void SerializePrimitiveStringXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializePrimitiveString (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               "<root>TEST</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializePrimitiveStringJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializePrimitiveString (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"""TEST""",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializePrimitiveString (XmlWriter writer)
+               {
+                       XmlObjectSerializer ser =
+                               new DataContractJsonSerializer (typeof (string));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, "TEST");
+                       }
+               }
+
+               // QName (primitive but ...)
+
+               [Test]
+               public void SerializePrimitiveQNameXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializePrimitiveQName (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               "<root>foo:urn:foo</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializePrimitiveQNameJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializePrimitiveQName (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"""foo:urn:foo""",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializePrimitiveQName (XmlWriter writer)
+               {
+                       XmlObjectSerializer ser =
+                               new DataContractJsonSerializer (typeof (XmlQualifiedName));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new XmlQualifiedName ("foo", "urn:foo"));
+                       }
+               }
+
+               // DBNull (primitive)
+
+               [Test]
+               public void SerializeDBNullXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeDBNull (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object"" />",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeDBNullJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeDBNull (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "{}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeDBNull (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (DBNull));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, DBNull.Value);
+                       }
+               }
+
+               // DCSimple1
+
+               [Test]
+               public void SerializeSimpleClass1Xml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeSimpleClass1 (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object""><Foo>TEST</Foo></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeSimpleClass1Json ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeSimpleClass1 (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"{""Foo"":""TEST""}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeSimpleClass1 (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (DCSimple1));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new DCSimple1 ());
+                       }
+               }
+
+               // NonDC
+
+               [Test]
+               // NonDC is not a DataContract type.
+               public void SerializeNonDCOnlyCtor ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (NonDC));
+               }
+
+               [Test]
+               //[ExpectedException (typeof (InvalidDataContractException))]
+               // NonDC is not a DataContract type.
+               // UPDATE: non-DataContract types are became valid in RTM.
+               public void SerializeNonDC ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (NonDC));
+                       using (XmlWriter w = XmlWriter.Create (TextWriter.Null, settings)) {
+                               ser.WriteObject (w, new NonDC ());
+                       }
+               }
+
+               // DCHasNonDC
+
+               [Test]
+               //[ExpectedException (typeof (InvalidDataContractException))]
+               // DCHasNonDC itself is a DataContract type whose field is
+               // marked as DataMember but its type is not DataContract.
+               // UPDATE: non-DataContract types are became valid in RTM.
+               public void SerializeDCHasNonDC ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCHasNonDC));
+                       using (XmlWriter w = XmlWriter.Create (TextWriter.Null, settings)) {
+                               ser.WriteObject (w, new DCHasNonDC ());
+                       }
+               }
+
+               // DCHasSerializable
+
+               [Test]
+               public void SerializeSimpleSerializable1Xml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeSimpleSerializable1 (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object""><Ser type=""object""><Doh>doh!</Doh></Ser></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeSimpleSerializable1Json ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeSimpleSerializable1 (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"{""Ser"":{""Doh"":""doh!""}}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               // DCHasSerializable itself is DataContract and has a field
+               // whose type is not contract but serializable.
+               void SerializeSimpleSerializable1 (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCHasSerializable));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new DCHasSerializable ());
+                       }
+               }
+
+               [Test]
+               public void SerializeDCWithNameXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeDCWithName (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object""><FooMember>value</FooMember></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeDCWithNameJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeDCWithName (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"{""FooMember"":""value""}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeDCWithName (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithName));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new DCWithName ());
+                       }
+               }
+
+               [Test]
+               public void SerializeDCWithEmptyName1 ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEmptyName));
+                       StringWriter sw = new StringWriter ();
+                       DCWithEmptyName dc = new DCWithEmptyName ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               try {
+                                       ser.WriteObject (w, dc);
+                               } catch (InvalidDataContractException) {
+                                       return;
+                               }
+                       }
+                       Assert.Fail ("Expected InvalidDataContractException");
+               }
+
+               [Test]
+               public void SerializeDCWithEmptyName2 ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithName));
+                       StringWriter sw = new StringWriter ();
+
+                       /* DataContractAttribute.Name == "", not valid */
+                       DCWithEmptyName dc = new DCWithEmptyName ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               try {
+                                       ser.WriteObject (w, dc);
+                               } catch (InvalidDataContractException) {
+                                       return;
+                               }
+                       }
+                       Assert.Fail ("Expected InvalidDataContractException");
+               }
+
+               [Test]
+               [Category("NotWorking")]
+               public void SerializeDCWithNullName ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithNullName));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               try {
+                                       /* DataContractAttribute.Name == "", not valid */
+                                       ser.WriteObject (w, new DCWithNullName ());
+                               } catch (InvalidDataContractException) {
+                                       return;
+                               }
+                       }
+                       Assert.Fail ("Expected InvalidDataContractException");
+               }
+
+               [Test]
+               public void SerializeDCWithEmptyNamespace1 ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEmptyNamespace));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, new DCWithEmptyNamespace ());
+                       }
+               }
+
+               [Test]
+               public void SerializeWrappedClassXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeWrappedClass (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object"" />",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeWrappedClassJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeWrappedClass (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "{}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeWrappedClass (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (Wrapper.DCWrapped));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new Wrapper.DCWrapped ());
+                       }
+               }
+
+               // CollectionContainer : Items must have a setter. (but became valid in RTM).
+               [Test]
+               public void SerializeReadOnlyCollectionMember ()
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (CollectionContainer));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, null);
+                       }
+               }
+
+               // DataCollectionContainer : Items must have a setter. (but became valid in RTM).
+               [Test]
+               public void SerializeReadOnlyDataCollectionMember ()
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (DataCollectionContainer));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, null);
+                       }
+               }
+
+               [Test]
+               [Ignore ("https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=409970")]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeReadOnlyDataCollection_NullCollection ()
+               {
+                       DataContractJsonSerializer ser =
+                               new DataContractJsonSerializer (typeof (CollectionContainer));
+                       StringWriter sw = new StringWriter ();
+                       var c = new CollectionContainer ();
+                       c.Items.Add ("foo");
+                       c.Items.Add ("bar");
+                       using (XmlWriter w = XmlWriter.Create (sw, settings))
+                               ser.WriteObject (w, c);
+                       // CollectionContainer.Items is null, so it cannot deserialize non-null collection.
+                       using (XmlReader r = XmlReader.Create (new StringReader (sw.ToString ())))
+                               c = (CollectionContainer) ser.ReadObject (r);
+               }
+
+               [Test]
+               public void SerializeGuidXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeGuid (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root>00000000-0000-0000-0000-000000000000</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeGuidJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeGuid (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"""00000000-0000-0000-0000-000000000000""",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeGuid (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (Guid));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, Guid.Empty);
+                       }
+               }
+
+               [Test]
+               public void SerializeEnumXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeEnum (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">0</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeEnumJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeEnum (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "0",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeEnum (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (Colors));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new Colors ());
+                       }
+               }
+
+               [Test]
+               public void SerializeEnum2Xml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeEnum2 (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">0</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeEnum2Json ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeEnum2 (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "0",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeEnum2 (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (Colors));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, 0);
+                       }
+               }
+
+               [Test] // so, DataContract does not affect here.
+               public void SerializeEnumWithDCXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeEnumWithDC (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">0</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeEnumWithDCJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeEnumWithDC (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "0",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeEnumWithDC (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsWithDC));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new ColorsWithDC ());
+                       }
+               }
+
+               [Test]
+               public void SerializeEnumWithNoDCXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeEnumWithNoDC (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">0</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeEnumWithNoDCJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeEnumWithNoDC (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "0",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeEnumWithNoDC (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsEnumMemberNoDC));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new ColorsEnumMemberNoDC ());
+                       }
+               }
+
+               [Test]
+               public void SerializeEnumWithDC2Xml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeEnumWithDC2 (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""number"">3</root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeEnumWithDC2Json ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeEnumWithDC2 (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               "3",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeEnumWithDC2 (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsWithDC));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, 3);
+                       }
+               }
+
+/*
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void SerializeEnumWithDCInvalid ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsWithDC));
+                       StringWriter sw = new StringWriter ();
+                       ColorsWithDC cdc = ColorsWithDC.Blue;
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, cdc);
+                       }
+               }
+*/
+
+               [Test]
+               public void SerializeDCWithEnumXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializeDCWithEnum (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""object""><_colors type=""number"">0</_colors></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeDCWithEnumJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializeDCWithEnum (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"{""_colors"":0}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializeDCWithEnum (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEnum));
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, new DCWithEnum ());
+                       }
+               }
+
+               [Test]
+               public void SerializerDCArrayXml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializerDCArray (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""array""><item type=""object""><_colors type=""number"">0</_colors></item><item type=""object""><_colors type=""number"">1</_colors></item></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializerDCArrayJson ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializerDCArray (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"[{""_colors"":0},{""_colors"":1}]",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializerDCArray (XmlWriter writer)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEnum []));
+                       DCWithEnum [] arr = new DCWithEnum [2];
+                       arr [0] = new DCWithEnum (); arr [0].colors = Colors.Red;
+                       arr [1] = new DCWithEnum (); arr [1].colors = Colors.Green;
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, arr);
+                       }
+               }
+
+               [Test]
+               public void SerializerDCArray2Xml ()
+               {
+                       StringWriter sw = new StringWriter ();
+                       SerializerDCArray2 (XmlWriter.Create (sw, settings));
+                       Assert.AreEqual (
+                               @"<root type=""array""><item __type=""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"" type=""object""><_colors type=""number"">0</_colors></item><item __type=""DCSimple1:#MonoTests.System.Runtime.Serialization.Json"" type=""object""><Foo>hello</Foo></item></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializerDCArray2Json ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       SerializerDCArray2 (JsonReaderWriterFactory.CreateJsonWriter (ms));
+                       Assert.AreEqual (
+                               @"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0},{""__type"":""DCSimple1:#MonoTests.System.Runtime.Serialization.Json"",""Foo"":""hello""}]",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               void SerializerDCArray2 (XmlWriter writer)
+               {
+                       List<Type> known = new List<Type> ();
+                       known.Add (typeof (DCWithEnum));
+                       known.Add (typeof (DCSimple1));
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (object []), known);
+                       object [] arr = new object [2];
+                       arr [0] = new DCWithEnum (); ((DCWithEnum)arr [0]).colors = Colors.Red;
+                       arr [1] = new DCSimple1 (); ((DCSimple1) arr [1]).Foo = "hello";
+
+                       using (XmlWriter w = writer) {
+                               ser.WriteObject (w, arr);
+                       }
+               }
+
+               [Test]
+               public void SerializerDCArray3Xml ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (int []));
+                       StringWriter sw = new StringWriter ();
+                       int [] arr = new int [2];
+                       arr [0] = 1; arr [1] = 2;
+
+                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (w, arr);
+                       }
+
+                       Assert.AreEqual (
+                               @"<root type=""array""><item type=""number"">1</item><item type=""number"">2</item></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializerDCArray3Json ()
+               {
+                       MemoryStream ms = new MemoryStream ();
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (int []));
+                       int [] arr = new int [2];
+                       arr [0] = 1; arr [1] = 2;
+
+                       using (XmlWriter w = JsonReaderWriterFactory.CreateJsonWriter (ms)) {
+                               ser.WriteObject (w, arr);
+                       }
+
+                       Assert.AreEqual (
+                               @"[1,2]",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               [Test]
+               // ... so, non-JSON XmlWriter is still accepted.
+               public void SerializeNonDCArrayXml ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (SerializeNonDCArrayType));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter xw = XmlWriter.Create (sw, settings)) {
+                               ser.WriteObject (xw, new SerializeNonDCArrayType ());
+                       }
+                       Assert.AreEqual (@"<root type=""object""><IPAddresses type=""array"" /></root>",
+                               sw.ToString ());
+               }
+
+               [Test]
+               public void SerializeNonDCArrayJson ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (SerializeNonDCArrayType));
+                       MemoryStream ms = new MemoryStream ();
+                       using (XmlWriter xw = JsonReaderWriterFactory.CreateJsonWriter (ms)) {
+                               ser.WriteObject (xw, new SerializeNonDCArrayType ());
+                       }
+                       Assert.AreEqual (@"{""IPAddresses"":[]}",
+                               Encoding.UTF8.GetString (ms.ToArray ()));
+               }
+
+               [Test]
+               public void SerializeNonDCArrayItems ()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (SerializeNonDCArrayType));
+                       StringWriter sw = new StringWriter ();
+                       using (XmlWriter xw = XmlWriter.Create (sw, settings)) {
+                               SerializeNonDCArrayType obj = new SerializeNonDCArrayType ();
+                               obj.IPAddresses = new NonDCItem [] {new NonDCItem () { Data = new byte [] {1, 2, 3, 4} } };
+                               ser.WriteObject (xw, obj);
+                       }
+
+                       XmlDocument doc = new XmlDocument ();
+                       doc.LoadXml (sw.ToString ());
+                       XmlNamespaceManager nsmgr = new XmlNamespaceManager (doc.NameTable);
+                       nsmgr.AddNamespace ("s", "http://schemas.datacontract.org/2004/07/MonoTests.System.Runtime.Serialization");
+                       nsmgr.AddNamespace ("n", "http://schemas.datacontract.org/2004/07/System.Net");
+                       nsmgr.AddNamespace ("a", "http://schemas.microsoft.com/2003/10/Serialization/Arrays");
+
+                       Assert.AreEqual (1, doc.SelectNodes ("/root/IPAddresses/item", nsmgr).Count, "#1");
+                       XmlElement el = doc.SelectSingleNode ("/root/IPAddresses/item/Data", nsmgr) as XmlElement;
+                       Assert.IsNotNull (el, "#3");
+                       Assert.AreEqual (4, el.SelectNodes ("item", nsmgr).Count, "#4");
+               }
+
+               [Test]
+               public void MaxItemsInObjectGraph1 ()
+               {
+                       // object count == maximum
+                       DataContractJsonSerializer s = new DataContractJsonSerializer (typeof (DCEmpty), null, 1, false, null, false);
+                       s.WriteObject (XmlWriter.Create (TextWriter.Null), new DCEmpty ());
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void MaxItemsInObjectGraph2 ()
+               {
+                       // object count > maximum
+                       DataContractJsonSerializer s = new DataContractJsonSerializer (typeof (DCSimple1), null, 1, false, null, false);
+                       s.WriteObject (XmlWriter.Create (TextWriter.Null), new DCSimple1 ());
+               }
+
+               [Test]
+               public void DeserializeString ()
+               {
+                       Assert.AreEqual ("ABC", Deserialize ("\"ABC\"", typeof (string)));
+               }
+
+               [Test]
+               public void DeserializeInt ()
+               {
+                       Assert.AreEqual (5, Deserialize ("5", typeof (int)));
+               }
+
+               [Test]
+               public void DeserializeArray ()
+               {
+                       int [] ret = (int []) Deserialize ("[5,6,7]", typeof (int []));
+                       Assert.AreEqual (5, ret [0], "#1");
+                       Assert.AreEqual (6, ret [1], "#2");
+                       Assert.AreEqual (7, ret [2], "#3");
+               }
+
+               [Test]
+               public void DeserializeArrayUntyped ()
+               {
+                       object [] ret = (object []) Deserialize ("[5,6,7]", typeof (object []));
+                       Assert.AreEqual (5, ret [0], "#1");
+                       Assert.AreEqual (6, ret [1], "#2");
+                       Assert.AreEqual (7, ret [2], "#3");
+               }
+
+               [Test]
+               public void DeserializeMixedArray ()
+               {
+                       object [] ret = (object []) Deserialize ("[5,\"6\",false]", typeof (object []));
+                       Assert.AreEqual (5, ret [0], "#1");
+                       Assert.AreEqual ("6", ret [1], "#2");
+                       Assert.AreEqual (false, ret [2], "#3");
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeEmptyAsString ()
+               {
+                       // it somehow expects "root" which should have been already consumed.
+                       Deserialize ("", typeof (string));
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeEmptyAsInt ()
+               {
+                       // it somehow expects "root" which should have been already consumed.
+                       Deserialize ("", typeof (int));
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeEmptyAsDBNull ()
+               {
+                       // it somehow expects "root" which should have been already consumed.
+                       Deserialize ("", typeof (DBNull));
+               }
+
+               [Test]
+               public void DeserializeEmptyObjectAsString ()
+               {
+                       // looks like it is converted to ""
+                       Assert.AreEqual (String.Empty, Deserialize ("{}", typeof (string)));
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeEmptyObjectAsInt ()
+               {
+                       Deserialize ("{}", typeof (int));
+               }
+
+               [Test]
+               public void DeserializeEmptyObjectAsDBNull ()
+               {
+                       Assert.AreEqual (DBNull.Value, Deserialize ("{}", typeof (DBNull)));
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeEnumByName ()
+               {
+                       // enum is parsed into long
+                       Deserialize (@"""Red""", typeof (Colors));
+               }
+
+               [Test]
+               public void DeserializeEnum2 ()
+               {
+                       object o = Deserialize ("0", typeof (Colors));
+
+                       Assert.AreEqual (typeof (Colors), o.GetType (), "#de3");
+                       Colors c = (Colors) o;
+                       Assert.AreEqual (Colors.Red, c, "#de4");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void DeserializeEnumInvalid ()
+               {
+                       Deserialize ("", typeof (Colors));
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               [Ignore ("NotDotNet")] // 0.0 is an invalid Colors value.
+               public void DeserializeEnumInvalid3 ()
+               {
+                       //"0.0" instead of "0"
+                       Deserialize (
+                               "0.0",
+                               typeof (Colors));
+               }
+
+               [Test]
+               public void DeserializeEnumWithDC ()
+               {
+                       object o = Deserialize ("0", typeof (ColorsWithDC));
+                       
+                       Assert.AreEqual (typeof (ColorsWithDC), o.GetType (), "#de5");
+                       ColorsWithDC cdc = (ColorsWithDC) o;
+                       Assert.AreEqual (ColorsWithDC.Red, o, "#de6");
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               [Ignore ("NotDotNet")] // 4 is an invalid Colors value.
+               [Category ("NotWorking")]
+               public void DeserializeEnumWithDCInvalid ()
+               {
+                       Deserialize (
+                               "4",
+                               typeof (ColorsWithDC));
+               }
+
+               [Test]
+               public void DeserializeDCWithEnum ()
+               {
+                       object o = Deserialize (
+                               "{\"_colors\":0}",
+                               typeof (DCWithEnum));
+
+                       Assert.AreEqual (typeof (DCWithEnum), o.GetType (), "#de7");
+                       DCWithEnum dc = (DCWithEnum) o;
+                       Assert.AreEqual (Colors.Red, dc.colors, "#de8");
+               }
+
+               [Test]
+               public void ReadObjectVerifyObjectNameFalse ()
+               {
+                       string xml = @"<any><Member1>bar</Member1></any>";
+                       object o = new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
+                               .ReadObject (XmlReader.Create (new StringReader (xml)), false);
+                       Assert.IsTrue (o is VerifyObjectNameTestData, "#1");
+
+                       string xml2 = @"<any><x:Member1 xmlns:x=""http://schemas.datacontract.org/2004/07/MonoTests.System.Runtime.Serialization"">bar</x:Member1></any>";
+                       o = new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
+                               .ReadObject (XmlReader.Create (new StringReader (xml2)), false);
+                       Assert.IsTrue (o is VerifyObjectNameTestData, "#2");
+               }
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void ReadObjectVerifyObjectNameTrue ()
+               {
+                       string xml = @"<any><Member1>bar</Member1></any>";
+                       new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
+                               .ReadObject (XmlReader.Create (new StringReader (xml)), true);
+               }
+
+               [Test] // member name is out of scope
+               public void ReadObjectVerifyObjectNameTrue2 ()
+               {
+                       string xml = @"<root><Member2>bar</Member2></root>";
+                       new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
+                               .ReadObject (XmlReader.Create (new StringReader (xml)), true);
+               }
+
+               [Test]
+               public void ReadTypedObjectJson ()
+               {
+                       object o = Deserialize (@"{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0}", typeof (DCWithEnum));
+                       Assert.AreEqual (typeof (DCWithEnum), o.GetType ());
+               }
+
+               [Test]
+               public void ReadObjectDCArrayJson ()
+               {
+                       object o = Deserialize (@"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0}]",
+                               typeof (object []), typeof (DCWithEnum));
+                       Assert.AreEqual (typeof (object []), o.GetType (), "#1");
+                       object [] arr = (object []) o;
+                       Assert.AreEqual (typeof (DCWithEnum), arr [0].GetType (), "#2");
+               }
+
+               [Test]
+               public void ReadObjectDCArray2Json ()
+               {
+                       object o = Deserialize (@"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0},{""__type"":""DCSimple1:#MonoTests.System.Runtime.Serialization.Json"",""Foo"":""hello""}]",
+                               typeof (object []), typeof (DCWithEnum), typeof (DCSimple1));
+                       Assert.AreEqual (typeof (object []), o.GetType (), "#1");
+                       object [] arr = (object []) o;
+                       Assert.AreEqual (typeof (DCWithEnum), arr [0].GetType (), "#2");
+                       Assert.AreEqual (typeof (DCSimple1), arr [1].GetType (), "#3");
+               }
+
+               private object Deserialize (string xml, Type type, params Type [] knownTypes)
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer (type, knownTypes);
+                       XmlReader xr = JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (xml), new XmlDictionaryReaderQuotas ());
+                       return ser.ReadObject (xr);
+               }
+
+               public T Deserialize<T>(string json)
+               {
+                       var bytes = Encoding.Unicode.GetBytes (json);
+                       using (MemoryStream stream = new MemoryStream (bytes)) {
+                               var serializer = new DataContractJsonSerializer (typeof(T));
+                               return (T)serializer.ReadObject (stream);       
+                       }
+               }
+
+               [Test]
+               public void IsStartObject ()
+               {
+                       DataContractJsonSerializer s = new DataContractJsonSerializer (typeof (DCSimple1));
+                       Assert.IsTrue (s.IsStartObject (XmlReader.Create (new StringReader ("<root></root>"))), "#1");
+                       Assert.IsFalse (s.IsStartObject (XmlReader.Create (new StringReader ("<dummy></dummy>"))), "#2");
+                       Assert.IsFalse (s.IsStartObject (XmlReader.Create (new StringReader ("<Foo></Foo>"))), "#3");
+                       Assert.IsFalse (s.IsStartObject (XmlReader.Create (new StringReader ("<root xmlns='urn:foo'></root>"))), "#4");
+               }
+
+               [Test]
+               public void SerializeNonDC2 ()
+               {
+                       var ser = new DataContractJsonSerializer (typeof (TestData));
+                       StringWriter sw = new StringWriter ();
+                       var obj = new TestData () { Foo = "foo", Bar = "bar", Baz = "baz" };
+
+                       // XML
+                       using (var xw = XmlWriter.Create (sw))
+                               ser.WriteObject (xw, obj);
+                       var s = sw.ToString ();
+                       // since the order is not preserved, we compare only contents.
+                       Assert.IsTrue (s.IndexOf ("<Foo>foo</Foo>") > 0, "#1-1");
+                       Assert.IsTrue (s.IndexOf ("<Bar>bar</Bar>") > 0, "#1-2");
+                       Assert.IsFalse (s.IndexOf ("<Baz>baz</Baz>") > 0, "#1-3");
+
+                       // JSON
+                       MemoryStream ms = new MemoryStream ();
+                       using (var xw = JsonReaderWriterFactory.CreateJsonWriter (ms))
+                               ser.WriteObject (ms, obj);
+                       s = new StreamReader (new MemoryStream (ms.ToArray ())).ReadToEnd ().Replace ('"', '/');
+                       // since the order is not preserved, we compare only contents.
+                       Assert.IsTrue (s.IndexOf ("/Foo/:/foo/") > 0, "#2-1");
+                       Assert.IsTrue (s.IndexOf ("/Bar/:/bar/") > 0, "#2-2");
+                       Assert.IsFalse (s.IndexOf ("/Baz/:/baz/") > 0, "#2-3");
+               }
+
+               [Test]
+               public void AlwaysEmitTypeInformation ()
+               {
+                       var ms = new MemoryStream ();
+                       var ds = new DataContractJsonSerializer (typeof (string), "root", null, 10, false, null, true);
+                       ds.WriteObject (ms, "foobar");
+                       var s = Encoding.UTF8.GetString (ms.ToArray ());
+                       Assert.AreEqual ("\"foobar\"", s, "#1");
+               }
+
+               [Test]
+               public void AlwaysEmitTypeInformation2 ()
+               {
+                       var ms = new MemoryStream ();
+                       var ds = new DataContractJsonSerializer (typeof (TestData), "root", null, 10, false, null, true);
+                       ds.WriteObject (ms, new TestData () { Foo = "foo"});
+                       var s = Encoding.UTF8.GetString (ms.ToArray ());
+                       Assert.AreEqual (@"{""__type"":""TestData:#MonoTests.System.Runtime.Serialization.Json"",""Bar"":null,""Foo"":""foo""}", s, "#1");
+               }
+
+               [Test]
+               public void AlwaysEmitTypeInformation3 ()
+               {
+                       var ms = new MemoryStream ();
+                       var ds = new DataContractJsonSerializer (typeof (TestData), "root", null, 10, false, null, false);
+                       ds.WriteObject (ms, new TestData () { Foo = "foo"});
+                       var s = Encoding.UTF8.GetString (ms.ToArray ());
+                       Assert.AreEqual (@"{""Bar"":null,""Foo"":""foo""}", s, "#1");
+               }
+
+               [Test]
+               public void TestNonpublicDeserialization ()
+               {
+                       string s1= @"{""Bar"":""bar"", ""Foo"":""foo"", ""Baz"":""baz""}";
+                       TestData o1 = ((TestData)(new DataContractJsonSerializer (typeof (TestData)).ReadObject (JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (s1), new XmlDictionaryReaderQuotas ()))));
+
+                       Assert.AreEqual (null, o1.Baz, "#1");
+
+                        string s2 = @"{""TestData"":[{""key"":""key1"",""value"":""value1""}]}";
+                        KeyValueTestData o2 = ((KeyValueTestData)(new DataContractJsonSerializer (typeof (KeyValueTestData)).ReadObject (JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (s2), new XmlDictionaryReaderQuotas ()))));
+
+                       Assert.AreEqual (1, o2.TestData.Count, "#2");
+                       Assert.AreEqual ("key1", o2.TestData[0].Key, "#3");
+                       Assert.AreEqual ("value1", o2.TestData[0].Value, "#4");
+               }
+
+               // [Test] use this case if you want to check lame silverlight parser behavior. Seealso #549756
+               public void QuotelessDeserialization ()
+               {
+                       string s1 = @"{FooMember:""value""}";
+                       var ds = new DataContractJsonSerializer (typeof (DCWithName));
+                       ds.ReadObject (new MemoryStream (Encoding.UTF8.GetBytes (s1)));
+
+                       string s2 = @"{FooMember:"" \""{dummy:string}\""""}";
+                       ds.ReadObject (new MemoryStream (Encoding.UTF8.GetBytes (s2)));
+               }
+
+               [Test]
+               [Category ("NotWorking")]
+               public void TypeIsNotPartsOfKnownTypes ()
+               {
+                       var dcs = new DataContractSerializer (typeof (string));
+                       Assert.AreEqual (0, dcs.KnownTypes.Count, "KnownTypes #1");
+                       var dcjs = new DataContractJsonSerializer (typeof (string));
+                       Assert.AreEqual (0, dcjs.KnownTypes.Count, "KnownTypes #2");
+               }
+
+               [Test]
+               public void ReadWriteNullObject ()
+               {
+                       DataContractJsonSerializer dcjs = new DataContractJsonSerializer (typeof (string));
+                       using (MemoryStream ms = new MemoryStream ()) {
+                               dcjs.WriteObject (ms, null);
+                               ms.Position = 0;
+                               using (StreamReader sr = new StreamReader (ms)) {
+                                       string data = sr.ReadToEnd ();
+                                       Assert.AreEqual ("null", data, "WriteObject(stream,null)");
+
+                                       ms.Position = 0;
+                                       Assert.IsNull (dcjs.ReadObject (ms), "ReadObject(stream)");
+                               }
+                       };
+               }
+
+               object ReadWriteObject (Type type, object obj, string expected)
+               {
+                       using (MemoryStream ms = new MemoryStream ()) {
+                               DataContractJsonSerializer dcjs = new DataContractJsonSerializer (type);
+                               dcjs.WriteObject (ms, obj);
+                               ms.Position = 0;
+                               using (StreamReader sr = new StreamReader (ms)) {
+                                       Assert.AreEqual (expected, sr.ReadToEnd (), "WriteObject");
+
+                                       ms.Position = 0;
+                                       return dcjs.ReadObject (ms);
+                               }
+                       }
+               }
+
+               [Test]
+               [Ignore ("Wrong test case. See bug #573691")]
+               public void ReadWriteObject_Single_SpecialCases ()
+               {
+                       Assert.IsTrue (Single.IsNaN ((float) ReadWriteObject (typeof (float), Single.NaN, "NaN")));
+                       Assert.IsTrue (Single.IsNegativeInfinity ((float) ReadWriteObject (typeof (float), Single.NegativeInfinity, "-INF")));
+                       Assert.IsTrue (Single.IsPositiveInfinity ((float) ReadWriteObject (typeof (float), Single.PositiveInfinity, "INF")));
+               }
+
+               [Test]
+               [Ignore ("Wrong test case. See bug #573691")]
+               public void ReadWriteObject_Double_SpecialCases ()
+               {
+                       Assert.IsTrue (Double.IsNaN ((double) ReadWriteObject (typeof (double), Double.NaN, "NaN")));
+                       Assert.IsTrue (Double.IsNegativeInfinity ((double) ReadWriteObject (typeof (double), Double.NegativeInfinity, "-INF")));
+                       Assert.IsTrue (Double.IsPositiveInfinity ((double) ReadWriteObject (typeof (double), Double.PositiveInfinity, "INF")));
+               }
+
+               [Test]
+               public void ReadWriteDateTime ()
+               {
+                       var ms = new MemoryStream ();
+                       DataContractJsonSerializer serializer = new DataContractJsonSerializer (typeof (Query));
+                       Query query = new Query () {
+                               StartDate = DateTime.SpecifyKind (new DateTime (2010, 3, 4, 5, 6, 7), DateTimeKind.Utc),
+                               EndDate = DateTime.SpecifyKind (new DateTime (2010, 4, 5, 6, 7, 8), DateTimeKind.Utc)
+                               };
+                       serializer.WriteObject (ms, query);
+                       Assert.AreEqual ("{\"StartDate\":\"\\/Date(1267679167000)\\/\",\"EndDate\":\"\\/Date(1270447628000)\\/\"}", Encoding.UTF8.GetString (ms.ToArray ()), "#1");
+                       ms.Position = 0;
+                       Console.WriteLine (new StreamReader (ms).ReadToEnd ());
+                       ms.Position = 0;
+                       var q = (Query) serializer.ReadObject(ms);
+                       Assert.AreEqual (query.StartDate, q.StartDate, "#2");
+                       Assert.AreEqual (query.EndDate, q.EndDate, "#3");
+               }
+
+               [DataContract(Name = "DateTest")]
+               public class DateTest
+               {
+                       [DataMember(Name = "should_have_value")]
+                       public DateTime? ShouldHaveValue { get; set; }
+               }
+
+               //
+               // This tests both the extended format "number-0500" as well
+               // as the nullable field in the structure
+               [Test]
+               public void BugXamarin163 ()
+               {
+                       string json = @"{""should_have_value"":""\/Date(1277355600000)\/""}";
+
+                       byte[] bytes = global::System.Text.Encoding.UTF8.GetBytes(json);
+                       Stream inputStream = new MemoryStream(bytes);
+                       
+                       DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DateTest));
+                       DateTest t = serializer.ReadObject(inputStream) as DateTest;
+                       Assert.AreEqual (634129524000000000, t.ShouldHaveValue.Value.Ticks, "#1");
+               }
+
+               [Test]
+               public void NullableFieldsShouldSupportNullValue ()
+               {
+                       string json = @"{""should_have_value"":null}";
+                       var inputStream = new MemoryStream (Encoding.UTF8.GetBytes (json));
+                       DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DateTest));
+                       Console.WriteLine ("# serializer assembly: {0}", serializer.GetType ().Assembly.Location);
+                       DateTest t = serializer.ReadObject (inputStream) as DateTest;
+                       Assert.AreEqual (false, t.ShouldHaveValue.HasValue, "#2");
+               }
+               
+               [Test]
+               public void DeserializeNullMember ()
+               {
+                       var ds = new DataContractJsonSerializer (typeof (ClassA));
+                       var stream = new MemoryStream ();
+                       var a = new ClassA ();
+                       ds.WriteObject (stream, a);
+                       stream.Position = 0;
+                       a = (ClassA) ds.ReadObject (stream);
+                       Assert.IsNull (a.B, "#1");
+               }
+
+               [Test]
+               public void OnDeserializationMethods ()
+               {
+                       var ds = new DataContractJsonSerializer (typeof (GSPlayerListErg));
+                       var obj = new GSPlayerListErg ();
+                       var ms = new MemoryStream ();
+                       ds.WriteObject (ms, obj);
+                       ms.Position = 0;
+                       ds.ReadObject (ms);
+                       Assert.IsTrue (GSPlayerListErg.A, "A");
+                       Assert.IsTrue (GSPlayerListErg.B, "B");
+                       Assert.IsTrue (GSPlayerListErg.C, "C");
+               }
+               
+               [Test]
+               public void WriteChar ()
+               {
+                       DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof (CharTest));
+                       using (MemoryStream ms = new MemoryStream()) {
+                               serializer.WriteObject(ms, new CharTest ());
+                               ms.Position = 0L;
+                               using (StreamReader reader = new StreamReader(ms)) {
+                                       reader.ReadToEnd();
+                               }
+                       }
+               }
+
+               [Test]
+               public void DictionarySerialization ()
+               {
+                       var dict = new JsonMyDictionary<string,string> ();
+                       dict.Add ("key", "value");
+                       var serializer = new DataContractJsonSerializer (dict.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, dict);
+                       stream.Position = 0;
+
+                       Assert.AreEqual ("[{\"Key\":\"key\",\"Value\":\"value\"}]", new StreamReader (stream).ReadToEnd (), "#1");
+                       stream.Position = 0;
+                       dict = (JsonMyDictionary<string,string>) serializer.ReadObject (stream);
+                       Assert.AreEqual (1, dict.Count, "#2");
+                       Assert.AreEqual ("value", dict ["key"], "#3");
+               }
+
+               [Test]
+               public void ExplicitCustomDictionarySerialization ()
+               {
+                       var dict = new MyExplicitDictionary<string,string> ();
+                       dict.Add ("key", "value");
+                       var serializer = new DataContractJsonSerializer (dict.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, dict);
+                       stream.Position = 0;
+
+                       Assert.AreEqual ("[{\"Key\":\"key\",\"Value\":\"value\"}]", new StreamReader (stream).ReadToEnd (), "#1");
+                       stream.Position = 0;
+                       dict = (MyExplicitDictionary<string,string>) serializer.ReadObject (stream);
+                       Assert.AreEqual (1, dict.Count, "#2");
+                       Assert.AreEqual ("value", dict ["key"], "#3");
+               }
+
+               [Test]
+               public void Bug13485 ()
+               {
+                       const string json = "{ \"Name\" : \"Test\", \"Value\" : \"ValueA\" }";
+
+                       string result = string.Empty;
+                       var serializer = new DataContractJsonSerializer (typeof (Bug13485Type));
+                       Bug13485Type entity;
+                       using (var stream = new MemoryStream (Encoding.UTF8.GetBytes (json)))
+                               entity = (Bug13485Type) serializer.ReadObject (stream);
+
+                       result = entity.GetValue;
+                       Assert.AreEqual ("ValueA", result, "#1");
+               }
+
+               [DataContract(Name = "UriTest")]
+               public class UriTest
+               {
+                       [DataMember(Name = "members")]
+                       public Uri MembersRelativeLink { get; set; }
+               }
+
+               [Test]
+               public void Bug15169 ()
+               {
+                       const string json = "{\"members\":\"foo/bar/members\"}";
+                       var serializer = new DataContractJsonSerializer (typeof (UriTest));
+                       UriTest entity;
+                       using (var stream = new MemoryStream (Encoding.UTF8.GetBytes (json)))
+                               entity = (UriTest) serializer.ReadObject (stream);
+
+                       Assert.AreEqual ("foo/bar/members", entity.MembersRelativeLink.ToString ());
+               }
+               
+               #region Test methods for collection serialization
+               
+               [Test]
+               public void TestArrayListSerialization ()
+               {
+                       var collection = new ArrayListContainer ();
+                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
+                       var expectedItemsCount = 4;
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+
+                       stream.Position = 0;
+                       collection = (ArrayListContainer) serializer.ReadObject (stream);
+                       
+                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestBitArraySerialization ()
+               {
+                       var collection = new BitArrayContainer ();
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+               
+               [Test]
+               public void TestHashtableSerialization ()
+               {
+                       var collection = new HashtableContainer ();
+                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void TestHashtableDeserialization ()
+               {
+                       var collection = new HashtableContainer ();
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       serializer.ReadObject (stream);
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestQueueSerialization ()
+               {
+                       var collection = new QueueContainer ();
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+               
+               [Test]
+               public void TestSortedListSerialization ()
+               {
+                       var collection = new SortedListContainer ();
+                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void TestSortedListDeserialization ()
+               {
+                       var collection = new SortedListContainer ();
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       serializer.ReadObject (stream);
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestStackSerialization ()
+               {
+                       var collection = new StackContainer ();
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+               
+               [Test]
+               public void TestEnumerableWithAddSerialization ()
+               {
+                       var collection = new EnumerableWithAddContainer ();
+                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
+                       var expectedItemsCount = 4;
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+
+                       stream.Position = 0;
+                       collection = (EnumerableWithAddContainer) serializer.ReadObject (stream);
+                       
+                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestEnumerableWithSpecialAddSerialization ()
+               {
+                       var collection = new EnumerableWithSpecialAddContainer ();                      
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+       
+               [Test]
+               public void TestHashSetSerialization ()
+               {
+                       var collection = new GenericHashSetContainer ();
+                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
+                       var expectedItemsCount = 2;
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+
+                       stream.Position = 0;
+                       collection = (GenericHashSetContainer) serializer.ReadObject (stream);
+                       
+                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
+               }
+               
+               [Test]
+               public void TestLinkedListSerialization ()
+               {
+                       var collection = new GenericLinkedListContainer ();
+                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
+                       var expectedItemsCount = 4;
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+
+                       stream.Position = 0;
+                       collection = (GenericLinkedListContainer) serializer.ReadObject (stream);
+                       
+                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestGenericQueueSerialization ()
+               {
+                       var collection = new GenericQueueContainer ();                  
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestGenericStackSerialization ()
+               {
+                       var collection = new GenericStackContainer ();                  
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+               
+               [Test]
+               public void TestGenericDictionarySerialization ()
+               {
+                       var collection = new GenericDictionaryContainer ();                     
+                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void TestGenericDictionaryDeserialization ()
+               {
+                       var collection = new GenericDictionaryContainer ();                     
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       serializer.ReadObject (stream);
+               }
+               
+               [Test]
+               public void TestGenericSortedListSerialization ()
+               {
+                       var collection = new GenericSortedListContainer ();                     
+                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void TestGenericSortedListDeserialization ()
+               {
+                       var collection = new GenericSortedListContainer ();                     
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       serializer.ReadObject (stream);
+               }
+               
+               [Test]
+               public void TestGenericSortedDictionarySerialization ()
+               {
+                       var collection = new GenericSortedDictionaryContainer ();                       
+                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void TestGenericSortedDictionaryDeserialization ()
+               {
+                       var collection = new GenericSortedDictionaryContainer ();                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+                       
+                       stream.Position = 0;
+                       serializer.ReadObject (stream);
+               }
+               
+               [Test]
+               public void TestGenericEnumerableWithAddSerialization ()
+               {
+                       var collection = new GenericEnumerableWithAddContainer ();
+                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
+                       var expectedItemsCount = 4;
+                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+
+                       stream.Position = 0;
+                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
+
+                       stream.Position = 0;
+                       collection = (GenericEnumerableWithAddContainer) serializer.ReadObject (stream);
+                       
+                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestGenericEnumerableWithSpecialAddSerialization ()
+               {
+                       var collection = new GenericEnumerableWithSpecialAddContainer ();                       
+                       var serializer = new DataContractJsonSerializer (collection.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, collection);
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidDataContractException))]
+               public void TestNonCollectionGetOnlyProperty ()
+               {
+                       var o = new NonCollectionGetOnlyContainer ();                   
+                       var serializer = new DataContractJsonSerializer (o.GetType ());
+                       var stream = new MemoryStream ();
+                       serializer.WriteObject (stream, o);
+               }
+               
+               // properly deserialize object with a polymorphic property (known derived type)
+               [Test]
+               public void Bug23058()
+               {
+                       string serializedObj = @"{""PolymorphicProperty"":{""__type"":""KnownDerivedType:#MonoTests.System.Runtime.Serialization.Json"",""BaseTypeProperty"":""Base"",""DerivedProperty"":""Derived 1""},""Name"":""Parent2""}";
+                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
+
+                       Assert.AreEqual (deserializedObj.PolymorphicProperty.GetType ().FullName, "MonoTests.System.Runtime.Serialization.Json.KnownDerivedType");
+                       Assert.AreEqual (deserializedObj.PolymorphicProperty.BaseTypeProperty, "Base");
+                       Assert.AreEqual ((deserializedObj.PolymorphicProperty as KnownDerivedType).DerivedProperty, "Derived 1");
+                       Assert.AreEqual (deserializedObj.Name, "Parent2");
+               }
+
+               // properly deserialize object with a polymorphic property (base type with __type hint)
+               [Test]
+               public void DeserializeBaseTypePropHint()
+               {
+                       string serializedObj = @"{""PolymorphicProperty"":{""__type"":""BaseType:#MonoTests.System.Runtime.Serialization.Json"",""BaseTypeProperty"":""Base""},""Name"":""Parent2""}";
+                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
+
+                       Assert.AreEqual (deserializedObj.PolymorphicProperty.GetType ().FullName, "MonoTests.System.Runtime.Serialization.Json.BaseType");
+                       Assert.AreEqual (deserializedObj.PolymorphicProperty.BaseTypeProperty, "Base");
+               }
+
+               // properly deserialize object with a polymorphic property (base type with __type hint)
+               [Test]
+               public void DeserializeBaseTypePropNoHint()
+               {
+                       string serializedObj = @"{""PolymorphicProperty"":{""BaseTypeProperty"":""Base""},""Name"":""Parent2""}";
+                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
+
+                       Assert.AreEqual (deserializedObj.PolymorphicProperty.GetType ().FullName, "MonoTests.System.Runtime.Serialization.Json.BaseType");
+                       Assert.AreEqual (deserializedObj.PolymorphicProperty.BaseTypeProperty, "Base");
+               }
+
+               // properly fail deserializing object with a polymorphic property (unknown derived type)
+               [ExpectedException (typeof (SerializationException))]
+               [Test]
+               public void FailDeserializingUnknownTypeProp()
+               {
+                       string serializedObj = @"{""PolymorphicProperty"":{""__type"":""UnknownDerivedType:#MonoTests.System.Runtime.Serialization.Json"",""BaseTypeProperty"":""Base"",""DerivedProperty"":""Derived 1""},""Name"":""Parent2""}";
+                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
+               }
+
+               [Test]
+               public void SubclassTest ()
+               {
+                       var knownTypes = new List<Type> { typeof(IntList) };
+                       var serializer = new DataContractJsonSerializer(typeof(ListOfNumbers), knownTypes);
+
+                       string json = "{\"Numbers\": [85]}";
+                       using (var stream = new MemoryStream(UTF8Encoding.Default.GetBytes(json)))
+                       {
+                               var nums = (ListOfNumbers)serializer.ReadObject(stream);
+                               Assert.AreEqual (1, nums.Numbers.Count);
+                       }
+               }
+               [DataContract]
+               public class ListOfNumbers
+               {
+                       [DataMember]
+                       public IntList Numbers;
+               }
+
+               public class IntList : List<int>{}
+               #endregion
+
+               [Test]
+               public void DefaultValueDeserialization ()
+               {
+                       // value type
+                       var person = new JsonPerson { name = "John" };
+                       using (var ms = new MemoryStream()) {
+                               var serializer = new DataContractJsonSerializer (typeof (JsonPerson), new DataContractJsonSerializerSettings {
+                                       SerializeReadOnlyTypes = true,
+                                       UseSimpleDictionaryFormat = true
+                                       });
+                               serializer.WriteObject (ms, person);
+                       }
+
+                       // reference type
+                       var person2 = new PersonWithContact {
+                               name = "Jane",
+                               contact = new Contact { url = "localhost", email = "jane@localhost" } };
+                       using (var ms = new MemoryStream ()) {
+                               var serializer = new DataContractJsonSerializer (typeof (PersonWithContact), new DataContractJsonSerializerSettings {
+                                       SerializeReadOnlyTypes = true,
+                                       UseSimpleDictionaryFormat = true
+                                       });
+                               serializer.WriteObject (ms, person2);
+                       }
+               }
+
+               [Test]
+               public void Bug15028()
+               {
+                       DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Bug15028));
+                       using (MemoryStream memoryStream = new MemoryStream())
+                       {
+                               ser.WriteObject(memoryStream, new Bug15028());
+                               string output = Encoding.Default.GetString(memoryStream.ToArray());
+                               Assert.AreEqual(@"{""Int0"":1,""Int1"":1,""IntZero1"":0,""Str0"":"""",""Str1"":"""",""StrNull1"":null}", output);
+                       }
+               }
+
+               [Test]
+               public void Bug4230()
+               {
+                       string serializedObj = @"{ ""Notifications"": null }";
+                       Bug4230Response deserializedObj = Deserialize<Bug4230Response> (serializedObj);
+
+                       Assert.IsNull (deserializedObj.Notifications);
+               }
+       }
+
+       public class Bug4230Notification {
+       }
+
+       public class Bug4230Response
+       {
+               public Bug4230Notification[] Notifications
+               {
+                       get;
+                       set;
+               }
+       }
+
+       [DataContract]
+       public class Bug15028
+       {
+               [DataMember(EmitDefaultValue = false)]
+               public string StrNull0 { get; private set; }
+
+               [DataMember(EmitDefaultValue = false)]
+               public string Str0 { get; private set; }
+
+               [DataMember(EmitDefaultValue = true)]
+               public string StrNull1 { get; private set; }
+
+               [DataMember(EmitDefaultValue = true)]
+               public string Str1 { get; private set; }
+
+               [DataMember(EmitDefaultValue = false)]
+               public int IntZero0 { get; private set; }
+
+               [DataMember(EmitDefaultValue = false)]
+               public int Int0 { get; private set; }
+
+               [DataMember(EmitDefaultValue = true)]
+               public int IntZero1 { get; private set; }
+
+               [DataMember(EmitDefaultValue = true)]
+               public int Int1 { get; private set; }
+
+               public Bug15028()
+               {
+                       Str0 = string.Empty;
+                       Str1 = string.Empty;
+                       Int0 = 1;
+                       Int1 = 1;
+               }
+       }
+
+       public class CharTest
+       {
+               public char Foo;
+       }
+
+       public class TestData
+       {
+               public string Foo { get; set; }
+               public string Bar { get; set; }
+               internal string Baz { get; set; }
+       }
+
+       public enum Colors {
+               Red, Green, Blue
+       }
+
+       [DataContract (Name = "_ColorsWithDC")]
+       public enum ColorsWithDC {
+
+               [EnumMember (Value = "_Red")]
+               Red, 
+               [EnumMember]
+               Green, 
+               Blue
+       }
+
+
+       public enum ColorsEnumMemberNoDC {
+               [EnumMember (Value = "_Red")]
+               Red, 
+               [EnumMember]
+               Green, 
+               Blue
+       }
+
+       [DataContract]
+       public class DCWithEnum {
+               [DataMember (Name = "_colors")]
+               public Colors colors;
+       }
+
+       [DataContract]
+       public class DCEmpty
+       {
+               // serializer doesn't touch it.
+               public string Foo = "TEST";
+       }
+
+       [DataContract]
+       public class DCSimple1
+       {
+               [DataMember]
+               public string Foo = "TEST";
+       }
+
+       [DataContract]
+       public class DCHasNonDC
+       {
+               [DataMember]
+               public NonDC Hoge= new NonDC ();
+       }
+
+       public class NonDC
+       {
+               public string Whee = "whee!";
+       }
+
+       [DataContract]
+       public class DCHasSerializable
+       {
+               [DataMember]
+               public SimpleSer1 Ser = new SimpleSer1 ();
+       }
+
+       [DataContract (Name = "Foo")]
+       public class DCWithName
+       {
+               [DataMember (Name = "FooMember")]
+               public string DMWithName = "value";
+       }
+
+       [DataContract (Name = "")]
+       public class DCWithEmptyName
+       {
+               [DataMember]
+               public string Foo;
+       }
+
+       [DataContract (Name = null)]
+       public class DCWithNullName
+       {
+               [DataMember]
+               public string Foo;
+       }
+
+       [DataContract (Namespace = "")]
+       public class DCWithEmptyNamespace
+       {
+               [DataMember]
+               public string Foo;
+       }
+
+       [Serializable]
+       public class SimpleSer1
+       {
+               public string Doh = "doh!";
+       }
+
+       public class Wrapper
+       {
+               [DataContract]
+               public class DCWrapped
+               {
+               }
+       }
+
+       [DataContract]
+       public class CollectionContainer
+       {
+               Collection<string> items = new Collection<string> ();
+
+               [DataMember]
+               public Collection<string> Items {
+                       get { return items; }
+               }
+       }
+
+       [CollectionDataContract]
+       public class DataCollection<T> : Collection<T>
+       {
+       }
+
+       [DataContract]
+       public class DataCollectionContainer
+       {
+               DataCollection<string> items = new DataCollection<string> ();
+
+               [DataMember]
+               public DataCollection<string> Items {
+                       get { return items; }
+               }
+       }
+
+       [DataContract]
+       class SerializeNonDCArrayType
+       {
+               [DataMember]
+               public NonDCItem [] IPAddresses = new NonDCItem [0];
+       }
+
+       public class NonDCItem
+       {
+               public byte [] Data { get; set; }
+       }
+
+       [DataContract]
+       public class VerifyObjectNameTestData
+       {
+               [DataMember]
+               string Member1 = "foo";
+       }
+
+       [Serializable]
+       public class KeyValueTestData {
+               public List<KeyValuePair<string,string>> TestData = new List<KeyValuePair<string,string>>();
+       }
+
+       [DataContract] // bug #586169
+       public class Query
+       {
+               [DataMember (Order=1)]
+               public DateTime StartDate { get; set; }
+               [DataMember (Order=2)]
+               public DateTime EndDate { get; set; }
+       }
+
+       public class ClassA {
+               public ClassB B { get; set; }
+       }
+
+       public class ClassB
+       {
+       }
+
+       public class GSPlayerListErg
+       {
+               public GSPlayerListErg ()
+               {
+                       Init ();
+               }
+
+               void Init ()
+               {
+                       C = true;
+                       ServerTimeUTC = DateTime.SpecifyKind (DateTime.MinValue, DateTimeKind.Utc);
+               }
+
+               [OnDeserializing]
+               public void OnDeserializing (StreamingContext c)
+               {
+                       A = true;
+                       Init ();
+               }
+
+               [OnDeserialized]
+               void OnDeserialized (StreamingContext c)
+               {
+                       B = true;
+               }
+
+               public static bool A, B, C;
+
+               [DataMember (Name = "T")]
+               public long CodedServerTimeUTC { get; set; }
+               public DateTime ServerTimeUTC { get; set; }
+       }
+
+       #region polymorphism test helper classes
+
+       [DataContract]
+       [KnownType (typeof (KnownDerivedType))]
+       public class ParentType
+       {
+               [DataMember]
+               public string Name { get; set; }
+
+               [DataMember]
+               public BaseType PolymorphicProperty { get; set; }
+       }
+
+       [DataContract]
+       public class BaseType
+       {
+               [DataMember]
+               public string BaseTypeProperty { get; set; }
+       }
+
+       [DataContract]
+       public class KnownDerivedType : BaseType
+       {
+               [DataMemberAttribute]
+               public string DerivedProperty { get; set; }
+       }
+
+       [DataContract]
+       public class UnknownDerivedType : BaseType
+       {
+               [DataMember]
+               public string DerivedProperty { get; set; }
+       }
+
+       #endregion
+}
+
+[DataContract]
+class JsonGlobalSample1
+{
+}
+
+
+public class JsonMyDictionary<K, V> : System.Collections.Generic.IDictionary<K, V>
+{
+       Dictionary<K,V> dic = new Dictionary<K,V> ();
+
+       public void Add (K key, V value)
+       {
+               dic.Add (key,  value);
+       }
+
+       public bool ContainsKey (K key)
+       {
+               return dic.ContainsKey (key);
+       }
+
+       public ICollection<K> Keys {
+               get { return dic.Keys; }
+       }
+
+       public bool Remove (K key)
+       {
+               return dic.Remove (key);
+       }
+
+       public bool TryGetValue (K key, out V value)
+       {
+               return dic.TryGetValue (key, out value);
+       }
+
+       public ICollection<V> Values {
+               get { return dic.Values; }
+       }
+
+       public V this [K key] {
+               get { return dic [key]; }
+               set { dic [key] = value; }
+       }
+
+       IEnumerator IEnumerable.GetEnumerator ()
+       {
+               return dic.GetEnumerator ();
+       }
+
+       ICollection<KeyValuePair<K,V>> Coll {
+               get { return (ICollection<KeyValuePair<K,V>>) dic; }
+       }
+
+       public void Add (KeyValuePair<K, V> item)
+       {
+               Coll.Add (item);
+       }
+
+       public void Clear ()
+       {
+               dic.Clear ();
+       }
+
+       public bool Contains (KeyValuePair<K, V> item)
+       {
+               return Coll.Contains (item);
+       }
+
+       public void CopyTo (KeyValuePair<K, V> [] array, int arrayIndex)
+       {
+               Coll.CopyTo (array, arrayIndex);
+       }
+
+       public int Count {
+               get { return dic.Count; }
+       }
+
+       public bool IsReadOnly {
+               get { return Coll.IsReadOnly; }
+       }
+
+       public bool Remove (KeyValuePair<K, V> item)
+       {
+               return Coll.Remove (item);
+       }
+
+       public IEnumerator<KeyValuePair<K, V>> GetEnumerator ()
+       {
+               return Coll.GetEnumerator ();
+       }
+}
+
+public class MyExplicitDictionary<K, V> : IDictionary<K, V> {
+
+       Dictionary<K,V> dic = new Dictionary<K,V> ();
+
+       public void Add (K key, V value)
+       {
+               dic.Add (key,  value);
+       }
+
+       public bool ContainsKey (K key)
+       {
+               return dic.ContainsKey (key);
+       }
+
+       ICollection<K> IDictionary<K, V>.Keys {
+               get { return dic.Keys; }
+       }
+
+       public bool Remove (K key)
+       {
+               return dic.Remove (key);
+       }
+
+       public bool TryGetValue (K key, out V value)
+       {
+               return dic.TryGetValue (key, out value);
+       }
+
+       ICollection<V> IDictionary<K, V>.Values {
+               get { return dic.Values; }
+       }
+
+       public V this [K key] {
+               get { return dic [key]; }
+               set { dic [key] = value; }
+       }
+
+       IEnumerator IEnumerable.GetEnumerator ()
+       {
+               return dic.GetEnumerator ();
+       }
+
+       ICollection<KeyValuePair<K,V>> Coll {
+               get { return (ICollection<KeyValuePair<K,V>>) dic; }
+       }
+
+       public void Add (KeyValuePair<K, V> item)
+       {
+               Coll.Add (item);
+       }
+
+       public void Clear ()
+       {
+               dic.Clear ();
+       }
+
+       public bool Contains (KeyValuePair<K, V> item)
+       {
+               return Coll.Contains (item);
+       }
+
+       public void CopyTo (KeyValuePair<K, V> [] array, int arrayIndex)
+       {
+               Coll.CopyTo (array, arrayIndex);
+       }
+
+       public int Count {
+               get { return dic.Count; }
+       }
+
+       public bool IsReadOnly {
+               get { return Coll.IsReadOnly; }
+       }
+
+       public bool Remove (KeyValuePair<K, V> item)
+       {
+               return Coll.Remove (item);
+       }
+
+       public IEnumerator<KeyValuePair<K, V>> GetEnumerator ()
+       {
+               return Coll.GetEnumerator ();
+       }
+}
+
+[DataContract]
+public class Bug13485Type
+{
+       [DataMember]
+       public string Name { get; set; }
+
+       [DataMember (Name = "Value")]
+       private string Value { get; set; }
+
+       public string GetValue { get { return this.Value; } }
+}
+
+#region Test classes for Collection serialization
+
+[DataContract]
+       public abstract class CollectionContainer <V>
+       {
+               V items;
+
+               [DataMember]
+               public V Items
+               {
+                       get {
+                               if (items == null) items = Init ();
+                               return items;
+                       }
+               }
+               
+               public CollectionContainer ()
+               {
+                       Init ();
+               }
+       
+               protected abstract V Init ();
+       }
+       
+       [DataContract]
+       public class ArrayListContainer : CollectionContainer<ArrayList> {
+               protected override ArrayList Init ()
+               {
+                       return new ArrayList { "banana", "apple" };
+               }
+       }
+       
+       [DataContract]
+       public class BitArrayContainer : CollectionContainer<BitArray> {
+               protected override BitArray Init ()
+               {
+                       return new BitArray (new [] { false, true });
+               }
+       }
+       
+       [DataContract]
+       public class HashtableContainer : CollectionContainer<Hashtable> {
+               protected override Hashtable Init ()
+               {
+                       var ht = new Hashtable ();
+                       ht.Add ("key1", "banana");
+                       ht.Add ("key2", "apple");
+                       return ht;
+               }
+       }
+       
+       [DataContract]
+       public class QueueContainer : CollectionContainer<Queue> {
+               protected override Queue Init ()
+               {
+                       var q = new Queue ();
+                       q.Enqueue ("banana");
+                       q.Enqueue ("apple");
+                       return q;
+               }
+       }
+       
+       [DataContract]
+       public class SortedListContainer : CollectionContainer<SortedList> {
+               protected override SortedList Init ()
+               {
+                       var l = new SortedList ();
+                       l.Add ("key1", "banana");
+                       l.Add ("key2", "apple");
+                       return l;
+               }
+       }
+       
+       [DataContract]
+       public class StackContainer : CollectionContainer<Stack> {
+               protected override Stack Init ()
+               {
+                       var s = new Stack ();
+                       s.Push ("banana");
+                       s.Push ("apple");
+                       return s;
+               }
+       }
+
+       public class EnumerableWithAdd : IEnumerable
+       {
+               private ArrayList items;
+
+               public EnumerableWithAdd()
+               {
+                       items = new ArrayList();
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return items.GetEnumerator();
+               }
+
+               public void Add(object value)
+               {
+                       items.Add(value);
+               }
+
+               public int Count
+               {
+                       get {
+                               return items.Count;
+                       }
+               }
+       }
+
+       public class EnumerableWithSpecialAdd : IEnumerable
+       {
+               private ArrayList items;
+
+               public EnumerableWithSpecialAdd()
+               {
+                       items = new ArrayList();
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return items.GetEnumerator();
+               }
+
+               public void Add(object value, int index)
+               {
+                       items.Add(value);
+               }
+
+               public int Count
+               {
+                       get
+                       {
+                               return items.Count;
+                       }
+               }
+       }
+
+       [DataContract]
+       public class EnumerableWithAddContainer : CollectionContainer<EnumerableWithAdd>
+       {
+               protected override EnumerableWithAdd Init()
+               {
+                       var s = new EnumerableWithAdd();
+                       s.Add ("banana");
+                       s.Add ("apple");
+                       return s;
+               }
+       }
+
+       [DataContract]
+       public class EnumerableWithSpecialAddContainer : CollectionContainer<EnumerableWithSpecialAdd>
+       {
+               protected override EnumerableWithSpecialAdd Init()
+               {
+                       var s = new EnumerableWithSpecialAdd();
+                       s.Add("banana", 0);
+                       s.Add("apple", 0);
+                       return s;
+               }
+       }
+
+       [DataContract]
+       public class GenericDictionaryContainer : CollectionContainer<Dictionary<string, string>> {
+               protected override Dictionary<string, string> Init ()
+               {
+                       var d = new Dictionary<string, string> ();
+                       d.Add ("key1", "banana");
+                       d.Add ("key2", "apple");
+                       return d;
+               }
+       }
+
+       [DataContract]
+       public class GenericHashSetContainer : CollectionContainer<HashSet<string>> {
+               protected override HashSet<string> Init ()
+               {
+                       return new HashSet<string> { "banana", "apple" };
+               }
+       }
+
+       [DataContract]
+       public class GenericLinkedListContainer : CollectionContainer<LinkedList<string>> {
+               protected override LinkedList<string> Init ()
+               {
+                       var l = new LinkedList<string> ();
+                       l.AddFirst ("apple");
+                       l.AddFirst ("banana");
+                       return l;
+               }
+       }
+
+       [DataContract]
+       public class GenericListContainer : CollectionContainer<List<string>> {
+               protected override List<string> Init ()
+               {
+                       return new List<string> { "banana", "apple" };
+               }
+       }
+
+       [DataContract]
+       public class GenericQueueContainer : CollectionContainer<Queue<string>> {
+               protected override Queue<string> Init ()
+               {
+                       var q = new Queue<string> ();
+                       q.Enqueue ("banana");
+                       q.Enqueue ("apple" );
+                       return q;
+               }
+       }
+
+       [DataContract]
+       public class GenericSortedDictionaryContainer : CollectionContainer<SortedDictionary<string, string>> {
+               protected override SortedDictionary<string, string> Init ()
+               {
+                       var d = new SortedDictionary<string, string> ();
+                       d.Add ("key1", "banana");
+                       d.Add ("key2", "apple");
+                       return d;
+               }
+       }
+
+       [DataContract]
+       public class GenericSortedListContainer : CollectionContainer<SortedList<string, string>> {
+               protected override SortedList<string, string> Init ()
+               {
+                       var d = new SortedList<string, string> ();
+                       d.Add ("key1", "banana");
+                       d.Add ("key2", "apple");
+                       return d;
+               }
+       }
+
+       [DataContract]
+       public class GenericStackContainer : CollectionContainer<Stack<string>> {
+               protected override Stack<string> Init ()
+               {
+                       var s = new Stack<string> ();
+                       s.Push ("banana");
+                       s.Push ("apple" );
+                       return s;
+               }
+       }
+
+       public class GenericEnumerableWithAdd : IEnumerable<string>
+       {
+               private List<string> items;
+
+               public GenericEnumerableWithAdd()
+               {
+                       items = new List<string>();
+               }
+
+               IEnumerator IEnumerable.GetEnumerator()
+               {
+                       return items.GetEnumerator ();
+               }
+
+               public IEnumerator<string> GetEnumerator()
+               {
+                       return items.GetEnumerator ();
+               }
+
+               public void Add(string value)
+               {
+                       items.Add(value);
+               }
+
+               public int Count
+               {
+                       get {
+                               return items.Count;
+                       }
+               }
+       }
+
+       public class GenericEnumerableWithSpecialAdd : IEnumerable<string>
+       {
+               private List<string> items;
+
+               public GenericEnumerableWithSpecialAdd()
+               {
+                       items = new List<string>();
+               }
+
+               IEnumerator IEnumerable.GetEnumerator()
+               {
+                       return items.GetEnumerator ();
+               }
+
+               public IEnumerator<string> GetEnumerator()
+               {
+                       return items.GetEnumerator ();
+               }
+
+               public void Add(string value, int index)
+               {
+                       items.Add(value);
+               }
+
+               public int Count
+               {
+                       get
+                       {
+                               return items.Count;
+                       }
+               }
+       }
+
+       [DataContract]
+       public class GenericEnumerableWithAddContainer : CollectionContainer<GenericEnumerableWithAdd>
+       {
+               protected override GenericEnumerableWithAdd Init()
+               {
+                       var s = new GenericEnumerableWithAdd();
+                       s.Add ("banana");
+                       s.Add ("apple");
+                       return s;
+               }
+       }
+
+       [DataContract]
+       public class GenericEnumerableWithSpecialAddContainer : CollectionContainer<GenericEnumerableWithSpecialAdd>
+       {
+               protected override GenericEnumerableWithSpecialAdd Init()
+               {
+                       var s = new GenericEnumerableWithSpecialAdd();
+                       s.Add("banana", 0);
+                       s.Add("apple", 0);
+                       return s;
+               }
+       }       
+
+       [DataContract]
+       public class NonCollectionGetOnlyContainer
+       {
+               string _test = "my string";
+       
+               [DataMember]
+               public string MyString {
+                       get {
+                               return _test;
+                       }
+               }
+       }       
+
+#endregion
+
+#region DefaultValueDeserialization
+    [DataContract]
+    public class JsonPerson
+    {
+        [DataMember(EmitDefaultValue = false)]
+        public string name { get; set; }
+    }
+
+    [DataContract]
+    public class PersonWithContact
+    {
+        [DataMember(EmitDefaultValue = false)]
+        public string name { get; set; }
+
+        [DataMember(EmitDefaultValue = false)]
+        public Contact contact { get; set; }
+    }
+
+    [DataContract]
+    public class Contact
+    {
+        [DataMember(EmitDefaultValue = false)]
+        public string url { get; set; }
+
+        [DataMember(EmitDefaultValue = false)]
+        public string email{ get; set; }
+    }
+#endregion
diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/JsonReaderTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/JsonReaderTest.cs
new file mode 100644 (file)
index 0000000..c95c3b6
--- /dev/null
@@ -0,0 +1,883 @@
+//
+// JsonReaderTest.cs
+//
+// Author:
+//     Atsushi Enomoto  <atsushi@ximian.com>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+// Copyright 2014 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.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Runtime.Serialization.Json;
+using System.Text;
+using System.Threading;
+using System.Xml;
+using NUnit.Framework;
+
+namespace MonoTests.System.Runtime.Serialization.Json
+{
+       [TestFixture]
+       public class JsonReaderTest
+       {
+               XmlDictionaryReader reader;
+
+               Stream GetInput (string s)
+               {
+                       return new MemoryStream (Encoding.ASCII.GetBytes (s));
+               }
+
+               XmlDictionaryReader CreateReader (string s)
+               {
+                       return JsonReaderWriterFactory.CreateJsonReader (GetInput (s), new XmlDictionaryReaderQuotas ());
+               }
+
+               void AssertNode (int depth, string localName, XmlNodeType nodeType, string value, string type, XmlDictionaryReader reader, string label)
+               {
+                       Assert.AreEqual (localName, reader.LocalName, label + ".LocalName");
+                       Assert.AreEqual (nodeType, reader.NodeType, label + ".NodeType");
+                       Assert.AreEqual (value, reader.Value, label + ".Value");
+                       Assert.AreEqual (type, reader.GetAttribute ("type"), label + ".GetAttribute('type')");
+               }
+
+               // Constructors
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorNullBytes ()
+               {
+                       JsonReaderWriterFactory.CreateJsonReader ((byte []) null, new XmlDictionaryReaderQuotas ());
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorNullStream ()
+               {
+                       JsonReaderWriterFactory.CreateJsonReader ((Stream) null, new XmlDictionaryReaderQuotas ());
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorNullReaderQuotas ()
+               {
+                       JsonReaderWriterFactory.CreateJsonReader (GetInput ("{}"), null);
+               }
+
+               [Test]
+               public void ConstructorNullEncodingAndReaderClose ()
+               {
+                       JsonReaderWriterFactory.CreateJsonReader (GetInput ("{}"), null, new XmlDictionaryReaderQuotas (), null);
+               }
+
+               // Close()
+
+               [Test]
+               public void CloseTwice ()
+               {
+                       reader = CreateReader ("{}");
+                       reader.Close ();
+                       reader.Close ();
+               }
+
+               [Test]
+               // hmm... [ExpectedException (typeof (InvalidOperationException))]
+               public void CloseAndRead ()
+               {
+                       reader = CreateReader ("{}");
+                       reader.Close ();
+                       reader.Read ();
+               }
+
+               [Test]
+               // hmm... [ExpectedException (typeof (InvalidOperationException))]
+               public void CloseAndMoveToFirstAttribute ()
+               {
+                       reader = CreateReader ("{}");
+                       reader.Close ();
+                       reader.MoveToFirstAttribute ();
+               }
+
+               // Read() several top-level types
+
+               [Test]
+               public void ReadStateEmpty ()
+               {
+                       reader = CreateReader ("");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read ();
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#2");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#3");
+               }
+
+               [Test]
+               public void ReadStateEmpty2 ()
+               {
+                       reader = CreateReader ("  ");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read ();
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#2");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#3");
+               }
+
+               [Test]
+               public void ReadStateObject ()
+               {
+                       reader = CreateReader ("{}");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read (); // element
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
+                       reader.Read (); // endelement
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
+                       reader.Read (); // endoffile
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#4");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#5");
+               }
+
+               [Test]
+               public void ReadStateArray ()
+               {
+                       reader = CreateReader ("[]");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read (); // element
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
+                       reader.Read (); // endelement
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
+                       reader.Read (); // endoffile
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#4");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#5");
+               }
+
+               [Test]
+               public void ReadNumber ()
+               {
+                       reader = CreateReader ("1234");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read (); // dummy root element
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
+                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
+                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
+                       reader.Read (); // content (number)
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
+                       Assert.AreEqual (XmlNodeType.Text, reader.NodeType, "#3-1");
+                       Assert.AreEqual ("1234", reader.Value, "#3-2");
+                       reader.Read (); // endelement
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#4");
+                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#4-1");
+                       reader.Read (); // endoffile
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#5");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#6");
+               }
+
+               [Test]
+               public void ReadBool ()
+               {
+                       reader = CreateReader ("true");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read (); // dummy root element
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
+                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
+                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
+                       Assert.AreEqual ("boolean", reader.GetAttribute ("type"), "#2-3");
+                       reader.Read (); // content (boolean)
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
+                       Assert.AreEqual (XmlNodeType.Text, reader.NodeType, "#3-1");
+                       Assert.AreEqual ("true", reader.Value, "#3-2");
+                       reader.Read (); // endelement
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#4");
+                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#4-1");
+                       reader.Read (); // endoffile
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#5");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#6");
+               }
+
+               [Test]
+               public void ReadNull ()
+               {
+                       reader = CreateReader ("null");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read (); // dummy root element
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
+                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
+                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
+                       // When it is null, the value is never given and the reader is skipped to the end element.
+                       reader.Read (); // endlement
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
+                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#3-1");
+                       reader.Read (); // endoffile
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#4");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#4");
+               }
+
+               [Test]
+               public void ReadString ()
+               {
+                       reader = CreateReader ("\"true\"");
+                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
+                       reader.Read (); // dummy root element
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
+                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
+                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
+                       Assert.AreEqual ("string", reader.GetAttribute ("type"), "#2-3");
+                       reader.Read (); // content (number)
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
+                       Assert.AreEqual (XmlNodeType.Text, reader.NodeType, "#3-1");
+                       Assert.AreEqual ("true", reader.Value, "#3-2");
+                       reader.Read (); // endelement
+                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#4");
+                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#4-1");
+                       reader.Read (); // endoffile
+                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#5");
+                       reader.Close ();
+                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#6");
+               }
+
+               // MoveToAttribute() / MoveToElement()
+
+               [Test]
+               public void MoveToAttributeObject ()
+               {
+                       reader = CreateReader ("{}");
+                       Assert.IsFalse (reader.MoveToFirstAttribute (), "#1");
+                       reader.Read (); // element
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
+                       Assert.AreEqual ("type", reader.LocalName, "#3");
+                       Assert.AreEqual ("object", reader.Value, "#4");
+                       Assert.IsTrue (reader.ReadAttributeValue (), "#5");
+                       Assert.AreEqual ("object", reader.Value, "#6");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#7");
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#8");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#9");
+               }
+
+               [Test]
+               public void MoveToElementObject ()
+               {
+                       reader = CreateReader ("{}");
+                       reader.Read (); // element
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#1");
+                       Assert.IsTrue (reader.MoveToElement (), "#1-1");
+
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
+                       Assert.IsTrue (reader.ReadAttributeValue (), "#2-1");
+                       Assert.IsTrue (reader.MoveToElement (), "#2-2");
+
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#3");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#3-1");
+                       Assert.IsTrue (reader.MoveToElement (), "#3-2");
+               }
+
+               [Test]
+               public void MoveToAttributeArray ()
+               {
+                       reader = CreateReader ("[]");
+                       Assert.IsFalse (reader.MoveToFirstAttribute (), "#1");
+                       reader.Read (); // element
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
+                       Assert.AreEqual ("type", reader.LocalName, "#3");
+                       Assert.AreEqual ("array", reader.Value, "#4");
+                       Assert.IsTrue (reader.ReadAttributeValue (), "#5");
+                       Assert.AreEqual ("array", reader.Value, "#6");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#7");
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#8");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#9");
+               }
+
+               [Test]
+               public void MoveToElementArray ()
+               {
+                       reader = CreateReader ("[]");
+                       reader.Read (); // element
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#1");
+                       Assert.IsTrue (reader.MoveToElement (), "#1-1");
+
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
+                       Assert.IsTrue (reader.ReadAttributeValue (), "#2-1");
+                       Assert.IsTrue (reader.MoveToElement (), "#2-2");
+
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#3");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#3-1");
+                       Assert.IsTrue (reader.MoveToElement (), "#3-2");
+               }
+
+               [Test]
+               public void MoveToAttributeSimpleDummyRoot ()
+               {
+                       reader = CreateReader ("1234");
+                       Assert.IsFalse (reader.MoveToFirstAttribute (), "#1");
+                       reader.Read (); // element
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
+                       Assert.AreEqual ("type", reader.LocalName, "#3");
+                       Assert.AreEqual ("number", reader.Value, "#4");
+                       Assert.IsTrue (reader.ReadAttributeValue (), "#5");
+                       Assert.AreEqual ("number", reader.Value, "#6");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#7");
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#8");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#9");
+               }
+
+               [Test]
+               public void MoveToElementSimpleDummyRoot ()
+               {
+                       reader = CreateReader ("1234");
+                       reader.Read (); // element
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#1");
+                       Assert.IsTrue (reader.MoveToElement (), "#1-1");
+
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
+                       Assert.IsTrue (reader.ReadAttributeValue (), "#2-1");
+                       Assert.IsTrue (reader.MoveToElement (), "#2-2");
+
+                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#3");
+                       Assert.IsFalse (reader.MoveToNextAttribute (), "#3-1");
+                       Assert.IsTrue (reader.MoveToElement (), "#3-2");
+               }
+
+               // Read() arrays and objects
+
+               [Test]
+               public void ReadArrayContent ()
+               {
+                       reader = CreateReader ("[123, \"123\", true, \"true\"]");
+
+                       // number value
+                       reader.Read (); // element
+                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "array", reader, "#1");
+
+                       reader.Read (); // 123 - element
+                       Assert.AreEqual ("number", reader.GetAttribute ("type"), "#2-0");
+                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "number", reader, "#2");
+                       reader.Read (); // 123 - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#3");
+                       reader.Read (); // 123 - endelement
+                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#4");
+
+                       // string value #1
+                       reader.Read (); // "123" - element
+                       Assert.AreEqual ("string", reader.GetAttribute ("type"), "#5-0");
+                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "string", reader, "#5");
+                       reader.Read (); // "123" - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#6");
+                       reader.Read (); // "123" - endelement
+                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#7");
+
+                       reader.Read (); // true - element
+                       Assert.AreEqual ("boolean", reader.GetAttribute ("type"), "#8-0");
+                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "boolean", reader, "#8");
+                       reader.Read (); // true - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#9");
+                       reader.Read (); // true - endelement
+                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#10");
+
+                       // string value #2
+                       reader.Read (); // "true" - element
+                       Assert.AreEqual ("string", reader.GetAttribute ("type"), "#11-0");
+                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "string", reader, "#11");
+                       reader.Read (); // "true" - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#12");
+                       reader.Read (); // "true" - endelement
+                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#13");
+                       Assert.IsTrue (reader.Read (), "#14"); // ]
+                       AssertNode (0, "root", XmlNodeType.EndElement, String.Empty, null, reader, "#15");
+                       Assert.IsFalse (reader.Read (), "#16"); // EOF
+               }
+
+               [Test]
+               public void ReadObjectContent ()
+               {
+                       reader = CreateReader ("{\"A\":123, \"B\": \"123\", \"C\" :true, \"D\" : \"true\"}");
+
+                       // number value
+                       reader.Read (); // element
+                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", reader, "#1");
+
+                       reader.Read (); // 123 - element
+                       AssertNode (1, "A", XmlNodeType.Element, String.Empty, "number", reader, "#2");
+                       reader.Read (); // 123 - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#3");
+                       reader.Read (); // 123 - endelement
+                       AssertNode (1, "A", XmlNodeType.EndElement, String.Empty, null, reader, "#4");
+
+                       // string value #1
+                       reader.Read (); // "123" - element
+                       AssertNode (1, "B", XmlNodeType.Element, String.Empty, "string", reader, "#5");
+                       reader.Read (); // "123" - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#6");
+                       reader.Read (); // "123" - endelement
+                       AssertNode (1, "B", XmlNodeType.EndElement, String.Empty, null, reader, "#7");
+
+                       reader.Read (); // true - element
+                       AssertNode (1, "C", XmlNodeType.Element, String.Empty, "boolean", reader, "#8");
+                       reader.Read (); // true - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#9");
+                       reader.Read (); // true - endelement
+                       AssertNode (1, "C", XmlNodeType.EndElement, String.Empty, null, reader, "#10");
+
+                       // string value #2
+                       reader.Read (); // "true" - element
+                       AssertNode (1, "D", XmlNodeType.Element, String.Empty, "string", reader, "#11");
+                       reader.Read (); // "true" - text
+                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#12");
+                       reader.Read (); // "true" - endelement
+                       AssertNode (1, "D", XmlNodeType.EndElement, String.Empty, null, reader, "#13");
+                       Assert.IsTrue (reader.Read (), "#14"); // }
+                       AssertNode (0, "root", XmlNodeType.EndElement, String.Empty, null, reader, "#15");
+                       Assert.IsFalse (reader.Read (), "#16"); // EOF
+               }
+
+               [Test]
+               public void ReadNestedObjects ()
+               {
+                       reader = CreateReader ("{\"A\": [123, {\"B\": \"456\", \"C\" :true}], \"D\" : {\"E\" : \"false\"}}");
+                       Assert.IsTrue (reader.Read (), "#1"); // {
+                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", reader, "#2");
+                       Assert.IsTrue (reader.Read (), "#3"); // A
+                       AssertNode (1, "A", XmlNodeType.Element, String.Empty, "array", reader, "#4");
+                       Assert.IsTrue (reader.Read (), "#5"); // (<123>)
+                       AssertNode (2, "item", XmlNodeType.Element, String.Empty, "number", reader, "#6");
+                       Assert.IsTrue (reader.Read (), "#7"); // (123)
+                       AssertNode (3, String.Empty, XmlNodeType.Text, "123", null, reader, "#8");
+                       Assert.IsTrue (reader.Read (), "#9"); // (</123>)
+                       AssertNode (2, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#10");
+                       Assert.IsTrue (reader.Read (), "#11"); // {
+                       AssertNode (2, "item", XmlNodeType.Element, String.Empty, "object", reader, "#12");
+                       Assert.IsTrue (reader.Read (), "#13"); // B
+                       AssertNode (3, "B", XmlNodeType.Element, String.Empty, "string", reader, "#14");
+                       Assert.IsTrue (reader.Read (), "#15"); // "456"
+                       AssertNode (4, String.Empty, XmlNodeType.Text, "456", null, reader, "#16");
+                       Assert.IsTrue (reader.Read (), "#17"); // /B
+                       AssertNode (3, "B", XmlNodeType.EndElement, String.Empty, null, reader, "#18");
+
+                       Assert.IsTrue (reader.Read (), "#19"); // C
+                       AssertNode (3, "C", XmlNodeType.Element, String.Empty, "boolean", reader, "#20");
+                       Assert.IsTrue (reader.Read (), "#21"); // true
+                       AssertNode (4, String.Empty, XmlNodeType.Text, "true", null, reader, "#22");
+                       Assert.IsTrue (reader.Read (), "#23"); // /C
+                       AssertNode (3, "C", XmlNodeType.EndElement, String.Empty, null, reader, "#24");
+                       Assert.IsTrue (reader.Read (), "#25"); // }
+                       AssertNode (2, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#26");
+                       Assert.IsTrue (reader.Read (), "#27"); // ]
+                       AssertNode (1, "A", XmlNodeType.EndElement, String.Empty, null, reader, "#28");
+                       Assert.IsTrue (reader.Read (), "#29"); // {
+                       AssertNode (1, "D", XmlNodeType.Element, String.Empty, "object", reader, "#30");
+                       Assert.IsTrue (reader.Read (), "#31"); // D
+                       AssertNode (2, "E", XmlNodeType.Element, String.Empty, "string", reader, "#32");
+                       Assert.IsTrue (reader.Read (), "#33"); // "false"
+                       AssertNode (3, String.Empty, XmlNodeType.Text, "false", null, reader, "#34");
+                       Assert.IsTrue (reader.Read (), "#35"); // /D
+                       AssertNode (2, "E", XmlNodeType.EndElement, String.Empty, null, reader, "#36");
+                       Assert.IsTrue (reader.Read (), "#37"); // }
+                       AssertNode (1, "D", XmlNodeType.EndElement, String.Empty, null, reader, "#38");
+                       Assert.IsTrue (reader.Read (), "#39"); // }
+                       AssertNode (0, "root", XmlNodeType.EndElement, String.Empty, null, reader, "#40");
+                       Assert.IsFalse (reader.Read (), "#41"); // EOF
+               }
+
+               void ReadToEnd (XmlDictionaryReader reader)
+               {
+                       while (!reader.EOF)
+                               reader.Read ();
+               }
+
+               // Read() valid and invalid contents
+
+               [Test]
+               [Ignore ("It should throw XmlException for parser error, but .NET fails to report that")]
+               public void ReadTwoTopLevelContents ()
+               {
+                       ReadToEnd (CreateReader ("{}{}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadMissingCloseCurly ()
+               {
+                       ReadToEnd (CreateReader ("{"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadMissingCloseCurly2 ()
+               {
+                       ReadToEnd (CreateReader ("{{}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadExtraCloseCurly ()
+               {
+                       ReadToEnd (CreateReader ("}"));
+               }
+
+               [Test]
+               [Ignore ("It should throw XmlException for parser error, but .NET fails to report that")]
+               public void ReadExtraCloseCurly2 ()
+               {
+                       ReadToEnd (CreateReader ("{}}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadMissingCloseBrace ()
+               {
+                       ReadToEnd (CreateReader ("["));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadMissingCloseBrace2 ()
+               {
+                       ReadToEnd (CreateReader ("[[]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadExtraCloseBrace ()
+               {
+                       ReadToEnd (CreateReader ("]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // hmm, why does it pass?
+               public void ReadExtraCloseBrace2 ()
+               {
+                       ReadToEnd (CreateReader ("[]]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadOpenCurlyCloseBrace ()
+               {
+                       ReadToEnd (CreateReader ("{]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadOpenBraceCloseCurly ()
+               {
+                       ReadToEnd (CreateReader ("[}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadParens ()
+               {
+                       ReadToEnd (CreateReader ("()"));
+               }
+
+               [Test]
+               public void ReadValidNumber ()
+               {
+                       ReadToEnd (CreateReader ("0"));
+               }
+
+               [Test]
+               public void ReadValidNumber2 ()
+               {
+                       ReadToEnd (CreateReader ("-0"));
+               }
+
+               [Test]
+               public void ReadValidNumber3 ()
+               {
+                       ReadToEnd (CreateReader ("0e5"));
+               }
+
+               [Test]
+               public void ReadValidNumber4 ()
+               {
+                       ReadToEnd (CreateReader ("0.5"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidNumber ()
+               {
+                       CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
+                       try {
+                               Thread.CurrentThread.CurrentCulture = new CultureInfo ("de-DE");
+                               // if we read a number just by current culture, it will be regarded as correct JSON.
+                               ReadToEnd (CreateReader ("123,45"));
+                       } finally {
+                               Thread.CurrentThread.CurrentCulture = originalCulture;
+                       }
+               }
+
+               [Test]
+               public void ReadValidNumberGerman ()
+               {
+                       CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
+                       try {
+                               Thread.CurrentThread.CurrentCulture = new CultureInfo ("de-DE");
+                               var s = GetInput ("123.45"); // German is ',' for decimals
+                               var r = new DataContractJsonSerializer (typeof (double));
+                               var d = (double) r.ReadObject (s);
+                               Assert.AreEqual (123.45, d, "InvariantCulture");
+                       } finally {
+                               Thread.CurrentThread.CurrentCulture = originalCulture;
+                       }
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidNumber2 ()
+               {
+                       ReadToEnd (CreateReader ("+5"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidNumber3 ()
+               {
+                       ReadToEnd (CreateReader ("01"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidNumber4 ()
+               {
+                       ReadToEnd (CreateReader (".1"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidNumber5 ()
+               {
+                       ReadToEnd (CreateReader ("10."));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidNumber7 ()
+               {
+                       ReadToEnd (CreateReader ("e5"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidNumber8 ()
+               {
+                       ReadToEnd (CreateReader ("-e5"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidNumber9 ()
+               {
+                       ReadToEnd (CreateReader ("-e5.5"));
+               }
+
+               [Test]
+               public void ReadInvalidNumber10 () // bug #531904
+               {
+                       ReadToEnd (CreateReader ("4.29153442382814E-05"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidObjectContent ()
+               {
+                       ReadToEnd (CreateReader ("{\"foo\"}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidObjectContent2 ()
+               {
+                       ReadToEnd (CreateReader ("{\"A\": 123 456}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidObjectContent3 ()
+               {
+                       ReadToEnd (CreateReader ("{, \"A\":123, \"B\":456}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidObjectContent4 ()
+               {
+                       ReadToEnd (CreateReader ("{\"A\":123, \"B\":456,}"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidArrayContent ()
+               {
+                       ReadToEnd (CreateReader ("[\"foo\":\"bar\"]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidArrayContent2 ()
+               {
+                       ReadToEnd (CreateReader ("[123 456]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidArrayContent3 ()
+               {
+                       ReadToEnd (CreateReader ("[,123,456]"));
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               [Ignore ("NotDotNet")] // likely .NET bug
+               public void ReadInvalidArrayContent4 ()
+               {
+                       ReadToEnd (CreateReader ("[123,456,]"));
+               }
+
+               [Test]
+               public void ReadObjectRuntimeTypeAsAttribute ()
+               {
+                       XmlDictionaryReader r = CreateReader ("{\"__type\":\"System.Int32\"}");
+                       r.Read ();
+                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", r, "#1");
+                       Assert.IsTrue (r.MoveToAttribute ("type"), "#2");
+                       AssertNode (0, "type", XmlNodeType.Attribute, "object", "object", r, "#3");
+                       Assert.IsTrue (r.MoveToAttribute ("__type"), "#4");
+                       AssertNode (0, "__type", XmlNodeType.Attribute, "System.Int32", "object", r, "#5");
+                       r.Read ();
+                       Assert.AreEqual (XmlNodeType.EndElement, r.NodeType, "#6");
+               }
+
+               [Test]
+               public void ReadObjectRuntimeType ()
+               {
+                       XmlDictionaryReader r = CreateReader ("{\"__type\":\"System.Int32\", \"foo\":true}");
+                       r.Read ();
+                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", r, "#1");
+                       Assert.IsTrue (r.MoveToAttribute ("type"), "#2");
+                       AssertNode (0, "type", XmlNodeType.Attribute, "object", "object", r, "#3");
+                       Assert.IsTrue (r.MoveToAttribute ("__type"), "#4");
+                       AssertNode (0, "__type", XmlNodeType.Attribute, "System.Int32", "object", r, "#5");
+                       r.Read ();
+                       Assert.AreEqual (XmlNodeType.Element, r.NodeType, "#6");
+                       Assert.AreEqual ("foo", r.LocalName, "#7");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void ReadInvalidObjectRuntimeTypeValue ()
+               {
+                       ReadToEnd (CreateReader ("{\"__type\":true}"));
+               }
+
+               [Test]
+               public void ReadObjectRuntimeTypeIncorrectPosition ()
+               {
+                       XmlReader r = CreateReader ("{\"foo\" : false, \"__type\" : \"System.Int32\"}");
+                       r.Read ();
+                       // When __type is not at the first content, it is not regarded as an attribute. Note that it is not treated as an error.
+                       Assert.IsFalse (r.MoveToAttribute ("__type"));
+                       r.Skip ();
+               }
+
+               [Test]
+               public void ReadObjectRuntimeTypeInArray ()
+               {
+                       XmlReader r = CreateReader (@"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0}]");
+                       r.Read ();
+                       Assert.AreEqual ("root", r.LocalName, "#1-1");
+                       Assert.AreEqual ("array", r.GetAttribute ("type"), "#1-2");
+                       r.Read ();
+                       Assert.AreEqual ("item", r.LocalName, "#2-1");
+                       Assert.AreEqual ("object", r.GetAttribute ("type"), "#2-2");
+                       Assert.IsNotNull (r.GetAttribute ("__type"), "#2-3");
+                       r.Read ();
+               }
+
+               [Test]
+               public void Skip ()
+               {
+                       XmlReader r = CreateReader ("{\"type\" : \"\", \"valid\" : \"0\", \"other\" : \"\"}");
+                       r.ReadStartElement ();
+                       r.MoveToContent ();
+                       Assert.AreEqual ("type", r.Name, "Skip-1");
+                       r.ReadElementContentAsString ();
+                       r.MoveToContent ();
+                       Assert.AreEqual ("valid", r.Name, "Skip-2");
+                       r.Skip ();
+                       Assert.AreEqual ("other", r.Name, "Skip-3");
+               }
+
+               [Test]
+               public void Depth ()
+               {
+                       XmlReader r = CreateReader ("{\"type\" : \"\", \"valid\" : \"0\"}");
+                       r.ReadStartElement ();
+                       r.Read ();
+                       Assert.AreEqual (2, r.Depth, "Depth-1");
+               }
+
+               [Test]
+               public void UnicodeEncodingAutoDetect ()
+               {
+                       var ms = new MemoryStream (Encoding.Unicode.GetBytes ("{\"type\" : \"\", \"valid\" : \"0\"}"));
+                       XmlReader r = JsonReaderWriterFactory.CreateJsonReader (ms, new XmlDictionaryReaderQuotas ());
+                       r.ReadStartElement ();
+                       r.Read ();
+               }
+
+               [Test]
+               public void ReadNumberAsObject ()
+               {
+                       const double testValue = 42.42D;
+                       var serializer = new DataContractJsonSerializer (typeof (object));
+                       var serializedStream = GetInput (testValue.ToString (CultureInfo.InvariantCulture));
+                       var deserializedValue = serializer.ReadObject (serializedStream);
+                       Assert.AreEqual (typeof (decimal), deserializedValue.GetType ());
+                       Assert.AreEqual (testValue, (decimal) deserializedValue);
+               }
+
+               [Test]
+               public void IEnumerableTest ()
+               {
+                       string json = "[\"A\", \"B\"]";
+                       using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(json))) {
+                               DataContractJsonSerializer jsonSerializer = new
+                                       DataContractJsonSerializer(typeof(IEnumerable<string>));
+                               var result = jsonSerializer.ReadObject(stream);
+                               Assert.AreEqual (typeof (string []), result.GetType ());
+                       }
+               }
+       }
+}
diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/JsonWriterTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization.Json/JsonWriterTest.cs
new file mode 100644 (file)
index 0000000..b6e42b9
--- /dev/null
@@ -0,0 +1,640 @@
+//
+// JsonWriterTest.cs
+//
+// Author:
+//     Atsushi Enomoto  <atsushi@ximian.com>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.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.IO;
+using System.Text;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Json;
+using System.Xml;
+using NUnit.Framework;
+
+namespace MonoTests.System.Runtime.Serialization.Json
+{
+       [TestFixture]
+       public class JsonWriterTest
+       {
+               MemoryStream ms;
+               XmlDictionaryWriter w;
+
+               string ResultString {
+                       get { return Encoding.UTF8.GetString (ms.ToArray ()); }
+               }
+
+               [SetUp]
+               public void Setup ()
+               {
+                       ms = new MemoryStream ();
+                       w = JsonReaderWriterFactory.CreateJsonWriter (ms);
+               }
+
+               /*
+               [Test]
+               public void Dummy_BitFlagsGenerator ()
+               {
+                       var b = new BitFlagsGenerator (2);
+                       Assert.IsFalse (b.Load (0), "#a1");
+                       b.Store (0, false);
+                       Assert.IsFalse (b.Load (0), "#a2");
+                       b.Store (0, true);
+                       Assert.IsTrue (b.Load (0), "#a3");
+                       Assert.IsFalse (b.Load (1), "#a4");
+                       b.Store (0, false);
+                       Assert.IsFalse (b.Load (0), "#a5");
+                       Assert.IsFalse (b.Load (1), "#a6");
+
+                       Assert.IsFalse (b.Load (1), "#b1");
+                       b.Store (1, false);
+                       Assert.IsFalse (b.Load (1), "#b2");
+                       b.Store (1, true);
+                       Assert.IsTrue (b.Load (1), "#b3");
+                       b.Store (1, false);
+                       Assert.IsFalse (b.Load (1), "#b4");
+
+                       var bytes = new byte [2];
+                       Assert.IsFalse (BitFlagsGenerator.IsBitSet (bytes, 0), "#c1");
+                       BitFlagsGenerator.SetBit (bytes, 0);
+                       Assert.IsTrue (BitFlagsGenerator.IsBitSet (bytes, 0), "#c2");
+                       Assert.IsFalse (BitFlagsGenerator.IsBitSet (bytes, 1), "#c3");
+                       BitFlagsGenerator.SetBit (bytes, 0);
+                       Assert.IsTrue (BitFlagsGenerator.IsBitSet (bytes, 0), "#c4");
+               }
+               */
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorNullStream ()
+               {
+                       JsonReaderWriterFactory.CreateJsonWriter (null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void ConstructorNullEncoding ()
+               {
+                       JsonReaderWriterFactory.CreateJsonWriter (new MemoryStream (), null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void SimpleElementNotRoot ()
+               {
+                       w.WriteStartElement ("foo");
+               }
+
+               [Test]
+               public void SimpleElement ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteEndElement ();
+                       w.Close ();
+                       // empty string literal ("")
+                       Assert.AreEqual ("\"\"", ResultString, "#1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void SimpleElement2 ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartElement ("foo");
+                       // type='array' or type='object' is required before writing immediate child of an element.
+               }
+
+               [Test]
+               public void SimpleElement3 ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("e1");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("e1_1");
+                       w.WriteEndElement (); // treated as a string literal
+                       w.WriteEndElement ();
+                       w.WriteStartElement ("e2");
+                       w.WriteString ("value");
+                       w.WriteEndElement ();
+                       w.WriteEndElement ();
+                       w.Close ();
+                       string json = "{\"e1\":{\"e1_1\":\"\"},\"e2\":\"value\"}";
+                       Assert.AreEqual (json, ResultString, "#1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void AttributeNonType ()
+               {
+                       w.WriteStartElement ("root");
+                       // only "type" attribute is expected.
+                       w.WriteStartAttribute ("a1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void TypeAttributeNonStandard ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "foo");
+               }
+
+               [Test]
+               public void SimpleTypeAttribute ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "number");
+                       w.WriteEndElement ();
+                       w.Close ();
+                       Assert.AreEqual (String.Empty, ResultString, "#1");
+               }
+
+               [Test]
+               public void SimpleTypeAttribute2 ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "number");
+                       w.WriteString ("1");
+                       w.WriteEndElement ();
+                       w.Close ();
+                       Assert.AreEqual ("{\"foo\":1}", ResultString, "#1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStringForNull ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "null");
+                       w.WriteString ("1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStringForArray ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "array");
+                       w.WriteString ("1");
+               }
+
+               [Test]
+               // uh, no exception?
+               public void WriteStringForBoolean ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "boolean");
+                       w.WriteString ("xyz");
+                       w.WriteEndElement ();
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStringForObject ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteString ("1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteArrayNonItem ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "array");
+                       w.WriteStartElement ("bar");
+               }
+
+               [Test]
+               public void WriteArray ()
+               {
+                       w.WriteStartElement ("root"); // name is ignored
+                       w.WriteAttributeString ("type", "array");
+                       w.WriteElementString ("item", "v1");
+                       w.WriteElementString ("item", "v2");
+                       w.Close ();
+                       Assert.AreEqual (@"[""v1"",""v2""]", ResultString, "#1");
+               }
+
+               [Test]
+               public void WriteArrayInObject ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "array");
+                       w.WriteElementString ("item", "v1");
+                       w.WriteElementString ("item", "v2");
+                       w.Close ();
+                       Assert.AreEqual (@"{""foo"":[""v1"",""v2""]}", ResultString, "#1");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteStartElementNonEmptyNS ()
+               {
+                       // namespaces are not allowed
+                       w.WriteStartElement (String.Empty, "x", "urn:foo");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteStartElementNonEmptyPrefix ()
+               {
+                       // prefixes are not allowed
+                       w.WriteStartElement ("p", "x", "urn:foo");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStartElementMultiTopLevel ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteEndElement ();
+                       // hmm...
+                       Assert.AreEqual (WriteState.Content, w.WriteState, "#1");
+                       // writing of multiple root elements is not supported
+                       w.WriteStartElement ("root2");
+                       w.Close ();
+                       Assert.AreEqual (String.Empty, ResultString, "#2");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteStartAttributeNonEmptyNS ()
+               {
+                       // namespaces are not allowed
+                       w.WriteStartElement ("root");
+                       // well, empty prefix for a global attribute would be
+                       // replaced anyways ...
+                       w.WriteStartAttribute (String.Empty, "x", "urn:foo");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteStartAttributeInXmlNamespace ()
+               {
+                       // even "xml" namespace is not allowed (anyways only "type" is allowed ...)
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("xml", "lang", "http://www.w3.org/XML/1998/namespace");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void LookupPrefixNull ()
+               {
+                       w.LookupPrefix (null);
+               }
+
+               [Test]
+               public void LookupPrefix ()
+               {
+                       // since namespaces are not allowed, it mostly makes no sense...
+                       Assert.AreEqual (String.Empty, w.LookupPrefix (String.Empty), "#1");
+                       Assert.IsNull (w.LookupPrefix ("urn:nonexistent"), "#2");
+                       Assert.AreEqual ("xml", w.LookupPrefix ("http://www.w3.org/XML/1998/namespace"), "#3");
+                       Assert.AreEqual ("xmlns", w.LookupPrefix ("http://www.w3.org/2000/xmlns/"), "#4");
+               }
+
+               [Test]
+               public void WriteStartDocument ()
+               {
+                       Assert.AreEqual (WriteState.Start, w.WriteState, "#1");
+                       w.WriteStartDocument ();
+                       Assert.AreEqual (WriteState.Start, w.WriteState, "#2");
+                       w.WriteStartDocument (true);
+                       Assert.AreEqual (WriteState.Start, w.WriteState, "#3");
+                       // So, it does nothing
+               }
+
+               [Test]
+               public void WriteEndDocument ()
+               {
+                       w.WriteEndDocument (); // so, it is completely wrong, but ignored.
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void WriteDocType ()
+               {
+                       w.WriteDocType (null, null, null, null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void WriteComment ()
+               {
+                       w.WriteComment ("test");
+               }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void WriteEntityRef ()
+               {
+                       w.WriteEntityRef ("ent");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteProcessingInstruction ()
+               {
+                       // since this method accepts case-insensitive "XML",
+                       // it throws ArgumentException.
+                       w.WriteProcessingInstruction ("T", "D");
+               }
+
+               [Test]
+               public void WriteProcessingInstructionXML ()
+               {
+                       // You might not know, but in some cases, things like
+                       // XmlWriter.WriteNode() is implemented to invoke
+                       // this method for writing XML declaration. This
+                       // check is (seems) case-insensitive.
+                       w.WriteProcessingInstruction ("XML", "foobar");
+                       // In this case, the data is simply ignored (as
+                       // WriteStartDocument() is).
+               }
+
+               [Test]
+               public void WriteRaw ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteRaw ("sample");
+                       w.WriteRaw (new char [] {'0', '1', '2', '3'}, 1, 2);
+                       w.Close ();
+                       Assert.AreEqual ("\"sample12\"", ResultString);
+               }
+
+               [Test]
+               public void WriteCData ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteCData ("]]>"); // this behavior is incompatible with ordinal XmlWriters.
+                       w.Close ();
+                       Assert.AreEqual ("\"]]>\"", ResultString);
+               }
+
+               [Test]
+               public void WriteCharEntity ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteCharEntity ('>');
+                       w.Close ();
+                       Assert.AreEqual ("\">\"", ResultString);
+               }
+
+               [Test]
+               public void WriteWhitespace ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteWhitespace ("\t  \n\r");
+                       w.Close ();
+                       Assert.AreEqual (@"""\u0009  \u000a\u000d""", ResultString);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteWhitespaceNonWhitespace ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteWhitespace ("TEST");
+               }
+
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void WriteStringTopLevel ()
+               {
+                       w.WriteString ("test");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStartAttributeTopLevel ()
+               {
+                       w.WriteStartAttribute ("test");
+               }
+
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void WriteStartDocumentAtClosed ()
+               {
+                       w.Close ();
+                       w.WriteStartDocument ();
+               }
+
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void WriteStartElementAtClosed ()
+               {
+                       w.Close ();
+                       w.WriteStartElement ("foo");
+               }
+
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void WriteProcessingInstructionAtClosed ()
+               {
+                       w.Close ();
+                       w.WriteProcessingInstruction ("xml", "version='1.0'");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteMixedContent ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteString ("TEST");
+                       w.WriteStartElement ("mixed"); // is not allowed.
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStartElementInvalidTopLevelName ()
+               {
+                       w.WriteStartElement ("anyname");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void WriteStartElementNullName ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement (null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void WriteStartElementEmptyName ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement (String.Empty);
+                       // It is regarded as invalid name in JSON. However,
+                       // I don't think there is such limitation in JSON specification.
+               }
+
+               [Test]
+               public void WriteStartElementWithRuntimeTypeName ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteAttributeString ("__type", "FooType:#FooNamespace");
+                       w.Close ();
+                       Assert.AreEqual (@"{""__type"":""FooType:#FooNamespace""}", ResultString);
+               }
+
+               [Test]
+               public void WriteStartElementWeirdName ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("!!!");
+                       w.Close ();
+                       Assert.AreEqual (@"{""!!!"":""""}", ResultString);
+               }
+
+               [Test]
+               public void WriteRootAsObject ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteString ("object");
+                       w.WriteEndAttribute ();
+                       w.Close ();
+                       Assert.AreEqual ("{}", ResultString);
+               }
+
+               [Test]
+               public void WriteRootAsArray ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteString ("array");
+                       w.WriteEndAttribute ();
+                       w.Close ();
+                       Assert.AreEqual ("[]", ResultString);
+               }
+
+               [Test]
+               public void WriteRootAsLiteral ()
+               {
+                       w.WriteStartElement ("root");
+                       w.Close ();
+                       Assert.AreEqual ("\"\"", ResultString);
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteEndElementOnAttribute ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteString ("array");
+                       w.WriteEndElement ();
+               }
+
+               [Test]
+               public void WriteAttributeAsSeparateStrings ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteString ("arr");
+                       w.WriteString ("ay");
+                       w.WriteEndAttribute ();
+                       w.Close ();
+                       Assert.AreEqual ("[]", ResultString);
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStartAttributeInAttributeMode ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteStartAttribute ("type");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStartAttributeInContentMode ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteString ("TEST");
+                       w.WriteStartAttribute ("type");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void WriteStartElementInAttributeMode ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteStartElement ("child");
+               }
+
+               [Test]
+               [ExpectedException (typeof (XmlException))]
+               public void CloseAtAtributeState ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteStartAttribute ("type");
+                       w.WriteString ("array");
+                       // It calls WriteEndElement() without calling
+                       // WriteEndAttribute().
+                       w.Close ();
+               }
+
+               [Test]
+               public void WriteSlashEscaped ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteString ("/my date/");
+                       w.WriteEndElement ();
+                       w.Close ();
+                       Assert.AreEqual ("\"\\/my date\\/\"", ResultString);
+               }
+
+               [Test]
+               public void WriteNullType ()
+               {
+                       w.WriteStartElement ("root");
+                       w.WriteAttributeString ("type", "object");
+                       w.WriteStartElement ("foo");
+                       w.WriteAttributeString ("type", "null");
+                       w.Close ();
+                       Assert.AreEqual ("{\"foo\":null}", ResultString);
+               }
+       }
+}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/ChangeLog b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/ChangeLog
deleted file mode 100644 (file)
index e0d70bd..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-2010-07-27  Andreia Gaita  <avidigal@novell.com>
-
-       * JsonSerializationReader.cs: Add Char type to the switch. Reads the
-         content as a string and validates its length
-
-2010-07-27  Andreia Gaita  <avidigal@novell.com>
-
-       * JsonSerializationReader.cs, JsonSerializationWriter.cs:
-         Add a special case for IDictionary, since KeyValuePair objects
-         have private setters and can't be processed via the normal
-         object code path.
-
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs :
-         Do not try to add static members as serialization targets.
-         Support OnDeserializing and OnDeserialized. Fixed bug #615800.
-
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationWriter.cs : it cannot serialize DateTime in
-         double, which causes crash in deserializer.
-
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs : when an object is null, return null, not just an 
-         uninitialized object.
-
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer_2_1.cs : add extra methods for
-         Sys.SM.Web.Extensions build.
-
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : do not keep Attribute state once Read() is called.
-
-2010-04-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationReader.cs : use List<T> if the contract member
-         type is interface.
-
-2010-03-16  Jb Evain  <jbevain@novell.com>
-
-       * DataContractJsonSerializer.cs: use MOONLIGHT symbol to
-       disambiguate MonoTouch and Moonlight code.
-
-2010-03-13  Kornél Pál  <kornelpal@gmail.com>
-
-       * JavaScriptReader.cs: Deserialize "false" correctly.
-         Fixed bug #586712.
-
-2010-03-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JavaScriptReader.cs : moved from Sys.Json/JsonReader.cs.
-
-2010-03-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JavaScriptObjectDeserializer.cs : new internal file, which is
-         used by System.Json (for moonlight compatibility).
-
-2010-03-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationWriter.cs, JsonSerializationReader.cs,
-         JsonWriter.cs : Fix DateTime serialization and "\/" string escape
-         issues. Fixed bug #586169.
-
-2010-02-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonWriter.cs : write NaN, INF, -INF as JSON string, not JSON number.
-         Fixed bug #573691.
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs : KnownTypes does not include root
-         type. Fixed bug #573689.
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationReader.cs : oops, wrong fix, should consume the
-         reader.
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationReader.cs : "null" for string should be read as
-         null, not String.Empty. Fixed bug #573690.
-
-2010-01-26  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DataContractJsonSerializer_2_1.cs: Don't hide [Field|Method]
-       AccessException inside a SerializationException but in a 
-       SecurityException.
-
-2010-01-25  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DataContractJsonSerializer_2_1.cs: New. Simpler version for 
-       Moonlight since it does not inherit from the same base type nor
-       does it overrides any base methods.
-
-2010-01-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs : forward port r145077 (see change line for 2009-10-29).
-
-2009-12-14  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs : handle [Serializable] objects such as KeyValuePair<,>
-         like we do in 2.0. Removed previous workarounds. (Do not serialize
-         and deserialize nonpublic members in "default" mappings.)
-
-2009-12-11  Chris Toshok  <toshok@ximian.com>
-
-       * TypeMap.cs (CreateDefaultTypeMap): only include non-public
-       property info when dealing with KeyValuePair<,>.  This is *not*
-       the way MS handles it, but we emulate things much better with this
-       hack.
-
-2009-12-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : e- and e+ was resulting in wrong parse error.
-         This should fix part of bug #531904.
-
-2009-12-08  Chris Toshok  <toshok@ximian.com>
-
-       * JsonSerializationReader.cs (DeserializeGenericCollection): in
-       the 2.1 case we still need to convert the List<> to an array.
-
-2009-12-07  Chris Toshok  <toshok@ximian.com>
-
-       * JsonReaderWriterFactory.cs (CreateJsonReader): pass null for the
-       encoding parameter instead of calling Detect.  The jsonreader's
-       PushbackReader will autodetect.
-       (Detect): remove.  a BufferedStream created from an unseekable
-       stream is itself unseekable, which makes it just as useless.  This
-       breaks netflix's isostore file parsing.
-
-       * JsonReader.cs (PushbackReader): add a ctor which doesn't take an
-       encoding, for the autodetecting reader case.  for this ctor, pass
-       true to StreamReader's ctor for detectEncodingFromByteOrderMarks.
-
-2009-12-06  Chris Toshok  <toshok@ximian.com>
-
-       * JsonSerializationReader.cs (DeserializeGenericCollection): this
-       is jb's (iirc) patch, actually.  Types subclassing from
-       ICollection<T> need to be supported, and since it's an interface
-       the implementation might be explicit.  So instead of groveling
-       around in the actual type, we need to dispatch through the
-       interface's method.
-
-       * TypeMap.cs (CreateDefaultTypeMap): we need to include non-public
-       properties, since KeyValuePair items must be able to write to Key
-       and Value properties.
-
-       * JsonReader.cs (ReadContent): for builtin values (null, true,
-       false), use TryReadString instead of individual ReadChar's, since
-       they aren't reversible if the string didn't match.  In the default
-       case, if we're LameSilverlightLiseralParser, we need to push back
-       the current character onto the stream -- this is because for
-       netflix's AppConfig.json we were parsing "frameRatePolicy" as
-       "rameRatePolicy" (the 'f' was triggering the "false" parsing).
-       (class PushBackReader): add this class to unify all the pushing
-       back of characters we need to do.  1 character (JsonReader's old
-       "saved_char") isn't enough given that you could have a property
-       named, e.g., "falsifiable", and we'd need 4 characters worth of
-       pushback to recognize that correctly.
-
-2009-11-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs, JsonReader.cs : Silverlight uses
-         LAME parser that allows object member name as *raw* string
-         without double-quotes. (This also reverts the previous change.)
-
-2009-11-12  Atsushi Enomoto  <atsushi@ximian.com>
-
-       *  JsonSerializationReader.cs : reuse generic collection search
-         logic in KnownTypeCollection.cs. Fixed bug #551671.
-
-2009-10-30  Andreia Gaita  <avidigal@novell.com>
-
-       * DataContractJsonSerializer.cs: SL accepts keys without "", so tweak
-       the data to fix the quotes before passing it to the deserializer
-
-2009-10-29  Chris Toshok  <toshok@ximian.com>
-
-       * TypeMap.cs (Deserialize): use
-       FormatterServices.GetUninitializedObject instead of
-       Activator.CreateInstance, since we shouldn't be invoking the
-       default ctor.
-
-       (forward ported to trunk on 2010-01-08 by atsushi)
-
-2009-10-23  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs
-         TypeMap.cs
-         JsonSerializationReader.cs : add experimental monotouch build.
-
-2009-10-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs, JsonSerializationWriter.cs:
-         alwaysEmitTypeInformation is  false by default. It is for __type
-         attribute, not for type attribute. __type name is always with ":#".
-       * TypeMap.cs : sort members in default typemap (it is ordered).
-         Uncomment EmitDefaultValue.
-       * JsonWriter.cs : handle "null" string (it is somewhat messy).
-
-2009-10-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : copy string literal parser from System.Json.
-
-2009-09-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationWriter.cs : output "type" attribute on bool
-         values too.
-       * JsonSerializationReader.cs : type loading attempt was insufficient
-         and hence often missed indicated types to deserialize.
-
-2009-09-15  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonWriter.cs : use Stream as its output directly and avoid
-         extraneous preamble output. Fix interop with .NET.
-
-2009-09-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReaderWriterFactory.cs : check null stream (fix test failure).
-
-2009-03-13  Andreia Gaita  <avidigal@novell.com>
-
-       * JsonReader.cs: fix depth calculation
-
-2009-03-12  Geoff Norton  <gnorton@novell.com>
-
-       * TypeMap.cs: Avoid checking the getter/setter information until after
-       checking if we have the required attribute decorated.
-
-2009-03-12  Andreia Gaita  <avidigal@novell.com>
-
-       * JsonReaderWriterFactory.cs: try to auto-detect encoding for streams
-       without BOM
-
-2009-03-02  Chris Toshok  <toshok@ximian.com>
-
-       * JsonReader.cs: 2.1 has HasValue.
-
-2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : show invalid input character in the error
-         message.
-
-2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs : in 2.1 do not use non-2.1 CreateInstance().
-
-2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs : allow get-only collections. Note that they are not
-         always deserializable (in .NET either).
-
-2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * TypeMap.cs : DataContractJsonSerializer in RTM does not seem to
-         reject contract-less types. So populate map for public members.
-       * DataContractJsonSerializer.cs : close XmlWriter to flush stream
-         (and it closes the stream by default).
-
-2009-02-02  Andreia Gaita  <avidigal@novell.com>
-
-       * JsonSerializationReader.cs : Use 2.1 "approved" calls for Enum.Parse
-    and Convert.ChangeType
-
-2008-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs : IsStartObject() could raise
-         an arbitrary exception, so wrap it inside try-catch too to enclose
-         with SerializationException.
-       * JsonSerializationReader.cs : support DBNull.
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs : fixed .ctor(type, knonwTypes) that
-         missed to delegate knownTypes correctly.
-       * JsonSerializationReader.cs : consider KnownTypes correctly.
-         Take "__type" fully into consideration, not just for arrays.
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : GetAttribute() was not still missing support for
-         __type.
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : now __type is fully supported in every methods and
-         properties in correct shape.
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReader.cs : Do not consume "__type" (which is the first content
-         of an object) as an element content. It must be handled as an
-         attribute (it needs more changes).
-
-2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationReader.cs : when deserializing primitive strings,
-         make use of "type" attribute (they are supposed to exist).
-         Output source reader location if available.
-       * JsonReader.cs : implement IXmlLineInfo.
-
-2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonSerializationReader.cs : new, for JSON deserialization support.
-       * DataContractJsonSerializer.cs, TypeMap.cs :
-         basic support for deserialization.
-
-2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs,
-         TypeMap.cs,
-         JsonSerializationWriter.cs : split the first to those three files.
-
-2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs : Uri and Guid are serialized as
-         string. XmlQualifiedName is serialized as local:ns.
-
-2008-01-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonWriter.cs : allow __type attribute. It required couple of
-         changes all around the class.
-       * DataContractJsonSerializer.cs : implemented large part of
-         serialization support (deserialization is not done yet).
-
-2007-12-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializer.cs :
-         moved from System.Runtime.Serialization and changed the namespace.
-       * JsonReader.cs, JsonWriter.cs, JsonReaderWriterFactory.cs,
-         IXmlJsonReaderInitializer.cs, IXmlJsonWriterInitializer.cs :
-         moved from System.Xml and changed the namespace.
-
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs
deleted file mode 100644 (file)
index 8077136..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-//
-// DataContractJsonSerializer.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007-2008 Novell, Inc (http://www.novell.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.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       public sealed class DataContractJsonSerializer : XmlObjectSerializer
-       {
-               const string default_root_name = "root";
-
-               #region lengthy constructor list
-
-               public DataContractJsonSerializer (Type type)
-                       : this (type, Type.EmptyTypes)
-               {
-               }
-
-               public DataContractJsonSerializer (Type type, IEnumerable<Type> knownTypes)
-                       : this (type, default_root_name, knownTypes)
-               {
-               }
-
-               public DataContractJsonSerializer (Type type, string rootName)
-                       : this (type, rootName, Type.EmptyTypes)
-               {
-               }
-
-               public DataContractJsonSerializer (Type type, XmlDictionaryString rootName)
-                       : this (type, rootName != null ? rootName.Value : default_root_name, Type.EmptyTypes)
-               {
-               }
-
-               public DataContractJsonSerializer (Type type, string rootName, IEnumerable<Type> knownTypes)
-                       : this (type, rootName, knownTypes, int.MaxValue, false, false)
-               {
-               }
-
-               public DataContractJsonSerializer (Type type, XmlDictionaryString rootName, IEnumerable<Type> knownTypes)
-                       : this (type, rootName != null ? rootName.Value : default_root_name, knownTypes)
-               {
-               }
-
-               DataContractJsonSerializer(Type type, string rootName, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool alwaysEmitTypeInformation)
-               {
-                       if (type == null)
-                               throw new ArgumentNullException ("type");
-                       if (rootName == null)
-                               throw new ArgumentNullException ("rootName");
-                       if (maxItemsInObjectGraph < 0)
-                               throw new ArgumentOutOfRangeException ("maxItemsInObjectGraph");
-
-                       this.type = type;
-
-                       var knownTypesFromAttributes = new List<Type> ();
-
-                       foreach (var attr in type.GetCustomAttributes (typeof (KnownTypeAttribute), false))
-                               knownTypesFromAttributes.Add ((attr as KnownTypeAttribute).Type);
-
-                       if (knownTypes != null)
-                               knownTypesFromAttributes.AddRange (knownTypes);
-
-                       known_types = new ReadOnlyCollection<Type> (knownTypesFromAttributes);
-
-                       root = rootName;
-                       max_items = maxItemsInObjectGraph;
-                       ignore_extension = ignoreExtensionDataObject;
-                       always_emit_type = alwaysEmitTypeInformation;
-               }
-
-               public DataContractJsonSerializer (Type type, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, IDataContractSurrogate dataContractSurrogate, bool alwaysEmitTypeInformation)
-            : this (type, default_root_name, knownTypes, maxItemsInObjectGraph, ignoreExtensionDataObject, alwaysEmitTypeInformation)
-               {
-       }
-
-               public DataContractJsonSerializer (Type type, string rootName, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, IDataContractSurrogate dataContractSurrogate, bool alwaysEmitTypeInformation)
-                       : this (type, rootName, knownTypes, maxItemsInObjectGraph, ignoreExtensionDataObject, alwaysEmitTypeInformation)
-               {
-                       surrogate = dataContractSurrogate;
-               }
-
-               public DataContractJsonSerializer (Type type, XmlDictionaryString rootName, IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, IDataContractSurrogate dataContractSurrogate, bool alwaysEmitTypeInformation)
-                       : this (type, rootName != null ? rootName.Value : default_root_name, knownTypes, maxItemsInObjectGraph, ignoreExtensionDataObject, dataContractSurrogate, alwaysEmitTypeInformation)
-               {
-               }
-
-               public DataContractJsonSerializer (Type type, DataContractJsonSerializerSettings settings)
-                       : this (type, settings.RootName, settings.KnownTypes, settings.MaxItemsInObjectGraph, settings.IgnoreExtensionDataObject,
-                               settings.DataContractSurrogate, false)
-               {
-               }
-
-        #endregion
-
-        Type type;
-               string root;
-               ReadOnlyCollection<Type> known_types;
-               int max_items;
-               bool ignore_extension;
-               bool always_emit_type;
-               IDataContractSurrogate surrogate;
-
-               [MonoTODO]
-               public IDataContractSurrogate DataContractSurrogate {
-                       get { return surrogate; }
-               }
-
-               [MonoTODO]
-               public bool IgnoreExtensionDataObject {
-                       get { return ignore_extension; }
-               }
-               public ReadOnlyCollection<Type> KnownTypes {
-                       get { return known_types; }
-               }
-
-               public int MaxItemsInObjectGraph {
-                       get { return max_items; }
-               }
-
-               public override bool IsStartObject (XmlReader reader)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-                       reader.MoveToContent ();
-                       return reader.IsStartElement (root, String.Empty);
-               }
-
-               public override bool IsStartObject (XmlDictionaryReader reader)
-               {
-                       return IsStartObject ((XmlReader) reader);
-               }
-
-               public override object ReadObject (Stream stream)
-               {
-#if NET_2_1
-                       var r = (JsonReader) JsonReaderWriterFactory.CreateJsonReader(stream, XmlDictionaryReaderQuotas.Max);
-                       r.LameSilverlightLiteralParser = true;
-                       return ReadObject(r);
-#else
-                       return ReadObject (JsonReaderWriterFactory.CreateJsonReader (stream, new XmlDictionaryReaderQuotas ()));
-#endif
-               }
-
-               public override object ReadObject (XmlDictionaryReader reader)
-               {
-                       return ReadObject (reader, true);
-               }
-
-               public override object ReadObject (XmlReader reader)
-               {
-                       return ReadObject (reader, true);
-               }
-
-               public override object ReadObject (XmlDictionaryReader reader, bool verifyObjectName)
-               {
-                       return ReadObject ((XmlReader) reader, verifyObjectName);
-               }
-
-               public override object ReadObject (XmlReader reader, bool verifyObjectName)
-               {
-                       if (reader == null)
-                               throw new ArgumentNullException ("reader");
-                       try {
-                               if (verifyObjectName && !IsStartObject (reader))
-                                       throw new SerializationException (String.Format ("Expected element was '{0}', but the actual input element was '{1}' in namespace '{2}'", root, reader.LocalName, reader.NamespaceURI));
-
-                               return new JsonSerializationReader (this, reader, type, verifyObjectName).ReadRoot ();
-                       } catch (SerializationException) {
-                               throw;
-                       } catch (InvalidDataContractException) {
-                               throw;
-                       } catch (System.Reflection.TargetInvocationException ex) {
-                               throw ex.InnerException;
-                       } catch (Exception ex) {
-                               throw new SerializationException ("Deserialization has failed", ex);
-                       }
-               }
-
-               public override void WriteObject (Stream stream, object graph)
-               {
-                       using (var xw = JsonReaderWriterFactory.CreateJsonWriter (stream))
-                               WriteObject (xw, graph);
-               }
-
-               public override void WriteObject (XmlWriter writer, object graph)
-               {
-                       try {
-                               WriteStartObject (writer, graph);
-                               WriteObjectContent (writer, graph);
-                               WriteEndObject (writer);
-                       } catch (NotImplementedException) {
-                               throw;
-                       } catch (InvalidDataContractException) {
-                               throw;
-                       } catch (Exception ex) {
-                               throw new SerializationException (String.Format ("There was an error during serialization for object of type {0}", graph != null ? graph.GetType () : null), ex);
-                       }
-               }
-
-               public override void WriteObject (XmlDictionaryWriter writer, object graph)
-               {
-                       WriteObject ((XmlWriter) writer, graph);
-               }
-
-               public override void WriteStartObject (XmlDictionaryWriter writer, object graph)
-               {
-                       WriteStartObject ((XmlWriter) writer, graph);
-               }
-
-               public override void WriteStartObject (XmlWriter writer, object graph)
-               {
-                       if (writer == null)
-                               throw new ArgumentNullException ("writer");
-                       writer.WriteStartElement (root);
-               }
-
-               public override void WriteObjectContent (XmlDictionaryWriter writer, object graph)
-               {
-                       WriteObjectContent ((XmlWriter) writer, graph);
-               }
-
-               public override void WriteObjectContent (XmlWriter writer, object graph)
-               {
-                       new JsonSerializationWriter (this, writer, type, always_emit_type).WriteObjectContent (graph, true, false);
-               }
-
-               public override void WriteEndObject (XmlDictionaryWriter writer)
-               {
-                       WriteEndObject ((XmlWriter) writer);
-               }
-
-               public override void WriteEndObject (XmlWriter writer)
-               {
-                       if (writer == null)
-                               throw new ArgumentNullException ("writer");
-                       writer.WriteEndElement ();
-               }
-
-               [MonoTODO]
-               public DateTimeFormat DateTimeFormat {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public EmitTypeInformation EmitTypeInformation {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public bool SerializeReadOnlyTypes {
-                       get { throw new NotImplementedException (); }
-               }
-
-               [MonoTODO]
-               public bool UseSimpleDictionaryFormat {
-                       get { throw new NotImplementedException (); }
-               }
-
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializerSettings.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializerSettings.cs
deleted file mode 100644 (file)
index 7e16d85..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// DataContractJsonSerializerSettings.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Xml;
-using System.Collections.Generic;
-
-namespace System.Runtime.Serialization.Json
-{
-       public class DataContractJsonSerializerSettings
-       {
-               public IDataContractSurrogate DataContractSurrogate { get; set; }
-               public DateTimeFormat DateTimeFormat { get; set; }
-               public EmitTypeInformation EmitTypeInformation { get; set; }
-               public bool IgnoreExtensionDataObject { get; set; }
-               public IEnumerable<Type> KnownTypes { get; set; }
-               public int MaxItemsInObjectGraph { get; set; }
-               public string RootName { get; set; }
-               public bool SerializeReadOnlyTypes { get; set; }
-               public bool UseSimpleDictionaryFormat { get; set; }
-       }
-}
-
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs
deleted file mode 100644 (file)
index 34df219..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// IXmlJsonReaderInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.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.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       public interface IXmlJsonReaderInitializer
-       {
-               void SetInput (byte [] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose);
-
-               void SetInput (Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose);
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs
deleted file mode 100644 (file)
index f337c85..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// IXmlJsonWriterInitializer.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.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.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       public interface IXmlJsonWriterInitializer
-       {
-               void SetOutput (Stream stream, Encoding encoding, bool ownsStream);
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReader.cs
deleted file mode 100644 (file)
index a5cff6d..0000000
+++ /dev/null
@@ -1,1099 +0,0 @@
-//
-// JsonReader.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007-2011 Novell, Inc (http://www.novell.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.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       // It is a subset of XmlInputStream from System.XML.
-       class EncodingDetecingInputStream : Stream
-       {
-               internal static readonly Encoding StrictUTF8, Strict1234UTF32, StrictBigEndianUTF16, StrictUTF16;
-
-               static EncodingDetecingInputStream ()
-               {
-                       StrictUTF8 = new UTF8Encoding (false, true);
-                       Strict1234UTF32 = new UTF32Encoding (true, false, true);
-                       StrictBigEndianUTF16 = new UnicodeEncoding (true, false, true);
-                       StrictUTF16 = new UnicodeEncoding (false, false, true);
-               }
-
-               Encoding enc;
-               Stream stream;
-               byte[] buffer;
-               int bufLength;
-               int bufPos;
-
-               static XmlException encodingException = new XmlException ("invalid encoding specification.");
-
-               public EncodingDetecingInputStream (Stream stream)
-               {
-                       if (stream == null)
-                               throw new ArgumentNullException ("stream");
-                       Initialize (stream);
-               }
-
-               private void Initialize (Stream stream)
-               {
-                       buffer = new byte [6];
-                       this.stream = stream;
-                       enc = StrictUTF8; // Default to UTF8 if we can't guess it
-                       bufLength = stream.Read (buffer, 0, buffer.Length);
-                       if (bufLength == -1 || bufLength == 0) {
-                               return;
-                       }
-
-                       int c = ReadByteSpecial ();
-                       switch (c) {
-                       case 0xFF:
-                               c = ReadByteSpecial ();
-                               if (c == 0xFE) {
-                                       // BOM-ed little endian utf-16
-                                       enc = Encoding.Unicode;
-                               } else {
-                                       // It doesn't start from "<?xml" then its encoding is utf-8
-                                       bufPos = 0;
-                               }
-                               break;
-                       case 0xFE:
-                               c = ReadByteSpecial ();
-                               if (c == 0xFF) {
-                                       // BOM-ed big endian utf-16
-                                       enc = Encoding.BigEndianUnicode;
-                                       return;
-                               } else {
-                                       // It doesn't start from "<?xml" then its encoding is utf-8
-                                       bufPos = 0;
-                               }
-                               break;
-                       case 0xEF:
-                               c = ReadByteSpecial ();
-                               if (c == 0xBB) {
-                                       c = ReadByteSpecial ();
-                                       if (c != 0xBF) {
-                                               bufPos = 0;
-                                       }
-                               } else {
-                                       buffer [--bufPos] = 0xEF;
-                               }
-                               break;
-                       case 0:
-                               // It could still be 1234/2143/3412 variants of UTF32, but only 1234 version is available on .NET.
-                               c = ReadByteSpecial ();
-                               if (c == 0)
-                                       enc = Strict1234UTF32;
-                               else
-                                       enc = StrictBigEndianUTF16;
-                               break;
-                       default:
-                               c = ReadByteSpecial ();
-                               if (c == 0)
-                                       enc = StrictUTF16;
-                               bufPos = 0;
-                               break;
-                       }
-               }
-
-               // Just like readbyte, but grows the buffer too.
-               int ReadByteSpecial ()
-               {
-                       if (bufLength > bufPos)
-                               return buffer [bufPos++];
-
-                       byte [] newbuf = new byte [buffer.Length * 2];
-                       Buffer.BlockCopy (buffer, 0, newbuf, 0, bufLength);
-                       int nbytes = stream.Read (newbuf, bufLength, buffer.Length);
-                       if (nbytes == -1 || nbytes == 0)
-                               return -1;
-                               
-                       bufLength += nbytes;
-                       buffer = newbuf;
-                       return buffer [bufPos++];
-               }
-
-               public Encoding ActualEncoding {
-                       get { return enc; }
-               }
-
-               #region Public Overrides
-               public override bool CanRead {
-                       get {
-                               if (bufLength > bufPos)
-                                       return true;
-                               else
-                                       return stream.CanRead; 
-                       }
-               }
-
-               // FIXME: It should support base stream's CanSeek.
-               public override bool CanSeek {
-                       get { return false; } // stream.CanSeek; }
-               }
-
-               public override bool CanWrite {
-                       get { return false; }
-               }
-
-               public override long Length {
-                       get {
-                               return stream.Length;
-                       }
-               }
-
-               public override long Position {
-                       get {
-                               return stream.Position - bufLength + bufPos;
-                       }
-                       set {
-                               if(value < bufLength)
-                                       bufPos = (int)value;
-                               else
-                                       stream.Position = value - bufLength;
-                       }
-               }
-
-               public override void Close ()
-               {
-                       stream.Close ();
-               }
-
-               public override void Flush ()
-               {
-                       stream.Flush ();
-               }
-
-               public override int Read (byte[] buffer, int offset, int count)
-               {
-                       int ret;
-                       if (count <= bufLength - bufPos)        {       // all from buffer
-                               Buffer.BlockCopy (this.buffer, bufPos, buffer, offset, count);
-                               bufPos += count;
-                               ret = count;
-                       } else {
-                               int bufRest = bufLength - bufPos;
-                               if (bufLength > bufPos) {
-                                       Buffer.BlockCopy (this.buffer, bufPos, buffer, offset, bufRest);
-                                       bufPos += bufRest;
-                               }
-                               ret = bufRest +
-                                       stream.Read (buffer, offset + bufRest, count - bufRest);
-                       }
-                       return ret;
-               }
-
-               public override int ReadByte ()
-               {
-                       if (bufLength > bufPos) {
-                               return buffer [bufPos++];
-                       }
-                       return stream.ReadByte ();
-               }
-
-               public override long Seek (long offset, System.IO.SeekOrigin origin)
-               {
-                       int bufRest = bufLength - bufPos;
-                       if (origin == SeekOrigin.Current)
-                               if (offset < bufRest)
-                                       return buffer [bufPos + offset];
-                               else
-                                       return stream.Seek (offset - bufRest, origin);
-                       else
-                               return stream.Seek (offset, origin);
-               }
-
-               public override void SetLength (long value)
-               {
-                       stream.SetLength (value);
-               }
-
-               public override void Write (byte[] buffer, int offset, int count)
-               {
-                       throw new NotSupportedException ();
-               }
-               #endregion
-       }
-
-       class PushbackReader : StreamReader
-       {
-               Stack<int> pushback;
-
-               public PushbackReader (Stream stream, Encoding encoding) : base (stream, encoding)
-               {
-                       pushback = new Stack<int>();
-               }
-
-               public PushbackReader (Stream stream) : this (new EncodingDetecingInputStream (stream))
-               {
-               }
-
-               public PushbackReader (EncodingDetecingInputStream stream) : this (stream, stream.ActualEncoding)
-               {
-               }
-
-               public override void Close ()
-               {
-                       pushback.Clear ();
-               }
-
-               public override int Peek ()
-               {
-                       if (pushback.Count > 0) {
-                               return pushback.Peek ();
-                       }
-                       else {
-                               return base.Peek ();
-                       }
-               }
-
-               public override int Read ()
-               {
-                       if (pushback.Count > 0) {
-                               return pushback.Pop ();
-                       }
-                       else {
-                               return base.Read ();
-                       }
-               }
-
-               public void Pushback (int ch)
-               {
-                       pushback.Push (ch);
-               }
-       }
-
-       // FIXME: quotas check
-       class JsonReader : XmlDictionaryReader, IXmlJsonReaderInitializer, IXmlLineInfo
-       {
-               class ElementInfo
-               {
-                       public readonly string Name;
-                       public readonly string Type;
-                       public bool HasContent;
-
-                       public ElementInfo (string name, string type)
-                       {
-                               this.Name = name;
-                               this.Type = type;
-                       }
-               }
-
-               enum AttributeState
-               {
-                       None,
-                       Type,
-                       TypeValue,
-                       RuntimeType,
-                       RuntimeTypeValue
-               }
-
-               PushbackReader reader;
-               XmlDictionaryReaderQuotas quotas;
-               OnXmlDictionaryReaderClose on_close;
-               XmlNameTable name_table = new NameTable ();
-
-               XmlNodeType current_node;
-               AttributeState attr_state;
-               string simple_value;
-               string next_element;
-               string current_runtime_type, next_object_content_name;
-               ReadState read_state = ReadState.Initial;
-               bool content_stored;
-               bool finished;
-               Stack<ElementInfo> elements = new Stack<ElementInfo> ();
-
-               int line = 1, column = 0;
-
-               // Constructors
-
-               public JsonReader (byte [] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
-               {
-                       SetInput (buffer, offset, count, encoding, quotas, onClose);
-               }
-
-               public JsonReader (Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
-               {
-                       SetInput (stream, encoding, quotas, onClose);
-               }
-
-               internal bool LameSilverlightLiteralParser { get; set; }
-
-               // IXmlLineInfo
-
-               public bool HasLineInfo ()
-               {
-                       return true;
-               }
-
-               public int LineNumber {
-                       get { return line; }
-               }
-
-               public int LinePosition {
-                       get { return column; }
-               }
-
-               // IXmlJsonReaderInitializer
-
-               public void SetInput (byte [] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
-               {
-                       SetInput (new MemoryStream (buffer, offset, count), encoding, quotas, onClose);
-               }
-
-               public void SetInput (Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
-               {
-                       if (encoding != null)
-                               reader = new PushbackReader (stream, encoding);
-                       else
-                               reader = new PushbackReader (stream);
-                       if (quotas == null)
-                               throw new ArgumentNullException ("quotas");
-                       this.quotas = quotas;
-                       this.on_close = onClose;
-               }
-
-               // XmlDictionaryReader
-
-               public override int AttributeCount {
-                       get { return current_node != XmlNodeType.Element ? 0 : current_runtime_type != null ? 2 : 1; }
-               }
-
-               public override string BaseURI {
-                       get { return String.Empty; }
-               }
-
-               public override int Depth {
-                       get {
-                               int mod = 0;
-                               switch (attr_state) {
-                               case AttributeState.Type:
-                               case AttributeState.RuntimeType:
-                                       mod++;
-                                       break;
-                               case AttributeState.TypeValue:
-                               case AttributeState.RuntimeTypeValue:
-                                       mod += 2;
-                                       break;
-                               case AttributeState.None:
-                                       if (NodeType == XmlNodeType.Text)
-                                               mod++;
-                                       break;
-                               }
-                               return read_state != ReadState.Interactive ? 0 : elements.Count - 1 + mod;
-                       }
-               }
-
-               public override bool EOF {
-                       get {
-                               switch (read_state) {
-                               case ReadState.Closed:
-                               case ReadState.EndOfFile:
-                                       return true;
-                               default:
-                                       return false;
-                               }
-                       }
-               }
-
-               public override bool HasValue {
-                       get {
-                               switch (NodeType) {
-                               case XmlNodeType.Attribute:
-                               case XmlNodeType.Text:
-                                       return true;
-                               default:
-                                       return false;
-                               }
-                       }
-               }
-
-               public override bool IsEmptyElement {
-                       get { return false; }
-               }
-
-               public override string LocalName {
-                       get {
-                               switch (attr_state) {
-                               case AttributeState.Type:
-                                       return "type";
-                               case AttributeState.RuntimeType:
-                                       return "__type";
-                               }
-                               switch (NodeType) {
-                               case XmlNodeType.Element:
-                               case XmlNodeType.EndElement:
-                                       return elements.Peek ().Name;
-                               default:
-                                       return String.Empty;
-                               }
-                       }
-               }
-
-               public override string NamespaceURI {
-                       get { return String.Empty; }
-               }
-
-               public override XmlNameTable NameTable {
-                       get { return name_table; }
-               }
-
-               public override XmlNodeType NodeType {
-                       get {
-                               switch (attr_state) {
-                               case AttributeState.Type:
-                               case AttributeState.RuntimeType:
-                                       return XmlNodeType.Attribute;
-                               case AttributeState.TypeValue:
-                               case AttributeState.RuntimeTypeValue:
-                                       return XmlNodeType.Text;
-                               default:
-                                       return current_node;
-                               }
-                       }
-               }
-
-               public override string Prefix {
-                       get { return String.Empty; }
-               }
-
-               public override ReadState ReadState {
-                       get { return read_state; }
-               }
-
-               public override string Value {
-                       get {
-                               switch (attr_state) {
-                               case AttributeState.Type:
-                               case AttributeState.TypeValue:
-                                       return elements.Peek ().Type;
-                               case AttributeState.RuntimeType:
-                               case AttributeState.RuntimeTypeValue:
-                                       return current_runtime_type;
-                               default:
-                                       return current_node == XmlNodeType.Text ? simple_value : String.Empty;
-                               }
-                       }
-               }
-
-               public override void Close ()
-               {
-                       if (on_close != null) {
-                               on_close (this);
-                               on_close = null;
-                       }
-                       read_state = ReadState.Closed;
-               }
-
-               public override string GetAttribute (int index)
-               {
-                       if (index == 0 && current_node == XmlNodeType.Element)
-                               return elements.Peek ().Type;
-                       else if (index == 1 && current_runtime_type != null)
-                               return current_runtime_type;
-                       throw new ArgumentOutOfRangeException ("index", "Index is must be either 0 or 1 when there is an explicit __type in the object, and only valid on an element on this XmlDictionaryReader");
-               }
-
-               public override string GetAttribute (string name)
-               {
-                       if (current_node != XmlNodeType.Element)
-                               return null;
-                       switch (name) {
-                       case "type":
-                               return elements.Peek ().Type;
-                       case "__type":
-                               return current_runtime_type;
-                       default:
-                               return null;
-                       }
-               }
-
-               public override string GetAttribute (string localName, string ns)
-               {
-                       if (ns == String.Empty)
-                               return GetAttribute (localName);
-                       else
-                               return null;
-               }
-
-               public override string LookupNamespace (string prefix)
-               {
-                       if (prefix == null)
-                               throw new ArgumentNullException ("prefix");
-                       else if (prefix.Length == 0)
-                               return String.Empty;
-                       return null;
-               }
-
-               public override bool MoveToAttribute (string name)
-               {
-                       if (current_node != XmlNodeType.Element)
-                               return false;
-                       switch (name) {
-                       case "type":
-                               attr_state = AttributeState.Type;
-                               return true;
-                       case "__type":
-                               if (current_runtime_type == null)
-                                       return false;
-                               attr_state = AttributeState.RuntimeType;
-                               return true;
-                       default:
-                               return false;
-                       }
-               }
-
-               public override bool MoveToAttribute (string localName, string ns)
-               {
-                       if (ns != String.Empty)
-                               return false;
-                       return MoveToAttribute (localName);
-               }
-
-               public override bool MoveToElement ()
-               {
-                       if (attr_state == AttributeState.None)
-                               return false;
-                       attr_state = AttributeState.None;
-                       return true;
-               }
-
-               public override bool MoveToFirstAttribute ()
-               {
-                       if (current_node != XmlNodeType.Element)
-                               return false;
-                       attr_state = AttributeState.Type;
-                       return true;
-               }
-
-               public override bool MoveToNextAttribute ()
-               {
-                       if (attr_state == AttributeState.None)
-                               return MoveToFirstAttribute ();
-                       else
-                               return MoveToAttribute ("__type");
-               }
-
-               public override bool ReadAttributeValue ()
-               {
-                       switch (attr_state) {
-                       case AttributeState.Type:
-                               attr_state = AttributeState.TypeValue;
-                               return true;
-                       case AttributeState.RuntimeType:
-                               attr_state = AttributeState.RuntimeTypeValue;
-                               return true;
-                       }
-                       return false;
-               }
-
-               public override void ResolveEntity ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override bool Read ()
-               {
-                       switch (read_state) {
-                       case ReadState.EndOfFile:
-                       case ReadState.Closed:
-                       case ReadState.Error:
-                               return false;
-                       case ReadState.Initial:
-                               read_state = ReadState.Interactive;
-                               next_element = "root";
-                               current_node = XmlNodeType.Element;
-                               break;
-                       }
-
-                       MoveToElement ();
-
-                       if (content_stored) {
-                               if (current_node == XmlNodeType.Element) {
-                                       if (elements.Peek ().Type == "null") {
-                                               // since null is not consumed as text content, it skips Text state.
-                                               current_node = XmlNodeType.EndElement;
-                                               content_stored = false;
-                                       }
-                                       else
-                                               current_node = XmlNodeType.Text;
-                                       return true;
-                               } else if (current_node == XmlNodeType.Text) {
-                                       current_node = XmlNodeType.EndElement;
-                                       content_stored = false;
-                                       return true;
-                               }
-                       }
-                       else if (current_node == XmlNodeType.EndElement) {
-                               // clear EndElement state
-                               elements.Pop ();
-                               if (elements.Count > 0)
-                                       elements.Peek ().HasContent = true;
-                               else
-                                       finished = true;
-                       }
-
-                       SkipWhitespaces ();
-
-                       attr_state = AttributeState.None;
-                       // Default. May be overriden only as EndElement or None.
-                       current_node = XmlNodeType.Element;
-
-                       if (!ReadContent (false))
-                               return false;
-                       if (finished)
-                               throw XmlError ("Multiple top-level content is not allowed");
-                       return true;
-               }
-
-               bool TryReadString (string str)
-               {
-                       for (int i = 0; i < str.Length; i ++) {
-                               int ch = ReadChar ();
-                               if (ch != str[i]) {
-                                       for (int j = i; j >= 0; j--)
-                                               PushbackChar (j);
-                                       return false;
-                               }
-                       }
-
-                       return true;
-               }
-
-               bool ReadContent (bool objectValue)
-               {
-                       int ch = ReadChar ();
-                       if (ch < 0) {
-                               ReadEndOfStream ();
-                               return false;
-                       }
-
-                       bool itemMustFollow = false;
-
-                       if (!objectValue && elements.Count > 0 && elements.Peek ().HasContent) {
-                               if (ch == ',') {
-                                       switch (elements.Peek ().Type) {
-                                       case "object":
-                                       case "array":
-                                               SkipWhitespaces ();
-                                               ch = ReadChar ();
-                                               itemMustFollow = true;
-                                               break;
-                                       }
-                               }
-                               else if (ch != '}' && ch != ']')
-                                       throw XmlError ("Comma is required unless an array or object is at the end");
-                       }
-
-                       if (elements.Count > 0 && elements.Peek ().Type == "array")
-                               next_element = "item";
-                       else if (next_object_content_name != null) {
-                               next_element = next_object_content_name;
-                               next_object_content_name = null;
-                               if (ch != ':')
-                                       throw XmlError ("':' is expected after a name of an object content");
-                               SkipWhitespaces ();
-                               ReadContent (true);
-                               return true;
-                       }
-
-                       switch (ch) {
-                       case '{':
-                               ReadStartObject ();
-                               return true;
-                       case '[':
-                               ReadStartArray ();
-                               return true;
-                       case '}':
-                               if (itemMustFollow)
-                                       throw XmlError ("Invalid comma before an end of object");
-                               if (objectValue)
-                                       throw XmlError ("Invalid end of object as an object content");
-                               ReadEndObject ();
-                               return true;
-                       case ']':
-                               if (itemMustFollow)
-                                       throw XmlError ("Invalid comma before an end of array");
-                               if (objectValue)
-                                       throw XmlError ("Invalid end of array as an object content");
-                               ReadEndArray ();
-                               return true;
-                       case '"':
-                               bool lame = LameSilverlightLiteralParser && ch != '"';
-                               string s = ReadStringLiteral (lame);
-                               if (!objectValue && elements.Count > 0 && elements.Peek ().Type == "object") {
-                                       next_element = s;
-                                       SkipWhitespaces ();
-                                       if (!lame)
-                                               Expect (':');
-                                       SkipWhitespaces ();
-                                       ReadContent (true);
-                               }
-                               else
-                                       ReadAsSimpleContent ("string", s);
-                               return true;
-                       case '-':
-                               ReadNumber (ch);
-                               return true;
-                       case 'n':
-                               if (TryReadString("ull")) {
-                                       ReadAsSimpleContent ("null", "null");
-                                       return true;
-                               }
-                               else {
-                                       // the pushback for 'n' is taken care of by the
-                                       // default case if we're in lame silverlight literal
-                                       // mode
-                                       goto default;
-                               }
-                       case 't':
-                               if (TryReadString ("rue")) {
-                                       ReadAsSimpleContent ("boolean", "true");
-                                       return true;
-                               }
-                               else {
-                                       // the pushback for 't' is taken care of by the
-                                       // default case if we're in lame silverlight literal
-                                       // mode
-                                       goto default;
-                               }
-                       case 'f':
-                               if (TryReadString ("alse")) {
-                                       ReadAsSimpleContent ("boolean", "false");
-                                       return true;
-                               }
-                               else {
-                                       // the pushback for 'f' is taken care of by the
-                                       // default case if we're in lame silverlight literal
-                                       // mode
-                                       goto default;
-                               }
-                       default:
-                               if ('0' <= ch && ch <= '9') {
-                                       ReadNumber (ch);
-                                       return true;
-                               }
-                               if (LameSilverlightLiteralParser) {
-                                       PushbackChar (ch);
-                                       goto case '"';
-                               }
-                               throw XmlError (String.Format ("Unexpected token: '{0}' ({1:X04})", (char) ch, (int) ch));
-                       }
-               }
-
-               void ReadStartObject ()
-               {
-                       ElementInfo ei = new ElementInfo (next_element, "object");
-                       elements.Push (ei);
-
-                       SkipWhitespaces ();
-                       if (PeekChar () == '"') { // it isn't premise: the object might be empty
-                               ReadChar ();
-                               string s = ReadStringLiteral ();
-                               if (s == "__type") {
-                                       SkipWhitespaces ();
-                                       Expect (':');
-                                       SkipWhitespaces ();
-                                       Expect ('"');
-                                       current_runtime_type = ReadStringLiteral ();
-                                       SkipWhitespaces ();
-                                       ei.HasContent = true;
-                               }
-                               else
-                                       next_object_content_name = s;
-                       }
-               }
-
-               void ReadStartArray ()
-               {
-                       elements.Push (new ElementInfo (next_element, "array"));
-               }
-
-               void ReadEndObject ()
-               {
-                       if (elements.Count == 0 || elements.Peek ().Type != "object")
-                               throw XmlError ("Unexpected end of object");
-                       current_node = XmlNodeType.EndElement;
-               }
-
-               void ReadEndArray ()
-               {
-                       if (elements.Count == 0 || elements.Peek ().Type != "array")
-                               throw XmlError ("Unexpected end of array");
-                       current_node = XmlNodeType.EndElement;
-               }
-
-               void ReadEndOfStream ()
-               {
-                       if (elements.Count > 0)
-                               throw XmlError (String.Format ("{0} missing end of arrays or objects", elements.Count));
-                       read_state = ReadState.EndOfFile;
-                       current_node = XmlNodeType.None;
-               }
-
-               void ReadAsSimpleContent (string type, string value)
-               {
-                       elements.Push (new ElementInfo (next_element, type));
-                       simple_value = value;
-                       content_stored = true;
-               }
-
-               void ReadNumber (int ch)
-               {
-                       elements.Push (new ElementInfo (next_element, "number"));
-                       content_stored = true;
-
-                       int init = ch;
-                       int prev;
-                       bool floating = false, exp = false;
-
-                       StringBuilder sb = new StringBuilder ();
-                       bool cont = true;
-                       do {
-                               sb.Append ((char) ch);
-                               prev = ch;
-                               ch = ReadChar ();
-
-                               if (prev == '-' && !IsNumber (ch)) // neither '.', '-' or '+' nor anything else is valid
-                                       throw XmlError ("Invalid JSON number");
-
-                               switch (ch) {
-                               case 'e':
-                               case 'E':
-                                       if (exp)
-                                               throw XmlError ("Invalid JSON number token. Either 'E' or 'e' must not occur more than once");
-                                       if (!IsNumber (prev))
-                                               throw XmlError ("Invalid JSON number token. only a number is valid before 'E' or 'e'");
-                                       exp = true;
-                                       break;
-                               case '.':
-                                       if (floating)
-                                               throw XmlError ("Invalid JSON number token. '.' must not occur twice");
-                                       if (exp)
-                                               throw XmlError ("Invalid JSON number token. '.' must not occur after 'E' or 'e'");
-                                       floating = true;
-                                       break;
-                               case '+':
-                               case '-':
-                                       if (prev == 'E' || prev == 'e')
-                                               break;
-                                       goto default;
-                               default:
-                                       if (!IsNumber (ch)) {
-                                               PushbackChar (ch);
-                                               cont = false;
-                                       }
-                                       break;
-                               }
-                       } while (cont);
-
-                       if (!IsNumber (prev)) // only number is valid at the end
-                               throw XmlError ("Invalid JSON number");
-
-                       simple_value = sb.ToString ();
-
-                       if (init == '0' && !floating && !exp && simple_value != "0")
-                               throw XmlError ("Invalid JSON number");
-               }
-
-               bool IsNumber (int c)
-               {
-                       return '0' <= c && c <= '9';
-               }
-
-               StringBuilder vb = new StringBuilder ();
-
-               string ReadStringLiteral ()
-               {
-                       return ReadStringLiteral (false);
-               }
-
-               string ReadStringLiteral (bool endWithColon)
-               {
-                       vb.Length = 0;
-                       while (true) {
-                               int c = ReadChar ();
-                               if (c < 0)
-                                       throw XmlError ("JSON string is not closed");
-                               if (c == '"' && !endWithColon)
-                                       return vb.ToString ();
-                               else if (c == ':' && endWithColon)
-                                       return vb.ToString ();
-                               else if (c != '\\') {
-                                       vb.Append ((char) c);
-                                       continue;
-                               }
-
-                               // escaped expression
-                               c = ReadChar ();
-                               if (c < 0)
-                                       throw XmlError ("Invalid JSON string literal; incomplete escape sequence");
-                               switch (c) {
-                               case '"':
-                               case '\\':
-                               case '/':
-                                       vb.Append ((char) c);
-                                       break;
-                               case 'b':
-                                       vb.Append ('\x8');
-                                       break;
-                               case 'f':
-                                       vb.Append ('\f');
-                                       break;
-                               case 'n':
-                                       vb.Append ('\n');
-                                       break;
-                               case 'r':
-                                       vb.Append ('\r');
-                                       break;
-                               case 't':
-                                       vb.Append ('\t');
-                                       break;
-                               case 'u':
-                                       ushort cp = 0;
-                                       for (int i = 0; i < 4; i++) {
-                                               if ((c = ReadChar ()) < 0)
-                                                       throw XmlError ("Incomplete unicode character escape literal");
-                                               cp *= 16;
-                                               if ('0' <= c && c <= '9')
-                                                       cp += (ushort) (c - '0');
-                                               if ('A' <= c && c <= 'F')
-                                                       cp += (ushort) (c - 'A' + 10);
-                                               if ('a' <= c && c <= 'f')
-                                                       cp += (ushort) (c - 'a' + 10);
-                                       }
-                                       vb.Append ((char) cp);
-                                       break;
-                               default:
-                                       throw XmlError ("Invalid JSON string literal; unexpected escape character");
-                               }
-                       }
-               }
-
-               int PeekChar ()
-               {
-                       return reader.Peek ();
-               }
-
-               int ReadChar ()
-               {
-                       int v = reader.Read ();
-                       if (v == '\n') {
-                               line++;
-                               column = 0;
-                       }
-                       else
-                               column++;
-                       return v;
-               }
-
-               void PushbackChar (int ch)
-               {
-                       // FIXME handle lines (and columns?  ugh, how?)
-                       reader.Pushback (ch);
-               }
-
-               void SkipWhitespaces ()
-               {
-                       do {
-                               switch (PeekChar ()) {
-                               case ' ':
-                               case '\t':
-                               case '\r':
-                               case '\n':
-                                       ReadChar ();
-                                       continue;
-                               default:
-                                       return;
-                               }
-                       } while (true);
-               }
-
-               void Expect (char c)
-               {
-                       int v = ReadChar ();
-                       if (v < 0)
-                               throw XmlError (String.Format ("Expected '{0}' but got EOF", c));
-                       if (v != c)
-                               throw XmlError (String.Format ("Expected '{0}' but got '{1}'", c, (char) v));
-               }
-
-               Exception XmlError (string s)
-               {
-                       return new XmlException (String.Format ("{0} ({1},{2})", s, line, column));
-               }
-
-               // This reads the current element and all its content as a string,
-               // with no processing done except for advancing the reader.
-               public override string ReadInnerXml ()
-               {
-
-                       if (NodeType != XmlNodeType.Element)
-                               return base.ReadInnerXml ();
-
-                       StringBuilder sb = new StringBuilder ();
-                       bool isobject = elements.Peek ().Type == "object";
-                       char end = isobject ? '}' : ']';
-                       char start = isobject ? '{' : '[';
-                       int count = 1;
-
-                       sb.Append (start);
-
-                       // add the first child manually, it's already been read
-                       // but hasn't been processed yet
-                       if (isobject && !String.IsNullOrEmpty (next_object_content_name))
-                                       sb.Append ("\"" + next_object_content_name + "\"");
-
-                       // keep reading until we hit the end marker, no processing is
-                       // done on anything
-                       do {
-                               char c = (char)ReadChar ();
-                               sb.Append (c);
-                               if (c == start)
-                                       ++count;
-                               else if (c == end)
-                                       --count;
-                       } while (count > 0);
-
-                       // Replace the content we've read with an empty object so it gets
-                       // skipped on the following Read
-                       reader.Pushback (end);
-                       if (isobject) {
-                               reader.Pushback ('"');
-                               reader.Pushback ('"');
-                               reader.Pushback (':');
-                       }
-
-                       // Skip the element
-                       Read ();
-                       return sb.ToString ();
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs
deleted file mode 100644 (file)
index 804eeeb..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// JsonReaderWriterFactory.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.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.IO;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       public static class JsonReaderWriterFactory
-       {
-               public static XmlDictionaryReader CreateJsonReader (byte [] buffer, XmlDictionaryReaderQuotas quotas)
-               {
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-                       return CreateJsonReader (buffer, 0, buffer.Length, quotas);
-               }
-
-               public static XmlDictionaryReader CreateJsonReader (byte [] buffer, int offset, int count, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateJsonReader (buffer, offset, count, null, quotas, null);
-               }
-
-               public static XmlDictionaryReader CreateJsonReader (byte [] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
-               {
-                       return new JsonReader (buffer, offset, count, encoding, quotas, onClose);
-               }
-
-               public static XmlDictionaryReader CreateJsonReader (Stream stream, XmlDictionaryReaderQuotas quotas)
-               {
-                       return CreateJsonReader (stream, null, quotas, null);
-               }
-
-               public static XmlDictionaryReader CreateJsonReader (Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
-               {
-                       return new JsonReader (stream, encoding, quotas, onClose);
-               }
-
-               public static XmlDictionaryWriter CreateJsonWriter (Stream stream)
-               {
-                       return CreateJsonWriter (stream, new UTF8Encoding (false, true));
-               }
-
-               public static XmlDictionaryWriter CreateJsonWriter (Stream stream, Encoding encoding)
-               {
-                       return CreateJsonWriter (stream, encoding, false);
-               }
-
-               public static XmlDictionaryWriter CreateJsonWriter (Stream stream, Encoding encoding, bool ownsStream)
-               {
-                       return new JsonWriter (stream, encoding, ownsStream);
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationReader.cs
deleted file mode 100644 (file)
index 597a5c3..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-//
-// JsonSerializationReader.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.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.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       class JsonSerializationReader
-       {
-               DataContractJsonSerializer serializer;
-               XmlReader reader;
-               int serialized_object_count;
-               bool verify_object_name;
-               Dictionary<Type, TypeMap> typemaps = new Dictionary<Type, TypeMap> ();
-               Type root_type;
-
-               public JsonSerializationReader (DataContractJsonSerializer serializer, XmlReader reader, Type rootType, bool verifyObjectName)
-               {
-                       this.serializer = serializer;
-                       this.reader = reader;
-                       this.root_type = rootType;
-                       this.verify_object_name = verifyObjectName;
-               }
-
-               public XmlReader Reader {
-                       get { return reader; }
-               }
-
-               public object ReadRoot ()
-               {
-                       TypeMap rootMap = GetTypeMap (root_type);
-
-                       object v = ReadObject (root_type);
-                       return v;
-               }
-
-               public object ReadObject (Type type)
-               {
-                       return ReadObject (type, null);
-               }
-               
-               public object ReadObject (Type type, object instance)
-               {
-                       if (serialized_object_count ++ == serializer.MaxItemsInObjectGraph)
-                               throw SerializationError (String.Format ("The object graph exceeded the maximum object count '{0}' specified in the serializer", serializer.MaxItemsInObjectGraph));
-
-                       bool nullable = false;
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) {
-                               nullable = true;
-                               type = Nullable.GetUnderlyingType (type);
-                       }
-
-                       bool isNull = reader.GetAttribute ("type") == "null";
-
-                       switch (Type.GetTypeCode (type)) {
-                       case TypeCode.DBNull:
-                               string dbn = reader.ReadElementContentAsString ();
-                               if (dbn != String.Empty)
-                                       throw new SerializationException (String.Format ("The only expected DBNull value string is '{{}}'. Tha actual input was '{0}'.", dbn));
-                               return DBNull.Value;
-                       case TypeCode.String:
-                               if (isNull) {
-                                       reader.ReadElementContentAsString ();
-                                       return null;
-                               }
-                               else
-                                       return reader.ReadElementContentAsString ();
-                       case TypeCode.Char:
-                               var c = reader.ReadElementContentAsString ();
-                               if (c.Length > 1)
-                                       throw new XmlException ("Invalid JSON char");
-                               return Char.Parse(c);
-                       case TypeCode.Single:
-                       case TypeCode.Double:
-                       case TypeCode.Decimal:
-                                       return ReadValueType (type, nullable);
-                       case TypeCode.Byte:
-                       case TypeCode.SByte:
-                       case TypeCode.Int16:
-                       case TypeCode.Int32:
-                       case TypeCode.UInt16:
-                       case TypeCode.UInt32:
-                       case TypeCode.Int64:
-                               if (type.IsEnum)
-                                       return Enum.ToObject (type, Convert.ChangeType (reader.ReadElementContentAsLong (), Enum.GetUnderlyingType (type), null));
-                               else
-                                       return ReadValueType (type, nullable);
-                       case TypeCode.UInt64:
-                               if (type.IsEnum)
-                                       return Enum.ToObject (type, Convert.ChangeType (reader.ReadElementContentAsDecimal (), Enum.GetUnderlyingType (type), null));
-                               else
-                                       return ReadValueType (type, nullable);
-                       case TypeCode.Boolean:
-                               return ReadValueType (type, nullable);
-                       case TypeCode.DateTime:
-                               // it does not use ReadElementContentAsDateTime(). Different string format.
-                               var s = reader.ReadElementContentAsString ();
-                               if (s.Length < 2 || !s.StartsWith ("/Date(", StringComparison.Ordinal) || !s.EndsWith (")/", StringComparison.Ordinal)) {
-                                       if (nullable)
-                                               return null;
-                                       throw new XmlException ("Invalid JSON DateTime format. The value format should be '/Date(UnixTime)/'");
-                               }
-
-                               // The date can contain [SIGN]LONG, [SIGN]LONG+HOURSMINUTES or [SIGN]LONG-HOURSMINUTES
-                               // the format for HOURSMINUTES is DDDD
-                               int tidx = s.IndexOf ('-', 8);
-                               if (tidx == -1)
-                                       tidx = s.IndexOf ('+', 8);
-                               int minutes = 0;
-                               if (tidx == -1){
-                                       s = s.Substring (6, s.Length - 8);
-                               } else {
-                                       int offset;
-                                       int.TryParse (s.Substring (tidx+1, s.Length-3-tidx), out offset);
-
-                                       minutes = (offset % 100) + (offset / 100) * 60;
-                                       if (s [tidx] == '-')
-                                               minutes = -minutes;
-
-                                       s = s.Substring (6, tidx-6);
-                               }
-                               var date = new DateTime (1970, 1, 1).AddMilliseconds (long.Parse (s));
-                               if (minutes != 0)
-                                       date = date.AddMinutes (minutes);
-                               return date;
-                       default:
-                               if (type == typeof (Guid)) {
-                                       return new Guid (reader.ReadElementContentAsString ());
-                               } else if (type == typeof (Uri)) {
-                                       if (isNull) {
-                                               reader.ReadElementContentAsString ();
-                                               return null;
-                                       }
-                                       else
-                                               return new Uri (reader.ReadElementContentAsString (), UriKind.RelativeOrAbsolute);
-                               } else if (type == typeof (XmlQualifiedName)) {
-                                       s = reader.ReadElementContentAsString ();
-                                       int idx = s.IndexOf (':');
-                                       return idx < 0 ? new XmlQualifiedName (s) : new XmlQualifiedName (s.Substring (0, idx), s.Substring (idx + 1));
-                               } else if (type != typeof (object)) {
-                                       // strongly-typed object
-                                       if (reader.IsEmptyElement) {
-                                               // empty -> null array or object
-                                               reader.Read ();
-                                               return null;
-                                       }
-
-                                       Type ct = GetCollectionElementType (type);
-                                       if (ct != null) {
-                                               return DeserializeGenericCollection (type, ct, instance);
-                                       } else {
-                                               string typeHint = reader.GetAttribute ("__type");
-                                               if (typeHint != null) {
-                                                       // this might be a derived & known type. We allow it when it's both.
-                                                       Type exactType = GetRuntimeType (typeHint, type);
-                                                       if (exactType == null)
-                                                               throw SerializationError (String.Format ("Cannot load type '{0}'", typeHint));
-                                                        TypeMap map = GetTypeMap (exactType);
-                                                        return map.Deserialize (this, instance);
-                                               } else { // no type hint
-                                                       TypeMap map = GetTypeMap (type);
-                                                        return map.Deserialize (this, instance);
-                                               }
-                                       }
-                               }
-                               else
-                                       return ReadInstanceDrivenObject ();
-                       }
-               }
-               
-               object ReadValueType (Type type, bool nullable)
-               {
-                       string s = reader.ReadElementContentAsString ();
-                       return nullable && s.Trim ().Length == 0 ? null : Convert.ChangeType (s, type, CultureInfo.InvariantCulture);
-               }
-               
-
-               Type GetRuntimeType (string name, Type baseType)
-               {
-                       string properName = ToRuntimeTypeName (name);
-
-                       if (baseType != null && baseType.FullName.Equals (properName))
-                               return baseType;
-
-                       if (serializer.KnownTypes != null)
-                               foreach (Type t in serializer.KnownTypes)
-                                       if (t.FullName.Equals (properName)) 
-                                               return t;
-
-                       if (baseType != null)
-                               foreach (var attr in baseType.GetCustomAttributes (typeof (KnownTypeAttribute), false))
-                                       if ((attr as KnownTypeAttribute).Type.FullName.Equals (properName))
-                                               return (attr as KnownTypeAttribute).Type;
-
-                       return null;
-               }
-
-               object ReadInstanceDrivenObject ()
-               {
-                       string type = reader.GetAttribute ("type");
-                       switch (type) {
-                       case "null":
-                               reader.Skip ();
-                               return null;
-                       case "object":
-                               string runtimeType = reader.GetAttribute ("__type");
-                               if (runtimeType != null) {
-                                       Type t = GetRuntimeType (runtimeType, null);
-                                       if (t == null)
-                                               throw SerializationError (String.Format ("Cannot load type '{0}'", runtimeType));
-                                       return ReadObject (t);
-                               }
-                               break;
-                       }
-                       string v = reader.ReadElementContentAsString ();
-                       switch (type) {
-                       case "boolean":
-                               switch (v) {
-                               case "true":
-                                       return true;
-                               case "false":
-                                       return false;
-                               default:
-                                       throw SerializationError (String.Format ("Invalid JSON boolean value: {0}", v));
-                               }
-                       case "string":
-                               return v;
-                       case "number":
-                               int i;
-                               if (int.TryParse (v, NumberStyles.None, CultureInfo.InvariantCulture, out i))
-                                       return i;
-                               long l;
-                               if (long.TryParse (v, NumberStyles.None, CultureInfo.InvariantCulture, out l))
-                                       return l;
-                               ulong ul;
-                               if (ulong.TryParse (v, NumberStyles.None, CultureInfo.InvariantCulture, out ul))
-                                       return ul;
-                               double dbl;
-                               if (double.TryParse (v, NumberStyles.None, CultureInfo.InvariantCulture, out dbl))
-                                       return dbl;
-                               decimal dec;
-                               if (decimal.TryParse (v, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out dec))
-                                       return dec;
-                               throw SerializationError (String.Format ("Invalid JSON input: {0}", v));
-                       default:
-                               throw SerializationError (String.Format ("Unexpected type: {0}", type));
-                       }
-               }
-
-               string FormatTypeName (Type type)
-               {
-                       return type.Namespace == null ? type.Name : String.Format ("{0}:#{1}", type.Name, type.Namespace);
-               }
-
-               string ToRuntimeTypeName (string s)
-               {
-                       int idx = s.IndexOf (":#", StringComparison.Ordinal);
-                       return idx < 0 ? s : String.Concat (s.Substring (idx + 2), ".", s.Substring (0, idx));
-               }
-
-               Type GetCollectionElementType (Type type)
-               {
-                       if (type.IsArray)
-                               return type.GetElementType ();
-
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (IEnumerable<>))
-                               return type.GetGenericArguments () [0];
-                       var inter = type.GetInterface ("System.Collections.Generic.IEnumerable`1", false);
-                       if (inter != null)
-                               return inter.GetGenericArguments () [0];
-                       
-                       if (typeof (IEnumerable).IsAssignableFrom (type))
-                               // return typeof(object) for mere collection.
-                               return typeof (object);
-                       else
-                               return null;
-               }
-
-               object DeserializeGenericCollection (Type collectionType, Type elementType, object collectionInstance)
-               {
-                       reader.ReadStartElement ();
-                       object ret;
-                       if (collectionType.IsInterface)
-                               collectionType = typeof (List<>).MakeGenericType (elementType);
-                       if (TypeMap.IsDictionary (collectionType)) {
-                               if (collectionInstance == null)
-                                       collectionInstance = Activator.CreateInstance (collectionType);
-                               
-                               var keyType = elementType.IsGenericType ? elementType.GetGenericArguments () [0] : typeof (object);
-                               var valueType = elementType.IsGenericType ? elementType.GetGenericArguments () [1] : typeof (object);
-                               MethodInfo add = collectionType.GetMethod ("Add", new Type [] { keyType, valueType });
-
-                               for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
-                                       if (!reader.IsStartElement ("item"))
-                                               throw SerializationError (String.Format ("Expected element 'item', but found '{0}' in namespace '{1}'", reader.LocalName, reader.NamespaceURI));
-
-                                       // reading a KeyValuePair in the form of <Key .../><Value .../>
-                                       reader.Read ();
-                                       reader.MoveToContent ();
-                                       object key = ReadObject (keyType);
-                                       reader.MoveToContent ();
-                                       object val = ReadObject (valueType);
-                                       reader.Read ();
-                                       add.Invoke (collectionInstance, new [] { key, val });
-                               }
-                               ret = collectionInstance;
-                       } else if (typeof (IList).IsAssignableFrom (collectionType)) {
-#if NET_2_1
-                               Type listType = collectionType.IsArray ? typeof (List<>).MakeGenericType (elementType) : null;
-#else
-                               Type listType = collectionType.IsArray ? typeof (ArrayList) : null;
-#endif
-                               
-                               IList c;
-                               if (collectionInstance == null)
-                                       c = (IList) Activator.CreateInstance (listType ?? collectionType);
-                               else 
-                                       c = (IList) collectionInstance;
-                               
-                               for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
-                                       if (!reader.IsStartElement ("item"))
-                                               throw SerializationError (String.Format ("Expected element 'item', but found '{0}' in namespace '{1}'", reader.LocalName, reader.NamespaceURI));
-                                       object elem = ReadObject (elementType);
-                                       c.Add (elem);
-                               }
-#if NET_2_1
-                               if (collectionType.IsArray) {
-                                       Array array = Array.CreateInstance (elementType, c.Count);
-                                       c.CopyTo (array, 0);
-                                       ret = array;
-                               }
-                               else
-                                       ret = c;
-#else
-                               ret = collectionType.IsArray ? ((ArrayList) c).ToArray (elementType) : c;
-#endif
-                       } else {
-                               if (collectionInstance == null)
-                                       collectionInstance = Activator.CreateInstance (collectionType);
-                               
-                               MethodInfo add;
-                               if (collectionInstance.GetType ().IsGenericType &&
-                                       collectionInstance.GetType ().GetGenericTypeDefinition () == typeof (LinkedList<>))
-                                       add = collectionType.GetMethod ("AddLast", new Type [] { elementType });
-                               else
-                                       add = collectionType.GetMethod ("Add", new Type [] { elementType });
-                               
-                               if (add == null) {
-                                       var icoll = typeof (ICollection<>).MakeGenericType (elementType);
-                                       if (icoll.IsAssignableFrom (collectionInstance.GetType ()))
-                                               add = icoll.GetMethod ("Add");
-                               }
-                               if (add == null) 
-                                       throw new MissingMethodException (elementType.FullName, "Add");
-                               
-                               for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
-                                       if (!reader.IsStartElement ("item"))
-                                               throw SerializationError (String.Format ("Expected element 'item', but found '{0}' in namespace '{1}'", reader.LocalName, reader.NamespaceURI));
-                                       object element = ReadObject (elementType);
-                                       add.Invoke (collectionInstance, new object [] { element });
-                               }
-                               ret = collectionInstance;
-                       }
-
-                       reader.ReadEndElement ();
-                       return ret;
-               }
-
-               TypeMap GetTypeMap (Type type)
-               {
-                       TypeMap map;
-                       if (!typemaps.TryGetValue (type, out map)) {
-                               map = TypeMap.CreateTypeMap (type);
-                               typemaps [type] = map;
-                       }
-                       return map;
-               }
-
-               Exception SerializationError (string basemsg)
-               {
-                       IXmlLineInfo li = reader as IXmlLineInfo;
-                       if (li == null || !li.HasLineInfo ())
-                               return new SerializationException (basemsg);
-                       else
-                               return new SerializationException (String.Format ("{0}. Error at {1} ({2},{3})", basemsg, reader.BaseURI, li.LineNumber, li.LinePosition));
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationWriter.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationWriter.cs
deleted file mode 100644 (file)
index 9ea5bf9..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// JsonSerializationWriter.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.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.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Globalization;
-using System.IO;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       class JsonSerializationWriter
-       {
-               DataContractJsonSerializer serializer;
-               XmlWriter writer;
-               int serialized_object_count;
-               bool always_emit_type;
-               Dictionary<Type, TypeMap> typemaps = new Dictionary<Type, TypeMap> ();
-               Type root_type;
-
-               public JsonSerializationWriter (DataContractJsonSerializer serializer, XmlWriter writer, Type rootType, bool alwaysEmitTypeInformation)
-               {
-                       this.serializer = serializer;
-                       this.writer = writer;
-                       this.root_type = rootType;
-                       this.always_emit_type = alwaysEmitTypeInformation;
-               }
-
-               public XmlWriter Writer {
-                       get { return writer; }
-               }
-
-               public void WriteObjectContent (object graph, bool top, bool outputTypeName)
-               {
-                       if (graph == null) {
-                               if (top)
-                                       GetTypeMap (root_type); // to make sure to reject invalid contracts
-                               writer.WriteAttributeString ("type", "null");
-                               writer.WriteString (null);
-                               return;
-                       }
-
-                       if (serialized_object_count ++ == serializer.MaxItemsInObjectGraph)
-                               throw new SerializationException (String.Format ("The object graph exceeded the maximum object count '{0}' specified in the serializer", serializer.MaxItemsInObjectGraph));
-
-                       var type = graph.GetType ();
-                       if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
-                               type = type.GetGenericArguments () [0];
-
-                       switch (Type.GetTypeCode (type)) {
-                       case TypeCode.Char:
-                       case TypeCode.String:
-                               writer.WriteString (graph.ToString ());
-                               break;
-                       case TypeCode.Single:
-                       case TypeCode.Double:
-                               writer.WriteAttributeString ("type", "number");
-                               writer.WriteString (((IFormattable) graph).ToString ("R", CultureInfo.InvariantCulture));
-                               break;
-                       case TypeCode.Byte:
-                       case TypeCode.SByte:
-                       case TypeCode.Int16:
-                       case TypeCode.Int32:
-                       case TypeCode.Int64:
-                       case TypeCode.UInt16:
-                       case TypeCode.UInt32:
-                       case TypeCode.UInt64:
-                       case TypeCode.Decimal:
-                               writer.WriteAttributeString ("type", "number");
-                               if (type.IsEnum)
-                                       graph = ((IConvertible) graph).ToType (Enum.GetUnderlyingType (type), CultureInfo.InvariantCulture);
-                               writer.WriteString (((IFormattable) graph).ToString ("G", CultureInfo.InvariantCulture));
-                               break;
-                       case TypeCode.Boolean:
-                               writer.WriteAttributeString ("type", "boolean");
-                               if ((bool) graph)
-                                       writer.WriteString ("true");
-                               else
-                                       writer.WriteString ("false");
-                               break;
-                       case TypeCode.DateTime:
-                               writer.WriteString (String.Format (CultureInfo.InvariantCulture, "/Date({0})/", (long) ((DateTime) graph).Subtract (new DateTime (1970, 1, 1)).TotalMilliseconds));
-                               break;
-                       default:
-                               if (graph is Guid) {
-                                       goto case TypeCode.String;
-                               } else if (graph is Uri) {
-                                       goto case TypeCode.String;
-                               } else if (graph is XmlQualifiedName) {
-                                       XmlQualifiedName qn = (XmlQualifiedName) graph;
-                                       writer.WriteString (qn.Name);
-                                       writer.WriteString (":");
-                                       writer.WriteString (qn.Namespace);
-                               } else if (TypeMap.IsDictionary (type)) {
-                                       writer.WriteAttributeString ("type", "array");
-                                       bool otn = !(graph is Array && type.GetElementType () != typeof (object));
-                                       var d = graph as IDictionary;
-                                       if (d != null) {
-                                               // Optimize the IDictionary case to avoid reflection
-                                               foreach (object k in d.Keys)
-                                                       WriteItem (k, d [k], otn);
-                                       } else {
-                                               // we can't typecast to IDictionary<,> and can't use dynamic for iOS support
-                                               var itemGetter = GetDictionaryProperty (type, "Item");
-                                               var keysGetter = GetDictionaryProperty (type, "Keys");
-                                               var argarr = new object [1];
-                                               foreach (object o in (IEnumerable) keysGetter.GetValue (graph, null)) {
-                                                       argarr [0] = o;
-                                                       WriteItem (o, itemGetter.GetValue (graph, argarr), otn);
-                                               }
-                                       }
-                               } else if (graph is Array || TypeMap.IsEnumerable (type)) {
-                                       writer.WriteAttributeString ("type", "array");
-                                       foreach (object o in (IEnumerable) graph) {
-                                               writer.WriteStartElement ("item");
-                                               // when it is typed, then no need to output "__type"
-                                               WriteObjectContent (o, false, !(graph is Array && type.GetElementType () != typeof (object)));
-                                               writer.WriteEndElement ();
-                                       }
-                               } else { // object
-                                       TypeMap tm = GetTypeMap (type);
-                                       if (tm != null) {
-                                               // FIXME: I'm not sure how it is determined whether __type is written or not...
-                                               if (outputTypeName || always_emit_type)
-                                                       writer.WriteAttributeString ("__type", FormatTypeName (type));
-                                               tm.Serialize (this, graph, "object");
-                                       }
-                                       else
-                                               // it does not emit type="object" (as the graph is regarded as a string)
-//                                             writer.WriteString (graph.ToString ());
-throw new InvalidDataContractException (String.Format ("Type {0} cannot be serialized by this JSON serializer", type));
-                               }
-                               break;
-                       }
-               }
-
-               void WriteItem (object key, object value, bool outputTypeName)
-               {
-                       writer.WriteStartElement ("item");
-                       writer.WriteAttributeString ("type", "object");
-                       // outputting a KeyValuePair as <Key .. /><Value ... />
-                       writer.WriteStartElement ("Key");
-                       WriteObjectContent (key, false, outputTypeName);
-                       writer.WriteEndElement ();
-                       writer.WriteStartElement ("Value");
-                       WriteObjectContent (value, false, outputTypeName);
-                       writer.WriteEndElement ();
-                       writer.WriteEndElement ();
-               }
-
-               PropertyInfo GetDictionaryProperty (Type type, string propertyName)
-               {
-                       var p = type.GetProperty (propertyName);
-                       if (p != null)
-                               return p;
-                       // check explicit - but the generic names might differ, e.g. TKey,TValue vs T,V
-                       var ap = type.GetProperties (BindingFlags.Instance | BindingFlags.NonPublic);
-                       foreach (var cp in ap) {
-                               if (!cp.Name.EndsWith (propertyName, StringComparison.Ordinal))
-                                       continue;
-                               if (cp.Name.StartsWith ("System.Collections.Generic.IDictionary<", StringComparison.Ordinal))
-                                       return cp;
-                       }
-                       return null;
-               }
-
-               string FormatTypeName (Type type)
-               {
-                       return String.Format ("{0}:#{1}", type.Name, type.Namespace);
-               }
-
-               TypeMap GetTypeMap (Type type)
-               {
-                       TypeMap map;
-                       if (!typemaps.TryGetValue (type, out map)) {
-                               map = TypeMap.CreateTypeMap (type);
-                               typemaps [type] = map;
-                       }
-                       return map;
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs
deleted file mode 100644 (file)
index bcd0188..0000000
+++ /dev/null
@@ -1,552 +0,0 @@
-//
-// JsonWriter.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.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.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       class JsonWriter : XmlDictionaryWriter, IXmlJsonWriterInitializer
-       {
-               enum ElementType
-               {
-                       None,
-                       Null,
-                       Object,
-                       Array,
-                       String,
-                       Number,
-                       Boolean,
-               }
-
-               Stream output;
-               bool close_output;
-               WriteState state;
-               Stack<ElementType> element_kinds = new Stack<ElementType> ();
-               Stack<bool> first_content_flags = new Stack<bool> ();
-               string attr_name, attr_value, runtime_type;
-               Encoding encoding;
-               byte [] encbuf = new byte [1024];
-               bool no_string_yet = true, is_null, is_ascii_single;
-
-               public JsonWriter (Stream stream, Encoding encoding, bool closeOutput)
-               {
-                       SetOutput (stream, encoding, closeOutput);
-               }
-
-               public void SetOutput (Stream stream, Encoding encoding, bool ownsStream)
-               {
-                       if (stream == null)
-                               throw new ArgumentNullException ("stream");
-                       if (encoding == null)
-                               throw new ArgumentNullException ("encoding");
-                       output = stream;
-                       this.encoding = encoding;
-                       close_output = ownsStream;
-                       is_ascii_single = encoding is UTF8Encoding || encoding.IsSingleByte;
-               }
-
-               void CheckState ()
-               {
-                       switch (state) {
-                       case WriteState.Closed:
-                       case WriteState.Error:
-                               throw new InvalidOperationException (String.Format ("This XmlDictionaryReader is already at '{0}' state", state));
-                       }
-               }
-
-               // copied from System.Silverlight JavaScriptSerializer.
-               static string EscapeStringLiteral (string input)
-               {
-                       StringBuilder sb = null;
-                       int i = 0, start = 0;
-                       for (; i < input.Length; i++) {
-                               switch (input [i]) {
-                               case '"':
-                                       AppendBuffer (ref sb, input, start, i, @"\""");
-                                       break;
-                               case '\\':
-                                       AppendBuffer (ref sb, input, start, i, @"\\");
-                                       break;
-                               case '/':
-                                       AppendBuffer (ref sb, input, start, i, @"\/");
-                                       break;
-                               case '\x8':
-                                       AppendBuffer (ref sb, input, start, i, @"\b");
-                                       break;
-                               case '\f':
-                                       AppendBuffer (ref sb, input, start, i, @"\f");
-                                       break;
-                               case '\n':
-                                       AppendBuffer (ref sb, input, start, i, /*@"\n"*/@"\u000a");
-                                       break;
-                               case '\r':
-                                       AppendBuffer (ref sb, input, start, i, /*@"\r"*/@"\u000d");
-                                       break;
-                               case '\t':
-                                       AppendBuffer (ref sb, input, start, i, /*@"\t"*/@"\u0009");
-                                       break;
-                               default:
-                                       continue;
-                               }
-                               start = i + 1;
-                       }
-                       string remaining = input.Substring (start, i - start);
-                       if (sb != null)
-                               return sb.Append (remaining).ToString ();
-                       else
-                               return remaining;
-               }
-
-               static void AppendBuffer (ref StringBuilder sb, string input, int start, int i, string append)
-               {
-                       if (sb == null)
-                               sb = new StringBuilder ();
-                       if (i != start)
-                               sb.Append (input, start, i - start);
-                       sb.Append (append);
-               }
-
-               public override WriteState WriteState {
-                       get { return state; }
-               }
-
-               public override void Close ()
-               {
-                       // close all open elements
-                       while (element_kinds.Count > 0)
-                               WriteEndElement ();
-
-                       if (close_output)
-                               output.Close ();
-                       else
-                               output.Flush ();
-
-                       state = WriteState.Closed;
-               }
-
-               public override void Flush ()
-               {
-                       output.Flush ();
-               }
-
-               public override void WriteStartElement (string prefix, string localName, string ns)
-               {
-                       CheckState ();
-
-                       if (localName == null)
-                               throw new ArgumentNullException ("localName");
-                       else if (localName.Length == 0)
-                               throw new ArgumentException ("Empty string is not a valid localName in this XmlDictionaryWriter");
-
-                       if (!String.IsNullOrEmpty (ns))
-                               throw new ArgumentException ("Non-empty namespace URI is not allowed in this XmlDictionaryWriter");
-                       if (!String.IsNullOrEmpty (prefix))
-                               throw new ArgumentException ("Non-empty prefix is not allowed in this XmlDictionaryWriter");
-
-                       if (state == WriteState.Attribute)
-                               WriteEndAttribute ();
-                       if (state == WriteState.Element)
-                               CloseStartElement ();
-
-                       else if (state != WriteState.Start && element_kinds.Count == 0)
-                               throw new XmlException ("This XmlDictionaryWriter does not support multiple top-level elements");
-
-                       if (element_kinds.Count == 0) {
-                               if (localName != "root")
-                                       throw new XmlException ("Only 'root' is allowed for the name of the top-level element");
-                       } else {
-                               switch (element_kinds.Peek ()) {
-                               case ElementType.Array:
-                                       if (localName != "item")
-                                               throw new XmlException ("Only 'item' is allowed as a content element of an array");
-                                       break;
-                               case ElementType.String:
-                                       throw new XmlException ("Mixed content is not allowed in this XmlDictionaryWriter");
-                               case ElementType.Null:
-                                       throw new XmlException ("Current type is null and writing element inside null is not allowed");
-                               case ElementType.None:
-                                       throw new XmlException ("Before writing a child element, an element needs 'type' attribute to indicate whether the element is a JSON array or a JSON object in this XmlDictionaryWriter");
-                               }
-
-                               if (first_content_flags.Peek ()) {
-                                       first_content_flags.Pop ();
-                                       first_content_flags.Push (false);
-                               }
-                               else
-                                       OutputAsciiChar (',');
-
-                               if (element_kinds.Peek () != ElementType.Array) {
-                                       OutputAsciiChar ('"');
-                                       OutputString (localName);
-                                       OutputAsciiChar ('\"');
-                                       OutputAsciiChar (':');
-                               }
-                       }
-
-                       element_kinds.Push (ElementType.None); // undetermined yet
-
-                       state = WriteState.Element;
-               }
-
-               public override void WriteEndElement ()
-               {
-                       CheckState ();
-
-                       if (state == WriteState.Attribute)
-                               throw new XmlException ("Cannot end element when an attribute is being written");
-                       if (state == WriteState.Element)
-                               CloseStartElement ();
-
-                       if (element_kinds.Count == 0)
-                               throw new XmlException ("There is no open element to close");
-                       switch (element_kinds.Pop ()) {
-                       case ElementType.String:
-                               if (!is_null) {
-                                       if (no_string_yet)
-                                               OutputAsciiChar ('"');
-                                       OutputAsciiChar ('"');
-                               }
-                               no_string_yet = true;
-                               is_null = false;
-                               break;
-                       case ElementType.Array:
-                               OutputAsciiChar (']');
-                               break;
-                       case ElementType.Object:
-                               OutputAsciiChar ('}');
-                               break;
-                       }
-
-                       // not sure if it is correct though ...
-                       state = WriteState.Content;
-                       first_content_flags.Pop ();
-               }
-
-               public override void WriteFullEndElement ()
-               {
-                       WriteEndElement (); // no such difference in JSON.
-               }
-
-               public override void WriteStartAttribute (string prefix, string localName, string ns)
-               {
-                       CheckState ();
-
-                       if (state != WriteState.Element)
-                               throw new XmlException ("Cannot write attribute as this XmlDictionaryWriter is not at element state");
-
-                       if (!String.IsNullOrEmpty (ns))
-                               throw new ArgumentException ("Non-empty namespace URI is not allowed in this XmlDictionaryWriter");
-                       if (!String.IsNullOrEmpty (prefix))
-                               throw new ArgumentException ("Non-empty prefix is not allowed in this XmlDictionaryWriter");
-
-                       if (localName != "type" && localName != "__type")
-                               throw new ArgumentException ("Only 'type' and '__type' are allowed as an attribute name in this XmlDictionaryWriter");
-
-                       if (state != WriteState.Element)
-                               throw new InvalidOperationException (String.Format ("Attribute cannot be written in {0} mode", state));
-
-                       attr_name = localName;
-                       state = WriteState.Attribute;
-               }
-
-               public override void WriteEndAttribute ()
-               {
-                       CheckState ();
-
-                       if (state != WriteState.Attribute)
-                               throw new XmlException ("Cannot close attribute, as this XmlDictionaryWriter is not at attribute state");
-
-                       if (attr_name == "type") {
-                               switch (attr_value) {
-                               case "object":
-                                       element_kinds.Pop ();
-                                       element_kinds.Push (ElementType.Object);
-                                       OutputAsciiChar ('{');
-                                       break;
-                               case "array":
-                                       element_kinds.Pop ();
-                                       element_kinds.Push (ElementType.Array);
-                                       OutputAsciiChar ('[');
-                                       break;
-                               case "number":
-                                       element_kinds.Pop ();
-                                       element_kinds.Push (ElementType.Number);
-                                       break;
-                               case "boolean":
-                                       element_kinds.Pop ();
-                                       element_kinds.Push (ElementType.Boolean);
-                                       break;
-                               case "string":
-                                       element_kinds.Pop ();
-                                       element_kinds.Push (ElementType.String);
-                                       break;
-                               case "null":
-                                       element_kinds.Pop ();
-                                       element_kinds.Push (ElementType.Null);
-                                       OutputString ("null");
-                                       break;
-                               default:
-                                       throw new XmlException (String.Format ("Unexpected type attribute value '{0}'", attr_value));
-                               }
-                       }
-                       else
-                               runtime_type = attr_value;
-
-                       state = WriteState.Element;
-                       attr_value = null;
-               }
-
-               void CloseStartElement ()
-               {
-                       if (element_kinds.Peek () == ElementType.None) {
-                               element_kinds.Pop ();
-                               element_kinds.Push (ElementType.String);
-                               no_string_yet = true;
-                               is_null = false;
-                       }
-
-                       first_content_flags.Push (true);
-
-                       if (runtime_type != null) {
-                               OutputString ("\"__type\":\"");
-                               OutputString (runtime_type);
-                               OutputAsciiChar ('\"');
-                               runtime_type = null;
-                               first_content_flags.Pop ();
-                               first_content_flags.Push (false);
-                       }
-               }
-
-               public override void WriteString (string text)
-               {
-                       CheckState ();
-
-                       if (state == WriteState.Start)
-                               throw new InvalidOperationException ("Top-level content string is not allowed in this XmlDictionaryWriter");
-
-                       if (state == WriteState.Element) {
-                               CloseStartElement ();
-                               state = WriteState.Content;
-                       }
-
-                       if (state == WriteState.Attribute)
-                               attr_value += text;
-                       else if (text == null) {
-                               no_string_yet = false;
-                               is_null = true;
-                               if (element_kinds.Peek () != ElementType.Null)
-                                       OutputString ("null");
-                       } else {
-                               switch (element_kinds.Peek ()) {
-                               case ElementType.String:
-                                       if (no_string_yet) {
-                                               OutputAsciiChar ('"');
-                                               no_string_yet = false;
-                                       }
-                                       break;
-                               case ElementType.Number:
-                                       // .NET is buggy here, it just outputs raw string, which results in invalid JSON format.
-                                       bool isString = false;
-                                       switch (text) {
-                                       case "INF":
-                                       case "-INF":
-                                       case "NaN":
-                                               isString = true;
-                                               break;
-                                       }
-                                       if (isString) {
-                                               element_kinds.Pop ();
-                                               element_kinds.Push (ElementType.String);
-                                               goto case ElementType.String;
-                                       }
-                                       break;
-                               case ElementType.Boolean:
-                                       break;
-                               default:
-                                       throw new XmlException (String.Format ("Simple content string is allowed only for string, number and boolean types and not for {0} type", element_kinds.Peek ()));
-                               }
-
-                               OutputString (EscapeStringLiteral (text));
-                       }
-               }
-
-               #region mostly-ignored operations
-
-               public override string LookupPrefix (string ns)
-               {
-                       // Since there is no way to declare namespaces in
-                       // this writer, it always returns fixed results.
-                       if (ns == null)
-                               throw new ArgumentNullException ("ns");
-                       else if (ns.Length == 0)
-                               return String.Empty;
-                       else if (ns == "http://www.w3.org/2000/xmlns/")
-                               return "xmlns";
-                       else if (ns == "http://www.w3.org/XML/1998/namespace")
-                               return "xml";
-                       return null;
-               }
-
-               public override void WriteStartDocument ()
-               {
-                       CheckState ();
-               }
-
-               public override void WriteStartDocument (bool standalone)
-               {
-                       CheckState ();
-               }
-
-               public override void WriteEndDocument ()
-               {
-                       CheckState ();
-               }
-
-               #endregion
-
-               #region unsupported operations
-
-               public override void WriteDocType (string name, string pubid, string sysid, string intSubset)
-               {
-                       CheckState ();
-
-                       throw new NotSupportedException ("This XmlDictionaryWriter does not support writing doctype declaration");
-               }
-
-               public override void WriteComment (string text)
-               {
-                       CheckState ();
-
-                       throw new NotSupportedException ("This XmlDictionaryWriter does not support writing comment");
-               }
-
-               public override void WriteEntityRef (string text)
-               {
-                       CheckState ();
-
-                       throw new NotSupportedException ("This XmlDictionaryWriter does not support writing entity reference");
-               }
-
-               public override void WriteProcessingInstruction (string target, string data)
-               {
-                       CheckState ();
-
-                       if (String.Compare (target, "xml", StringComparison.OrdinalIgnoreCase) != 0)
-                               throw new ArgumentException ("This XmlDictionaryWriter does not support writing processing instruction");
-               }
-
-               #endregion
-
-               #region WriteString() variants
-
-               public override void WriteRaw (string text)
-               {
-                       WriteString (text);
-               }
-
-               public override void WriteRaw (char [] chars, int start, int length)
-               {
-                       WriteChars (chars, start, length);
-               }
-
-               public override void WriteCData (string text)
-               {
-                       WriteString (text);
-               }
-
-               public override void WriteCharEntity (char entity)
-               {
-                       WriteString (entity.ToString ());
-               }
-
-               public override void WriteChars (char [] chars, int start, int length)
-               {
-                       WriteString (new string (chars, start, length));
-               }
-
-               public override void WriteSurrogateCharEntity (char high, char low)
-               {
-                       WriteChars (new char [] {high, low}, 0, 2);
-               }
-
-               public override void WriteBase64 (byte [] bytes, int start, int length)
-               {
-                       WriteString (Convert.ToBase64String (bytes, start, length));
-               }
-
-               public override void WriteWhitespace (string text)
-               {
-                       if (text == null)
-                               throw new ArgumentNullException ("text");
-                       for (int i = 0; i < text.Length; i++) {
-                               if (text [i] != ' ') {
-                                       for (int j = i; j < text.Length; j++) {
-                                               switch (text [j]) {
-                                               case '\t':
-                                               case ' ':
-                                               case '\n':
-                                               case '\r':
-                                                       continue;
-                                               default:
-                                                       throw new ArgumentException (String.Format ("WriteWhitespace() does not accept non-whitespace character '{0}'", text [j]));
-                                               }
-                                       }
-                                       break;
-                               }
-                       }
-                       WriteString (text);
-               }
-
-               char [] char_buf = new char [1];
-               void OutputAsciiChar (char c)
-               {
-                       if (is_ascii_single)
-                               output.WriteByte ((byte) c);
-                       else {
-                               char_buf [0] = c;
-                               int size = encoding.GetBytes (char_buf, 0, 1, encbuf, 0);
-                               output.Write (encbuf, 0, size);
-                       }
-               }
-
-               void OutputString (string s)
-               {
-                       int size = encoding.GetByteCount (s);
-                       if (encbuf.Length < size)
-                               encbuf = new byte [size];
-                       size = encoding.GetBytes (s, 0, s.Length, encbuf, 0);
-                       output.Write (encbuf, 0, size);
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs
deleted file mode 100644 (file)
index 8378a70..0000000
+++ /dev/null
@@ -1,374 +0,0 @@
-//
-// TypeMap.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.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.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Text;
-using System.Xml;
-
-namespace System.Runtime.Serialization.Json
-{
-       class TypeMap
-       {
-               static bool IsInvalidNCName (string name)
-               {
-                       if (name == null || name.Length == 0)
-                               return true;
-                       try {
-                               XmlConvert.VerifyNCName (name);
-                       } catch (XmlException) {
-                               return true;
-                       }
-                       return false;
-               }
-
-               public static TypeMap CreateTypeMap (Type type)
-               {
-                       object [] atts = type.GetCustomAttributes (typeof (DataContractAttribute), true);
-                       if (atts.Length == 1)
-                               return CreateTypeMap (type, (DataContractAttribute) atts [0]);
-
-                       atts = type.GetCustomAttributes (typeof (SerializableAttribute), false);
-                       if (atts.Length == 1)
-                               return CreateTypeMap (type, null);
-
-                       if (IsPrimitiveType (type))
-                               return null;
-
-                       return CreateDefaultTypeMap (type);
-               }
-
-               static bool IsPrimitiveType (Type type)
-               {
-                       if (type.IsEnum)
-                               return true;
-                       if (Type.GetTypeCode (type) != TypeCode.Object)
-                               return true; // FIXME: it is likely hacky
-                       return false;
-               }
-
-               static TypeMap CreateDefaultTypeMap (Type type)
-               {
-                       var l = new List<TypeMapMember> ();
-                       foreach (var fi in type.GetFields ())
-                               if (!fi.IsStatic)
-                                       l.Add (new TypeMapField (fi, null));
-                       foreach (var pi in type.GetProperties ())
-                               if (pi.CanRead && pi.CanWrite && !pi.GetGetMethod (true).IsStatic && pi.GetIndexParameters ().Length == 0)
-                                       l.Add (new TypeMapProperty (pi, null));
-                       l.Sort ((x, y) => x.Order != y.Order ? x.Order - y.Order : String.Compare (x.Name, y.Name, StringComparison.Ordinal));
-                       return new TypeMap (type, null, l.ToArray ());
-               }
-
-               internal static bool IsDictionary (Type type)
-               {
-                       Type inter;
-                       inter = type.GetInterface ("System.Collections.IDictionary", false);
-                       if (inter != null
-                               && type.GetMethod ("Add", new Type[] { typeof (object), typeof (object) }) != null)
-                               return true;
-                       
-                       inter = type.GetInterface ("System.Collections.Generic.IDictionary`2", false);
-                       if (inter != null
-                               && type.GetMethod ("Add", new Type[] { inter.GetGenericArguments() [0], 
-                                                                          inter.GetGenericArguments() [1] }) != null)
-                               return true;
-                       return false;
-               }
-
-               internal static bool IsEnumerable (Type type)
-               {
-                       if (type.IsGenericType && 
-                               type.GetGenericTypeDefinition() == typeof (LinkedList<>))
-                               return true;
-                       
-                       if (IsPrimitiveType (type) || IsDictionary (type))
-                               return false;
-                       
-                       Type inter;
-                       inter = type.GetInterface ("System.Collections.Generic.IReadOnlyCollection`1", false);
-                       if (inter != null)
-                               return true;
-                       
-                       inter = type.GetInterface ("System.Collections.IEnumerable", false);
-                       if (inter != null && type.GetMethod ("Add", new Type[] { typeof (object) }) != null)
-                               return true;
-                       
-                       inter = type.GetInterface ("System.Collections.Generic.IEnumerable`1", false);
-                       if (inter != null && type.GetMethod ("Add", new Type[] { inter.GetGenericArguments() [0] }) != null)
-                               return true;
-                       return false;
-               }
-
-               static TypeMap CreateTypeMap (Type type, DataContractAttribute dca)
-               {
-                       if (dca != null && dca.Name != null && IsInvalidNCName (dca.Name))
-                               throw new InvalidDataContractException (String.Format ("DataContractAttribute for type '{0}' has an invalid name", type));
-
-                       List<TypeMapMember> members = new List<TypeMapMember> ();
-
-                       foreach (FieldInfo fi in type.GetFields (binding_flags)) {
-                               if (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), false).Length > 0)
-                                       continue;
-                               if (dca != null) {
-                                       object [] atts = fi.GetCustomAttributes (typeof (DataMemberAttribute), true);
-                                       if (atts.Length == 0)
-                                               continue;
-                                       DataMemberAttribute dma = (DataMemberAttribute) atts [0];
-                                       members.Add (new TypeMapField (fi, dma));
-                               } else {
-                                       if (fi.GetCustomAttributes (typeof (IgnoreDataMemberAttribute), false).Length > 0)
-                                               continue;
-                                       members.Add (new TypeMapField (fi, null));
-                               }
-                       }
-
-                       if (dca != null) {
-                               foreach (PropertyInfo pi in type.GetProperties (binding_flags)) {
-                                       object [] atts = pi.GetCustomAttributes (typeof (DataMemberAttribute), true);
-                                       if (atts.Length == 0)
-                                               continue;
-                                       if (pi.GetIndexParameters ().Length > 0)
-                                               continue;
-                                       if (IsEnumerable (pi.PropertyType) || IsDictionary (pi.PropertyType)) {
-                                               if (!pi.CanRead)
-                                                       throw new InvalidDataContractException (String.Format ("Property {0} must have a getter", pi));
-                                       }
-                                       else if (!pi.CanRead || !pi.CanWrite)
-                                               throw new InvalidDataContractException (String.Format ("Non-collection property {0} must have both getter and setter", pi));
-                                       DataMemberAttribute dma = (DataMemberAttribute) atts [0];
-                                       members.Add (new TypeMapProperty (pi, dma));
-                               }
-                       }
-
-                       members.Sort (delegate (TypeMapMember m1, TypeMapMember m2) { return m1.Order != m2.Order ? m1.Order - m2.Order : String.CompareOrdinal (m1.Name, m2.Name); });
-                       return new TypeMap (type, dca == null ? null : dca.Name, members.ToArray ());
-               }
-
-               Type type;
-               string element;
-               TypeMapMember [] members;
-
-               static readonly Type [] deser_methods_args = new Type [] { typeof (StreamingContext) };
-               const BindingFlags binding_flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
-
-               public TypeMap (Type type, string element, TypeMapMember [] orderedMembers)
-               {
-                       this.type = type;
-                       this.element = element;
-                       this.members = orderedMembers;
-
-                       foreach (var mi in type.GetMethods (binding_flags)) {
-                               if (mi.GetCustomAttributes (typeof (OnDeserializingAttribute), false).Length > 0)
-                                       OnDeserializing = mi;
-                               else if (mi.GetCustomAttributes (typeof (OnDeserializedAttribute), false).Length > 0)
-                                       OnDeserialized = mi;
-                               else if (mi.GetCustomAttributes (typeof (OnSerializingAttribute), false).Length > 0)
-                                       OnSerializing = mi;
-                               else if (mi.GetCustomAttributes (typeof (OnSerializedAttribute), false).Length > 0)
-                                       OnSerialized = mi;
-                       }
-               }
-
-               public MethodInfo OnDeserializing { get; set; }
-               public MethodInfo OnDeserialized { get; set; }
-               public MethodInfo OnSerializing { get; set; }
-               public MethodInfo OnSerialized { get; set; }
-
-               public virtual void Serialize (JsonSerializationWriter outputter, object graph, string type)
-               {
-                       if (OnSerializing != null)
-                               OnSerializing.Invoke (graph, new object [] {new StreamingContext (StreamingContextStates.All)});
-
-                       outputter.Writer.WriteAttributeString ("type", type);
-                       foreach (TypeMapMember member in members) {
-                               object memberObj = member.GetMemberOf (graph);
-                               // FIXME: consider EmitDefaultValue
-                               outputter.Writer.WriteStartElement (member.Name);
-                               outputter.WriteObjectContent (memberObj, false, false);
-                               outputter.Writer.WriteEndElement ();
-                       }
-
-                       if (OnSerialized != null)
-                               OnSerialized.Invoke (graph, new object [] {new StreamingContext (StreamingContextStates.All)});
-               }
-
-               internal static object CreateInstance (Type type)
-               {
-                       if (TypeMap.IsDictionary (type)) {
-                               if (type.IsGenericType)
-                                       return Activator.CreateInstance (typeof (Dictionary<,>).MakeGenericType (type.GetGenericArguments ()));
-                               else
-                                       return new Hashtable ();
-                       } else if (TypeMap.IsEnumerable (type)) {
-                               if (type.IsGenericType)
-                                       return Activator.CreateInstance (typeof (List<>).MakeGenericType (type.GetGenericArguments ()));
-                               else
-                                       return new ArrayList ();
-                       }
-                       else
-                               return FormatterServices.GetUninitializedObject (type);
-               }
-
-               public virtual object Deserialize (JsonSerializationReader jsr, object o)
-               {
-                       XmlReader reader = jsr.Reader;
-                       bool isNull = reader.GetAttribute ("type") == "null";
-
-                       object ret = isNull ? null : CreateInstance (type);
-                       if (ret != null && OnDeserializing != null)
-                               OnDeserializing.Invoke (ret, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       Dictionary<TypeMapMember,bool> filled = new Dictionary<TypeMapMember,bool> ();
-
-                       reader.ReadStartElement ();
-                       for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
-                               bool consumed = false;
-                               for (int i = 0; i < members.Length; i++) {
-                                       TypeMapMember mm = members [i];
-                                       if (mm.Name == reader.LocalName && reader.NamespaceURI == String.Empty) {
-                                               if (filled.ContainsKey (mm))
-                                                       throw new SerializationException (String.Format ("Object content '{0}' for '{1}' already appeared in the reader", reader.LocalName, type));
-                                               mm.SetMemberValue (ret, jsr);
-                                               filled [mm] = true;
-                                               consumed = true;
-                                               break;
-                                       }
-                               }
-                               if (!consumed)
-                                       reader.Skip ();
-                       }
-                       reader.ReadEndElement ();
-                       if (ret != null && OnDeserialized != null)
-                               OnDeserialized.Invoke (ret, new object [] {new StreamingContext (StreamingContextStates.All)});
-                       return ret;
-               }
-       }
-
-       abstract class TypeMapMember
-       {
-               MemberInfo mi;
-               DataMemberAttribute dma;
-
-               protected TypeMapMember (MemberInfo mi, DataMemberAttribute dma)
-               {
-                       this.mi = mi;
-                       this.dma = dma;
-               }
-
-               public string Name {
-                       get { return dma == null ? mi.Name : dma.Name ?? mi.Name; }
-               }
-
-               public bool EmitDefaultValue {
-                       get { return dma != null && dma.EmitDefaultValue; }
-               }
-
-               public bool IsRequired {
-                       get { return dma != null && dma.IsRequired; }
-               }
-
-               public int Order {
-                       get { return dma != null ? dma.Order : -1; }
-               }
-
-               public abstract Type Type { get; }
-
-               public abstract object GetMemberOf (object owner);
-
-               public abstract void SetMemberValue (object owner, JsonSerializationReader value);
-       }
-
-       class TypeMapField : TypeMapMember
-       {
-               FieldInfo field;
-
-               public TypeMapField (FieldInfo fi, DataMemberAttribute dma)
-                       : base (fi, dma)
-               {
-                       this.field = fi;
-               }
-
-               public override Type Type {
-                       get { return field.FieldType; }
-               }
-
-               public override object GetMemberOf (object owner)
-               {
-                       return field.GetValue (owner);
-               }
-               
-               public override void SetMemberValue (object owner, JsonSerializationReader jsr)
-               {
-                       field.SetValue (owner, jsr.ReadObject (this.Type));
-               }
-       }
-
-       class TypeMapProperty : TypeMapMember
-       {
-               PropertyInfo property;
-
-               public TypeMapProperty (PropertyInfo pi, DataMemberAttribute dma)
-                       : base (pi, dma)
-               {
-                       this.property = pi;
-               }
-
-               public override Type Type {
-                       get { return property.PropertyType; }
-               }
-
-               public override object GetMemberOf (object owner)
-               {
-                       return property.GetValue (owner, null);
-               }
-
-               public override void SetMemberValue (object owner, JsonSerializationReader jsr)
-               {
-                       var pSetter = this.property.GetSetMethod (true);
-                       if (pSetter != null) {
-                               property.SetValue (owner, jsr.ReadObject (this.Type), null);
-                               
-                       } else { // no setter
-                               var oldValue = property.GetValue (owner, null);
-                               try {
-                                       jsr.ReadObject (this.Type, oldValue);
-                               } catch (MissingMethodException e) {
-                                       throw new InvalidDataContractException (string.Format ("No set method for property '{0}' "
-                                               + "in type '{1}'.", this.property.Name, this.property.PropertyType.FullName), e);
-                               }
-                       }
-               }
-       }
-}
index 319640fc23476960fd9b9139104a6f01088f26a3..8a6d9c8eadf76f907c3dea7d0fc5906a77a9a099 100644 (file)
@@ -1,7 +1,4 @@
 ../../test-helpers/NetworkHelpers.cs
-System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs
-System.Runtime.Serialization.Json/JsonReaderTest.cs
-System.Runtime.Serialization.Json/JsonWriterTest.cs
 System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs
 System.ServiceModel.Channels/WebBodyFormatMessagePropertyTest.cs
 System.ServiceModel.Channels/WebMessageEncodingBindingElementTest.cs
diff --git a/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/ChangeLog b/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/ChangeLog
deleted file mode 100644 (file)
index 532e123..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : add test for bug #615800.
-
-2010-07-06  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : add test for bug #615801.
-
-2010-04-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : don't use ToUniversalTime()
-         which makes test results timezone dependent.
-
-2010-03-10  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : oops, the test was careless.
-         Use fixed date.
-
-2010-03-09  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : add test for bug #586169.
-       * JsonWriterTest.cs : add standalone write case for "\/".
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs :
-         enable TypeIsNotPartsOfKnownTypes(), and add more related tests.
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : make some tests narrow down
-         possible cause of errors to detect expected errors more precisely.
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : null-string case is working.
-
-2010-01-27  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : invalidate previous non-working
-         tests.
-
-2010-01-25  Sebastien Pouliot  <sebastien@ximian.com>
-
-       * DataContractJsonSerializerTest.cs: Add non-working test cases
-       for null-string, known types and handling floating point special
-       values
-
-2009-12-11  Chris Toshok  <toshok@ximian.com>
-
-       * DataContractJsonSerializerTest.cs: add a test case for
-       non-public properties.
-
-2009-12-11  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReaderTest.cs : another number parse case.
-
-2009-11-20  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : added ignored test case that
-         verifies 2.1 behavior (with another case that justifies removal
-         of the previous hack).
-
-2009-10-08  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : added test for
-         alwaysEmitTypeInformation argument.
-
-2009-09-07  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : fix non-datacontract
-         serialization test. It depended on IPAddress field internals
-         (runtime serialization incompatibility).
-
-2009-03-13  Andreia Gaita  <avidigal@novell.com>
-
-       * JsonReaderTest.cs: test for skip and depth (if depth fails, skip is affected)
-
-2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : fixed some tests to match
-         .NET RTM behavior. Added read-only collection case, (but [Ignore]d).
-
-2009-02-02  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : added test for contract-less
-         serialization.
-
-2008-02-18  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : added couple of DBNull tests.
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : added deserialization tests
-         for typed object with "__type".
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReaderTest.cs : test GetAttribute() for "__type".
-
-2008-01-30  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReaderTest.cs : added tests for "__type" attributes (some of
-         them are not working yet).
-
-2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonReaderTest.cs : test "type" attribute in several nodes.
-
-2008-01-24  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs : some more deserialization tests.
-
-2008-01-22  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * JsonWriterTest.cs : added test for writing __type attribute.
-       * DataContractJsonSerializerTest.cs : added more random-ish tests.
-
-2007-12-05  Atsushi Enomoto  <atsushi@ximian.com>
-
-       * DataContractJsonSerializerTest.cs :
-         moved from Test/System.Runtime.Serialization and fixed some.
-       * JsonReaderTest.cs, JsonWriterTest.cs : moved from Test/System.Xml.
-
diff --git a/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/DataContractJsonSerializerTest.cs
deleted file mode 100644 (file)
index 1e32b6f..0000000
+++ /dev/null
@@ -1,2792 +0,0 @@
-//
-// DataContractJsonSerializerTest.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//     Ankit Jain <JAnkit@novell.com>
-//     Antoine Cailliau <antoinecailliau@gmail.com>
-//
-// Copyright (C) 2005-2007 Novell, Inc.  http://www.novell.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.
-//
-
-//
-// This test code contains tests for DataContractJsonSerializer, which is
-// imported from DataContractSerializerTest.cs.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Net;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Json;
-using System.Text;
-using System.Xml;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization.Json
-{
-       [TestFixture]
-       public class DataContractJsonSerializerTest
-       {
-               static readonly XmlWriterSettings settings;
-
-               static DataContractJsonSerializerTest ()
-               {
-                       settings = new XmlWriterSettings ();
-                       settings.OmitXmlDeclaration = true;
-               }
-
-               [DataContract]
-               class Sample1
-               {
-                       [DataMember]
-                       public string Member1;
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorTypeNull ()
-               {
-                       new DataContractJsonSerializer (null);
-               }
-
-               [Test]
-               public void ConstructorKnownTypesNull ()
-               {
-                       // null knownTypes is allowed.
-                       new DataContractJsonSerializer (typeof (Sample1), (IEnumerable<Type>) null);
-                       new DataContractJsonSerializer (typeof (Sample1), "Foo", null);
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorNameNull ()
-               {
-                       new DataContractJsonSerializer (typeof (Sample1), (string) null);
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentOutOfRangeException))]
-               public void ConstructorNegativeMaxObjects ()
-               {
-                       new DataContractJsonSerializer (typeof (Sample1), "Sample1",
-                               null, -1, false, null, false);
-               }
-
-               [Test]
-               public void ConstructorMisc ()
-               {
-                       new DataContractJsonSerializer (typeof (GlobalSample1)).WriteObject (new MemoryStream (), new GlobalSample1 ());
-               }
-
-               [Test]
-               public void WriteObjectContent ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter xw = XmlWriter.Create (sw, settings)) {
-                               DataContractJsonSerializer ser =
-                                       new DataContractJsonSerializer (typeof (string));
-                               xw.WriteStartElement ("my-element");
-                               ser.WriteObjectContent (xw, "TEST STRING");
-                               xw.WriteEndElement ();
-                       }
-                       Assert.AreEqual ("<my-element>TEST STRING</my-element>",
-                               sw.ToString ());
-               }
-
-               // int
-
-               [Test]
-               public void SerializeIntXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeInt (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">1</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeIntJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeInt (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "1",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeInt (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (int));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, 1);
-                       }
-               }
-
-               // int, with rootName
-
-               [Test]
-               public void SerializeIntXmlWithRootName ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeIntWithRootName (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<myroot type=""number"">1</myroot>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               // since JsonWriter supports only "root" as the root name, using
-               // XmlWriter from JsonReaderWriterFactory will always fail with
-               // an explicit rootName.
-               [ExpectedException (typeof (SerializationException))]
-               public void SerializeIntJsonWithRootName ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeIntWithRootName (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "1",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeIntWithRootName (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (int), "myroot");
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, 1);
-                       }
-               }
-
-               // pass typeof(DCEmpty), serialize int
-
-               [Test]
-               public void SerializeIntForDCEmptyXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeIntForDCEmpty (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">1</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeIntForDCEmptyJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeIntForDCEmpty (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "1",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeIntForDCEmpty (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (DCEmpty));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, 1);
-                       }
-               }
-
-               // DCEmpty
-
-               [Test]
-               public void SerializeEmptyClassXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeEmptyClass (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object"" />",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeEmptyClassJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeEmptyClass (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "{}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeEmptyClass (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (DCEmpty));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new DCEmpty ());
-                       }
-               }
-
-               // string (primitive)
-
-               [Test]
-               public void SerializePrimitiveStringXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializePrimitiveString (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               "<root>TEST</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializePrimitiveStringJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializePrimitiveString (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"""TEST""",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializePrimitiveString (XmlWriter writer)
-               {
-                       XmlObjectSerializer ser =
-                               new DataContractJsonSerializer (typeof (string));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, "TEST");
-                       }
-               }
-
-               // QName (primitive but ...)
-
-               [Test]
-               public void SerializePrimitiveQNameXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializePrimitiveQName (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               "<root>foo:urn:foo</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializePrimitiveQNameJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializePrimitiveQName (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"""foo:urn:foo""",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializePrimitiveQName (XmlWriter writer)
-               {
-                       XmlObjectSerializer ser =
-                               new DataContractJsonSerializer (typeof (XmlQualifiedName));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new XmlQualifiedName ("foo", "urn:foo"));
-                       }
-               }
-
-               // DBNull (primitive)
-
-               [Test]
-               public void SerializeDBNullXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeDBNull (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object"" />",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeDBNullJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeDBNull (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "{}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeDBNull (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (DBNull));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, DBNull.Value);
-                       }
-               }
-
-               // DCSimple1
-
-               [Test]
-               public void SerializeSimpleClass1Xml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeSimpleClass1 (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object""><Foo>TEST</Foo></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeSimpleClass1Json ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeSimpleClass1 (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"{""Foo"":""TEST""}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeSimpleClass1 (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (DCSimple1));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new DCSimple1 ());
-                       }
-               }
-
-               // NonDC
-
-               [Test]
-               // NonDC is not a DataContract type.
-               public void SerializeNonDCOnlyCtor ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (NonDC));
-               }
-
-               [Test]
-               //[ExpectedException (typeof (InvalidDataContractException))]
-               // NonDC is not a DataContract type.
-               // UPDATE: non-DataContract types are became valid in RTM.
-               public void SerializeNonDC ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (NonDC));
-                       using (XmlWriter w = XmlWriter.Create (TextWriter.Null, settings)) {
-                               ser.WriteObject (w, new NonDC ());
-                       }
-               }
-
-               // DCHasNonDC
-
-               [Test]
-               //[ExpectedException (typeof (InvalidDataContractException))]
-               // DCHasNonDC itself is a DataContract type whose field is
-               // marked as DataMember but its type is not DataContract.
-               // UPDATE: non-DataContract types are became valid in RTM.
-               public void SerializeDCHasNonDC ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCHasNonDC));
-                       using (XmlWriter w = XmlWriter.Create (TextWriter.Null, settings)) {
-                               ser.WriteObject (w, new DCHasNonDC ());
-                       }
-               }
-
-               // DCHasSerializable
-
-               [Test]
-               public void SerializeSimpleSerializable1Xml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeSimpleSerializable1 (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object""><Ser type=""object""><Doh>doh!</Doh></Ser></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeSimpleSerializable1Json ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeSimpleSerializable1 (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"{""Ser"":{""Doh"":""doh!""}}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               // DCHasSerializable itself is DataContract and has a field
-               // whose type is not contract but serializable.
-               void SerializeSimpleSerializable1 (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCHasSerializable));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new DCHasSerializable ());
-                       }
-               }
-
-               [Test]
-               public void SerializeDCWithNameXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeDCWithName (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object""><FooMember>value</FooMember></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeDCWithNameJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeDCWithName (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"{""FooMember"":""value""}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeDCWithName (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithName));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new DCWithName ());
-                       }
-               }
-
-               [Test]
-               public void SerializeDCWithEmptyName1 ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEmptyName));
-                       StringWriter sw = new StringWriter ();
-                       DCWithEmptyName dc = new DCWithEmptyName ();
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               try {
-                                       ser.WriteObject (w, dc);
-                               } catch (InvalidDataContractException) {
-                                       return;
-                               }
-                       }
-                       Assert.Fail ("Expected InvalidDataContractException");
-               }
-
-               [Test]
-               public void SerializeDCWithEmptyName2 ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithName));
-                       StringWriter sw = new StringWriter ();
-
-                       /* DataContractAttribute.Name == "", not valid */
-                       DCWithEmptyName dc = new DCWithEmptyName ();
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               try {
-                                       ser.WriteObject (w, dc);
-                               } catch (InvalidDataContractException) {
-                                       return;
-                               }
-                       }
-                       Assert.Fail ("Expected InvalidDataContractException");
-               }
-
-               [Test]
-               [Category("NotWorking")]
-               public void SerializeDCWithNullName ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithNullName));
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               try {
-                                       /* DataContractAttribute.Name == "", not valid */
-                                       ser.WriteObject (w, new DCWithNullName ());
-                               } catch (InvalidDataContractException) {
-                                       return;
-                               }
-                       }
-                       Assert.Fail ("Expected InvalidDataContractException");
-               }
-
-               [Test]
-               public void SerializeDCWithEmptyNamespace1 ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEmptyNamespace));
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               ser.WriteObject (w, new DCWithEmptyNamespace ());
-                       }
-               }
-
-               [Test]
-               public void SerializeWrappedClassXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeWrappedClass (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object"" />",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeWrappedClassJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeWrappedClass (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "{}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeWrappedClass (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (Wrapper.DCWrapped));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new Wrapper.DCWrapped ());
-                       }
-               }
-
-               // CollectionContainer : Items must have a setter. (but became valid in RTM).
-               [Test]
-               public void SerializeReadOnlyCollectionMember ()
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (CollectionContainer));
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               ser.WriteObject (w, null);
-                       }
-               }
-
-               // DataCollectionContainer : Items must have a setter. (but became valid in RTM).
-               [Test]
-               public void SerializeReadOnlyDataCollectionMember ()
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (DataCollectionContainer));
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               ser.WriteObject (w, null);
-                       }
-               }
-
-               [Test]
-               [Ignore ("https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=409970")]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeReadOnlyDataCollection_NullCollection ()
-               {
-                       DataContractJsonSerializer ser =
-                               new DataContractJsonSerializer (typeof (CollectionContainer));
-                       StringWriter sw = new StringWriter ();
-                       var c = new CollectionContainer ();
-                       c.Items.Add ("foo");
-                       c.Items.Add ("bar");
-                       using (XmlWriter w = XmlWriter.Create (sw, settings))
-                               ser.WriteObject (w, c);
-                       // CollectionContainer.Items is null, so it cannot deserialize non-null collection.
-                       using (XmlReader r = XmlReader.Create (new StringReader (sw.ToString ())))
-                               c = (CollectionContainer) ser.ReadObject (r);
-               }
-
-               [Test]
-               public void SerializeGuidXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeGuid (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root>00000000-0000-0000-0000-000000000000</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeGuidJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeGuid (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"""00000000-0000-0000-0000-000000000000""",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeGuid (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (Guid));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, Guid.Empty);
-                       }
-               }
-
-               [Test]
-               public void SerializeEnumXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeEnum (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">0</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeEnumJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeEnum (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "0",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeEnum (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (Colors));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new Colors ());
-                       }
-               }
-
-               [Test]
-               public void SerializeEnum2Xml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeEnum2 (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">0</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeEnum2Json ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeEnum2 (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "0",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeEnum2 (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (Colors));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, 0);
-                       }
-               }
-
-               [Test] // so, DataContract does not affect here.
-               public void SerializeEnumWithDCXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeEnumWithDC (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">0</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeEnumWithDCJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeEnumWithDC (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "0",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeEnumWithDC (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsWithDC));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new ColorsWithDC ());
-                       }
-               }
-
-               [Test]
-               public void SerializeEnumWithNoDCXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeEnumWithNoDC (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">0</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeEnumWithNoDCJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeEnumWithNoDC (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "0",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeEnumWithNoDC (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsEnumMemberNoDC));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new ColorsEnumMemberNoDC ());
-                       }
-               }
-
-               [Test]
-               public void SerializeEnumWithDC2Xml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeEnumWithDC2 (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""number"">3</root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeEnumWithDC2Json ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeEnumWithDC2 (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               "3",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeEnumWithDC2 (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsWithDC));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, 3);
-                       }
-               }
-
-/*
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void SerializeEnumWithDCInvalid ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (ColorsWithDC));
-                       StringWriter sw = new StringWriter ();
-                       ColorsWithDC cdc = ColorsWithDC.Blue;
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               ser.WriteObject (w, cdc);
-                       }
-               }
-*/
-
-               [Test]
-               public void SerializeDCWithEnumXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializeDCWithEnum (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""object""><_colors type=""number"">0</_colors></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeDCWithEnumJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializeDCWithEnum (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"{""_colors"":0}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializeDCWithEnum (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEnum));
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, new DCWithEnum ());
-                       }
-               }
-
-               [Test]
-               public void SerializerDCArrayXml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializerDCArray (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""array""><item type=""object""><_colors type=""number"">0</_colors></item><item type=""object""><_colors type=""number"">1</_colors></item></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializerDCArrayJson ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializerDCArray (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"[{""_colors"":0},{""_colors"":1}]",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializerDCArray (XmlWriter writer)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (DCWithEnum []));
-                       DCWithEnum [] arr = new DCWithEnum [2];
-                       arr [0] = new DCWithEnum (); arr [0].colors = Colors.Red;
-                       arr [1] = new DCWithEnum (); arr [1].colors = Colors.Green;
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, arr);
-                       }
-               }
-
-               [Test]
-               public void SerializerDCArray2Xml ()
-               {
-                       StringWriter sw = new StringWriter ();
-                       SerializerDCArray2 (XmlWriter.Create (sw, settings));
-                       Assert.AreEqual (
-                               @"<root type=""array""><item __type=""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"" type=""object""><_colors type=""number"">0</_colors></item><item __type=""DCSimple1:#MonoTests.System.Runtime.Serialization.Json"" type=""object""><Foo>hello</Foo></item></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializerDCArray2Json ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       SerializerDCArray2 (JsonReaderWriterFactory.CreateJsonWriter (ms));
-                       Assert.AreEqual (
-                               @"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0},{""__type"":""DCSimple1:#MonoTests.System.Runtime.Serialization.Json"",""Foo"":""hello""}]",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               void SerializerDCArray2 (XmlWriter writer)
-               {
-                       List<Type> known = new List<Type> ();
-                       known.Add (typeof (DCWithEnum));
-                       known.Add (typeof (DCSimple1));
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (object []), known);
-                       object [] arr = new object [2];
-                       arr [0] = new DCWithEnum (); ((DCWithEnum)arr [0]).colors = Colors.Red;
-                       arr [1] = new DCSimple1 (); ((DCSimple1) arr [1]).Foo = "hello";
-
-                       using (XmlWriter w = writer) {
-                               ser.WriteObject (w, arr);
-                       }
-               }
-
-               [Test]
-               public void SerializerDCArray3Xml ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (int []));
-                       StringWriter sw = new StringWriter ();
-                       int [] arr = new int [2];
-                       arr [0] = 1; arr [1] = 2;
-
-                       using (XmlWriter w = XmlWriter.Create (sw, settings)) {
-                               ser.WriteObject (w, arr);
-                       }
-
-                       Assert.AreEqual (
-                               @"<root type=""array""><item type=""number"">1</item><item type=""number"">2</item></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializerDCArray3Json ()
-               {
-                       MemoryStream ms = new MemoryStream ();
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (int []));
-                       int [] arr = new int [2];
-                       arr [0] = 1; arr [1] = 2;
-
-                       using (XmlWriter w = JsonReaderWriterFactory.CreateJsonWriter (ms)) {
-                               ser.WriteObject (w, arr);
-                       }
-
-                       Assert.AreEqual (
-                               @"[1,2]",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               [Test]
-               // ... so, non-JSON XmlWriter is still accepted.
-               public void SerializeNonDCArrayXml ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (SerializeNonDCArrayType));
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter xw = XmlWriter.Create (sw, settings)) {
-                               ser.WriteObject (xw, new SerializeNonDCArrayType ());
-                       }
-                       Assert.AreEqual (@"<root type=""object""><IPAddresses type=""array"" /></root>",
-                               sw.ToString ());
-               }
-
-               [Test]
-               public void SerializeNonDCArrayJson ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (SerializeNonDCArrayType));
-                       MemoryStream ms = new MemoryStream ();
-                       using (XmlWriter xw = JsonReaderWriterFactory.CreateJsonWriter (ms)) {
-                               ser.WriteObject (xw, new SerializeNonDCArrayType ());
-                       }
-                       Assert.AreEqual (@"{""IPAddresses"":[]}",
-                               Encoding.UTF8.GetString (ms.ToArray ()));
-               }
-
-               [Test]
-               public void SerializeNonDCArrayItems ()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (typeof (SerializeNonDCArrayType));
-                       StringWriter sw = new StringWriter ();
-                       using (XmlWriter xw = XmlWriter.Create (sw, settings)) {
-                               SerializeNonDCArrayType obj = new SerializeNonDCArrayType ();
-                               obj.IPAddresses = new NonDCItem [] {new NonDCItem () { Data = new byte [] {1, 2, 3, 4} } };
-                               ser.WriteObject (xw, obj);
-                       }
-
-                       XmlDocument doc = new XmlDocument ();
-                       doc.LoadXml (sw.ToString ());
-                       XmlNamespaceManager nsmgr = new XmlNamespaceManager (doc.NameTable);
-                       nsmgr.AddNamespace ("s", "http://schemas.datacontract.org/2004/07/MonoTests.System.Runtime.Serialization");
-                       nsmgr.AddNamespace ("n", "http://schemas.datacontract.org/2004/07/System.Net");
-                       nsmgr.AddNamespace ("a", "http://schemas.microsoft.com/2003/10/Serialization/Arrays");
-
-                       Assert.AreEqual (1, doc.SelectNodes ("/root/IPAddresses/item", nsmgr).Count, "#1");
-                       XmlElement el = doc.SelectSingleNode ("/root/IPAddresses/item/Data", nsmgr) as XmlElement;
-                       Assert.IsNotNull (el, "#3");
-                       Assert.AreEqual (4, el.SelectNodes ("item", nsmgr).Count, "#4");
-               }
-
-               [Test]
-               public void MaxItemsInObjectGraph1 ()
-               {
-                       // object count == maximum
-                       DataContractJsonSerializer s = new DataContractJsonSerializer (typeof (DCEmpty), null, 1, false, null, false);
-                       s.WriteObject (XmlWriter.Create (TextWriter.Null), new DCEmpty ());
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void MaxItemsInObjectGraph2 ()
-               {
-                       // object count > maximum
-                       DataContractJsonSerializer s = new DataContractJsonSerializer (typeof (DCSimple1), null, 1, false, null, false);
-                       s.WriteObject (XmlWriter.Create (TextWriter.Null), new DCSimple1 ());
-               }
-
-               [Test]
-               public void DeserializeString ()
-               {
-                       Assert.AreEqual ("ABC", Deserialize ("\"ABC\"", typeof (string)));
-               }
-
-               [Test]
-               public void DeserializeInt ()
-               {
-                       Assert.AreEqual (5, Deserialize ("5", typeof (int)));
-               }
-
-               [Test]
-               public void DeserializeArray ()
-               {
-                       int [] ret = (int []) Deserialize ("[5,6,7]", typeof (int []));
-                       Assert.AreEqual (5, ret [0], "#1");
-                       Assert.AreEqual (6, ret [1], "#2");
-                       Assert.AreEqual (7, ret [2], "#3");
-               }
-
-               [Test]
-               public void DeserializeArrayUntyped ()
-               {
-                       object [] ret = (object []) Deserialize ("[5,6,7]", typeof (object []));
-                       Assert.AreEqual (5, ret [0], "#1");
-                       Assert.AreEqual (6, ret [1], "#2");
-                       Assert.AreEqual (7, ret [2], "#3");
-               }
-
-               [Test]
-               public void DeserializeMixedArray ()
-               {
-                       object [] ret = (object []) Deserialize ("[5,\"6\",false]", typeof (object []));
-                       Assert.AreEqual (5, ret [0], "#1");
-                       Assert.AreEqual ("6", ret [1], "#2");
-                       Assert.AreEqual (false, ret [2], "#3");
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeEmptyAsString ()
-               {
-                       // it somehow expects "root" which should have been already consumed.
-                       Deserialize ("", typeof (string));
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeEmptyAsInt ()
-               {
-                       // it somehow expects "root" which should have been already consumed.
-                       Deserialize ("", typeof (int));
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeEmptyAsDBNull ()
-               {
-                       // it somehow expects "root" which should have been already consumed.
-                       Deserialize ("", typeof (DBNull));
-               }
-
-               [Test]
-               public void DeserializeEmptyObjectAsString ()
-               {
-                       // looks like it is converted to ""
-                       Assert.AreEqual (String.Empty, Deserialize ("{}", typeof (string)));
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeEmptyObjectAsInt ()
-               {
-                       Deserialize ("{}", typeof (int));
-               }
-
-               [Test]
-               public void DeserializeEmptyObjectAsDBNull ()
-               {
-                       Assert.AreEqual (DBNull.Value, Deserialize ("{}", typeof (DBNull)));
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeEnumByName ()
-               {
-                       // enum is parsed into long
-                       Deserialize (@"""Red""", typeof (Colors));
-               }
-
-               [Test]
-               public void DeserializeEnum2 ()
-               {
-                       object o = Deserialize ("0", typeof (Colors));
-
-                       Assert.AreEqual (typeof (Colors), o.GetType (), "#de3");
-                       Colors c = (Colors) o;
-                       Assert.AreEqual (Colors.Red, c, "#de4");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void DeserializeEnumInvalid ()
-               {
-                       Deserialize ("", typeof (Colors));
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               [Ignore ("NotDotNet")] // 0.0 is an invalid Colors value.
-               public void DeserializeEnumInvalid3 ()
-               {
-                       //"0.0" instead of "0"
-                       Deserialize (
-                               "0.0",
-                               typeof (Colors));
-               }
-
-               [Test]
-               public void DeserializeEnumWithDC ()
-               {
-                       object o = Deserialize ("0", typeof (ColorsWithDC));
-                       
-                       Assert.AreEqual (typeof (ColorsWithDC), o.GetType (), "#de5");
-                       ColorsWithDC cdc = (ColorsWithDC) o;
-                       Assert.AreEqual (ColorsWithDC.Red, o, "#de6");
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               [Ignore ("NotDotNet")] // 4 is an invalid Colors value.
-               [Category ("NotWorking")]
-               public void DeserializeEnumWithDCInvalid ()
-               {
-                       Deserialize (
-                               "4",
-                               typeof (ColorsWithDC));
-               }
-
-               [Test]
-               public void DeserializeDCWithEnum ()
-               {
-                       object o = Deserialize (
-                               "{\"_colors\":0}",
-                               typeof (DCWithEnum));
-
-                       Assert.AreEqual (typeof (DCWithEnum), o.GetType (), "#de7");
-                       DCWithEnum dc = (DCWithEnum) o;
-                       Assert.AreEqual (Colors.Red, dc.colors, "#de8");
-               }
-
-               [Test]
-               public void ReadObjectVerifyObjectNameFalse ()
-               {
-                       string xml = @"<any><Member1>bar</Member1></any>";
-                       object o = new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
-                               .ReadObject (XmlReader.Create (new StringReader (xml)), false);
-                       Assert.IsTrue (o is VerifyObjectNameTestData, "#1");
-
-                       string xml2 = @"<any><x:Member1 xmlns:x=""http://schemas.datacontract.org/2004/07/MonoTests.System.Runtime.Serialization"">bar</x:Member1></any>";
-                       o = new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
-                               .ReadObject (XmlReader.Create (new StringReader (xml2)), false);
-                       Assert.IsTrue (o is VerifyObjectNameTestData, "#2");
-               }
-
-               [Test]
-               [ExpectedException (typeof (SerializationException))]
-               public void ReadObjectVerifyObjectNameTrue ()
-               {
-                       string xml = @"<any><Member1>bar</Member1></any>";
-                       new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
-                               .ReadObject (XmlReader.Create (new StringReader (xml)), true);
-               }
-
-               [Test] // member name is out of scope
-               public void ReadObjectVerifyObjectNameTrue2 ()
-               {
-                       string xml = @"<root><Member2>bar</Member2></root>";
-                       new DataContractJsonSerializer (typeof (VerifyObjectNameTestData))
-                               .ReadObject (XmlReader.Create (new StringReader (xml)), true);
-               }
-
-               [Test]
-               public void ReadTypedObjectJson ()
-               {
-                       object o = Deserialize (@"{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0}", typeof (DCWithEnum));
-                       Assert.AreEqual (typeof (DCWithEnum), o.GetType ());
-               }
-
-               [Test]
-               public void ReadObjectDCArrayJson ()
-               {
-                       object o = Deserialize (@"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0}]",
-                               typeof (object []), typeof (DCWithEnum));
-                       Assert.AreEqual (typeof (object []), o.GetType (), "#1");
-                       object [] arr = (object []) o;
-                       Assert.AreEqual (typeof (DCWithEnum), arr [0].GetType (), "#2");
-               }
-
-               [Test]
-               public void ReadObjectDCArray2Json ()
-               {
-                       object o = Deserialize (@"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0},{""__type"":""DCSimple1:#MonoTests.System.Runtime.Serialization.Json"",""Foo"":""hello""}]",
-                               typeof (object []), typeof (DCWithEnum), typeof (DCSimple1));
-                       Assert.AreEqual (typeof (object []), o.GetType (), "#1");
-                       object [] arr = (object []) o;
-                       Assert.AreEqual (typeof (DCWithEnum), arr [0].GetType (), "#2");
-                       Assert.AreEqual (typeof (DCSimple1), arr [1].GetType (), "#3");
-               }
-
-               private object Deserialize (string xml, Type type, params Type [] knownTypes)
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer (type, knownTypes);
-                       XmlReader xr = JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (xml), new XmlDictionaryReaderQuotas ());
-                       return ser.ReadObject (xr);
-               }
-
-               public T Deserialize<T>(string json)
-               {
-                       var bytes = Encoding.Unicode.GetBytes (json);
-                       using (MemoryStream stream = new MemoryStream (bytes)) {
-                               var serializer = new DataContractJsonSerializer (typeof(T));
-                               return (T)serializer.ReadObject (stream);       
-                       }
-               }
-
-               [Test]
-               public void IsStartObject ()
-               {
-                       DataContractJsonSerializer s = new DataContractJsonSerializer (typeof (DCSimple1));
-                       Assert.IsTrue (s.IsStartObject (XmlReader.Create (new StringReader ("<root></root>"))), "#1");
-                       Assert.IsFalse (s.IsStartObject (XmlReader.Create (new StringReader ("<dummy></dummy>"))), "#2");
-                       Assert.IsFalse (s.IsStartObject (XmlReader.Create (new StringReader ("<Foo></Foo>"))), "#3");
-                       Assert.IsFalse (s.IsStartObject (XmlReader.Create (new StringReader ("<root xmlns='urn:foo'></root>"))), "#4");
-               }
-
-               [Test]
-               public void SerializeNonDC2 ()
-               {
-                       var ser = new DataContractJsonSerializer (typeof (TestData));
-                       StringWriter sw = new StringWriter ();
-                       var obj = new TestData () { Foo = "foo", Bar = "bar", Baz = "baz" };
-
-                       // XML
-                       using (var xw = XmlWriter.Create (sw))
-                               ser.WriteObject (xw, obj);
-                       var s = sw.ToString ();
-                       // since the order is not preserved, we compare only contents.
-                       Assert.IsTrue (s.IndexOf ("<Foo>foo</Foo>") > 0, "#1-1");
-                       Assert.IsTrue (s.IndexOf ("<Bar>bar</Bar>") > 0, "#1-2");
-                       Assert.IsFalse (s.IndexOf ("<Baz>baz</Baz>") > 0, "#1-3");
-
-                       // JSON
-                       MemoryStream ms = new MemoryStream ();
-                       using (var xw = JsonReaderWriterFactory.CreateJsonWriter (ms))
-                               ser.WriteObject (ms, obj);
-                       s = new StreamReader (new MemoryStream (ms.ToArray ())).ReadToEnd ().Replace ('"', '/');
-                       // since the order is not preserved, we compare only contents.
-                       Assert.IsTrue (s.IndexOf ("/Foo/:/foo/") > 0, "#2-1");
-                       Assert.IsTrue (s.IndexOf ("/Bar/:/bar/") > 0, "#2-2");
-                       Assert.IsFalse (s.IndexOf ("/Baz/:/baz/") > 0, "#2-3");
-               }
-
-               [Test]
-               public void AlwaysEmitTypeInformation ()
-               {
-                       var ms = new MemoryStream ();
-                       var ds = new DataContractJsonSerializer (typeof (string), "root", null, 10, false, null, true);
-                       ds.WriteObject (ms, "foobar");
-                       var s = Encoding.UTF8.GetString (ms.ToArray ());
-                       Assert.AreEqual ("\"foobar\"", s, "#1");
-               }
-
-               [Test]
-               public void AlwaysEmitTypeInformation2 ()
-               {
-                       var ms = new MemoryStream ();
-                       var ds = new DataContractJsonSerializer (typeof (TestData), "root", null, 10, false, null, true);
-                       ds.WriteObject (ms, new TestData () { Foo = "foo"});
-                       var s = Encoding.UTF8.GetString (ms.ToArray ());
-                       Assert.AreEqual (@"{""__type"":""TestData:#MonoTests.System.Runtime.Serialization.Json"",""Bar"":null,""Foo"":""foo""}", s, "#1");
-               }
-
-               [Test]
-               public void AlwaysEmitTypeInformation3 ()
-               {
-                       var ms = new MemoryStream ();
-                       var ds = new DataContractJsonSerializer (typeof (TestData), "root", null, 10, false, null, false);
-                       ds.WriteObject (ms, new TestData () { Foo = "foo"});
-                       var s = Encoding.UTF8.GetString (ms.ToArray ());
-                       Assert.AreEqual (@"{""Bar"":null,""Foo"":""foo""}", s, "#1");
-               }
-
-               [Test]
-               public void TestNonpublicDeserialization ()
-               {
-                       string s1= @"{""Bar"":""bar"", ""Foo"":""foo"", ""Baz"":""baz""}";
-                       TestData o1 = ((TestData)(new DataContractJsonSerializer (typeof (TestData)).ReadObject (JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (s1), new XmlDictionaryReaderQuotas ()))));
-
-                       Assert.AreEqual (null, o1.Baz, "#1");
-
-                        string s2 = @"{""TestData"":[{""key"":""key1"",""value"":""value1""}]}";
-                        KeyValueTestData o2 = ((KeyValueTestData)(new DataContractJsonSerializer (typeof (KeyValueTestData)).ReadObject (JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (s2), new XmlDictionaryReaderQuotas ()))));
-
-                       Assert.AreEqual (1, o2.TestData.Count, "#2");
-                       Assert.AreEqual ("key1", o2.TestData[0].Key, "#3");
-                       Assert.AreEqual ("value1", o2.TestData[0].Value, "#4");
-               }
-
-               // [Test] use this case if you want to check lame silverlight parser behavior. Seealso #549756
-               public void QuotelessDeserialization ()
-               {
-                       string s1 = @"{FooMember:""value""}";
-                       var ds = new DataContractJsonSerializer (typeof (DCWithName));
-                       ds.ReadObject (new MemoryStream (Encoding.UTF8.GetBytes (s1)));
-
-                       string s2 = @"{FooMember:"" \""{dummy:string}\""""}";
-                       ds.ReadObject (new MemoryStream (Encoding.UTF8.GetBytes (s2)));
-               }
-
-               [Test]
-               [Category ("NotWorking")]
-               public void TypeIsNotPartsOfKnownTypes ()
-               {
-                       var dcs = new DataContractSerializer (typeof (string));
-                       Assert.AreEqual (0, dcs.KnownTypes.Count, "KnownTypes #1");
-                       var dcjs = new DataContractJsonSerializer (typeof (string));
-                       Assert.AreEqual (0, dcjs.KnownTypes.Count, "KnownTypes #2");
-               }
-
-               [Test]
-               public void ReadWriteNullObject ()
-               {
-                       DataContractJsonSerializer dcjs = new DataContractJsonSerializer (typeof (string));
-                       using (MemoryStream ms = new MemoryStream ()) {
-                               dcjs.WriteObject (ms, null);
-                               ms.Position = 0;
-                               using (StreamReader sr = new StreamReader (ms)) {
-                                       string data = sr.ReadToEnd ();
-                                       Assert.AreEqual ("null", data, "WriteObject(stream,null)");
-
-                                       ms.Position = 0;
-                                       Assert.IsNull (dcjs.ReadObject (ms), "ReadObject(stream)");
-                               }
-                       };
-               }
-
-               object ReadWriteObject (Type type, object obj, string expected)
-               {
-                       using (MemoryStream ms = new MemoryStream ()) {
-                               DataContractJsonSerializer dcjs = new DataContractJsonSerializer (type);
-                               dcjs.WriteObject (ms, obj);
-                               ms.Position = 0;
-                               using (StreamReader sr = new StreamReader (ms)) {
-                                       Assert.AreEqual (expected, sr.ReadToEnd (), "WriteObject");
-
-                                       ms.Position = 0;
-                                       return dcjs.ReadObject (ms);
-                               }
-                       }
-               }
-
-               [Test]
-               [Ignore ("Wrong test case. See bug #573691")]
-               public void ReadWriteObject_Single_SpecialCases ()
-               {
-                       Assert.IsTrue (Single.IsNaN ((float) ReadWriteObject (typeof (float), Single.NaN, "NaN")));
-                       Assert.IsTrue (Single.IsNegativeInfinity ((float) ReadWriteObject (typeof (float), Single.NegativeInfinity, "-INF")));
-                       Assert.IsTrue (Single.IsPositiveInfinity ((float) ReadWriteObject (typeof (float), Single.PositiveInfinity, "INF")));
-               }
-
-               [Test]
-               [Ignore ("Wrong test case. See bug #573691")]
-               public void ReadWriteObject_Double_SpecialCases ()
-               {
-                       Assert.IsTrue (Double.IsNaN ((double) ReadWriteObject (typeof (double), Double.NaN, "NaN")));
-                       Assert.IsTrue (Double.IsNegativeInfinity ((double) ReadWriteObject (typeof (double), Double.NegativeInfinity, "-INF")));
-                       Assert.IsTrue (Double.IsPositiveInfinity ((double) ReadWriteObject (typeof (double), Double.PositiveInfinity, "INF")));
-               }
-
-               [Test]
-               public void ReadWriteDateTime ()
-               {
-                       var ms = new MemoryStream ();
-                       DataContractJsonSerializer serializer = new DataContractJsonSerializer (typeof (Query));
-                       Query query = new Query () {
-                               StartDate = DateTime.SpecifyKind (new DateTime (2010, 3, 4, 5, 6, 7), DateTimeKind.Utc),
-                               EndDate = DateTime.SpecifyKind (new DateTime (2010, 4, 5, 6, 7, 8), DateTimeKind.Utc)
-                               };
-                       serializer.WriteObject (ms, query);
-                       Assert.AreEqual ("{\"StartDate\":\"\\/Date(1267679167000)\\/\",\"EndDate\":\"\\/Date(1270447628000)\\/\"}", Encoding.UTF8.GetString (ms.ToArray ()), "#1");
-                       ms.Position = 0;
-                       Console.WriteLine (new StreamReader (ms).ReadToEnd ());
-                       ms.Position = 0;
-                       var q = (Query) serializer.ReadObject(ms);
-                       Assert.AreEqual (query.StartDate, q.StartDate, "#2");
-                       Assert.AreEqual (query.EndDate, q.EndDate, "#3");
-               }
-
-               [DataContract(Name = "DateTest")]
-               public class DateTest
-               {
-                       [DataMember(Name = "should_have_value")]
-                       public DateTime? ShouldHaveValue { get; set; }
-               }
-
-               //
-               // This tests both the extended format "number-0500" as well
-               // as the nullable field in the structure
-               [Test]
-               public void BugXamarin163 ()
-               {
-                       string json = @"{""should_have_value"":""\/Date(1277355600000)\/""}";
-
-                       byte[] bytes = global::System.Text.Encoding.UTF8.GetBytes(json);
-                       Stream inputStream = new MemoryStream(bytes);
-                       
-                       DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DateTest));
-                       DateTest t = serializer.ReadObject(inputStream) as DateTest;
-                       Assert.AreEqual (634129524000000000, t.ShouldHaveValue.Value.Ticks, "#1");
-               }
-
-               [Test]
-               public void NullableFieldsShouldSupportNullValue ()
-               {
-                       string json = @"{""should_have_value"":null}";
-                       var inputStream = new MemoryStream (Encoding.UTF8.GetBytes (json));
-                       DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DateTest));
-                       Console.WriteLine ("# serializer assembly: {0}", serializer.GetType ().Assembly.Location);
-                       DateTest t = serializer.ReadObject (inputStream) as DateTest;
-                       Assert.AreEqual (false, t.ShouldHaveValue.HasValue, "#2");
-               }
-               
-               [Test]
-               public void DeserializeNullMember ()
-               {
-                       var ds = new DataContractJsonSerializer (typeof (ClassA));
-                       var stream = new MemoryStream ();
-                       var a = new ClassA ();
-                       ds.WriteObject (stream, a);
-                       stream.Position = 0;
-                       a = (ClassA) ds.ReadObject (stream);
-                       Assert.IsNull (a.B, "#1");
-               }
-
-               [Test]
-               public void OnDeserializationMethods ()
-               {
-                       var ds = new DataContractJsonSerializer (typeof (GSPlayerListErg));
-                       var obj = new GSPlayerListErg ();
-                       var ms = new MemoryStream ();
-                       ds.WriteObject (ms, obj);
-                       ms.Position = 0;
-                       ds.ReadObject (ms);
-                       Assert.IsTrue (GSPlayerListErg.A, "A");
-                       Assert.IsTrue (GSPlayerListErg.B, "B");
-                       Assert.IsTrue (GSPlayerListErg.C, "C");
-               }
-               
-               [Test]
-               public void WriteChar ()
-               {
-                       DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof (CharTest));
-                       using (MemoryStream ms = new MemoryStream()) {
-                               serializer.WriteObject(ms, new CharTest ());
-                               ms.Position = 0L;
-                               using (StreamReader reader = new StreamReader(ms)) {
-                                       reader.ReadToEnd();
-                               }
-                       }
-               }
-
-               [Test]
-               public void DictionarySerialization ()
-               {
-                       var dict = new MyDictionary<string,string> ();
-                       dict.Add ("key", "value");
-                       var serializer = new DataContractJsonSerializer (dict.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, dict);
-                       stream.Position = 0;
-
-                       Assert.AreEqual ("[{\"Key\":\"key\",\"Value\":\"value\"}]", new StreamReader (stream).ReadToEnd (), "#1");
-                       stream.Position = 0;
-                       dict = (MyDictionary<string,string>) serializer.ReadObject (stream);
-                       Assert.AreEqual (1, dict.Count, "#2");
-                       Assert.AreEqual ("value", dict ["key"], "#3");
-               }
-
-               [Test]
-               public void ExplicitCustomDictionarySerialization ()
-               {
-                       var dict = new MyExplicitDictionary<string,string> ();
-                       dict.Add ("key", "value");
-                       var serializer = new DataContractJsonSerializer (dict.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, dict);
-                       stream.Position = 0;
-
-                       Assert.AreEqual ("[{\"Key\":\"key\",\"Value\":\"value\"}]", new StreamReader (stream).ReadToEnd (), "#1");
-                       stream.Position = 0;
-                       dict = (MyExplicitDictionary<string,string>) serializer.ReadObject (stream);
-                       Assert.AreEqual (1, dict.Count, "#2");
-                       Assert.AreEqual ("value", dict ["key"], "#3");
-               }
-
-               [Test]
-               public void Bug13485 ()
-               {
-                       const string json = "{ \"Name\" : \"Test\", \"Value\" : \"ValueA\" }";
-
-                       string result = string.Empty;
-                       var serializer = new DataContractJsonSerializer (typeof (Bug13485Type));
-                       Bug13485Type entity;
-                       using (var stream = new MemoryStream (Encoding.UTF8.GetBytes (json)))
-                               entity = (Bug13485Type) serializer.ReadObject (stream);
-
-                       result = entity.GetValue;
-                       Assert.AreEqual ("ValueA", result, "#1");
-               }
-
-               [DataContract(Name = "UriTest")]
-               public class UriTest
-               {
-                       [DataMember(Name = "members")]
-                       public Uri MembersRelativeLink { get; set; }
-               }
-
-               [Test]
-               public void Bug15169 ()
-               {
-                       const string json = "{\"members\":\"foo/bar/members\"}";
-                       var serializer = new DataContractJsonSerializer (typeof (UriTest));
-                       UriTest entity;
-                       using (var stream = new MemoryStream (Encoding.UTF8.GetBytes (json)))
-                               entity = (UriTest) serializer.ReadObject (stream);
-
-                       Assert.AreEqual ("foo/bar/members", entity.MembersRelativeLink.ToString ());
-               }
-               
-               #region Test methods for collection serialization
-               
-               [Test]
-               public void TestArrayListSerialization ()
-               {
-                       var collection = new ArrayListContainer ();
-                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
-                       var expectedItemsCount = 4;
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-
-                       stream.Position = 0;
-                       collection = (ArrayListContainer) serializer.ReadObject (stream);
-                       
-                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestBitArraySerialization ()
-               {
-                       var collection = new BitArrayContainer ();
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-               
-               [Test]
-               public void TestHashtableSerialization ()
-               {
-                       var collection = new HashtableContainer ();
-                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void TestHashtableDeserialization ()
-               {
-                       var collection = new HashtableContainer ();
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       serializer.ReadObject (stream);
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestQueueSerialization ()
-               {
-                       var collection = new QueueContainer ();
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-               
-               [Test]
-               public void TestSortedListSerialization ()
-               {
-                       var collection = new SortedListContainer ();
-                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void TestSortedListDeserialization ()
-               {
-                       var collection = new SortedListContainer ();
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       serializer.ReadObject (stream);
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestStackSerialization ()
-               {
-                       var collection = new StackContainer ();
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-               
-               [Test]
-               public void TestEnumerableWithAddSerialization ()
-               {
-                       var collection = new EnumerableWithAddContainer ();
-                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
-                       var expectedItemsCount = 4;
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-
-                       stream.Position = 0;
-                       collection = (EnumerableWithAddContainer) serializer.ReadObject (stream);
-                       
-                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestEnumerableWithSpecialAddSerialization ()
-               {
-                       var collection = new EnumerableWithSpecialAddContainer ();                      
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-       
-               [Test]
-               public void TestHashSetSerialization ()
-               {
-                       var collection = new GenericHashSetContainer ();
-                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
-                       var expectedItemsCount = 2;
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-
-                       stream.Position = 0;
-                       collection = (GenericHashSetContainer) serializer.ReadObject (stream);
-                       
-                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
-               }
-               
-               [Test]
-               public void TestLinkedListSerialization ()
-               {
-                       var collection = new GenericLinkedListContainer ();
-                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
-                       var expectedItemsCount = 4;
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-
-                       stream.Position = 0;
-                       collection = (GenericLinkedListContainer) serializer.ReadObject (stream);
-                       
-                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestGenericQueueSerialization ()
-               {
-                       var collection = new GenericQueueContainer ();                  
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestGenericStackSerialization ()
-               {
-                       var collection = new GenericStackContainer ();                  
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-               
-               [Test]
-               public void TestGenericDictionarySerialization ()
-               {
-                       var collection = new GenericDictionaryContainer ();                     
-                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void TestGenericDictionaryDeserialization ()
-               {
-                       var collection = new GenericDictionaryContainer ();                     
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       serializer.ReadObject (stream);
-               }
-               
-               [Test]
-               public void TestGenericSortedListSerialization ()
-               {
-                       var collection = new GenericSortedListContainer ();                     
-                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void TestGenericSortedListDeserialization ()
-               {
-                       var collection = new GenericSortedListContainer ();                     
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       serializer.ReadObject (stream);
-               }
-               
-               [Test]
-               public void TestGenericSortedDictionarySerialization ()
-               {
-                       var collection = new GenericSortedDictionaryContainer ();                       
-                       var expectedOutput = "{\"Items\":[{\"Key\":\"key1\",\"Value\":\"banana\"},{\"Key\":\"key2\",\"Value\":\"apple\"}]}";
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void TestGenericSortedDictionaryDeserialization ()
-               {
-                       var collection = new GenericSortedDictionaryContainer ();                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-                       
-                       stream.Position = 0;
-                       serializer.ReadObject (stream);
-               }
-               
-               [Test]
-               public void TestGenericEnumerableWithAddSerialization ()
-               {
-                       var collection = new GenericEnumerableWithAddContainer ();
-                       var expectedOutput = "{\"Items\":[\"banana\",\"apple\"]}";
-                       var expectedItemsCount = 4;
-                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-
-                       stream.Position = 0;
-                       Assert.AreEqual (expectedOutput, new StreamReader (stream).ReadToEnd (), "#1");
-
-                       stream.Position = 0;
-                       collection = (GenericEnumerableWithAddContainer) serializer.ReadObject (stream);
-                       
-                       Assert.AreEqual (expectedItemsCount, collection.Items.Count, "#2");
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestGenericEnumerableWithSpecialAddSerialization ()
-               {
-                       var collection = new GenericEnumerableWithSpecialAddContainer ();                       
-                       var serializer = new DataContractJsonSerializer (collection.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, collection);
-               }
-               
-               [Test]
-               [ExpectedException (typeof (InvalidDataContractException))]
-               public void TestNonCollectionGetOnlyProperty ()
-               {
-                       var o = new NonCollectionGetOnlyContainer ();                   
-                       var serializer = new DataContractJsonSerializer (o.GetType ());
-                       var stream = new MemoryStream ();
-                       serializer.WriteObject (stream, o);
-               }
-               
-               // properly deserialize object with a polymorphic property (known derived type)
-               [Test]
-               public void Bug23058()
-               {
-                       string serializedObj = @"{""PolymorphicProperty"":{""__type"":""KnownDerivedType:#MonoTests.System.Runtime.Serialization.Json"",""BaseTypeProperty"":""Base"",""DerivedProperty"":""Derived 1""},""Name"":""Parent2""}";
-                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
-
-                       Assert.AreEqual (deserializedObj.PolymorphicProperty.GetType ().FullName, "MonoTests.System.Runtime.Serialization.Json.KnownDerivedType");
-                       Assert.AreEqual (deserializedObj.PolymorphicProperty.BaseTypeProperty, "Base");
-                       Assert.AreEqual ((deserializedObj.PolymorphicProperty as KnownDerivedType).DerivedProperty, "Derived 1");
-                       Assert.AreEqual (deserializedObj.Name, "Parent2");
-               }
-
-               // properly deserialize object with a polymorphic property (base type with __type hint)
-               [Test]
-               public void DeserializeBaseTypePropHint()
-               {
-                       string serializedObj = @"{""PolymorphicProperty"":{""__type"":""BaseType:#MonoTests.System.Runtime.Serialization.Json"",""BaseTypeProperty"":""Base""},""Name"":""Parent2""}";
-                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
-
-                       Assert.AreEqual (deserializedObj.PolymorphicProperty.GetType ().FullName, "MonoTests.System.Runtime.Serialization.Json.BaseType");
-                       Assert.AreEqual (deserializedObj.PolymorphicProperty.BaseTypeProperty, "Base");
-               }
-
-               // properly deserialize object with a polymorphic property (base type with __type hint)
-               [Test]
-               public void DeserializeBaseTypePropNoHint()
-               {
-                       string serializedObj = @"{""PolymorphicProperty"":{""BaseTypeProperty"":""Base""},""Name"":""Parent2""}";
-                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
-
-                       Assert.AreEqual (deserializedObj.PolymorphicProperty.GetType ().FullName, "MonoTests.System.Runtime.Serialization.Json.BaseType");
-                       Assert.AreEqual (deserializedObj.PolymorphicProperty.BaseTypeProperty, "Base");
-               }
-
-               // properly fail deserializing object with a polymorphic property (unknown derived type)
-               [ExpectedException (typeof (SerializationException))]
-               [Test]
-               public void FailDeserializingUnknownTypeProp()
-               {
-                       string serializedObj = @"{""PolymorphicProperty"":{""__type"":""UnknownDerivedType:#MonoTests.System.Runtime.Serialization.Json"",""BaseTypeProperty"":""Base"",""DerivedProperty"":""Derived 1""},""Name"":""Parent2""}";
-                       ParentType deserializedObj = Deserialize<ParentType> (serializedObj);
-               }
-
-               [Test]
-               public void SubclassTest ()
-               {
-                       var knownTypes = new List<Type> { typeof(IntList) };
-                       var serializer = new DataContractJsonSerializer(typeof(ListOfNumbers), knownTypes);
-
-                       string json = "{\"Numbers\": [85]}";
-                       using (var stream = new MemoryStream(UTF8Encoding.Default.GetBytes(json)))
-                       {
-                               var nums = (ListOfNumbers)serializer.ReadObject(stream);
-                               Assert.AreEqual (1, nums.Numbers.Count);
-                       }
-               }
-               [DataContract]
-               public class ListOfNumbers
-               {
-                       [DataMember]
-                       public IntList Numbers;
-               }
-
-               public class IntList : List<int>{}
-               #endregion
-
-               [Test]
-               public void DefaultValueDeserialization ()
-               {
-                       // value type
-                       var person = new Person { name = "John" };
-                       using (var ms = new MemoryStream()) {
-                               var serializer = new DataContractJsonSerializer (typeof (Person), new DataContractJsonSerializerSettings {
-                                       SerializeReadOnlyTypes = true,
-                                       UseSimpleDictionaryFormat = true
-                                       });
-                               serializer.WriteObject (ms, person);
-                       }
-
-                       // reference type
-                       var person2 = new PersonWithContact {
-                               name = "Jane",
-                               contact = new Contact { url = "localhost", email = "jane@localhost" } };
-                       using (var ms = new MemoryStream ()) {
-                               var serializer = new DataContractJsonSerializer (typeof (PersonWithContact), new DataContractJsonSerializerSettings {
-                                       SerializeReadOnlyTypes = true,
-                                       UseSimpleDictionaryFormat = true
-                                       });
-                               serializer.WriteObject (ms, person2);
-                       }
-               }
-
-               [Test]
-               public void Bug15028()
-               {
-                       DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Bug15028));
-                       using (MemoryStream memoryStream = new MemoryStream())
-                       {
-                               ser.WriteObject(memoryStream, new Bug15028());
-                               string output = Encoding.Default.GetString(memoryStream.ToArray());
-                               Assert.AreEqual(@"{""Int0"":1,""Int1"":1,""IntZero1"":0,""Str0"":"""",""Str1"":"""",""StrNull1"":null}", output);
-                       }
-               }
-       }
-       
-
-       [DataContract]
-       public class Bug15028
-       {
-               [DataMember(EmitDefaultValue = false)]
-               public string StrNull0 { get; private set; }
-
-               [DataMember(EmitDefaultValue = false)]
-               public string Str0 { get; private set; }
-
-               [DataMember(EmitDefaultValue = true)]
-               public string StrNull1 { get; private set; }
-
-               [DataMember(EmitDefaultValue = true)]
-               public string Str1 { get; private set; }
-
-               [DataMember(EmitDefaultValue = false)]
-               public int IntZero0 { get; private set; }
-
-               [DataMember(EmitDefaultValue = false)]
-               public int Int0 { get; private set; }
-
-               [DataMember(EmitDefaultValue = true)]
-               public int IntZero1 { get; private set; }
-
-               [DataMember(EmitDefaultValue = true)]
-               public int Int1 { get; private set; }
-
-               public Bug15028()
-               {
-                       Str0 = string.Empty;
-                       Str1 = string.Empty;
-                       Int0 = 1;
-                       Int1 = 1;
-               }
-       }
-
-       public class CharTest
-       {
-               public char Foo;
-       }
-
-       public class TestData
-       {
-               public string Foo { get; set; }
-               public string Bar { get; set; }
-               internal string Baz { get; set; }
-       }
-
-       public enum Colors {
-               Red, Green, Blue
-       }
-
-       [DataContract (Name = "_ColorsWithDC")]
-       public enum ColorsWithDC {
-
-               [EnumMember (Value = "_Red")]
-               Red, 
-               [EnumMember]
-               Green, 
-               Blue
-       }
-
-
-       public enum ColorsEnumMemberNoDC {
-               [EnumMember (Value = "_Red")]
-               Red, 
-               [EnumMember]
-               Green, 
-               Blue
-       }
-
-       [DataContract]
-       public class DCWithEnum {
-               [DataMember (Name = "_colors")]
-               public Colors colors;
-       }
-
-       [DataContract]
-       public class DCEmpty
-       {
-               // serializer doesn't touch it.
-               public string Foo = "TEST";
-       }
-
-       [DataContract]
-       public class DCSimple1
-       {
-               [DataMember]
-               public string Foo = "TEST";
-       }
-
-       [DataContract]
-       public class DCHasNonDC
-       {
-               [DataMember]
-               public NonDC Hoge= new NonDC ();
-       }
-
-       public class NonDC
-       {
-               public string Whee = "whee!";
-       }
-
-       [DataContract]
-       public class DCHasSerializable
-       {
-               [DataMember]
-               public SimpleSer1 Ser = new SimpleSer1 ();
-       }
-
-       [DataContract (Name = "Foo")]
-       public class DCWithName
-       {
-               [DataMember (Name = "FooMember")]
-               public string DMWithName = "value";
-       }
-
-       [DataContract (Name = "")]
-       public class DCWithEmptyName
-       {
-               [DataMember]
-               public string Foo;
-       }
-
-       [DataContract (Name = null)]
-       public class DCWithNullName
-       {
-               [DataMember]
-               public string Foo;
-       }
-
-       [DataContract (Namespace = "")]
-       public class DCWithEmptyNamespace
-       {
-               [DataMember]
-               public string Foo;
-       }
-
-       [Serializable]
-       public class SimpleSer1
-       {
-               public string Doh = "doh!";
-       }
-
-       public class Wrapper
-       {
-               [DataContract]
-               public class DCWrapped
-               {
-               }
-       }
-
-       [DataContract]
-       public class CollectionContainer
-       {
-               Collection<string> items = new Collection<string> ();
-
-               [DataMember]
-               public Collection<string> Items {
-                       get { return items; }
-               }
-       }
-
-       [CollectionDataContract]
-       public class DataCollection<T> : Collection<T>
-       {
-       }
-
-       [DataContract]
-       public class DataCollectionContainer
-       {
-               DataCollection<string> items = new DataCollection<string> ();
-
-               [DataMember]
-               public DataCollection<string> Items {
-                       get { return items; }
-               }
-       }
-
-       [DataContract]
-       class SerializeNonDCArrayType
-       {
-               [DataMember]
-               public NonDCItem [] IPAddresses = new NonDCItem [0];
-       }
-
-       public class NonDCItem
-       {
-               public byte [] Data { get; set; }
-       }
-
-       [DataContract]
-       public class VerifyObjectNameTestData
-       {
-               [DataMember]
-               string Member1 = "foo";
-       }
-
-       [Serializable]
-       public class KeyValueTestData {
-               public List<KeyValuePair<string,string>> TestData = new List<KeyValuePair<string,string>>();
-       }
-
-       [DataContract] // bug #586169
-       public class Query
-       {
-               [DataMember (Order=1)]
-               public DateTime StartDate { get; set; }
-               [DataMember (Order=2)]
-               public DateTime EndDate { get; set; }
-       }
-
-       public class ClassA {
-               public ClassB B { get; set; }
-       }
-
-       public class ClassB
-       {
-       }
-
-       public class GSPlayerListErg
-       {
-               public GSPlayerListErg ()
-               {
-                       Init ();
-               }
-
-               void Init ()
-               {
-                       C = true;
-                       ServerTimeUTC = DateTime.SpecifyKind (DateTime.MinValue, DateTimeKind.Utc);
-               }
-
-               [OnDeserializing]
-               public void OnDeserializing (StreamingContext c)
-               {
-                       A = true;
-                       Init ();
-               }
-
-               [OnDeserialized]
-               void OnDeserialized (StreamingContext c)
-               {
-                       B = true;
-               }
-
-               public static bool A, B, C;
-
-               [DataMember (Name = "T")]
-               public long CodedServerTimeUTC { get; set; }
-               public DateTime ServerTimeUTC { get; set; }
-       }
-
-       #region polymorphism test helper classes
-
-       [DataContract]
-       [KnownType (typeof (KnownDerivedType))]
-       public class ParentType
-       {
-               [DataMember]
-               public string Name { get; set; }
-
-               [DataMember]
-               public BaseType PolymorphicProperty { get; set; }
-       }
-
-       [DataContract]
-       public class BaseType
-       {
-               [DataMember]
-               public string BaseTypeProperty { get; set; }
-       }
-
-       [DataContract]
-       public class KnownDerivedType : BaseType
-       {
-               [DataMemberAttribute]
-               public string DerivedProperty { get; set; }
-       }
-
-       [DataContract]
-       public class UnknownDerivedType : BaseType
-       {
-               [DataMember]
-               public string DerivedProperty { get; set; }
-       }
-
-       #endregion
-}
-
-[DataContract]
-class GlobalSample1
-{
-}
-
-
-public class MyDictionary<K, V> : System.Collections.Generic.IDictionary<K, V>
-{
-       Dictionary<K,V> dic = new Dictionary<K,V> ();
-
-       public void Add (K key, V value)
-       {
-               dic.Add (key,  value);
-       }
-
-       public bool ContainsKey (K key)
-       {
-               return dic.ContainsKey (key);
-       }
-
-       public ICollection<K> Keys {
-               get { return dic.Keys; }
-       }
-
-       public bool Remove (K key)
-       {
-               return dic.Remove (key);
-       }
-
-       public bool TryGetValue (K key, out V value)
-       {
-               return dic.TryGetValue (key, out value);
-       }
-
-       public ICollection<V> Values {
-               get { return dic.Values; }
-       }
-
-       public V this [K key] {
-               get { return dic [key]; }
-               set { dic [key] = value; }
-       }
-
-       IEnumerator IEnumerable.GetEnumerator ()
-       {
-               return dic.GetEnumerator ();
-       }
-
-       ICollection<KeyValuePair<K,V>> Coll {
-               get { return (ICollection<KeyValuePair<K,V>>) dic; }
-       }
-
-       public void Add (KeyValuePair<K, V> item)
-       {
-               Coll.Add (item);
-       }
-
-       public void Clear ()
-       {
-               dic.Clear ();
-       }
-
-       public bool Contains (KeyValuePair<K, V> item)
-       {
-               return Coll.Contains (item);
-       }
-
-       public void CopyTo (KeyValuePair<K, V> [] array, int arrayIndex)
-       {
-               Coll.CopyTo (array, arrayIndex);
-       }
-
-       public int Count {
-               get { return dic.Count; }
-       }
-
-       public bool IsReadOnly {
-               get { return Coll.IsReadOnly; }
-       }
-
-       public bool Remove (KeyValuePair<K, V> item)
-       {
-               return Coll.Remove (item);
-       }
-
-       public IEnumerator<KeyValuePair<K, V>> GetEnumerator ()
-       {
-               return Coll.GetEnumerator ();
-       }
-}
-
-public class MyExplicitDictionary<K, V> : IDictionary<K, V> {
-
-       Dictionary<K,V> dic = new Dictionary<K,V> ();
-
-       public void Add (K key, V value)
-       {
-               dic.Add (key,  value);
-       }
-
-       public bool ContainsKey (K key)
-       {
-               return dic.ContainsKey (key);
-       }
-
-       ICollection<K> IDictionary<K, V>.Keys {
-               get { return dic.Keys; }
-       }
-
-       public bool Remove (K key)
-       {
-               return dic.Remove (key);
-       }
-
-       public bool TryGetValue (K key, out V value)
-       {
-               return dic.TryGetValue (key, out value);
-       }
-
-       ICollection<V> IDictionary<K, V>.Values {
-               get { return dic.Values; }
-       }
-
-       public V this [K key] {
-               get { return dic [key]; }
-               set { dic [key] = value; }
-       }
-
-       IEnumerator IEnumerable.GetEnumerator ()
-       {
-               return dic.GetEnumerator ();
-       }
-
-       ICollection<KeyValuePair<K,V>> Coll {
-               get { return (ICollection<KeyValuePair<K,V>>) dic; }
-       }
-
-       public void Add (KeyValuePair<K, V> item)
-       {
-               Coll.Add (item);
-       }
-
-       public void Clear ()
-       {
-               dic.Clear ();
-       }
-
-       public bool Contains (KeyValuePair<K, V> item)
-       {
-               return Coll.Contains (item);
-       }
-
-       public void CopyTo (KeyValuePair<K, V> [] array, int arrayIndex)
-       {
-               Coll.CopyTo (array, arrayIndex);
-       }
-
-       public int Count {
-               get { return dic.Count; }
-       }
-
-       public bool IsReadOnly {
-               get { return Coll.IsReadOnly; }
-       }
-
-       public bool Remove (KeyValuePair<K, V> item)
-       {
-               return Coll.Remove (item);
-       }
-
-       public IEnumerator<KeyValuePair<K, V>> GetEnumerator ()
-       {
-               return Coll.GetEnumerator ();
-       }
-}
-
-[DataContract]
-public class Bug13485Type
-{
-       [DataMember]
-       public string Name { get; set; }
-
-       [DataMember (Name = "Value")]
-       private string Value { get; set; }
-
-       public string GetValue { get { return this.Value; } }
-}
-
-#region Test classes for Collection serialization
-
-[DataContract]
-       public abstract class CollectionContainer <V>
-       {
-               V items;
-
-               [DataMember]
-               public V Items
-               {
-                       get {
-                               if (items == null) items = Init ();
-                               return items;
-                       }
-               }
-               
-               public CollectionContainer ()
-               {
-                       Init ();
-               }
-       
-               protected abstract V Init ();
-       }
-       
-       [DataContract]
-       public class ArrayListContainer : CollectionContainer<ArrayList> {
-               protected override ArrayList Init ()
-               {
-                       return new ArrayList { "banana", "apple" };
-               }
-       }
-       
-       [DataContract]
-       public class BitArrayContainer : CollectionContainer<BitArray> {
-               protected override BitArray Init ()
-               {
-                       return new BitArray (new [] { false, true });
-               }
-       }
-       
-       [DataContract]
-       public class HashtableContainer : CollectionContainer<Hashtable> {
-               protected override Hashtable Init ()
-               {
-                       var ht = new Hashtable ();
-                       ht.Add ("key1", "banana");
-                       ht.Add ("key2", "apple");
-                       return ht;
-               }
-       }
-       
-       [DataContract]
-       public class QueueContainer : CollectionContainer<Queue> {
-               protected override Queue Init ()
-               {
-                       var q = new Queue ();
-                       q.Enqueue ("banana");
-                       q.Enqueue ("apple");
-                       return q;
-               }
-       }
-       
-       [DataContract]
-       public class SortedListContainer : CollectionContainer<SortedList> {
-               protected override SortedList Init ()
-               {
-                       var l = new SortedList ();
-                       l.Add ("key1", "banana");
-                       l.Add ("key2", "apple");
-                       return l;
-               }
-       }
-       
-       [DataContract]
-       public class StackContainer : CollectionContainer<Stack> {
-               protected override Stack Init ()
-               {
-                       var s = new Stack ();
-                       s.Push ("banana");
-                       s.Push ("apple");
-                       return s;
-               }
-       }
-
-       public class EnumerableWithAdd : IEnumerable
-       {
-               private ArrayList items;
-
-               public EnumerableWithAdd()
-               {
-                       items = new ArrayList();
-               }
-
-               public IEnumerator GetEnumerator()
-               {
-                       return items.GetEnumerator();
-               }
-
-               public void Add(object value)
-               {
-                       items.Add(value);
-               }
-
-               public int Count
-               {
-                       get {
-                               return items.Count;
-                       }
-               }
-       }
-
-       public class EnumerableWithSpecialAdd : IEnumerable
-       {
-               private ArrayList items;
-
-               public EnumerableWithSpecialAdd()
-               {
-                       items = new ArrayList();
-               }
-
-               public IEnumerator GetEnumerator()
-               {
-                       return items.GetEnumerator();
-               }
-
-               public void Add(object value, int index)
-               {
-                       items.Add(value);
-               }
-
-               public int Count
-               {
-                       get
-                       {
-                               return items.Count;
-                       }
-               }
-       }
-
-       [DataContract]
-       public class EnumerableWithAddContainer : CollectionContainer<EnumerableWithAdd>
-       {
-               protected override EnumerableWithAdd Init()
-               {
-                       var s = new EnumerableWithAdd();
-                       s.Add ("banana");
-                       s.Add ("apple");
-                       return s;
-               }
-       }
-
-       [DataContract]
-       public class EnumerableWithSpecialAddContainer : CollectionContainer<EnumerableWithSpecialAdd>
-       {
-               protected override EnumerableWithSpecialAdd Init()
-               {
-                       var s = new EnumerableWithSpecialAdd();
-                       s.Add("banana", 0);
-                       s.Add("apple", 0);
-                       return s;
-               }
-       }
-
-       [DataContract]
-       public class GenericDictionaryContainer : CollectionContainer<Dictionary<string, string>> {
-               protected override Dictionary<string, string> Init ()
-               {
-                       var d = new Dictionary<string, string> ();
-                       d.Add ("key1", "banana");
-                       d.Add ("key2", "apple");
-                       return d;
-               }
-       }
-
-       [DataContract]
-       public class GenericHashSetContainer : CollectionContainer<HashSet<string>> {
-               protected override HashSet<string> Init ()
-               {
-                       return new HashSet<string> { "banana", "apple" };
-               }
-       }
-
-       [DataContract]
-       public class GenericLinkedListContainer : CollectionContainer<LinkedList<string>> {
-               protected override LinkedList<string> Init ()
-               {
-                       var l = new LinkedList<string> ();
-                       l.AddFirst ("apple");
-                       l.AddFirst ("banana");
-                       return l;
-               }
-       }
-
-       [DataContract]
-       public class GenericListContainer : CollectionContainer<List<string>> {
-               protected override List<string> Init ()
-               {
-                       return new List<string> { "banana", "apple" };
-               }
-       }
-
-       [DataContract]
-       public class GenericQueueContainer : CollectionContainer<Queue<string>> {
-               protected override Queue<string> Init ()
-               {
-                       var q = new Queue<string> ();
-                       q.Enqueue ("banana");
-                       q.Enqueue ("apple" );
-                       return q;
-               }
-       }
-
-       [DataContract]
-       public class GenericSortedDictionaryContainer : CollectionContainer<SortedDictionary<string, string>> {
-               protected override SortedDictionary<string, string> Init ()
-               {
-                       var d = new SortedDictionary<string, string> ();
-                       d.Add ("key1", "banana");
-                       d.Add ("key2", "apple");
-                       return d;
-               }
-       }
-
-       [DataContract]
-       public class GenericSortedListContainer : CollectionContainer<SortedList<string, string>> {
-               protected override SortedList<string, string> Init ()
-               {
-                       var d = new SortedList<string, string> ();
-                       d.Add ("key1", "banana");
-                       d.Add ("key2", "apple");
-                       return d;
-               }
-       }
-
-       [DataContract]
-       public class GenericStackContainer : CollectionContainer<Stack<string>> {
-               protected override Stack<string> Init ()
-               {
-                       var s = new Stack<string> ();
-                       s.Push ("banana");
-                       s.Push ("apple" );
-                       return s;
-               }
-       }
-
-       public class GenericEnumerableWithAdd : IEnumerable<string>
-       {
-               private List<string> items;
-
-               public GenericEnumerableWithAdd()
-               {
-                       items = new List<string>();
-               }
-
-               IEnumerator IEnumerable.GetEnumerator()
-               {
-                       return items.GetEnumerator ();
-               }
-
-               public IEnumerator<string> GetEnumerator()
-               {
-                       return items.GetEnumerator ();
-               }
-
-               public void Add(string value)
-               {
-                       items.Add(value);
-               }
-
-               public int Count
-               {
-                       get {
-                               return items.Count;
-                       }
-               }
-       }
-
-       public class GenericEnumerableWithSpecialAdd : IEnumerable<string>
-       {
-               private List<string> items;
-
-               public GenericEnumerableWithSpecialAdd()
-               {
-                       items = new List<string>();
-               }
-
-               IEnumerator IEnumerable.GetEnumerator()
-               {
-                       return items.GetEnumerator ();
-               }
-
-               public IEnumerator<string> GetEnumerator()
-               {
-                       return items.GetEnumerator ();
-               }
-
-               public void Add(string value, int index)
-               {
-                       items.Add(value);
-               }
-
-               public int Count
-               {
-                       get
-                       {
-                               return items.Count;
-                       }
-               }
-       }
-
-       [DataContract]
-       public class GenericEnumerableWithAddContainer : CollectionContainer<GenericEnumerableWithAdd>
-       {
-               protected override GenericEnumerableWithAdd Init()
-               {
-                       var s = new GenericEnumerableWithAdd();
-                       s.Add ("banana");
-                       s.Add ("apple");
-                       return s;
-               }
-       }
-
-       [DataContract]
-       public class GenericEnumerableWithSpecialAddContainer : CollectionContainer<GenericEnumerableWithSpecialAdd>
-       {
-               protected override GenericEnumerableWithSpecialAdd Init()
-               {
-                       var s = new GenericEnumerableWithSpecialAdd();
-                       s.Add("banana", 0);
-                       s.Add("apple", 0);
-                       return s;
-               }
-       }       
-
-       [DataContract]
-       public class NonCollectionGetOnlyContainer
-       {
-               string _test = "my string";
-       
-               [DataMember]
-               public string MyString {
-                       get {
-                               return _test;
-                       }
-               }
-       }       
-
-#endregion
-
-#region DefaultValueDeserialization
-    [DataContract]
-    public class Person
-    {
-        [DataMember(EmitDefaultValue = false)]
-        public string name { get; set; }
-    }
-
-    [DataContract]
-    public class PersonWithContact
-    {
-        [DataMember(EmitDefaultValue = false)]
-        public string name { get; set; }
-
-        [DataMember(EmitDefaultValue = false)]
-        public Contact contact { get; set; }
-    }
-
-    [DataContract]
-    public class Contact
-    {
-        [DataMember(EmitDefaultValue = false)]
-        public string url { get; set; }
-
-        [DataMember(EmitDefaultValue = false)]
-        public string email{ get; set; }
-    }
-#endregion
diff --git a/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/JsonReaderTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/JsonReaderTest.cs
deleted file mode 100644 (file)
index c95c3b6..0000000
+++ /dev/null
@@ -1,883 +0,0 @@
-//
-// JsonReaderTest.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-// Copyright 2014 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.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization.Json;
-using System.Text;
-using System.Threading;
-using System.Xml;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization.Json
-{
-       [TestFixture]
-       public class JsonReaderTest
-       {
-               XmlDictionaryReader reader;
-
-               Stream GetInput (string s)
-               {
-                       return new MemoryStream (Encoding.ASCII.GetBytes (s));
-               }
-
-               XmlDictionaryReader CreateReader (string s)
-               {
-                       return JsonReaderWriterFactory.CreateJsonReader (GetInput (s), new XmlDictionaryReaderQuotas ());
-               }
-
-               void AssertNode (int depth, string localName, XmlNodeType nodeType, string value, string type, XmlDictionaryReader reader, string label)
-               {
-                       Assert.AreEqual (localName, reader.LocalName, label + ".LocalName");
-                       Assert.AreEqual (nodeType, reader.NodeType, label + ".NodeType");
-                       Assert.AreEqual (value, reader.Value, label + ".Value");
-                       Assert.AreEqual (type, reader.GetAttribute ("type"), label + ".GetAttribute('type')");
-               }
-
-               // Constructors
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorNullBytes ()
-               {
-                       JsonReaderWriterFactory.CreateJsonReader ((byte []) null, new XmlDictionaryReaderQuotas ());
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorNullStream ()
-               {
-                       JsonReaderWriterFactory.CreateJsonReader ((Stream) null, new XmlDictionaryReaderQuotas ());
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorNullReaderQuotas ()
-               {
-                       JsonReaderWriterFactory.CreateJsonReader (GetInput ("{}"), null);
-               }
-
-               [Test]
-               public void ConstructorNullEncodingAndReaderClose ()
-               {
-                       JsonReaderWriterFactory.CreateJsonReader (GetInput ("{}"), null, new XmlDictionaryReaderQuotas (), null);
-               }
-
-               // Close()
-
-               [Test]
-               public void CloseTwice ()
-               {
-                       reader = CreateReader ("{}");
-                       reader.Close ();
-                       reader.Close ();
-               }
-
-               [Test]
-               // hmm... [ExpectedException (typeof (InvalidOperationException))]
-               public void CloseAndRead ()
-               {
-                       reader = CreateReader ("{}");
-                       reader.Close ();
-                       reader.Read ();
-               }
-
-               [Test]
-               // hmm... [ExpectedException (typeof (InvalidOperationException))]
-               public void CloseAndMoveToFirstAttribute ()
-               {
-                       reader = CreateReader ("{}");
-                       reader.Close ();
-                       reader.MoveToFirstAttribute ();
-               }
-
-               // Read() several top-level types
-
-               [Test]
-               public void ReadStateEmpty ()
-               {
-                       reader = CreateReader ("");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read ();
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#2");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#3");
-               }
-
-               [Test]
-               public void ReadStateEmpty2 ()
-               {
-                       reader = CreateReader ("  ");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read ();
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#2");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#3");
-               }
-
-               [Test]
-               public void ReadStateObject ()
-               {
-                       reader = CreateReader ("{}");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read (); // element
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
-                       reader.Read (); // endelement
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
-                       reader.Read (); // endoffile
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#4");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#5");
-               }
-
-               [Test]
-               public void ReadStateArray ()
-               {
-                       reader = CreateReader ("[]");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read (); // element
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
-                       reader.Read (); // endelement
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
-                       reader.Read (); // endoffile
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#4");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#5");
-               }
-
-               [Test]
-               public void ReadNumber ()
-               {
-                       reader = CreateReader ("1234");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read (); // dummy root element
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
-                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
-                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
-                       reader.Read (); // content (number)
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
-                       Assert.AreEqual (XmlNodeType.Text, reader.NodeType, "#3-1");
-                       Assert.AreEqual ("1234", reader.Value, "#3-2");
-                       reader.Read (); // endelement
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#4");
-                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#4-1");
-                       reader.Read (); // endoffile
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#5");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#6");
-               }
-
-               [Test]
-               public void ReadBool ()
-               {
-                       reader = CreateReader ("true");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read (); // dummy root element
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
-                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
-                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
-                       Assert.AreEqual ("boolean", reader.GetAttribute ("type"), "#2-3");
-                       reader.Read (); // content (boolean)
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
-                       Assert.AreEqual (XmlNodeType.Text, reader.NodeType, "#3-1");
-                       Assert.AreEqual ("true", reader.Value, "#3-2");
-                       reader.Read (); // endelement
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#4");
-                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#4-1");
-                       reader.Read (); // endoffile
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#5");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#6");
-               }
-
-               [Test]
-               public void ReadNull ()
-               {
-                       reader = CreateReader ("null");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read (); // dummy root element
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
-                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
-                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
-                       // When it is null, the value is never given and the reader is skipped to the end element.
-                       reader.Read (); // endlement
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
-                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#3-1");
-                       reader.Read (); // endoffile
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#4");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#4");
-               }
-
-               [Test]
-               public void ReadString ()
-               {
-                       reader = CreateReader ("\"true\"");
-                       Assert.AreEqual (ReadState.Initial, reader.ReadState, "#1");
-                       reader.Read (); // dummy root element
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#2");
-                       Assert.AreEqual (XmlNodeType.Element, reader.NodeType, "#2-1");
-                       Assert.AreEqual ("root", reader.LocalName, "#2-2");
-                       Assert.AreEqual ("string", reader.GetAttribute ("type"), "#2-3");
-                       reader.Read (); // content (number)
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#3");
-                       Assert.AreEqual (XmlNodeType.Text, reader.NodeType, "#3-1");
-                       Assert.AreEqual ("true", reader.Value, "#3-2");
-                       reader.Read (); // endelement
-                       Assert.AreEqual (ReadState.Interactive, reader.ReadState, "#4");
-                       Assert.AreEqual (XmlNodeType.EndElement, reader.NodeType, "#4-1");
-                       reader.Read (); // endoffile
-                       Assert.AreEqual (ReadState.EndOfFile, reader.ReadState, "#5");
-                       reader.Close ();
-                       Assert.AreEqual (ReadState.Closed, reader.ReadState, "#6");
-               }
-
-               // MoveToAttribute() / MoveToElement()
-
-               [Test]
-               public void MoveToAttributeObject ()
-               {
-                       reader = CreateReader ("{}");
-                       Assert.IsFalse (reader.MoveToFirstAttribute (), "#1");
-                       reader.Read (); // element
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
-                       Assert.AreEqual ("type", reader.LocalName, "#3");
-                       Assert.AreEqual ("object", reader.Value, "#4");
-                       Assert.IsTrue (reader.ReadAttributeValue (), "#5");
-                       Assert.AreEqual ("object", reader.Value, "#6");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#7");
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#8");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#9");
-               }
-
-               [Test]
-               public void MoveToElementObject ()
-               {
-                       reader = CreateReader ("{}");
-                       reader.Read (); // element
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#1");
-                       Assert.IsTrue (reader.MoveToElement (), "#1-1");
-
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
-                       Assert.IsTrue (reader.ReadAttributeValue (), "#2-1");
-                       Assert.IsTrue (reader.MoveToElement (), "#2-2");
-
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#3");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#3-1");
-                       Assert.IsTrue (reader.MoveToElement (), "#3-2");
-               }
-
-               [Test]
-               public void MoveToAttributeArray ()
-               {
-                       reader = CreateReader ("[]");
-                       Assert.IsFalse (reader.MoveToFirstAttribute (), "#1");
-                       reader.Read (); // element
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
-                       Assert.AreEqual ("type", reader.LocalName, "#3");
-                       Assert.AreEqual ("array", reader.Value, "#4");
-                       Assert.IsTrue (reader.ReadAttributeValue (), "#5");
-                       Assert.AreEqual ("array", reader.Value, "#6");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#7");
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#8");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#9");
-               }
-
-               [Test]
-               public void MoveToElementArray ()
-               {
-                       reader = CreateReader ("[]");
-                       reader.Read (); // element
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#1");
-                       Assert.IsTrue (reader.MoveToElement (), "#1-1");
-
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
-                       Assert.IsTrue (reader.ReadAttributeValue (), "#2-1");
-                       Assert.IsTrue (reader.MoveToElement (), "#2-2");
-
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#3");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#3-1");
-                       Assert.IsTrue (reader.MoveToElement (), "#3-2");
-               }
-
-               [Test]
-               public void MoveToAttributeSimpleDummyRoot ()
-               {
-                       reader = CreateReader ("1234");
-                       Assert.IsFalse (reader.MoveToFirstAttribute (), "#1");
-                       reader.Read (); // element
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
-                       Assert.AreEqual ("type", reader.LocalName, "#3");
-                       Assert.AreEqual ("number", reader.Value, "#4");
-                       Assert.IsTrue (reader.ReadAttributeValue (), "#5");
-                       Assert.AreEqual ("number", reader.Value, "#6");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#7");
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#8");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#9");
-               }
-
-               [Test]
-               public void MoveToElementSimpleDummyRoot ()
-               {
-                       reader = CreateReader ("1234");
-                       reader.Read (); // element
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#1");
-                       Assert.IsTrue (reader.MoveToElement (), "#1-1");
-
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#2");
-                       Assert.IsTrue (reader.ReadAttributeValue (), "#2-1");
-                       Assert.IsTrue (reader.MoveToElement (), "#2-2");
-
-                       Assert.IsTrue (reader.MoveToFirstAttribute (), "#3");
-                       Assert.IsFalse (reader.MoveToNextAttribute (), "#3-1");
-                       Assert.IsTrue (reader.MoveToElement (), "#3-2");
-               }
-
-               // Read() arrays and objects
-
-               [Test]
-               public void ReadArrayContent ()
-               {
-                       reader = CreateReader ("[123, \"123\", true, \"true\"]");
-
-                       // number value
-                       reader.Read (); // element
-                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "array", reader, "#1");
-
-                       reader.Read (); // 123 - element
-                       Assert.AreEqual ("number", reader.GetAttribute ("type"), "#2-0");
-                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "number", reader, "#2");
-                       reader.Read (); // 123 - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#3");
-                       reader.Read (); // 123 - endelement
-                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#4");
-
-                       // string value #1
-                       reader.Read (); // "123" - element
-                       Assert.AreEqual ("string", reader.GetAttribute ("type"), "#5-0");
-                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "string", reader, "#5");
-                       reader.Read (); // "123" - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#6");
-                       reader.Read (); // "123" - endelement
-                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#7");
-
-                       reader.Read (); // true - element
-                       Assert.AreEqual ("boolean", reader.GetAttribute ("type"), "#8-0");
-                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "boolean", reader, "#8");
-                       reader.Read (); // true - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#9");
-                       reader.Read (); // true - endelement
-                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#10");
-
-                       // string value #2
-                       reader.Read (); // "true" - element
-                       Assert.AreEqual ("string", reader.GetAttribute ("type"), "#11-0");
-                       AssertNode (1, "item", XmlNodeType.Element, String.Empty, "string", reader, "#11");
-                       reader.Read (); // "true" - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#12");
-                       reader.Read (); // "true" - endelement
-                       AssertNode (1, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#13");
-                       Assert.IsTrue (reader.Read (), "#14"); // ]
-                       AssertNode (0, "root", XmlNodeType.EndElement, String.Empty, null, reader, "#15");
-                       Assert.IsFalse (reader.Read (), "#16"); // EOF
-               }
-
-               [Test]
-               public void ReadObjectContent ()
-               {
-                       reader = CreateReader ("{\"A\":123, \"B\": \"123\", \"C\" :true, \"D\" : \"true\"}");
-
-                       // number value
-                       reader.Read (); // element
-                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", reader, "#1");
-
-                       reader.Read (); // 123 - element
-                       AssertNode (1, "A", XmlNodeType.Element, String.Empty, "number", reader, "#2");
-                       reader.Read (); // 123 - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#3");
-                       reader.Read (); // 123 - endelement
-                       AssertNode (1, "A", XmlNodeType.EndElement, String.Empty, null, reader, "#4");
-
-                       // string value #1
-                       reader.Read (); // "123" - element
-                       AssertNode (1, "B", XmlNodeType.Element, String.Empty, "string", reader, "#5");
-                       reader.Read (); // "123" - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "123", null, reader, "#6");
-                       reader.Read (); // "123" - endelement
-                       AssertNode (1, "B", XmlNodeType.EndElement, String.Empty, null, reader, "#7");
-
-                       reader.Read (); // true - element
-                       AssertNode (1, "C", XmlNodeType.Element, String.Empty, "boolean", reader, "#8");
-                       reader.Read (); // true - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#9");
-                       reader.Read (); // true - endelement
-                       AssertNode (1, "C", XmlNodeType.EndElement, String.Empty, null, reader, "#10");
-
-                       // string value #2
-                       reader.Read (); // "true" - element
-                       AssertNode (1, "D", XmlNodeType.Element, String.Empty, "string", reader, "#11");
-                       reader.Read (); // "true" - text
-                       AssertNode (2, String.Empty, XmlNodeType.Text, "true", null, reader, "#12");
-                       reader.Read (); // "true" - endelement
-                       AssertNode (1, "D", XmlNodeType.EndElement, String.Empty, null, reader, "#13");
-                       Assert.IsTrue (reader.Read (), "#14"); // }
-                       AssertNode (0, "root", XmlNodeType.EndElement, String.Empty, null, reader, "#15");
-                       Assert.IsFalse (reader.Read (), "#16"); // EOF
-               }
-
-               [Test]
-               public void ReadNestedObjects ()
-               {
-                       reader = CreateReader ("{\"A\": [123, {\"B\": \"456\", \"C\" :true}], \"D\" : {\"E\" : \"false\"}}");
-                       Assert.IsTrue (reader.Read (), "#1"); // {
-                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", reader, "#2");
-                       Assert.IsTrue (reader.Read (), "#3"); // A
-                       AssertNode (1, "A", XmlNodeType.Element, String.Empty, "array", reader, "#4");
-                       Assert.IsTrue (reader.Read (), "#5"); // (<123>)
-                       AssertNode (2, "item", XmlNodeType.Element, String.Empty, "number", reader, "#6");
-                       Assert.IsTrue (reader.Read (), "#7"); // (123)
-                       AssertNode (3, String.Empty, XmlNodeType.Text, "123", null, reader, "#8");
-                       Assert.IsTrue (reader.Read (), "#9"); // (</123>)
-                       AssertNode (2, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#10");
-                       Assert.IsTrue (reader.Read (), "#11"); // {
-                       AssertNode (2, "item", XmlNodeType.Element, String.Empty, "object", reader, "#12");
-                       Assert.IsTrue (reader.Read (), "#13"); // B
-                       AssertNode (3, "B", XmlNodeType.Element, String.Empty, "string", reader, "#14");
-                       Assert.IsTrue (reader.Read (), "#15"); // "456"
-                       AssertNode (4, String.Empty, XmlNodeType.Text, "456", null, reader, "#16");
-                       Assert.IsTrue (reader.Read (), "#17"); // /B
-                       AssertNode (3, "B", XmlNodeType.EndElement, String.Empty, null, reader, "#18");
-
-                       Assert.IsTrue (reader.Read (), "#19"); // C
-                       AssertNode (3, "C", XmlNodeType.Element, String.Empty, "boolean", reader, "#20");
-                       Assert.IsTrue (reader.Read (), "#21"); // true
-                       AssertNode (4, String.Empty, XmlNodeType.Text, "true", null, reader, "#22");
-                       Assert.IsTrue (reader.Read (), "#23"); // /C
-                       AssertNode (3, "C", XmlNodeType.EndElement, String.Empty, null, reader, "#24");
-                       Assert.IsTrue (reader.Read (), "#25"); // }
-                       AssertNode (2, "item", XmlNodeType.EndElement, String.Empty, null, reader, "#26");
-                       Assert.IsTrue (reader.Read (), "#27"); // ]
-                       AssertNode (1, "A", XmlNodeType.EndElement, String.Empty, null, reader, "#28");
-                       Assert.IsTrue (reader.Read (), "#29"); // {
-                       AssertNode (1, "D", XmlNodeType.Element, String.Empty, "object", reader, "#30");
-                       Assert.IsTrue (reader.Read (), "#31"); // D
-                       AssertNode (2, "E", XmlNodeType.Element, String.Empty, "string", reader, "#32");
-                       Assert.IsTrue (reader.Read (), "#33"); // "false"
-                       AssertNode (3, String.Empty, XmlNodeType.Text, "false", null, reader, "#34");
-                       Assert.IsTrue (reader.Read (), "#35"); // /D
-                       AssertNode (2, "E", XmlNodeType.EndElement, String.Empty, null, reader, "#36");
-                       Assert.IsTrue (reader.Read (), "#37"); // }
-                       AssertNode (1, "D", XmlNodeType.EndElement, String.Empty, null, reader, "#38");
-                       Assert.IsTrue (reader.Read (), "#39"); // }
-                       AssertNode (0, "root", XmlNodeType.EndElement, String.Empty, null, reader, "#40");
-                       Assert.IsFalse (reader.Read (), "#41"); // EOF
-               }
-
-               void ReadToEnd (XmlDictionaryReader reader)
-               {
-                       while (!reader.EOF)
-                               reader.Read ();
-               }
-
-               // Read() valid and invalid contents
-
-               [Test]
-               [Ignore ("It should throw XmlException for parser error, but .NET fails to report that")]
-               public void ReadTwoTopLevelContents ()
-               {
-                       ReadToEnd (CreateReader ("{}{}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadMissingCloseCurly ()
-               {
-                       ReadToEnd (CreateReader ("{"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadMissingCloseCurly2 ()
-               {
-                       ReadToEnd (CreateReader ("{{}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadExtraCloseCurly ()
-               {
-                       ReadToEnd (CreateReader ("}"));
-               }
-
-               [Test]
-               [Ignore ("It should throw XmlException for parser error, but .NET fails to report that")]
-               public void ReadExtraCloseCurly2 ()
-               {
-                       ReadToEnd (CreateReader ("{}}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadMissingCloseBrace ()
-               {
-                       ReadToEnd (CreateReader ("["));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadMissingCloseBrace2 ()
-               {
-                       ReadToEnd (CreateReader ("[[]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadExtraCloseBrace ()
-               {
-                       ReadToEnd (CreateReader ("]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // hmm, why does it pass?
-               public void ReadExtraCloseBrace2 ()
-               {
-                       ReadToEnd (CreateReader ("[]]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadOpenCurlyCloseBrace ()
-               {
-                       ReadToEnd (CreateReader ("{]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadOpenBraceCloseCurly ()
-               {
-                       ReadToEnd (CreateReader ("[}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadParens ()
-               {
-                       ReadToEnd (CreateReader ("()"));
-               }
-
-               [Test]
-               public void ReadValidNumber ()
-               {
-                       ReadToEnd (CreateReader ("0"));
-               }
-
-               [Test]
-               public void ReadValidNumber2 ()
-               {
-                       ReadToEnd (CreateReader ("-0"));
-               }
-
-               [Test]
-               public void ReadValidNumber3 ()
-               {
-                       ReadToEnd (CreateReader ("0e5"));
-               }
-
-               [Test]
-               public void ReadValidNumber4 ()
-               {
-                       ReadToEnd (CreateReader ("0.5"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidNumber ()
-               {
-                       CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
-                       try {
-                               Thread.CurrentThread.CurrentCulture = new CultureInfo ("de-DE");
-                               // if we read a number just by current culture, it will be regarded as correct JSON.
-                               ReadToEnd (CreateReader ("123,45"));
-                       } finally {
-                               Thread.CurrentThread.CurrentCulture = originalCulture;
-                       }
-               }
-
-               [Test]
-               public void ReadValidNumberGerman ()
-               {
-                       CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
-                       try {
-                               Thread.CurrentThread.CurrentCulture = new CultureInfo ("de-DE");
-                               var s = GetInput ("123.45"); // German is ',' for decimals
-                               var r = new DataContractJsonSerializer (typeof (double));
-                               var d = (double) r.ReadObject (s);
-                               Assert.AreEqual (123.45, d, "InvariantCulture");
-                       } finally {
-                               Thread.CurrentThread.CurrentCulture = originalCulture;
-                       }
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidNumber2 ()
-               {
-                       ReadToEnd (CreateReader ("+5"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidNumber3 ()
-               {
-                       ReadToEnd (CreateReader ("01"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidNumber4 ()
-               {
-                       ReadToEnd (CreateReader (".1"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidNumber5 ()
-               {
-                       ReadToEnd (CreateReader ("10."));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidNumber7 ()
-               {
-                       ReadToEnd (CreateReader ("e5"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidNumber8 ()
-               {
-                       ReadToEnd (CreateReader ("-e5"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidNumber9 ()
-               {
-                       ReadToEnd (CreateReader ("-e5.5"));
-               }
-
-               [Test]
-               public void ReadInvalidNumber10 () // bug #531904
-               {
-                       ReadToEnd (CreateReader ("4.29153442382814E-05"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidObjectContent ()
-               {
-                       ReadToEnd (CreateReader ("{\"foo\"}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidObjectContent2 ()
-               {
-                       ReadToEnd (CreateReader ("{\"A\": 123 456}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidObjectContent3 ()
-               {
-                       ReadToEnd (CreateReader ("{, \"A\":123, \"B\":456}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidObjectContent4 ()
-               {
-                       ReadToEnd (CreateReader ("{\"A\":123, \"B\":456,}"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidArrayContent ()
-               {
-                       ReadToEnd (CreateReader ("[\"foo\":\"bar\"]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidArrayContent2 ()
-               {
-                       ReadToEnd (CreateReader ("[123 456]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidArrayContent3 ()
-               {
-                       ReadToEnd (CreateReader ("[,123,456]"));
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               [Ignore ("NotDotNet")] // likely .NET bug
-               public void ReadInvalidArrayContent4 ()
-               {
-                       ReadToEnd (CreateReader ("[123,456,]"));
-               }
-
-               [Test]
-               public void ReadObjectRuntimeTypeAsAttribute ()
-               {
-                       XmlDictionaryReader r = CreateReader ("{\"__type\":\"System.Int32\"}");
-                       r.Read ();
-                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", r, "#1");
-                       Assert.IsTrue (r.MoveToAttribute ("type"), "#2");
-                       AssertNode (0, "type", XmlNodeType.Attribute, "object", "object", r, "#3");
-                       Assert.IsTrue (r.MoveToAttribute ("__type"), "#4");
-                       AssertNode (0, "__type", XmlNodeType.Attribute, "System.Int32", "object", r, "#5");
-                       r.Read ();
-                       Assert.AreEqual (XmlNodeType.EndElement, r.NodeType, "#6");
-               }
-
-               [Test]
-               public void ReadObjectRuntimeType ()
-               {
-                       XmlDictionaryReader r = CreateReader ("{\"__type\":\"System.Int32\", \"foo\":true}");
-                       r.Read ();
-                       AssertNode (0, "root", XmlNodeType.Element, String.Empty, "object", r, "#1");
-                       Assert.IsTrue (r.MoveToAttribute ("type"), "#2");
-                       AssertNode (0, "type", XmlNodeType.Attribute, "object", "object", r, "#3");
-                       Assert.IsTrue (r.MoveToAttribute ("__type"), "#4");
-                       AssertNode (0, "__type", XmlNodeType.Attribute, "System.Int32", "object", r, "#5");
-                       r.Read ();
-                       Assert.AreEqual (XmlNodeType.Element, r.NodeType, "#6");
-                       Assert.AreEqual ("foo", r.LocalName, "#7");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void ReadInvalidObjectRuntimeTypeValue ()
-               {
-                       ReadToEnd (CreateReader ("{\"__type\":true}"));
-               }
-
-               [Test]
-               public void ReadObjectRuntimeTypeIncorrectPosition ()
-               {
-                       XmlReader r = CreateReader ("{\"foo\" : false, \"__type\" : \"System.Int32\"}");
-                       r.Read ();
-                       // When __type is not at the first content, it is not regarded as an attribute. Note that it is not treated as an error.
-                       Assert.IsFalse (r.MoveToAttribute ("__type"));
-                       r.Skip ();
-               }
-
-               [Test]
-               public void ReadObjectRuntimeTypeInArray ()
-               {
-                       XmlReader r = CreateReader (@"[{""__type"":""DCWithEnum:#MonoTests.System.Runtime.Serialization.Json"",""_colors"":0}]");
-                       r.Read ();
-                       Assert.AreEqual ("root", r.LocalName, "#1-1");
-                       Assert.AreEqual ("array", r.GetAttribute ("type"), "#1-2");
-                       r.Read ();
-                       Assert.AreEqual ("item", r.LocalName, "#2-1");
-                       Assert.AreEqual ("object", r.GetAttribute ("type"), "#2-2");
-                       Assert.IsNotNull (r.GetAttribute ("__type"), "#2-3");
-                       r.Read ();
-               }
-
-               [Test]
-               public void Skip ()
-               {
-                       XmlReader r = CreateReader ("{\"type\" : \"\", \"valid\" : \"0\", \"other\" : \"\"}");
-                       r.ReadStartElement ();
-                       r.MoveToContent ();
-                       Assert.AreEqual ("type", r.Name, "Skip-1");
-                       r.ReadElementContentAsString ();
-                       r.MoveToContent ();
-                       Assert.AreEqual ("valid", r.Name, "Skip-2");
-                       r.Skip ();
-                       Assert.AreEqual ("other", r.Name, "Skip-3");
-               }
-
-               [Test]
-               public void Depth ()
-               {
-                       XmlReader r = CreateReader ("{\"type\" : \"\", \"valid\" : \"0\"}");
-                       r.ReadStartElement ();
-                       r.Read ();
-                       Assert.AreEqual (2, r.Depth, "Depth-1");
-               }
-
-               [Test]
-               public void UnicodeEncodingAutoDetect ()
-               {
-                       var ms = new MemoryStream (Encoding.Unicode.GetBytes ("{\"type\" : \"\", \"valid\" : \"0\"}"));
-                       XmlReader r = JsonReaderWriterFactory.CreateJsonReader (ms, new XmlDictionaryReaderQuotas ());
-                       r.ReadStartElement ();
-                       r.Read ();
-               }
-
-               [Test]
-               public void ReadNumberAsObject ()
-               {
-                       const double testValue = 42.42D;
-                       var serializer = new DataContractJsonSerializer (typeof (object));
-                       var serializedStream = GetInput (testValue.ToString (CultureInfo.InvariantCulture));
-                       var deserializedValue = serializer.ReadObject (serializedStream);
-                       Assert.AreEqual (typeof (decimal), deserializedValue.GetType ());
-                       Assert.AreEqual (testValue, (decimal) deserializedValue);
-               }
-
-               [Test]
-               public void IEnumerableTest ()
-               {
-                       string json = "[\"A\", \"B\"]";
-                       using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(json))) {
-                               DataContractJsonSerializer jsonSerializer = new
-                                       DataContractJsonSerializer(typeof(IEnumerable<string>));
-                               var result = jsonSerializer.ReadObject(stream);
-                               Assert.AreEqual (typeof (string []), result.GetType ());
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/JsonWriterTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.Runtime.Serialization.Json/JsonWriterTest.cs
deleted file mode 100644 (file)
index b6e42b9..0000000
+++ /dev/null
@@ -1,640 +0,0 @@
-//
-// JsonWriterTest.cs
-//
-// Author:
-//     Atsushi Enomoto  <atsushi@ximian.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.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.IO;
-using System.Text;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Json;
-using System.Xml;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization.Json
-{
-       [TestFixture]
-       public class JsonWriterTest
-       {
-               MemoryStream ms;
-               XmlDictionaryWriter w;
-
-               string ResultString {
-                       get { return Encoding.UTF8.GetString (ms.ToArray ()); }
-               }
-
-               [SetUp]
-               public void Setup ()
-               {
-                       ms = new MemoryStream ();
-                       w = JsonReaderWriterFactory.CreateJsonWriter (ms);
-               }
-
-               /*
-               [Test]
-               public void Dummy_BitFlagsGenerator ()
-               {
-                       var b = new BitFlagsGenerator (2);
-                       Assert.IsFalse (b.Load (0), "#a1");
-                       b.Store (0, false);
-                       Assert.IsFalse (b.Load (0), "#a2");
-                       b.Store (0, true);
-                       Assert.IsTrue (b.Load (0), "#a3");
-                       Assert.IsFalse (b.Load (1), "#a4");
-                       b.Store (0, false);
-                       Assert.IsFalse (b.Load (0), "#a5");
-                       Assert.IsFalse (b.Load (1), "#a6");
-
-                       Assert.IsFalse (b.Load (1), "#b1");
-                       b.Store (1, false);
-                       Assert.IsFalse (b.Load (1), "#b2");
-                       b.Store (1, true);
-                       Assert.IsTrue (b.Load (1), "#b3");
-                       b.Store (1, false);
-                       Assert.IsFalse (b.Load (1), "#b4");
-
-                       var bytes = new byte [2];
-                       Assert.IsFalse (BitFlagsGenerator.IsBitSet (bytes, 0), "#c1");
-                       BitFlagsGenerator.SetBit (bytes, 0);
-                       Assert.IsTrue (BitFlagsGenerator.IsBitSet (bytes, 0), "#c2");
-                       Assert.IsFalse (BitFlagsGenerator.IsBitSet (bytes, 1), "#c3");
-                       BitFlagsGenerator.SetBit (bytes, 0);
-                       Assert.IsTrue (BitFlagsGenerator.IsBitSet (bytes, 0), "#c4");
-               }
-               */
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorNullStream ()
-               {
-                       JsonReaderWriterFactory.CreateJsonWriter (null);
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void ConstructorNullEncoding ()
-               {
-                       JsonReaderWriterFactory.CreateJsonWriter (new MemoryStream (), null);
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void SimpleElementNotRoot ()
-               {
-                       w.WriteStartElement ("foo");
-               }
-
-               [Test]
-               public void SimpleElement ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteEndElement ();
-                       w.Close ();
-                       // empty string literal ("")
-                       Assert.AreEqual ("\"\"", ResultString, "#1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void SimpleElement2 ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartElement ("foo");
-                       // type='array' or type='object' is required before writing immediate child of an element.
-               }
-
-               [Test]
-               public void SimpleElement3 ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("e1");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("e1_1");
-                       w.WriteEndElement (); // treated as a string literal
-                       w.WriteEndElement ();
-                       w.WriteStartElement ("e2");
-                       w.WriteString ("value");
-                       w.WriteEndElement ();
-                       w.WriteEndElement ();
-                       w.Close ();
-                       string json = "{\"e1\":{\"e1_1\":\"\"},\"e2\":\"value\"}";
-                       Assert.AreEqual (json, ResultString, "#1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void AttributeNonType ()
-               {
-                       w.WriteStartElement ("root");
-                       // only "type" attribute is expected.
-                       w.WriteStartAttribute ("a1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void TypeAttributeNonStandard ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "foo");
-               }
-
-               [Test]
-               public void SimpleTypeAttribute ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "number");
-                       w.WriteEndElement ();
-                       w.Close ();
-                       Assert.AreEqual (String.Empty, ResultString, "#1");
-               }
-
-               [Test]
-               public void SimpleTypeAttribute2 ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "number");
-                       w.WriteString ("1");
-                       w.WriteEndElement ();
-                       w.Close ();
-                       Assert.AreEqual ("{\"foo\":1}", ResultString, "#1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStringForNull ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "null");
-                       w.WriteString ("1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStringForArray ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "array");
-                       w.WriteString ("1");
-               }
-
-               [Test]
-               // uh, no exception?
-               public void WriteStringForBoolean ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "boolean");
-                       w.WriteString ("xyz");
-                       w.WriteEndElement ();
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStringForObject ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteString ("1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteArrayNonItem ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "array");
-                       w.WriteStartElement ("bar");
-               }
-
-               [Test]
-               public void WriteArray ()
-               {
-                       w.WriteStartElement ("root"); // name is ignored
-                       w.WriteAttributeString ("type", "array");
-                       w.WriteElementString ("item", "v1");
-                       w.WriteElementString ("item", "v2");
-                       w.Close ();
-                       Assert.AreEqual (@"[""v1"",""v2""]", ResultString, "#1");
-               }
-
-               [Test]
-               public void WriteArrayInObject ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "array");
-                       w.WriteElementString ("item", "v1");
-                       w.WriteElementString ("item", "v2");
-                       w.Close ();
-                       Assert.AreEqual (@"{""foo"":[""v1"",""v2""]}", ResultString, "#1");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteStartElementNonEmptyNS ()
-               {
-                       // namespaces are not allowed
-                       w.WriteStartElement (String.Empty, "x", "urn:foo");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteStartElementNonEmptyPrefix ()
-               {
-                       // prefixes are not allowed
-                       w.WriteStartElement ("p", "x", "urn:foo");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStartElementMultiTopLevel ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteEndElement ();
-                       // hmm...
-                       Assert.AreEqual (WriteState.Content, w.WriteState, "#1");
-                       // writing of multiple root elements is not supported
-                       w.WriteStartElement ("root2");
-                       w.Close ();
-                       Assert.AreEqual (String.Empty, ResultString, "#2");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteStartAttributeNonEmptyNS ()
-               {
-                       // namespaces are not allowed
-                       w.WriteStartElement ("root");
-                       // well, empty prefix for a global attribute would be
-                       // replaced anyways ...
-                       w.WriteStartAttribute (String.Empty, "x", "urn:foo");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteStartAttributeInXmlNamespace ()
-               {
-                       // even "xml" namespace is not allowed (anyways only "type" is allowed ...)
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("xml", "lang", "http://www.w3.org/XML/1998/namespace");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void LookupPrefixNull ()
-               {
-                       w.LookupPrefix (null);
-               }
-
-               [Test]
-               public void LookupPrefix ()
-               {
-                       // since namespaces are not allowed, it mostly makes no sense...
-                       Assert.AreEqual (String.Empty, w.LookupPrefix (String.Empty), "#1");
-                       Assert.IsNull (w.LookupPrefix ("urn:nonexistent"), "#2");
-                       Assert.AreEqual ("xml", w.LookupPrefix ("http://www.w3.org/XML/1998/namespace"), "#3");
-                       Assert.AreEqual ("xmlns", w.LookupPrefix ("http://www.w3.org/2000/xmlns/"), "#4");
-               }
-
-               [Test]
-               public void WriteStartDocument ()
-               {
-                       Assert.AreEqual (WriteState.Start, w.WriteState, "#1");
-                       w.WriteStartDocument ();
-                       Assert.AreEqual (WriteState.Start, w.WriteState, "#2");
-                       w.WriteStartDocument (true);
-                       Assert.AreEqual (WriteState.Start, w.WriteState, "#3");
-                       // So, it does nothing
-               }
-
-               [Test]
-               public void WriteEndDocument ()
-               {
-                       w.WriteEndDocument (); // so, it is completely wrong, but ignored.
-               }
-
-               [Test]
-               [ExpectedException (typeof (NotSupportedException))]
-               public void WriteDocType ()
-               {
-                       w.WriteDocType (null, null, null, null);
-               }
-
-               [Test]
-               [ExpectedException (typeof (NotSupportedException))]
-               public void WriteComment ()
-               {
-                       w.WriteComment ("test");
-               }
-
-               [Test]
-               [ExpectedException (typeof (NotSupportedException))]
-               public void WriteEntityRef ()
-               {
-                       w.WriteEntityRef ("ent");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteProcessingInstruction ()
-               {
-                       // since this method accepts case-insensitive "XML",
-                       // it throws ArgumentException.
-                       w.WriteProcessingInstruction ("T", "D");
-               }
-
-               [Test]
-               public void WriteProcessingInstructionXML ()
-               {
-                       // You might not know, but in some cases, things like
-                       // XmlWriter.WriteNode() is implemented to invoke
-                       // this method for writing XML declaration. This
-                       // check is (seems) case-insensitive.
-                       w.WriteProcessingInstruction ("XML", "foobar");
-                       // In this case, the data is simply ignored (as
-                       // WriteStartDocument() is).
-               }
-
-               [Test]
-               public void WriteRaw ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteRaw ("sample");
-                       w.WriteRaw (new char [] {'0', '1', '2', '3'}, 1, 2);
-                       w.Close ();
-                       Assert.AreEqual ("\"sample12\"", ResultString);
-               }
-
-               [Test]
-               public void WriteCData ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteCData ("]]>"); // this behavior is incompatible with ordinal XmlWriters.
-                       w.Close ();
-                       Assert.AreEqual ("\"]]>\"", ResultString);
-               }
-
-               [Test]
-               public void WriteCharEntity ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteCharEntity ('>');
-                       w.Close ();
-                       Assert.AreEqual ("\">\"", ResultString);
-               }
-
-               [Test]
-               public void WriteWhitespace ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteWhitespace ("\t  \n\r");
-                       w.Close ();
-                       Assert.AreEqual (@"""\u0009  \u000a\u000d""", ResultString);
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteWhitespaceNonWhitespace ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteWhitespace ("TEST");
-               }
-
-               [Test]
-               [ExpectedException (typeof (InvalidOperationException))]
-               public void WriteStringTopLevel ()
-               {
-                       w.WriteString ("test");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStartAttributeTopLevel ()
-               {
-                       w.WriteStartAttribute ("test");
-               }
-
-               [Test]
-               [ExpectedException (typeof (InvalidOperationException))]
-               public void WriteStartDocumentAtClosed ()
-               {
-                       w.Close ();
-                       w.WriteStartDocument ();
-               }
-
-               [Test]
-               [ExpectedException (typeof (InvalidOperationException))]
-               public void WriteStartElementAtClosed ()
-               {
-                       w.Close ();
-                       w.WriteStartElement ("foo");
-               }
-
-               [Test]
-               [ExpectedException (typeof (InvalidOperationException))]
-               public void WriteProcessingInstructionAtClosed ()
-               {
-                       w.Close ();
-                       w.WriteProcessingInstruction ("xml", "version='1.0'");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteMixedContent ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteString ("TEST");
-                       w.WriteStartElement ("mixed"); // is not allowed.
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStartElementInvalidTopLevelName ()
-               {
-                       w.WriteStartElement ("anyname");
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentNullException))]
-               public void WriteStartElementNullName ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement (null);
-               }
-
-               [Test]
-               [ExpectedException (typeof (ArgumentException))]
-               public void WriteStartElementEmptyName ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement (String.Empty);
-                       // It is regarded as invalid name in JSON. However,
-                       // I don't think there is such limitation in JSON specification.
-               }
-
-               [Test]
-               public void WriteStartElementWithRuntimeTypeName ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteAttributeString ("__type", "FooType:#FooNamespace");
-                       w.Close ();
-                       Assert.AreEqual (@"{""__type"":""FooType:#FooNamespace""}", ResultString);
-               }
-
-               [Test]
-               public void WriteStartElementWeirdName ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("!!!");
-                       w.Close ();
-                       Assert.AreEqual (@"{""!!!"":""""}", ResultString);
-               }
-
-               [Test]
-               public void WriteRootAsObject ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteString ("object");
-                       w.WriteEndAttribute ();
-                       w.Close ();
-                       Assert.AreEqual ("{}", ResultString);
-               }
-
-               [Test]
-               public void WriteRootAsArray ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteString ("array");
-                       w.WriteEndAttribute ();
-                       w.Close ();
-                       Assert.AreEqual ("[]", ResultString);
-               }
-
-               [Test]
-               public void WriteRootAsLiteral ()
-               {
-                       w.WriteStartElement ("root");
-                       w.Close ();
-                       Assert.AreEqual ("\"\"", ResultString);
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteEndElementOnAttribute ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteString ("array");
-                       w.WriteEndElement ();
-               }
-
-               [Test]
-               public void WriteAttributeAsSeparateStrings ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteString ("arr");
-                       w.WriteString ("ay");
-                       w.WriteEndAttribute ();
-                       w.Close ();
-                       Assert.AreEqual ("[]", ResultString);
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStartAttributeInAttributeMode ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteStartAttribute ("type");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStartAttributeInContentMode ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteString ("TEST");
-                       w.WriteStartAttribute ("type");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void WriteStartElementInAttributeMode ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteStartElement ("child");
-               }
-
-               [Test]
-               [ExpectedException (typeof (XmlException))]
-               public void CloseAtAtributeState ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteStartAttribute ("type");
-                       w.WriteString ("array");
-                       // It calls WriteEndElement() without calling
-                       // WriteEndAttribute().
-                       w.Close ();
-               }
-
-               [Test]
-               public void WriteSlashEscaped ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteString ("/my date/");
-                       w.WriteEndElement ();
-                       w.Close ();
-                       Assert.AreEqual ("\"\\/my date\\/\"", ResultString);
-               }
-
-               [Test]
-               public void WriteNullType ()
-               {
-                       w.WriteStartElement ("root");
-                       w.WriteAttributeString ("type", "object");
-                       w.WriteStartElement ("foo");
-                       w.WriteAttributeString ("type", "null");
-                       w.Close ();
-                       Assert.AreEqual ("{\"foo\":null}", ResultString);
-               }
-       }
-}
index 2279967f4e2ea57b3b84bd7fa7adcbf6c1e7c73d..4f0d50bf06504991c01ec1ac1abb9c8a538406f6 100644 (file)
@@ -79,4 +79,5 @@ using System.Runtime.InteropServices;
 #endif
 
        [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+       [assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
        [assembly: InternalsVisibleTo ("Mono.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
index 141c7526c103b6b7d0f89a0090603ccb9a9d7059..63caf2a0cd9f803cbc9349e42b322a8b5856f36f 100644 (file)
@@ -76,6 +76,7 @@ namespace Mono.Net.Security
        {
                readonly object sender;
                readonly MonoTlsSettings settings;
+               readonly MonoTlsProvider provider;
                readonly ServerCertValidationCallback certValidationCallback;
                readonly LocalCertSelectionCallback certSelectionCallback;
                readonly ServerCertValidationCallbackWrapper callbackWrapper;
@@ -84,7 +85,7 @@ namespace Mono.Net.Security
 
                static bool is_macosx;
                static bool is_mobile;
-#if !MONOTOUCH
+#if !MOBILE
                static X509RevocationMode revocation_mode;
 #endif
 
@@ -101,7 +102,7 @@ namespace Mono.Net.Security
                        is_mobile = false;
 #endif
 
-#if !MONOTOUCH
+#if !MOBILE
                        revocation_mode = X509RevocationMode.NoCheck;
                        try {
                                string str = Environment.GetEnvironmentVariable ("MONO_X509_REVOCATION_MODE");
@@ -113,11 +114,13 @@ namespace Mono.Net.Security
 #endif
                }
 
-               internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
+               internal static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
-                       if (settings.CertificateValidator == null)
-                               settings.CertificateValidator = new ChainValidationHelper (settings, false, null, null);
-                       return settings.CertificateValidator;
+                       if (settings == null)
+                               return new ChainValidationHelper (provider, null, false, null, null);
+                       if (settings.CertificateValidator != null)
+                               return settings.CertificateValidator;
+                       return new ChainValidationHelper (provider, settings, false, null, null);
                }
 
 #region SslStream support
@@ -125,13 +128,13 @@ namespace Mono.Net.Security
                /*
                 * This is a hack which is used in SslStream - see ReferenceSources/SslStream.cs for details.
                 */
-               internal static ChainValidationHelper CloneWithCallbackWrapper (ref MonoTlsSettings settings, ServerCertValidationCallbackWrapper wrapper)
+               internal static ChainValidationHelper CloneWithCallbackWrapper (MonoTlsProvider provider, ref MonoTlsSettings settings, ServerCertValidationCallbackWrapper wrapper)
                {
                        var helper = (ChainValidationHelper)settings.CertificateValidator;
                        if (helper == null)
-                               helper = new ChainValidationHelper (settings, true, null, wrapper);
+                               helper = new ChainValidationHelper (provider, settings, true, null, wrapper);
                        else
-                               helper = new ChainValidationHelper (helper, settings, wrapper);
+                               helper = new ChainValidationHelper (helper, provider, settings, wrapper);
                        settings = helper.settings;
                        return helper;
                }
@@ -143,7 +146,7 @@ namespace Mono.Net.Security
 
 #endregion
 
-               ChainValidationHelper (ChainValidationHelper other, MonoTlsSettings settings, ServerCertValidationCallbackWrapper callbackWrapper = null)
+               ChainValidationHelper (ChainValidationHelper other, MonoTlsProvider provider, MonoTlsSettings settings, ServerCertValidationCallbackWrapper callbackWrapper = null)
                {
                        sender = other.sender;
                        certValidationCallback = other.certValidationCallback;
@@ -151,22 +154,24 @@ namespace Mono.Net.Security
                        tlsStream = other.tlsStream;
                        request = other.request;
 
+                       this.provider = provider;
                        this.settings = settings = settings.CloneWithValidator (this);
                        this.callbackWrapper = callbackWrapper;
                }
 
-               internal static ChainValidationHelper Create (ref MonoTlsSettings settings, MonoTlsStream stream)
+               internal static ChainValidationHelper Create (MonoTlsProvider provider, ref MonoTlsSettings settings, MonoTlsStream stream)
                {
-                       var helper = new ChainValidationHelper (settings, true, stream, null);
+                       var helper = new ChainValidationHelper (provider, settings, true, stream, null);
                        settings = helper.settings;
                        return helper;
                }
 
-               ChainValidationHelper (MonoTlsSettings settings, bool cloneSettings, MonoTlsStream stream, ServerCertValidationCallbackWrapper callbackWrapper)
+               ChainValidationHelper (MonoTlsProvider provider, MonoTlsSettings settings, bool cloneSettings, MonoTlsStream stream, ServerCertValidationCallbackWrapper callbackWrapper)
                {
                        if (cloneSettings)
                                settings = settings.CloneWithValidator (this);
 
+                       this.provider = provider;
                        this.settings = settings;
                        this.tlsStream = stream;
                        this.callbackWrapper = callbackWrapper;
@@ -174,8 +179,8 @@ namespace Mono.Net.Security
                        var fallbackToSPM = false;
 
                        if (settings != null) {
-                               if (settings.ServerCertificateValidationCallback != null) {
-                                       var callback = Private.CallbackHelpers.MonoToPublic (settings.ServerCertificateValidationCallback);
+                               if (settings.RemoteCertificateValidationCallback != null) {
+                                       var callback = Private.CallbackHelpers.MonoToPublic (settings.RemoteCertificateValidationCallback);
                                        certValidationCallback = new ServerCertValidationCallback (callback);
                                }
                                certSelectionCallback = Private.CallbackHelpers.MonoToInternal (settings.ClientCertificateSelectionCallback);
@@ -209,6 +214,10 @@ namespace Mono.Net.Security
                        return clientCertificate;
                }
 
+               public MonoTlsProvider Provider {
+                       get { return provider; }
+               }
+
                public MonoTlsSettings Settings {
                        get { return settings; }
                }
@@ -228,65 +237,25 @@ namespace Mono.Net.Security
 
                internal bool ValidateClientCertificate (X509Certificate certificate, MonoSslPolicyErrors errors)
                {
-                       var certs2 = new X509Certificate2Collection ();
-                       certs2.Add (new X509Certificate2 (certificate.GetRawCertData ()));
+                       var certs = new XX509CertificateCollection ();
+                       certs.Add (new X509Certificate2 (certificate.GetRawCertData ()));
 
-                       var result = ValidateChain (null, certs2, (SslPolicyErrors)errors);
+                       var result = ValidateChain (string.Empty, false, certs, (SslPolicyErrors)errors);
                        if (result == null)
                                return false;
 
                        return result.Trusted && !result.UserDenied;
                }
 
-               static X509Certificate2Collection Convert (MSX.X509CertificateCollection certificates)
-               {
-                       if (certificates == null)
-                               return null;
-
-                       var certs2 = new X509Certificate2Collection ();
-                       for (int i = 0; i < certificates.Count; i++)
-                               certs2.Add (new X509Certificate2 (certificates [i].RawData));
-                       return certs2;
-               }
-
-               static X509Certificate2Collection Convert (XX509CertificateCollection certificates)
-               {
-                       var certs2 = (object)certificates as X509Certificate2Collection;
-                       if (certs2 != null || certificates == null)
-                               return certs2;
-
-                       certs2 = new X509Certificate2Collection ();
-                       for (int i = 0; i < certificates.Count; i++)
-                               certs2.Add ((X509Certificate2)certificates [i]);
-                       return certs2;
-               }
-
                public ValidationResult ValidateClientCertificate (XX509CertificateCollection certs)
                {
-                       var certs2 = Convert (certs);
-                       return ValidateChain (null, certs2, 0);
+                       return ValidateChain (string.Empty, false, certs, 0);
                }
 
                public ValidationResult ValidateChain (string host, XX509CertificateCollection certs)
                {
                        try {
-                               var certs2 = Convert (certs);
-                               var result = ValidateChain (host, certs2, 0);
-                               if (tlsStream != null)
-                                       tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
-                               return result;
-                       } catch {
-                               if (tlsStream != null)
-                                       tlsStream.CertificateValidationFailed = true;
-                               throw;
-                       }
-               }
-
-               internal ValidationResult ValidateChain (string host, MSX.X509CertificateCollection certs)
-               {
-                       try {
-                               var certs2 = Convert (certs);
-                               var result = ValidateChain (host, certs2, 0);
+                               var result = ValidateChain (host, true, certs, 0);
                                if (tlsStream != null)
                                        tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
                                return result;
@@ -297,7 +266,7 @@ namespace Mono.Net.Security
                        }
                }
 
-               ValidationResult ValidateChain (string host, X509Certificate2Collection certs, SslPolicyErrors errors)
+               ValidationResult ValidateChain (string host, bool server, XX509CertificateCollection certs, SslPolicyErrors errors)
                {
                        // user_denied is true if the user callback is called and returns false
                        bool user_denied = false;
@@ -305,7 +274,7 @@ namespace Mono.Net.Security
 
                        var hasCallback = certValidationCallback != null || callbackWrapper != null;
 
-                       X509Certificate2 leaf;
+                       X509Certificate leaf;
                        if (certs == null || certs.Count == 0)
                                leaf = null;
                        else
@@ -326,106 +295,29 @@ namespace Mono.Net.Security
                                return new ValidationResult (result, user_denied, 0, (MonoSslPolicyErrors)errors);
                        }
 
-                       bool needsChain;
-                       bool skipSystemValidators = false;
-                       if (!CertificateValidationHelper.SupportsX509Chain || is_mobile || is_macosx) {
-                               needsChain = false;
-                       } else if (settings != null) {
-                               skipSystemValidators = settings.SkipSystemValidators;
-                               needsChain = !settings.SkipSystemValidators || settings.CallbackNeedsCertificateChain;
-                       } else {
-                               needsChain = true;
-                       }
-
                        ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy ();
 
                        int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback
                        X509Chain chain = null;
 
-                       if (needsChain) {
-                               chain = new X509Chain ();
-                               chain.ChainPolicy = new X509ChainPolicy ();
-
-
-#if !MONOTOUCH
-                               chain.ChainPolicy.RevocationMode = revocation_mode;
-#endif
-                               for (int i = 1; i < certs.Count; i++) {
-                                       chain.ChainPolicy.ExtraStore.Add (certs [i]);
-                               }
-                       }
-
-#if !MONOTOUCH
-                       if (needsChain) {
-                               try {
-                                       if (!chain.Build (leaf))
-                                               errors |= GetErrorsFromChain (chain);
-                               } catch (Exception e) {
-                                       Console.Error.WriteLine ("ERROR building certificate chain: {0}", e);
-                                       Console.Error.WriteLine ("Please, report this problem to the Mono team");
-                                       errors |= SslPolicyErrors.RemoteCertificateChainErrors;
-                               }
-                       }
-
-                       // for OSX and iOS we're using the native API to check for the SSL server policy and host names
-                       if (!is_macosx) {
-                               if (!CheckCertificateUsage (leaf)) {
-                                       errors |= SslPolicyErrors.RemoteCertificateChainErrors;
-                                       status11 = -2146762490; //CERT_E_PURPOSE 0x800B0106
-                               }
-
-                               if (host != null && !CheckServerIdentity (leaf, host)) {
-                                       errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
-                                       status11 = -2146762481; // CERT_E_CN_NO_MATCH 0x800B010F
-                               }
-                       }
-#endif
-
-                       if (is_macosx && !skipSystemValidators) {
-                               // Attempt to use OSX certificates
-                               // Ideally we should return the SecTrustResult
-                               OSX509Certificates.SecTrustResult trustResult = OSX509Certificates.SecTrustResult.Deny;
-                               try {
-                                       trustResult = OSX509Certificates.TrustEvaluateSsl (certs, host);
-                                       // We could use the other values of trustResult to pass this extra information
-                                       // to the .NET 2 callback for values like SecTrustResult.Confirm
-                                       result = (trustResult == OSX509Certificates.SecTrustResult.Proceed ||
-                                       trustResult == OSX509Certificates.SecTrustResult.Unspecified);
-                               } catch {
-                                       // Ignore
-                               }
-                                       
-                               if (result) {
-                                       // TrustEvaluateSsl was successful so there's no trust error
-                                       // IOW we discard our own chain (since we trust OSX one instead)
-                                       errors = 0;
-                               } else {
-                                       // callback and DefaultCertificatePolicy needs this since 'result' is not specified
-                                       status11 = (int)trustResult;
-                                       errors |= SslPolicyErrors.RemoteCertificateChainErrors;
-                               }
+                       if (provider != null && provider.HasCustomSystemCertificateValidator) {
+                               if (SystemCertificateValidator.NeedsChain (settings))
+                                       throw new NotSupportedException ("Cannot use MonoTlsProvider.InvokeSystemCertificateValidator() when the X509Chain is required.");
+                               var xerrors = (MonoSslPolicyErrors)errors;
+                               result = provider.InvokeSystemCertificateValidator (this, host, server, certs, ref xerrors, ref status11);
+                               errors = (SslPolicyErrors)xerrors;
+                       } else {
+                               result = SystemCertificateValidator.Evaluate (settings, host, certs, ref chain, ref errors, ref status11);
                        }
 
-
-#if MONODROID && SECURITY_DEP
-                       if (!skipSystemValidators) {
-                               result = AndroidPlatform.TrustEvaluateSsl (certs, sender, leaf, chain, errors);
-                               if (result) {
-                                       // chain.Build() + GetErrorsFromChain() (above) will ALWAYS fail on
-                                       // Android (there are no mozroots or preinstalled root certificates),
-                                       // thus `errors` will ALWAYS have RemoteCertificateChainErrors.
-                                       // Android just verified the chain; clear RemoteCertificateChainErrors.
-                                       errors  &= ~SslPolicyErrors.RemoteCertificateChainErrors;
-                               }
-                       }
-#endif
-       
                        if (policy != null && (!(policy is DefaultCertificatePolicy) || certValidationCallback == null)) {
                                ServicePoint sp = null;
                                if (request != null)
                                        sp = request.ServicePointNoLock;
-                               if (status11 == 0 && errors != 0)
-                                       status11 = GetStatusFromChain (chain);
+                               if (status11 == 0 && errors != 0) {
+                                       // TRUST_E_FAIL
+                                       status11 = unchecked ((int)0x800B010B);
+                               }
 
                                // pre 2.0 callback
                                result = policy.CheckValidationResult (sp, leaf, request, status11);
@@ -442,252 +334,17 @@ namespace Mono.Net.Security
                        return new ValidationResult (result, user_denied, status11, (MonoSslPolicyErrors)errors);
                }
 
-               static int GetStatusFromChain (X509Chain chain)
-               {
-                       long result = 0;
-                       foreach (var status in chain.ChainStatus) {
-                               X509ChainStatusFlags flags = status.Status;
-                               if (flags == X509ChainStatusFlags.NoError)
-                                       continue;
-
-                               // CERT_E_EXPIRED
-                               if ((flags & X509ChainStatusFlags.NotTimeValid) != 0)
-                                       result = 0x800B0101;
-                                       // CERT_E_VALIDITYPERIODNESTING
-                                       else if ((flags & X509ChainStatusFlags.NotTimeNested) != 0)
-                                       result = 0x800B0102;
-                                       // CERT_E_REVOKED
-                                       else if ((flags & X509ChainStatusFlags.Revoked) != 0)
-                                       result = 0x800B010C;
-                                       // TRUST_E_CERT_SIGNATURE
-                                       else if ((flags & X509ChainStatusFlags.NotSignatureValid) != 0)
-                                       result = 0x80096004;
-                                       // CERT_E_WRONG_USAGE
-                                       else if ((flags & X509ChainStatusFlags.NotValidForUsage) != 0)
-                                       result = 0x800B0110;
-                                       // CERT_E_UNTRUSTEDROOT
-                                       else if ((flags & X509ChainStatusFlags.UntrustedRoot) != 0)
-                                       result = 0x800B0109;
-                                       // CRYPT_E_NO_REVOCATION_CHECK
-                                       else if ((flags & X509ChainStatusFlags.RevocationStatusUnknown) != 0)
-                                       result = 0x80092012;
-                                       // CERT_E_CHAINING
-                                       else if ((flags & X509ChainStatusFlags.Cyclic) != 0)
-                                       result = 0x800B010A;
-                                       // TRUST_E_FAIL - generic
-                                       else if ((flags & X509ChainStatusFlags.InvalidExtension) != 0)
-                                       result = 0x800B010B;
-                                       // CERT_E_UNTRUSTEDROOT
-                                       else if ((flags & X509ChainStatusFlags.InvalidPolicyConstraints) != 0)
-                                       result = 0x800B010D;
-                                       // TRUST_E_BASIC_CONSTRAINTS
-                                       else if ((flags & X509ChainStatusFlags.InvalidBasicConstraints) != 0)
-                                       result = 0x80096019;
-                                       // CERT_E_INVALID_NAME
-                                       else if ((flags & X509ChainStatusFlags.InvalidNameConstraints) != 0)
-                                       result = 0x800B0114;
-                                       // CERT_E_INVALID_NAME
-                                       else if ((flags & X509ChainStatusFlags.HasNotSupportedNameConstraint) != 0)
-                                       result = 0x800B0114;
-                                       // CERT_E_INVALID_NAME
-                                       else if ((flags & X509ChainStatusFlags.HasNotDefinedNameConstraint) != 0)
-                                       result = 0x800B0114;
-                                       // CERT_E_INVALID_NAME
-                                       else if ((flags & X509ChainStatusFlags.HasNotPermittedNameConstraint) != 0)
-                                       result = 0x800B0114;
-                                       // CERT_E_INVALID_NAME
-                                       else if ((flags & X509ChainStatusFlags.HasExcludedNameConstraint) != 0)
-                                       result = 0x800B0114;
-                                       // CERT_E_CHAINING
-                                       else if ((flags & X509ChainStatusFlags.PartialChain) != 0)
-                                       result = 0x800B010A;
-                                       // CERT_E_EXPIRED
-                                       else if ((flags & X509ChainStatusFlags.CtlNotTimeValid) != 0)
-                                       result = 0x800B0101;
-                                       // TRUST_E_CERT_SIGNATURE
-                                       else if ((flags & X509ChainStatusFlags.CtlNotSignatureValid) != 0)
-                                       result = 0x80096004;
-                                       // CERT_E_WRONG_USAGE
-                                       else if ((flags & X509ChainStatusFlags.CtlNotValidForUsage) != 0)
-                                       result = 0x800B0110;
-                                       // CRYPT_E_NO_REVOCATION_CHECK
-                                       else if ((flags & X509ChainStatusFlags.OfflineRevocation) != 0)
-                                       result = 0x80092012;
-                                       // CERT_E_ISSUERCHAINING
-                                       else if ((flags & X509ChainStatusFlags.NoIssuanceChainPolicy) != 0)
-                                       result = 0x800B0107;
-                               else
-                                       result = 0x800B010B; // TRUST_E_FAIL - generic
-
-                               break; // Exit the loop on the first error
-                       }
-                       return (int)result;
-               }
-
-
-#if !MONOTOUCH
-               static SslPolicyErrors GetErrorsFromChain (X509Chain chain)
-               {
-                       SslPolicyErrors errors = SslPolicyErrors.None;
-                       foreach (var status in chain.ChainStatus) {
-                               if (status.Status == X509ChainStatusFlags.NoError)
-                                       continue;
-                               errors |= SslPolicyErrors.RemoteCertificateChainErrors;
-                               break;
-                       }
-                       return errors;
-               }
-
-               static X509KeyUsageFlags s_flags = X509KeyUsageFlags.DigitalSignature |
-                                                   X509KeyUsageFlags.KeyAgreement |
-                                                   X509KeyUsageFlags.KeyEncipherment;
-               // Adapted to System 2.0+ from TlsServerCertificate.cs
-               //------------------------------
-               // Note: this method only works for RSA certificates
-               // DH certificates requires some changes - does anyone use one ?
-               static bool CheckCertificateUsage (X509Certificate2 cert)
+               public bool InvokeSystemValidator (string targetHost, bool serverMode, XX509CertificateCollection certificates, ref MonoSslPolicyErrors xerrors, ref int status11)
                {
-                       try {
-                               // certificate extensions are required for this
-                               // we "must" accept older certificates without proofs
-                               if (cert.Version < 3)
-                                       return true;
-
-                               X509KeyUsageExtension kux = (cert.Extensions ["2.5.29.15"] as X509KeyUsageExtension);
-                               X509EnhancedKeyUsageExtension eku = (cert.Extensions ["2.5.29.37"] as X509EnhancedKeyUsageExtension);
-                               if (kux != null && eku != null) {
-                                       // RFC3280 states that when both KeyUsageExtension and 
-                                       // ExtendedKeyUsageExtension are present then BOTH should
-                                       // be valid
-                                       if ((kux.KeyUsages & s_flags) == 0)
-                                               return false;
-                                       return eku.EnhancedKeyUsages ["1.3.6.1.5.5.7.3.1"] != null ||
-                                       eku.EnhancedKeyUsages ["2.16.840.1.113730.4.1"] != null;
-                               } else if (kux != null) {
-                                       return ((kux.KeyUsages & s_flags) != 0);
-                               } else if (eku != null) {
-                                       // Server Authentication (1.3.6.1.5.5.7.3.1) or
-                                       // Netscape Server Gated Crypto (2.16.840.1.113730.4)
-                                       return eku.EnhancedKeyUsages ["1.3.6.1.5.5.7.3.1"] != null ||
-                                       eku.EnhancedKeyUsages ["2.16.840.1.113730.4.1"] != null;
-                               }
-
-                               // last chance - try with older (deprecated) Netscape extensions
-                               X509Extension ext = cert.Extensions ["2.16.840.1.113730.1.1"];
-                               if (ext != null) {
-                                       string text = ext.NetscapeCertType (false);
-                                       return text.IndexOf ("SSL Server Authentication", StringComparison.Ordinal) != -1;
-                               }
-                               return true;
-                       } catch (Exception e) {
-                               Console.Error.WriteLine ("ERROR processing certificate: {0}", e);
-                               Console.Error.WriteLine ("Please, report this problem to the Mono team");
-                               return false;
-                       }
-               }
+                       if (SystemCertificateValidator.NeedsChain (settings))
+                               throw new NotSupportedException ("Cannot use ICertificateValidator.InvokeSystemValidator() when the X509Chain is required.");
 
-               // RFC2818 - HTTP Over TLS, Section 3.1
-               // http://www.ietf.org/rfc/rfc2818.txt
-               //
-               // 1.   if present MUST use subjectAltName dNSName as identity
-               // 1.1.         if multiples entries a match of any one is acceptable
-               // 1.2.         wildcard * is acceptable
-               // 2.   URI may be an IP address -> subjectAltName.iPAddress
-               // 2.1.         exact match is required
-               // 3.   Use of the most specific Common Name (CN=) in the Subject
-               // 3.1          Existing practice but DEPRECATED
-               static bool CheckServerIdentity (X509Certificate2 cert, string targetHost)
-               {
-                       try {
-                               var mcert = new MSX.X509Certificate (cert.RawData);
-                               MSX.X509Extension ext = mcert.Extensions ["2.5.29.17"];
-                               // 1. subjectAltName
-                               if (ext != null) {
-                                       SubjectAltNameExtension subjectAltName = new SubjectAltNameExtension (ext);
-                                       // 1.1 - multiple dNSName
-                                       foreach (string dns in subjectAltName.DNSNames) {
-                                               // 1.2 TODO - wildcard support
-                                               if (Match (targetHost, dns))
-                                                       return true;
-                                       }
-                                       // 2. ipAddress
-                                       foreach (string ip in subjectAltName.IPAddresses) {
-                                               // 2.1. Exact match required
-                                               if (ip == targetHost)
-                                                       return true;
-                                       }
-                               }
-                               // 3. Common Name (CN=)
-                               return CheckDomainName (mcert.SubjectName, targetHost);
-                       } catch (Exception e) {
-                               Console.Error.WriteLine ("ERROR processing certificate: {0}", e);
-                               Console.Error.WriteLine ("Please, report this problem to the Mono team");
-                               return false;
-                       }
-               }
-
-               static bool CheckDomainName (string subjectName, string targetHost)
-               {
-                       string  domainName = String.Empty;
-                       Regex search = new Regex (@"CN\s*=\s*([^,]*)");
-                       MatchCollection elements = search.Matches (subjectName);
-                       if (elements.Count == 1) {
-                               if (elements [0].Success)
-                                       domainName = elements [0].Groups [1].Value.ToString ();
-                       }
-
-                       return Match (targetHost, domainName);
-               }
-
-               // ensure the pattern is valid wrt to RFC2595 and RFC2818
-               // http://www.ietf.org/rfc/rfc2595.txt
-               // http://www.ietf.org/rfc/rfc2818.txt
-               static bool Match (string hostname, string pattern)
-               {
-                       // check if this is a pattern
-                       int index = pattern.IndexOf ('*');
-                       if (index == -1) {
-                               // not a pattern, do a direct case-insensitive comparison
-                               return (String.Compare (hostname, pattern, true, CultureInfo.InvariantCulture) == 0);
-                       }
-
-                       // check pattern validity
-                       // A "*" wildcard character MAY be used as the left-most name component in the certificate.
-
-                       // unless this is the last char (valid)
-                       if (index != pattern.Length - 1) {
-                               // then the next char must be a dot .'.
-                               if (pattern [index + 1] != '.')
-                                       return false;
-                       }
-
-                       // only one (A) wildcard is supported
-                       int i2 = pattern.IndexOf ('*', index + 1);
-                       if (i2 != -1)
-                               return false;
-
-                       // match the end of the pattern
-                       string end = pattern.Substring (index + 1);
-                       int length = hostname.Length - end.Length;
-                       // no point to check a pattern that is longer than the hostname
-                       if (length <= 0)
-                               return false;
-
-                       if (String.Compare (hostname, length, end, 0, end.Length, true, CultureInfo.InvariantCulture) != 0)
-                               return false;
-
-                       // special case, we start with the wildcard
-                       if (index == 0) {
-                               // ensure we hostname non-matched part (start) doesn't contain a dot
-                               int i3 = hostname.IndexOf ('.');
-                               return ((i3 == -1) || (i3 >= (hostname.Length - end.Length)));
-                       }
-
-                       // match the start of the pattern
-                       string start = pattern.Substring (0, index);
-                       return (String.Compare (hostname, 0, start, 0, start.Length, true, CultureInfo.InvariantCulture) == 0);
+                       X509Chain chain = null;
+                       var errors = (SslPolicyErrors)xerrors;
+                       var result = SystemCertificateValidator.Evaluate (settings, targetHost, certificates, ref chain, ref errors, ref status11);
+                       xerrors = (MonoSslPolicyErrors)errors;
+                       return result;
                }
-#endif
        }
 }
 #endif
index 8913c8a513bb7419661906dd53c386efb0cf6d06..5978317fc16a04ccf21b5492e100f4827d75a20e 100644 (file)
@@ -83,6 +83,7 @@ namespace Mono.Net.Security
                #region Fields
 
                SslStreamBase ssl_stream;
+               MonoTlsProvider provider;
                MonoTlsSettings settings;
                ICertificateValidator certificateValidator;
 
@@ -90,21 +91,12 @@ namespace Mono.Net.Security
 
                #region Constructors
 
-               public LegacySslStream (Stream innerStream)
-                       : this (innerStream, false)
-               {
-               }
-
-               public LegacySslStream (Stream innerStream, bool leaveInnerStreamOpen)
-                       : base (innerStream, leaveInnerStreamOpen)
-               {
-               }
-
-               public LegacySslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings)
+               public LegacySslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsProvider provider, MonoTlsSettings settings)
                        : base (innerStream, leaveInnerStreamOpen)
                {
+                       this.provider = provider;
                        this.settings = settings;
-                       this.certificateValidator = settings.CertificateValidator;
+                       this.certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
                }
                #endregion // Constructors
 
@@ -369,7 +361,15 @@ namespace Mono.Net.Security
                        // Even if validation_callback is null this allows us to verify requests where the user
                        // does not provide a verification callback but attempts to authenticate with the website
                        // as a client (see https://bugzilla.xamarin.com/show_bug.cgi?id=18962 for an example)
-                       s.ServerCertValidation2 += (certs) => ((ChainValidationHelper)certificateValidator).ValidateChain (targetHost, certs);
+                       s.ServerCertValidation2 += (mcerts) => {
+                               X509CertificateCollection certs = null;
+                               if (mcerts != null) {
+                                       certs = new X509CertificateCollection ();
+                                       for (int i = 0; i < mcerts.Count; i++)
+                                               certs.Add (new X509Certificate2 (mcerts [i].RawData));
+                               }
+                               return ((ChainValidationHelper)certificateValidator).ValidateChain (targetHost, certs);
+                       };
                        s.ClientCertSelectionDelegate = OnCertificateSelection;
 
                        ssl_stream = s;
@@ -394,7 +394,7 @@ namespace Mono.Net.Security
                        if (IsAuthenticated)
                                throw new InvalidOperationException ("This SslStream is already authenticated");
 
-                       SslServerStream s = new SslServerStream (InnerStream, serverCertificate, clientCertificateRequired, !LeaveInnerStreamOpen, GetMonoSslProtocol (enabledSslProtocols));
+                       SslServerStream s = new SslServerStream (InnerStream, serverCertificate, false, clientCertificateRequired, !LeaveInnerStreamOpen, GetMonoSslProtocol (enabledSslProtocols));
                        s.CheckCertRevocationStatus = checkCertificateRevocation;
                        // Due to the Mono.Security internal, it cannot reuse
                        // the delegated argument, as Mono.Security creates 
index 628e74429444d0d9e6c63aa0d8b37321b0b001b2..8fd50fd1a3e6378edefcb01fe93453e1e638f4f5 100644 (file)
@@ -43,10 +43,8 @@ using XX509CertificateCollection = System.Security.Cryptography.X509Certificates
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
-using MonoSecurity::Mono.Security.Protocol.Tls;
 #else
 using Mono.Security.Interface;
-using Mono.Security.Protocol.Tls;
 #endif
 
 using System;
@@ -86,7 +84,7 @@ namespace Mono.Net.Security.Private
                        Stream innerStream, bool leaveInnerStreamOpen,
                        MonoTlsSettings settings)
                {
-                       return new LegacySslStream (innerStream, leaveInnerStreamOpen, settings);
+                       return new LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
                }
 
                protected override IMonoTlsContext CreateTlsContextImpl (
index 0ea7190902f1c5581c87742d1fddea8c2af663df..24b777c87adaa56f728bd1c628b29a4557b06d1d 100644 (file)
@@ -34,19 +34,9 @@ extern alias MonoSecurity;
 #endif
 
 #if MONO_SECURITY_ALIAS
-using MonoCipherAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = MonoSecurity::Mono.Security.Protocol.Tls.SecurityProtocolType;
 using MonoSecurity::Mono.Security.Interface;
-// using MonoSecurity::Mono.Security.Protocol.Tls;
 #else
-using MonoCipherAlgorithmType = Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType;
 using Mono.Security.Interface;
-// using Mono.Security.Protocol.Tls;
 #endif
 #if MONO_X509_ALIAS
 using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
index c35ffe1af5148d0e09480f6f3305c6516d800cee..a401de63006887cebc99b27ee79c0b652a157244 100644 (file)
@@ -33,10 +33,16 @@ using MX = MonoSecurity::Mono.Security.X509;
 using MSI = Mono.Security.Interface;
 using MX = Mono.Security.X509;
 #endif
+using System.Security.Cryptography.X509Certificates;
 #endif
 
 using System;
 using System.Net;
+using System.Collections.Generic;
+
+#if !MOBILE
+using System.Reflection;
+#endif
 
 namespace Mono.Net.Security
 {
@@ -111,7 +117,7 @@ namespace Mono.Net.Security
                        var userProvider = MSI.MonoTlsProviderFactory.GetProvider ();
                        return new Private.MonoTlsProviderWrapper (userProvider);
 #else
-                       return new Private.MonoDefaultTlsProvider ();
+                       return CreateDefaultProviderImpl ();
 #endif
 #else
                        return null;
@@ -126,6 +132,83 @@ namespace Mono.Net.Security
 
 #if SECURITY_DEP && !MONO_FEATURE_NEW_SYSTEM_SOURCE
 
+#if !MOBILE
+               static Dictionary<string,string> providerRegistration;
+
+               internal static void RegisterProvider (string name, string type)
+               {
+                       lock (locker) {
+                               InitializeProviderRegistration ();
+                               providerRegistration.Add (name, type);
+                       }
+               }
+
+               static string LookupProvider (string name)
+               {
+                       lock (locker) {
+                               InitializeProviderRegistration ();
+                               string type;
+                               if (!providerRegistration.TryGetValue (name, out type))
+                                       type = null;
+                               return type;
+                       }
+               }
+
+               static void InitializeProviderRegistration ()
+               {
+                       lock (locker) {
+                               if (providerRegistration != null)
+                                       return;
+                               providerRegistration = new Dictionary<string,string> ();
+                               providerRegistration.Add ("newtls", "Mono.Security.Providers.NewTls.NewTlsProvider, Mono.Security.Providers.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=84e3aee7225169c2");
+                               providerRegistration.Add ("oldtls", "Mono.Security.Providers.OldTls.OldTlsProvider, Mono.Security.Providers.OldTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=84e3aee7225169c2");
+                       }
+               }
+
+               static IMonoTlsProvider TryDynamicLoad ()
+               {
+                       var variable = Environment.GetEnvironmentVariable ("MONO_TLS_PROVIDER");
+                       if (variable == null)
+                               return null;
+
+                       if (string.Equals (variable, "default", StringComparison.OrdinalIgnoreCase))
+                               return null;
+
+                       string typeName;
+                       if (variable.IndexOfAny (new char[] { ',', '.', '=' }) > 0) {
+                               typeName = variable;
+                       } else {
+                               typeName = LookupProvider (variable);
+                               if (typeName == null)
+                                       throw new NotSupportedException (string.Format ("No such TLS Provider: `{0}'.", typeName));
+                       }
+
+                       var type = Type.GetType (typeName, false);
+                       if (type == null)
+                               throw new NotSupportedException (string.Format ("Could not find TLS Provider: `{0}'.", typeName));
+
+                       MSI.MonoTlsProvider provider;
+                       try {
+                               provider = (MSI.MonoTlsProvider)Activator.CreateInstance (type);
+                       } catch (Exception ex) {
+                               throw new NotSupportedException (string.Format ("Unable to instantiate TLS Provider `{0}'.", typeName), ex);
+                       }
+
+                       return new Private.MonoTlsProviderWrapper (provider);
+               }
+#endif
+
+               static IMonoTlsProvider CreateDefaultProviderImpl ()
+               {
+#if !MOBILE
+                       var provider = TryDynamicLoad ();
+                       if (provider != null)
+                               return provider;
+#endif
+
+                       return new Private.MonoDefaultTlsProvider ();
+               }
+
                #region Mono.Security visible API
 
                /*
@@ -174,6 +257,14 @@ namespace Mono.Net.Security
                                return new HttpWebRequest (requestUri, internalProvider, settings);
                        }
                }
+
+               internal static HttpListener CreateHttpListener (X509Certificate2 certificate, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
+               {
+                       lock (locker) {
+                               var internalProvider = provider != null ? new Private.MonoTlsProviderWrapper (provider) : null;
+                               return new HttpListener (certificate, internalProvider, settings);
+                       }
+               }
                #endregion
 
 #endif
index 22eb330a0ab8cde428c83dbaee30da9b1cf29f38..f10f99f5176366a0080eadf401426b9f3171b335 100644 (file)
@@ -98,7 +98,7 @@ namespace Mono.Net.Security
                        if (settings == null)
                                settings = new MonoTlsSettings ();
 
-                       validationHelper = ChainValidationHelper.Create (ref settings, this);
+                       validationHelper = ChainValidationHelper.Create (provider.Provider, ref settings, this);
                }
 
                internal Stream CreateStream (byte[] buffer)
index 08b6085e340a4155afa38dcd9a12ddd12d9dad83..641921390531f1bd56bd6d2255e5d87a433eb119 100644 (file)
@@ -33,6 +33,7 @@ using MX = MonoSecurity::Mono.Security.X509;
 using MSI = Mono.Security.Interface;
 using MX = Mono.Security.X509;
 #endif
+using System.Security.Cryptography.X509Certificates;
 #endif
 
 using System;
@@ -45,10 +46,10 @@ namespace Mono.Net.Security
        //
        internal static class NoReflectionHelper
        {
-               internal static object GetDefaultCertificateValidator (object settings)
+               internal static object GetDefaultCertificateValidator (object provider, object settings)
                {
                        #if SECURITY_DEP
-                       return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsSettings)settings);
+                       return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
                        #else
                        throw new NotSupportedException ();
                        #endif
@@ -99,5 +100,14 @@ namespace Mono.Net.Security
                        throw new NotSupportedException ();
                        #endif
                }
+
+               internal static object CreateHttpListener (object certificate, object provider, object settings)
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.CreateHttpListener ((X509Certificate2)certificate, (MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
        }
 }
diff --git a/mcs/class/System/Mono.Net.Security/SystemCertificateValidator.cs b/mcs/class/System/Mono.Net.Security/SystemCertificateValidator.cs
new file mode 100644 (file)
index 0000000..39cfa73
--- /dev/null
@@ -0,0 +1,454 @@
+#if SECURITY_DEP
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+#if MONO_X509_ALIAS
+extern alias PrebuiltSystem;
+#endif
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+using MSX = MonoSecurity::Mono.Security.X509;
+using MonoSecurity::Mono.Security.X509.Extensions;
+#else
+using Mono.Security.Interface;
+using MSX = Mono.Security.X509;
+using Mono.Security.X509.Extensions;
+#endif
+#if MONO_X509_ALIAS
+using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
+#else
+using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
+#endif
+
+using System;
+using System.Net;
+using System.Threading;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Configuration;
+using System.Net.Configuration;
+using System.Text.RegularExpressions;
+using System.Security.Cryptography.X509Certificates;
+
+using System.Globalization;
+using System.Net.Security;
+using System.Diagnostics;
+
+namespace Mono.Net.Security
+{
+       internal static class SystemCertificateValidator
+       {
+               static bool is_macosx;
+               static bool is_mobile;
+#if !MOBILE
+               static X509RevocationMode revocation_mode;
+#endif
+
+               static SystemCertificateValidator ()
+               {
+#if MONOTOUCH
+                       is_macosx = true;
+                       is_mobile = true;
+#elif MONODROID
+                       is_macosx = false;
+                       is_mobile = true;
+#else
+                       is_macosx = System.IO.File.Exists (OSX509Certificates.SecurityLibrary);
+                       is_mobile = false;
+#endif
+
+#if !MOBILE
+                       revocation_mode = X509RevocationMode.NoCheck;
+                       try {
+                               string str = Environment.GetEnvironmentVariable ("MONO_X509_REVOCATION_MODE");
+                               if (String.IsNullOrEmpty (str))
+                                       return;
+                               revocation_mode = (X509RevocationMode)Enum.Parse (typeof(X509RevocationMode), str, true);
+                       } catch {
+                       }
+#endif
+               }
+
+               static X509Chain ComputeX509Chain (XX509CertificateCollection certs, ref SslPolicyErrors errors, ref int status11)
+               {
+#if MOBILE
+                       return null;
+#else
+                       if (is_macosx)
+                               return null;
+
+                       var chain = new X509Chain ();
+                       chain.ChainPolicy = new X509ChainPolicy ();
+
+                       chain.ChainPolicy.RevocationMode = revocation_mode;
+
+                       for (int i = 1; i < certs.Count; i++) {
+                               chain.ChainPolicy.ExtraStore.Add (certs [i]);
+                       }
+
+                       var leaf = (X509Certificate2)certs [0];
+
+                       try {
+                               if (!chain.Build (leaf))
+                                       errors |= GetErrorsFromChain (chain);
+                       } catch (Exception e) {
+                               Console.Error.WriteLine ("ERROR building certificate chain: {0}", e);
+                               Console.Error.WriteLine ("Please, report this problem to the Mono team");
+                               errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+                       }
+
+                       status11 = GetStatusFromChain (chain);
+
+                       return chain;
+#endif
+               }
+
+               static void CheckUsage (XX509CertificateCollection certs, string host, ref SslPolicyErrors errors, ref int status11)
+               {
+#if !MONOTOUCH
+                       var leaf = (X509Certificate2)certs[0];
+                       // for OSX and iOS we're using the native API to check for the SSL server policy and host names
+                       if (!is_macosx) {
+                               if (!CheckCertificateUsage (leaf)) {
+                                       errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+                                       status11 = -2146762490; //CERT_E_PURPOSE 0x800B0106
+                               }
+
+                               if (host != null && !CheckServerIdentity (leaf, host)) {
+                                       errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
+                                       status11 = -2146762481; // CERT_E_CN_NO_MATCH 0x800B010F
+                               }
+                       }
+#endif
+               }
+
+               static bool EvaluateSystem (XX509CertificateCollection certs, XX509CertificateCollection anchors, string host, X509Chain chain, ref SslPolicyErrors errors, ref int status11)
+               {
+                       var leaf = certs [0];
+                       var result = false;
+
+#if MONODROID
+                       result = AndroidPlatform.TrustEvaluateSsl (certs);
+                       if (result) {
+                               // chain.Build() + GetErrorsFromChain() (above) will ALWAYS fail on
+                               // Android (there are no mozroots or preinstalled root certificates),
+                               // thus `errors` will ALWAYS have RemoteCertificateChainErrors.
+                               // Android just verified the chain; clear RemoteCertificateChainErrors.
+                               errors  &= ~SslPolicyErrors.RemoteCertificateChainErrors;
+                       }
+#else
+                       if (is_macosx) {
+                               // Attempt to use OSX certificates
+                               // Ideally we should return the SecTrustResult
+                               OSX509Certificates.SecTrustResult trustResult = OSX509Certificates.SecTrustResult.Deny;
+                               try {
+                                       trustResult = OSX509Certificates.TrustEvaluateSsl (certs, anchors, host);
+                                       // We could use the other values of trustResult to pass this extra information
+                                       // to the .NET 2 callback for values like SecTrustResult.Confirm
+                                       result = (trustResult == OSX509Certificates.SecTrustResult.Proceed ||
+                                               trustResult == OSX509Certificates.SecTrustResult.Unspecified);
+                               } catch {
+                                       // Ignore
+                               }
+
+                               if (result) {
+                                       // TrustEvaluateSsl was successful so there's no trust error
+                                       // IOW we discard our own chain (since we trust OSX one instead)
+                                       errors = 0;
+                               } else {
+                                       // callback and DefaultCertificatePolicy needs this since 'result' is not specified
+                                       status11 = (int)trustResult;
+                                       errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+                               }
+                       }
+#endif
+
+                       return result;
+               }
+
+               public static bool Evaluate (
+                       MonoTlsSettings settings, string host, XX509CertificateCollection certs,
+                       ref X509Chain chain, ref SslPolicyErrors errors, ref int status11)
+               {
+#if !MOBILE
+                       if (NeedsChain (settings) && chain == null)
+                               chain = ComputeX509Chain (certs, ref errors, ref status11);
+#endif
+
+                       CheckUsage (certs, host, ref errors, ref status11);
+
+                       if (settings != null && settings.SkipSystemValidators)
+                               return false;
+
+                       var anchors = settings != null ? settings.TrustAnchors : null;
+                       return EvaluateSystem (certs, anchors, host, chain, ref errors, ref status11);
+               }
+
+               internal static bool NeedsChain (MonoTlsSettings settings)
+               {
+#if MOBILE
+                       return false;
+#else
+                       if (!CertificateValidationHelper.SupportsX509Chain)
+                               return false;
+                       if (settings != null)
+                               return !settings.SkipSystemValidators || settings.CallbackNeedsCertificateChain;
+                       else
+                               return true;
+#endif
+               }
+
+#if !MOBILE
+               static int GetStatusFromChain (X509Chain chain)
+               {
+                       long result = 0;
+                       foreach (var status in chain.ChainStatus) {
+                               X509ChainStatusFlags flags = status.Status;
+                               if (flags == X509ChainStatusFlags.NoError)
+                                       continue;
+
+                               // CERT_E_EXPIRED
+                               if ((flags & X509ChainStatusFlags.NotTimeValid) != 0)
+                                       result = 0x800B0101;
+                               // CERT_E_VALIDITYPERIODNESTING
+                               else if ((flags & X509ChainStatusFlags.NotTimeNested) != 0)
+                                       result = 0x800B0102;
+                               // CERT_E_REVOKED
+                               else if ((flags & X509ChainStatusFlags.Revoked) != 0)
+                                       result = 0x800B010C;
+                               // TRUST_E_CERT_SIGNATURE
+                               else if ((flags & X509ChainStatusFlags.NotSignatureValid) != 0)
+                                       result = 0x80096004;
+                               // CERT_E_WRONG_USAGE
+                               else if ((flags & X509ChainStatusFlags.NotValidForUsage) != 0)
+                                       result = 0x800B0110;
+                               // CERT_E_UNTRUSTEDROOT
+                               else if ((flags & X509ChainStatusFlags.UntrustedRoot) != 0)
+                                       result = 0x800B0109;
+                               // CRYPT_E_NO_REVOCATION_CHECK
+                               else if ((flags & X509ChainStatusFlags.RevocationStatusUnknown) != 0)
+                                       result = 0x80092012;
+                               // CERT_E_CHAINING
+                               else if ((flags & X509ChainStatusFlags.Cyclic) != 0)
+                                       result = 0x800B010A;
+                               // TRUST_E_FAIL - generic
+                               else if ((flags & X509ChainStatusFlags.InvalidExtension) != 0)
+                                       result = 0x800B010B;
+                               // CERT_E_UNTRUSTEDROOT
+                               else if ((flags & X509ChainStatusFlags.InvalidPolicyConstraints) != 0)
+                                       result = 0x800B010D;
+                               // TRUST_E_BASIC_CONSTRAINTS
+                               else if ((flags & X509ChainStatusFlags.InvalidBasicConstraints) != 0)
+                                       result = 0x80096019;
+                               // CERT_E_INVALID_NAME
+                               else if ((flags & X509ChainStatusFlags.InvalidNameConstraints) != 0)
+                                       result = 0x800B0114;
+                               // CERT_E_INVALID_NAME
+                               else if ((flags & X509ChainStatusFlags.HasNotSupportedNameConstraint) != 0)
+                                       result = 0x800B0114;
+                               // CERT_E_INVALID_NAME
+                               else if ((flags & X509ChainStatusFlags.HasNotDefinedNameConstraint) != 0)
+                                       result = 0x800B0114;
+                               // CERT_E_INVALID_NAME
+                               else if ((flags & X509ChainStatusFlags.HasNotPermittedNameConstraint) != 0)
+                                       result = 0x800B0114;
+                               // CERT_E_INVALID_NAME
+                               else if ((flags & X509ChainStatusFlags.HasExcludedNameConstraint) != 0)
+                                       result = 0x800B0114;
+                               // CERT_E_CHAINING
+                               else if ((flags & X509ChainStatusFlags.PartialChain) != 0)
+                                       result = 0x800B010A;
+                               // CERT_E_EXPIRED
+                               else if ((flags & X509ChainStatusFlags.CtlNotTimeValid) != 0)
+                                       result = 0x800B0101;
+                               // TRUST_E_CERT_SIGNATURE
+                               else if ((flags & X509ChainStatusFlags.CtlNotSignatureValid) != 0)
+                                       result = 0x80096004;
+                               // CERT_E_WRONG_USAGE
+                               else if ((flags & X509ChainStatusFlags.CtlNotValidForUsage) != 0)
+                                       result = 0x800B0110;
+                               // CRYPT_E_NO_REVOCATION_CHECK
+                               else if ((flags & X509ChainStatusFlags.OfflineRevocation) != 0)
+                                       result = 0x80092012;
+                               // CERT_E_ISSUERCHAINING
+                               else if ((flags & X509ChainStatusFlags.NoIssuanceChainPolicy) != 0)
+                                       result = 0x800B0107;
+                               else
+                                       result = 0x800B010B; // TRUST_E_FAIL - generic
+
+                               break; // Exit the loop on the first error
+                       }
+                       return (int)result;
+               }
+
+               static SslPolicyErrors GetErrorsFromChain (X509Chain chain)
+               {
+                       SslPolicyErrors errors = SslPolicyErrors.None;
+                       foreach (var status in chain.ChainStatus) {
+                               if (status.Status == X509ChainStatusFlags.NoError)
+                                       continue;
+                               errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+                               break;
+                       }
+                       return errors;
+               }
+#endif
+
+#if !MONOTOUCH
+               static X509KeyUsageFlags s_flags = X509KeyUsageFlags.DigitalSignature |
+                       X509KeyUsageFlags.KeyAgreement |
+                       X509KeyUsageFlags.KeyEncipherment;
+               // Adapted to System 2.0+ from TlsServerCertificate.cs
+               //------------------------------
+               // Note: this method only works for RSA certificates
+               // DH certificates requires some changes - does anyone use one ?
+               static bool CheckCertificateUsage (X509Certificate2 cert)
+               {
+                       try {
+                               // certificate extensions are required for this
+                               // we "must" accept older certificates without proofs
+                               if (cert.Version < 3)
+                                       return true;
+
+                               X509KeyUsageExtension kux = (cert.Extensions ["2.5.29.15"] as X509KeyUsageExtension);
+                               X509EnhancedKeyUsageExtension eku = (cert.Extensions ["2.5.29.37"] as X509EnhancedKeyUsageExtension);
+                               if (kux != null && eku != null) {
+                                       // RFC3280 states that when both KeyUsageExtension and 
+                                       // ExtendedKeyUsageExtension are present then BOTH should
+                                       // be valid
+                                       if ((kux.KeyUsages & s_flags) == 0)
+                                               return false;
+                                       return eku.EnhancedKeyUsages ["1.3.6.1.5.5.7.3.1"] != null ||
+                                               eku.EnhancedKeyUsages ["2.16.840.1.113730.4.1"] != null;
+                               } else if (kux != null) {
+                                       return ((kux.KeyUsages & s_flags) != 0);
+                               } else if (eku != null) {
+                                       // Server Authentication (1.3.6.1.5.5.7.3.1) or
+                                       // Netscape Server Gated Crypto (2.16.840.1.113730.4)
+                                       return eku.EnhancedKeyUsages ["1.3.6.1.5.5.7.3.1"] != null ||
+                                               eku.EnhancedKeyUsages ["2.16.840.1.113730.4.1"] != null;
+                               }
+
+                               // last chance - try with older (deprecated) Netscape extensions
+                               X509Extension ext = cert.Extensions ["2.16.840.1.113730.1.1"];
+                               if (ext != null) {
+                                       string text = ext.NetscapeCertType (false);
+                                       return text.IndexOf ("SSL Server Authentication", StringComparison.Ordinal) != -1;
+                               }
+                               return true;
+                       } catch (Exception e) {
+                               Console.Error.WriteLine ("ERROR processing certificate: {0}", e);
+                               Console.Error.WriteLine ("Please, report this problem to the Mono team");
+                               return false;
+                       }
+               }
+
+               // RFC2818 - HTTP Over TLS, Section 3.1
+               // http://www.ietf.org/rfc/rfc2818.txt
+               //
+               // 1.   if present MUST use subjectAltName dNSName as identity
+               // 1.1.         if multiples entries a match of any one is acceptable
+               // 1.2.         wildcard * is acceptable
+               // 2.   URI may be an IP address -> subjectAltName.iPAddress
+               // 2.1.         exact match is required
+               // 3.   Use of the most specific Common Name (CN=) in the Subject
+               // 3.1          Existing practice but DEPRECATED
+               static bool CheckServerIdentity (X509Certificate2 cert, string targetHost)
+               {
+                       try {
+                               var mcert = new MSX.X509Certificate (cert.RawData);
+                               MSX.X509Extension ext = mcert.Extensions ["2.5.29.17"];
+                               // 1. subjectAltName
+                               if (ext != null) {
+                                       SubjectAltNameExtension subjectAltName = new SubjectAltNameExtension (ext);
+                                       // 1.1 - multiple dNSName
+                                       foreach (string dns in subjectAltName.DNSNames) {
+                                               // 1.2 TODO - wildcard support
+                                               if (Match (targetHost, dns))
+                                                       return true;
+                                       }
+                                       // 2. ipAddress
+                                       foreach (string ip in subjectAltName.IPAddresses) {
+                                               // 2.1. Exact match required
+                                               if (ip == targetHost)
+                                                       return true;
+                                       }
+                               }
+                               // 3. Common Name (CN=)
+                               return CheckDomainName (mcert.SubjectName, targetHost);
+                       } catch (Exception e) {
+                               Console.Error.WriteLine ("ERROR processing certificate: {0}", e);
+                               Console.Error.WriteLine ("Please, report this problem to the Mono team");
+                               return false;
+                       }
+               }
+
+               static bool CheckDomainName (string subjectName, string targetHost)
+               {
+                       string  domainName = String.Empty;
+                       Regex search = new Regex (@"CN\s*=\s*([^,]*)");
+                       MatchCollection elements = search.Matches (subjectName);
+                       if (elements.Count == 1) {
+                               if (elements [0].Success)
+                                       domainName = elements [0].Groups [1].Value.ToString ();
+                       }
+
+                       return Match (targetHost, domainName);
+               }
+
+               // ensure the pattern is valid wrt to RFC2595 and RFC2818
+               // http://www.ietf.org/rfc/rfc2595.txt
+               // http://www.ietf.org/rfc/rfc2818.txt
+               static bool Match (string hostname, string pattern)
+               {
+                       // check if this is a pattern
+                       int index = pattern.IndexOf ('*');
+                       if (index == -1) {
+                               // not a pattern, do a direct case-insensitive comparison
+                               return (String.Compare (hostname, pattern, true, CultureInfo.InvariantCulture) == 0);
+                       }
+
+                       // check pattern validity
+                       // A "*" wildcard character MAY be used as the left-most name component in the certificate.
+
+                       // unless this is the last char (valid)
+                       if (index != pattern.Length - 1) {
+                               // then the next char must be a dot .'.
+                               if (pattern [index + 1] != '.')
+                                       return false;
+                       }
+
+                       // only one (A) wildcard is supported
+                       int i2 = pattern.IndexOf ('*', index + 1);
+                       if (i2 != -1)
+                               return false;
+
+                       // match the end of the pattern
+                       string end = pattern.Substring (index + 1);
+                       int length = hostname.Length - end.Length;
+                       // no point to check a pattern that is longer than the hostname
+                       if (length <= 0)
+                               return false;
+
+                       if (String.Compare (hostname, length, end, 0, end.Length, true, CultureInfo.InvariantCulture) != 0)
+                               return false;
+
+                       // special case, we start with the wildcard
+                       if (index == 0) {
+                               // ensure we hostname non-matched part (start) doesn't contain a dot
+                               int i3 = hostname.IndexOf ('.');
+                               return ((i3 == -1) || (i3 >= (hostname.Length - end.Length)));
+                       }
+
+                       // match the start of the pattern
+                       string start = pattern.Substring (0, index);
+                       return (String.Compare (hostname, 0, start, 0, start.Length, true, CultureInfo.InvariantCulture) == 0);
+               }
+#endif
+       }
+}
+#endif
+
index 09dacd71c79fdc1a862687679a5adf3ca43ef60a..3ab41387ef4083ebcf5e2d37eef17310cd75b984 100644 (file)
@@ -31,11 +31,16 @@ using MonoSecurity::Mono.Security.Interface;
 #else
 using Mono.Security.Interface;
 #endif
+using Mono.Net.Security;
 
 namespace System.Net.Security
 {
        internal interface SSPIConfiguration
        {
+               IMonoTlsProvider Provider {
+                       get;
+               }
+
                MonoTlsSettings Settings {
                        get;
                }
index 6c775e3dbe2818e5893177d5565fc41e7051ac80..629617f60312967c794b5f3a526de8eed72ed531 100644 (file)
@@ -77,16 +77,13 @@ namespace System.Net.Security
                                                           bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus, EncryptionPolicy encryptionPolicy,
                                                           LocalCertSelectionCallback certSelectionDelegate, RemoteCertValidationCallback remoteValidationCallback, SSPIConfiguration userConfig)
                {
-                       var provider = MNS.MonoTlsProviderFactory.GetProviderInternal ();
-                       var settings = userConfig != null ? userConfig.Settings : null;
-                       var eventSink = userConfig != null ? userConfig.EventSink : null;
-                       if (settings != null && remoteValidationCallback != null)
+                       if (userConfig.Settings != null && remoteValidationCallback != null)
                                throw new InvalidOperationException ();
-                       var context = provider.CreateTlsContext (
+                       var context = userConfig.Provider.CreateTlsContext (
                                hostname, serverMode, (TlsProtocols)protocolFlags, serverCertificate, clientCertificates,
                                remoteCertRequired, checkCertName, checkCertRevocationStatus,
-                               (MonoEncryptionPolicy)encryptionPolicy, settings);
-                       return new SSPIInterface (context, eventSink);
+                               (MonoEncryptionPolicy)encryptionPolicy, userConfig.Settings);
+                       return new SSPIInterface (context, userConfig.EventSink);
                }
        }
 
index 65436edd3bea2a48b09ac1cab52a39baaa200aba..fea8922f809b307515e5c67cbb829d8bc84d1f6d 100644 (file)
@@ -10,7 +10,7 @@ using Mono.Security.Interface;
 #endif
 using System.Threading;
 using System.Security.Cryptography.X509Certificates;
-using Mono.Net.Security;
+using MNS = Mono.Net.Security;
 
 namespace System.Net.Security
 {
@@ -22,19 +22,20 @@ namespace System.Net.Security
                #if SECURITY_DEP
                SSPIConfiguration _Configuration;
 
-               internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, EncryptionPolicy encryptionPolicy, MonoTlsSettings settings)
+               internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, EncryptionPolicy encryptionPolicy, MonoTlsProvider provider, MonoTlsSettings settings)
                        : base (innerStream, leaveInnerStreamOpen)
                {
                        if (encryptionPolicy != EncryptionPolicy.RequireEncryption && encryptionPolicy != EncryptionPolicy.AllowNoEncryption && encryptionPolicy != EncryptionPolicy.NoEncryption)
                                throw new ArgumentException (SR.GetString (SR.net_invalid_enum, "EncryptionPolicy"), "encryptionPolicy");
 
-                       var validationHelper = ChainValidationHelper.CloneWithCallbackWrapper (ref settings, myUserCertValidationCallbackWrapper);
+                       var validationHelper = MNS.ChainValidationHelper.CloneWithCallbackWrapper (provider, ref settings, myUserCertValidationCallbackWrapper);
 
                        LocalCertSelectionCallback selectionCallback = null;
                        if (validationHelper.HasCertificateSelectionCallback)
                                selectionCallback = validationHelper.SelectClientCertificate;
 
-                       _Configuration = new MyConfiguration (settings, this);
+                       var internalProvider = new MNS.Private.MonoTlsProviderWrapper (provider);
+                       _Configuration = new MyConfiguration (internalProvider, settings, this);
                        _SslState = new SslState (innerStream, null, selectionCallback, encryptionPolicy, _Configuration);
                }
 
@@ -54,20 +55,26 @@ namespace System.Net.Security
                                return (sslPolicyErrors == MonoSslPolicyErrors.None);
                        }
 
-                       return ChainValidationHelper.InvokeCallback (callback, this, certificate, chain, sslPolicyErrors);
+                       return MNS.ChainValidationHelper.InvokeCallback (callback, this, certificate, chain, sslPolicyErrors);
                }
 
                class MyConfiguration : SSPIConfiguration
                {
+                       MNS.IMonoTlsProvider provider;
                        MonoTlsSettings settings;
                        IMonoTlsEventSink eventSink;
 
-                       public MyConfiguration (MonoTlsSettings settings, IMonoTlsEventSink eventSink)
+                       public MyConfiguration (MNS.IMonoTlsProvider provider, MonoTlsSettings settings, IMonoTlsEventSink eventSink)
                        {
+                               this.provider = provider;
                                this.settings = settings;
                                this.eventSink = eventSink;
                        }
 
+                       public MNS.IMonoTlsProvider Provider {
+                               get { return provider; }
+                       }
+
                        public MonoTlsSettings Settings {
                                get { return settings; }
                        }
index 8a89fcd9860330e4c37ec180f699208d6a6fb62a..f51dc2616006918a4780d9e3ec4c6c8086c8cd8e 100644 (file)
@@ -1216,38 +1216,14 @@ namespace System.Diagnostics {
                        if (process_handle == IntPtr.Zero)
                                throw new InvalidOperationException ("No process is associated with this object.");
 
-                       DateTime start = DateTime.UtcNow;
-
                        if (!WaitForExit_internal (process_handle, ms))
                                return false;
 
-                       if (ms >= 0) {
-                               ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
-                               if (ms <= 0)
-                                       return false;
-                       }
-
-                       if (async_output != null && !async_output.IsCompleted) {
-                               if (false == async_output.AsyncWaitHandle.WaitOne (ms, false))
-                                       return false; // Timed out
-
-                               if (ms >= 0) {
-                                       ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
-                                       if (ms <= 0)
-                                               return false;
-                               }
-                       }
+                       if (async_output != null && !async_output.IsCompleted)
+                               async_output.AsyncWaitHandle.WaitOne ();
 
-                       if (async_error != null && !async_error.IsCompleted) {
-                               if (false == async_error.AsyncWaitHandle.WaitOne (ms, false))
-                                       return false; // Timed out
-
-                               if (ms >= 0) {
-                                       ms -= (int) (DateTime.UtcNow - start).TotalMilliseconds;
-                                       if (ms <= 0)
-                                               return false;
-                               }
-                       }
+                       if (async_error != null && !async_error.IsCompleted)
+                               async_error.AsyncWaitHandle.WaitOne ();
 
                        OnExited ();
 
@@ -1321,6 +1297,8 @@ namespace System.Diagnostics {
                        StringBuilder sb = new StringBuilder ();
                        byte[] buffer = new byte [4096];
 
+                       const int ERROR_INVALID_HANDLE = 6;
+
                        public ProcessAsyncReader (Process process, FileStream stream, bool err_out)
                                : base (null, null)
                        {
@@ -1342,6 +1320,9 @@ namespace System.Diagnostics {
                                try {
                                        nread = stream.Read (buffer, 0, buffer.Length);
                                } catch (ObjectDisposedException) {
+                               } catch (IOException ex) {
+                                       if (ex.HResult != (unchecked((int) 0x80070000) | (int) ERROR_INVALID_HANDLE))
+                                               throw;
                                } catch (NotSupportedException) {
                                        if (stream.CanRead)
                                                throw;
index 06d765fbddf273b00a05642198ae335c2c39f8b1..67266618aaee535695f55b1b66d48d954d725a80 100644 (file)
@@ -1,36 +1,28 @@
 //
-// System.Net.Security.SslStream.cs
+// SslStream.cs
 //
-// Authors:
-//     Tim Coleman (tim@timcoleman.com)
-//     Atsushi Enomoto (atsushi@ximian.com)
-//     Marek Safar (marek.safar@gmail.com)
+// Author:
+//       Martin Baulig <martin.baulig@xamarin.com>
 //
-// Copyright (C) Tim Coleman, 2004
-// (c) 2004,2007 Novell, Inc. (http://www.novell.com)
-// Copyright 2011 Xamarin Inc.
+// 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:
 //
-// 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.
+// 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 SECURITY_DEP && !MONO_FEATURE_NEW_TLS
 
@@ -42,22 +34,16 @@ extern alias MonoSecurity;
 #endif
 
 #if MONO_SECURITY_ALIAS
-using MonoCipherAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = MonoSecurity::Mono.Security.Protocol.Tls.SecurityProtocolType;
-using MonoSecurity::Mono.Security.Protocol.Tls;
 using MonoSecurity::Mono.Security.Interface;
 #else
-using MonoCipherAlgorithmType = Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType;
-using Mono.Security.Protocol.Tls;
 using Mono.Security.Interface;
 #endif
 #if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
+using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
+using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
+#else
+using XSslProtocols = System.Security.Authentication.SslProtocols;
+using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 #endif
 
 using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
@@ -67,15 +53,18 @@ using ExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmTy
 using System;
 using System.IO;
 using System.Net;
+using System.Net.Security;
 using System.Security.Authentication;
 using System.Security.Cryptography.X509Certificates;
+using System.Security.Permissions;
 using System.Security.Principal;
 using System.Security.Cryptography;
 
 using System.Threading.Tasks;
+
 using MNS = Mono.Net.Security;
 
-namespace System.Net.Security 
+namespace System.Net.Security
 {
        /*
         * These two are defined by the referencesource; add them heere to make
@@ -90,22 +79,25 @@ namespace System.Net.Security
 
        internal delegate X509Certificate LocalCertSelectionCallback (
                string targetHost,
-               X509CertificateCollection localCertificates,
+               XX509CertificateCollection localCertificates,
                X509Certificate remoteCertificate,
                string[] acceptableIssuers);
 
-       [MonoTODO ("Non-X509Certificate2 certificate is not supported")]
-       public class SslStream : AuthenticatedStream
+       public class SslStream : AuthenticatedStream, MNS.IMonoSslStream
        {
-               #region Fields
+               MonoSslStream impl;
 
-               SslStreamBase ssl_stream;
-               RemoteCertificateValidationCallback validation_callback;
-               LocalCertificateSelectionCallback selection_callback;
-
-               #endregion // Fields
+               internal MonoSslStream Impl {
+                       get {
+                               CheckDisposed ();
+                               return impl;
+                       }
+               }
 
-               #region Constructors
+               static MonoTlsProvider GetProvider ()
+               {
+                       return MonoTlsProviderFactory.GetDefaultProvider ();
+               }
 
                public SslStream (Stream innerStream)
                        : this (innerStream, false)
@@ -115,493 +107,285 @@ namespace System.Net.Security
                public SslStream (Stream innerStream, bool leaveInnerStreamOpen)
                        : base (innerStream, leaveInnerStreamOpen)
                {
+                       var provider = GetProvider ();
+                       impl = provider.CreateSslStream (innerStream, leaveInnerStreamOpen);
                }
 
-               [MonoTODO ("userCertificateValidationCallback is not passed X509Chain and SslPolicyErrors correctly")]
                public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback)
                        : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, null)
                {
                }
 
-               [MonoTODO ("userCertificateValidationCallback is not passed X509Chain and SslPolicyErrors correctly")]
                public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback)
                        : base (innerStream, leaveInnerStreamOpen)
                {
-                       // they are nullable.
-                       validation_callback = userCertificateValidationCallback;
-                       selection_callback = userCertificateSelectionCallback;
-               }
-               #endregion // Constructors
-
-               #region Properties
-
-               public override bool CanRead {
-                       get { return InnerStream.CanRead; }
-               }
-
-               public override bool CanSeek {
-                       get { return InnerStream.CanSeek; }
+                       var provider = GetProvider ();
+                       var settings = new MonoTlsSettings ();
+                       settings.RemoteCertificateValidationCallback = MNS.Private.CallbackHelpers.PublicToMono (userCertificateValidationCallback);
+                       settings.ClientCertificateSelectionCallback = MNS.Private.CallbackHelpers.PublicToMono (userCertificateSelectionCallback);
+                       impl = provider.CreateSslStream (innerStream, leaveInnerStreamOpen, settings);
                }
 
-               public override bool CanTimeout {
-                       get { return InnerStream.CanTimeout; }
+               internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoSslStream impl)
+                       : base (innerStream, leaveInnerStreamOpen)
+               {
+                       this.impl = impl;
                }
 
-               public override bool CanWrite {
-                       get { return InnerStream.CanWrite; }
+               public virtual void AuthenticateAsClient (string targetHost)
+               {
+                       Impl.AuthenticateAsClient (targetHost);
                }
 
-               public override long Length {
-                       get { return InnerStream.Length; }
+               public virtual void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       Impl.AuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
                }
 
-               public override long Position {
-                       get { return InnerStream.Position; }
-                       set {
-                               throw new NotSupportedException ("This stream does not support seek operations");
-                       }
+               // [HostProtection (ExternalThreading=true)]
+               public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
+               {
+                       return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
                }
 
-               // AuthenticatedStream overrides
-
-               public override bool IsAuthenticated { 
-                       get { return ssl_stream != null; }
+               // [HostProtection (ExternalThreading=true)]
+               public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+               {
+                       return Impl.BeginAuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
                }
 
-               public override bool IsEncrypted { 
-                       get { return IsAuthenticated; }
+               public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
+               {
+                       Impl.EndAuthenticateAsClient (asyncResult);
                }
 
-               public override bool IsMutuallyAuthenticated { 
-                       get { return IsAuthenticated && (IsServer ? RemoteCertificate != null : LocalCertificate != null); }
+               public virtual void AuthenticateAsServer (X509Certificate serverCertificate)
+               {
+                       Impl.AuthenticateAsServer (serverCertificate);
                }
 
-               public override bool IsServer { 
-                       get { return ssl_stream is SslServerStream; }
+               public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
                }
 
-               public override bool IsSigned { 
-                       get { return IsAuthenticated; }
+               // [HostProtection (ExternalThreading=true)]
+               public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
+               {
+                       return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
                }
 
-               public override int ReadTimeout {
-                       get { return InnerStream.ReadTimeout; }
-                       set { InnerStream.ReadTimeout = value; }
+               public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+               {
+                       return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
                }
 
-               public override int WriteTimeout {
-                       get { return InnerStream.WriteTimeout; }
-                       set { InnerStream.WriteTimeout = value; }
+               public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
+               {
+                       Impl.EndAuthenticateAsServer (asyncResult);
                }
 
-               // SslStream
-
-               public virtual bool CheckCertRevocationStatus {
+               public TransportContext TransportContext {
                        get {
-                               if (!IsAuthenticated)
-                                       return false;
-
-                               return ssl_stream.CheckCertRevocationStatus;
+                               throw new NotSupportedException();
                        }
                }
 
-               public virtual CipherAlgorithmType CipherAlgorithm  {
-                       get {
-                               CheckConnectionAuthenticated ();
-
-                               switch (ssl_stream.CipherAlgorithm) {
-                               case MonoCipherAlgorithmType.Des:
-                                       return CipherAlgorithmType.Des;
-                               case MonoCipherAlgorithmType.None:
-                                       return CipherAlgorithmType.None;
-                               case MonoCipherAlgorithmType.Rc2:
-                                       return CipherAlgorithmType.Rc2;
-                               case MonoCipherAlgorithmType.Rc4:
-                                       return CipherAlgorithmType.Rc4;
-                               case MonoCipherAlgorithmType.SkipJack:
-                                       break;
-                               case MonoCipherAlgorithmType.TripleDes:
-                                       return CipherAlgorithmType.TripleDes;
-                               case MonoCipherAlgorithmType.Rijndael:
-                                       switch (ssl_stream.CipherStrength) {
-                                       case 128:
-                                               return CipherAlgorithmType.Aes128;
-                                       case 192:
-                                               return CipherAlgorithmType.Aes192;
-                                       case 256:
-                                               return CipherAlgorithmType.Aes256;
-                                       }
-                                       break;
-                               }
+               // [HostProtection (ExternalThreading=true)]
+               public virtual Task AuthenticateAsClientAsync (string targetHost)
+               {
+                       return Impl.AuthenticateAsClientAsync (targetHost);
+               }
 
-                               throw new InvalidOperationException ("Not supported cipher algorithm is in use. It is likely a bug in SslStream.");
-                       }
+               public virtual Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
                }
 
-               public virtual int CipherStrength  {
-                       get {
-                               CheckConnectionAuthenticated ();
+               public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
+               {
+                       return Impl.AuthenticateAsServerAsync (serverCertificate);
+               }
 
-                               return ssl_stream.CipherStrength;
-                       }
+               public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
                }
 
-               public virtual HashAlgorithmType HashAlgorithm  {
-                       get {
-                               CheckConnectionAuthenticated ();
-
-                               switch (ssl_stream.HashAlgorithm) {
-                               case MonoHashAlgorithmType.Md5:
-                                       return HashAlgorithmType.Md5;
-                               case MonoHashAlgorithmType.None:
-                                       return HashAlgorithmType.None;
-                               case MonoHashAlgorithmType.Sha1:
-                                       return HashAlgorithmType.Sha1;
-                               }
+               public override bool IsAuthenticated {
+                       get { return Impl.IsAuthenticated; }
+               }
 
-                               throw new InvalidOperationException ("Not supported hash algorithm is in use. It is likely a bug in SslStream.");
-                       }
+               public override bool IsMutuallyAuthenticated {
+                       get { return Impl.IsMutuallyAuthenticated; }
                }
 
-               public virtual int HashStrength  {
-                       get {
-                               CheckConnectionAuthenticated ();
+               public override bool IsEncrypted {
+                       get { return Impl.IsEncrypted; }
+               }
 
-                               return ssl_stream.HashStrength;
-                       }
+               public override bool IsSigned {
+                       get { return Impl.IsSigned; }
                }
 
-               public virtual ExchangeAlgorithmType KeyExchangeAlgorithm { 
-                       get {
-                               CheckConnectionAuthenticated ();
-
-                               switch (ssl_stream.KeyExchangeAlgorithm) {
-                               case MonoExchangeAlgorithmType.DiffieHellman:
-                                       return ExchangeAlgorithmType.DiffieHellman;
-                               case MonoExchangeAlgorithmType.Fortezza:
-                                       break;
-                               case MonoExchangeAlgorithmType.None:
-                                       return ExchangeAlgorithmType.None;
-                               case MonoExchangeAlgorithmType.RsaKeyX:
-                                       return ExchangeAlgorithmType.RsaKeyX;
-                               case MonoExchangeAlgorithmType.RsaSign:
-                                       return ExchangeAlgorithmType.RsaSign;
-                               }
+               public override bool IsServer {
+                       get { return Impl.IsServer; }
+               }
 
-                               throw new InvalidOperationException ("Not supported exchange algorithm is in use. It is likely a bug in SslStream.");
-                       }
+               public virtual SslProtocols SslProtocol {
+                       get { return (SslProtocols)Impl.SslProtocol; }
                }
 
-               public virtual int KeyExchangeStrength { 
-                       get {
-                               CheckConnectionAuthenticated ();
+               public virtual bool CheckCertRevocationStatus {
+                       get { return Impl.CheckCertRevocationStatus; }
+               }
 
-                               return ssl_stream.KeyExchangeStrength;
-                       }
+               X509Certificate MNS.IMonoSslStream.InternalLocalCertificate {
+                       get { return Impl.InternalLocalCertificate; }
                }
 
                public virtual X509Certificate LocalCertificate {
-                       get {
-                               CheckConnectionAuthenticated ();
-
-                               return IsServer ? ssl_stream.ServerCertificate : ((SslClientStream) ssl_stream).SelectedClientCertificate;
-                       }
+                       get { return Impl.LocalCertificate; }
                }
 
                public virtual X509Certificate RemoteCertificate {
-                       get {
-                               CheckConnectionAuthenticated ();
-                               return !IsServer ? ssl_stream.ServerCertificate : ((SslServerStream) ssl_stream).ClientCertificate;
-                       }
+                       get { return Impl.RemoteCertificate; }
                }
 
-               public virtual SslProtocols SslProtocol {
-                       get {
-                               CheckConnectionAuthenticated ();
-
-                               switch (ssl_stream.SecurityProtocol) {
-                               case MonoSecurityProtocolType.Default:
-                                       return SslProtocols.Default;
-                               case MonoSecurityProtocolType.Ssl2:
-                                       return SslProtocols.Ssl2;
-                               case MonoSecurityProtocolType.Ssl3:
-                                       return SslProtocols.Ssl3;
-                               case MonoSecurityProtocolType.Tls:
-                                       return SslProtocols.Tls;
-                               }
-
-                               throw new InvalidOperationException ("Not supported SSL/TLS protocol is in use. It is likely a bug in SslStream.");
-                       }
+               public virtual CipherAlgorithmType CipherAlgorithm {
+                       get { return (CipherAlgorithmType)Impl.CipherAlgorithm; }
                }
 
-               #endregion // Properties
-
-               #region Methods
-/*
-               AsymmetricAlgorithm GetPrivateKey (X509Certificate cert, string targetHost)
-               {
-                       // FIXME: what can I do for non-X509Certificate2 ?
-                       X509Certificate2 cert2 = cert as X509Certificate2;
-                       return cert2 != null ? cert2.PrivateKey : null;
-               }
-*/
-               X509Certificate OnCertificateSelection (X509CertificateCollection clientCerts, X509Certificate serverCert, string targetHost, X509CertificateCollection serverRequestedCerts)
-               {
-                       string [] acceptableIssuers = new string [serverRequestedCerts != null ? serverRequestedCerts.Count : 0];
-                       for (int i = 0; i < acceptableIssuers.Length; i++)
-                               acceptableIssuers [i] = serverRequestedCerts [i].GetIssuerName ();
-                       return selection_callback (this, targetHost, clientCerts, serverCert, acceptableIssuers);
+               public virtual int CipherStrength {
+                       get { return Impl.CipherStrength; }
                }
 
-               public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
-               {
-                       return BeginAuthenticateAsClient (targetHost, new X509CertificateCollection (), SslProtocols.Tls, false, asyncCallback, asyncState);
+               public virtual HashAlgorithmType HashAlgorithm {
+                       get { return (HashAlgorithmType)Impl.HashAlgorithm; }
                }
 
-               public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
-               {
-                       if (IsAuthenticated)
-                               throw new InvalidOperationException ("This SslStream is already authenticated");
-
-                       SslClientStream s = new SslClientStream (InnerStream, targetHost, !LeaveInnerStreamOpen, GetMonoSslProtocol (enabledSslProtocols), clientCertificates);
-                       s.CheckCertRevocationStatus = checkCertificateRevocation;
-
-                       // Due to the Mono.Security internal, it cannot reuse
-                       // the delegated argument, as Mono.Security creates 
-                       // another instance of X509Certificate which lacks 
-                       // private key but is filled the private key via this
-                       // delegate.
-                       s.PrivateKeyCertSelectionDelegate = delegate (X509Certificate cert, string host) {
-                               string hash = cert.GetCertHashString ();
-                               // ... so, we cannot use the delegate argument.
-                               foreach (X509Certificate cc in clientCertificates) {
-                                       if (cc.GetCertHashString () != hash)
-                                               continue;
-                                       X509Certificate2 cert2 = cc as X509Certificate2;
-                                       cert2 = cert2 ?? new X509Certificate2 (cc);
-                                       return cert2.PrivateKey;
-                               }
-                               return null;
-                       };
-
-                       // Even if validation_callback is null this allows us to verify requests where the user
-                       // does not provide a verification callback but attempts to authenticate with the website
-                       // as a client (see https://bugzilla.xamarin.com/show_bug.cgi?id=18962 for an example)
-                       var settings = new MonoTlsSettings ();
-                       settings.ServerCertificateValidationCallback = MNS.Private.CallbackHelpers.PublicToMono (validation_callback);
-                       var helper = MNS.ChainValidationHelper.Create (ref settings, null);
-                       s.ServerCertValidation2 += (certs) => helper.ValidateChain (targetHost, certs);
-                       if (selection_callback != null)
-                               s.ClientCertSelectionDelegate = OnCertificateSelection;
-
-                       ssl_stream = s;
-
-                       return BeginWrite (new byte [0], 0, 0, asyncCallback, asyncState);
+               public virtual int HashStrength {
+                       get { return Impl.HashStrength; }
                }
 
-               public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
-               {
-                       CheckConnectionAuthenticated ();
-
-                       return ssl_stream.BeginRead (buffer, offset, count, asyncCallback, asyncState);
+               public virtual ExchangeAlgorithmType KeyExchangeAlgorithm {
+                       get { return (ExchangeAlgorithmType)Impl.KeyExchangeAlgorithm; }
                }
 
-               public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
-               {
-                       return BeginAuthenticateAsServer (serverCertificate, false, SslProtocols.Tls, false, asyncCallback, asyncState);
+               public virtual int KeyExchangeStrength {
+                       get { return Impl.KeyExchangeStrength; }
                }
 
-               public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
-               {
-                       if (IsAuthenticated)
-                               throw new InvalidOperationException ("This SslStream is already authenticated");
-
-                       SslServerStream s = new SslServerStream (InnerStream, serverCertificate, clientCertificateRequired, !LeaveInnerStreamOpen, GetMonoSslProtocol (enabledSslProtocols));
-                       s.CheckCertRevocationStatus = checkCertificateRevocation;
-                       // Due to the Mono.Security internal, it cannot reuse
-                       // the delegated argument, as Mono.Security creates 
-                       // another instance of X509Certificate which lacks 
-                       // private key but is filled the private key via this
-                       // delegate.
-                       s.PrivateKeyCertSelectionDelegate = delegate (X509Certificate cert, string targetHost) {
-                               // ... so, we cannot use the delegate argument.
-                               X509Certificate2 cert2 = serverCertificate as X509Certificate2 ?? new X509Certificate2 (serverCertificate);
-                               return cert2 != null ? cert2.PrivateKey : null;
-                       };
-
-                       if (validation_callback != null)
-                               s.ClientCertValidationDelegate = delegate (X509Certificate cert, int [] certErrors) {
-                                       X509Chain chain = null;
-                                       if (cert is X509Certificate2) {
-                                               chain = new X509Chain ();
-                                               chain.Build ((X509Certificate2) cert);
-                                       }
-                                       // FIXME: SslPolicyErrors is incomplete
-                                       SslPolicyErrors errors = certErrors.Length > 0 ? SslPolicyErrors.RemoteCertificateChainErrors : SslPolicyErrors.None;
-                                       return validation_callback (this, cert, chain, errors);
-                               };
-
-                       ssl_stream = s;
-
-                       return BeginWrite (new byte[0], 0, 0, asyncCallback, asyncState);
-               }
-
-               MonoSecurityProtocolType GetMonoSslProtocol (SslProtocols ms)
-               {
-                       switch (ms) {
-                       case SslProtocols.Ssl2:
-                               return MonoSecurityProtocolType.Ssl2;
-                       case SslProtocols.Ssl3:
-                               return MonoSecurityProtocolType.Ssl3;
-                       case SslProtocols.Tls:
-                               return MonoSecurityProtocolType.Tls;
-                       default:
-                               return MonoSecurityProtocolType.Default;
-                       }
+               public override bool CanSeek {
+                       get { return false; }
                }
 
-               public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
-               {
-                       CheckConnectionAuthenticated ();
+               public override bool CanRead {
+                       get { return Impl.CanRead; }
+               }
 
-                       return ssl_stream.BeginWrite (buffer, offset, count, asyncCallback, asyncState);
+               public override bool CanTimeout {
+                       get { return Impl.CanTimeout; }
                }
 
-               public virtual void AuthenticateAsClient (string targetHost)
-               {
-                       AuthenticateAsClient (targetHost, new X509CertificateCollection (), SslProtocols.Tls, false);
+               public override bool CanWrite {
+                       get { return Impl.CanWrite; }
                }
 
-               public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
-               {
-                       EndAuthenticateAsClient (BeginAuthenticateAsClient (
-                               targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, null, null));
+               public override int ReadTimeout {
+                       get { return Impl.ReadTimeout; }
+                       set { Impl.ReadTimeout = value; }
                }
 
-               public virtual void AuthenticateAsServer (X509Certificate serverCertificate)
-               {
-                       AuthenticateAsServer (serverCertificate, false, SslProtocols.Tls, false);
+               public override int WriteTimeout {
+                       get { return Impl.WriteTimeout; }
+                       set { Impl.WriteTimeout = value; }
                }
 
-               public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
-               {
-                       EndAuthenticateAsServer (BeginAuthenticateAsServer (
-                               serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, null, null));
+               public override long Length {
+                       get { return Impl.Length; }
                }
 
-               protected override void Dispose (bool disposing)
-               {
-                       if (disposing) {
-                               if (ssl_stream != null)
-                                       ssl_stream.Dispose ();
-                               ssl_stream = null;
+               public override long Position {
+                       get { return Impl.Position; }
+                       set {
+                               throw new NotSupportedException (SR.GetString (SR.net_noseek));
                        }
-                       base.Dispose (disposing);
                }
 
-               public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
+               public override void SetLength (long value)
                {
-                       CheckConnectionAuthenticated ();
-
-                       if (CanRead)
-                               ssl_stream.EndRead (asyncResult);
-                       else
-                               ssl_stream.EndWrite (asyncResult);
+                       Impl.SetLength (value);
                }
 
-               public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
+               public override long Seek (long offset, SeekOrigin origin)
                {
-                       CheckConnectionAuthenticated ();
-
-                       if (CanRead)
-                               ssl_stream.EndRead (asyncResult);
-                       else
-                               ssl_stream.EndWrite (asyncResult);
+                       throw new NotSupportedException (SR.GetString (SR.net_noseek));
                }
 
-               public override int EndRead (IAsyncResult asyncResult)
+               public override void Flush ()
                {
-                       CheckConnectionAuthenticated ();
-
-                       return ssl_stream.EndRead (asyncResult);
+                       Impl.Flush ();
                }
 
-               public override void EndWrite (IAsyncResult asyncResult)
+               void CheckDisposed ()
                {
-                       CheckConnectionAuthenticated ();
-
-                       ssl_stream.EndWrite (asyncResult);
+                       if (impl == null)
+                               throw new ObjectDisposedException ("MonoSslStream");
                }
 
-               public override void Flush ()
+               protected override void Dispose (bool disposing)
                {
-                       CheckConnectionAuthenticated ();
-
-                       InnerStream.Flush ();
+                       try {
+                               if (impl != null && disposing) {
+                                       impl.Dispose ();
+                                       impl = null;
+                               }
+                       } finally {
+                               base.Dispose (disposing);
+                       }
                }
 
                public override int Read (byte[] buffer, int offset, int count)
                {
-                       return EndRead (BeginRead (buffer, offset, count, null, null));
+                       return Impl.Read (buffer, offset, count);
                }
 
-               public override long Seek (long offset, SeekOrigin origin)
-               {
-                       throw new NotSupportedException ("This stream does not support seek operations");
-               }
-
-               public override void SetLength (long value)
+               public void Write (byte[] buffer)
                {
-                       InnerStream.SetLength (value);
+                       Impl.Write (buffer);
                }
 
                public override void Write (byte[] buffer, int offset, int count)
                {
-                       EndWrite (BeginWrite (buffer, offset, count, null, null));
+                       Impl.Write (buffer, offset, count);
                }
 
-               public void Write (byte[] buffer)
-               {
-                       Write (buffer, 0, buffer.Length);
-               }
-
-               void CheckConnectionAuthenticated ()
+               // [HostProtection (ExternalThreading=true)]
+               public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
                {
-                       if (!IsAuthenticated)
-                               throw new InvalidOperationException ("This operation is invalid until it is successfully authenticated");
+                       return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState);
                }
 
-               public virtual Task AuthenticateAsClientAsync (string targetHost)
+               public override int EndRead (IAsyncResult asyncResult)
                {
-                       return Task.Factory.FromAsync (BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null);
+                       return Impl.EndRead (asyncResult);
                }
 
-               public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               // [HostProtection (ExternalThreading=true)]
+               public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
                {
-                       var t = Tuple.Create (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, this);
-
-                       return Task.Factory.FromAsync ((callback, state) => {
-                               var d = (Tuple<string, X509CertificateCollection, SslProtocols, bool, SslStream>) state;
-                               return d.Item5.BeginAuthenticateAsClient (d.Item1, d.Item2, d.Item3, d.Item4, callback, null);
-                       }, EndAuthenticateAsClient, t);
+                       return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState);
                }
 
-               public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
+               public override void EndWrite (IAsyncResult asyncResult)
                {
-                       return Task.Factory.FromAsync (BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null);
+                       Impl.EndWrite (asyncResult);
                }
 
-               public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
-               {
-                       var t = Tuple.Create (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, this);
-
-                       return Task.Factory.FromAsync ((callback, state) => {
-                               var d = (Tuple<X509Certificate, bool, SslProtocols, bool, SslStream>) state;
-                               return d.Item5.BeginAuthenticateAsServer (d.Item1, d.Item2, d.Item3, d.Item4, callback, null);
-                       }, EndAuthenticateAsServer, t);
+               AuthenticatedStream MNS.IMonoSslStream.AuthenticatedStream {
+                       get { return this; }
                }
-
-               #endregion // Methods
        }
 }
 
index df73d85428e37786b523f71cb071de1522a4e3e8..d5a1d484dee6b671f97228667b5cfd062e7c9c12 100644 (file)
@@ -47,21 +47,23 @@ using System.Threading;
 namespace System.Net {
        sealed class EndPointListener
        {
+               HttpListener listener;
                IPEndPoint endpoint;
                Socket sock;
                Hashtable prefixes;  // Dictionary <ListenerPrefix, HttpListener>
                ArrayList unhandled; // List<ListenerPrefix> unhandled; host = '*'
                ArrayList all;       // List<ListenerPrefix> all;  host = '+'
                X509Certificate2 cert;
-               AsymmetricAlgorithm key;
                bool secure;
                Dictionary<HttpConnection, HttpConnection> unregistered;
 
-               public EndPointListener (IPAddress addr, int port, bool secure)
+               public EndPointListener (HttpListener listener, IPAddress addr, int port, bool secure)
                {
+                       this.listener = listener;
+
                        if (secure) {
                                this.secure = secure;
-                               LoadCertificateAndKey (addr, port);
+                               cert = listener.LoadCertificateAndKey (addr, port);
                        }
 
                        endpoint = new IPEndPoint (addr, port);
@@ -76,24 +78,8 @@ namespace System.Net {
                        unregistered = new Dictionary<HttpConnection, HttpConnection> ();
                }
 
-               void LoadCertificateAndKey (IPAddress addr, int port)
-               {
-                       // Actually load the certificate
-                       try {
-                               string dirname = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
-                               string path = Path.Combine (dirname, ".mono");
-                               path = Path.Combine (path, "httplistener");
-                               string cert_file = Path.Combine (path, String.Format ("{0}.cer", port));
-                               if (!File.Exists (cert_file))
-                                       return;
-                               string pvk_file = Path.Combine (path, String.Format ("{0}.pvk", port));
-                               if (!File.Exists (pvk_file))
-                                       return;
-                               cert = new X509Certificate2 (cert_file);
-                               key = PrivateKey.CreateFromFile (pvk_file).RSA;
-                       } catch {
-                               // ignore errors
-                       }
+               internal HttpListener Listener {
+                       get { return listener; }
                }
 
                static void OnAccept (object sender, EventArgs e)
@@ -121,11 +107,11 @@ namespace System.Net {
                        if (accepted == null)
                                return;
 
-                       if (epl.secure && (epl.cert == null || epl.key == null)) {
+                       if (epl.secure && (epl.cert == null || !epl.cert.HasPrivateKey)) {
                                accepted.Close ();
                                return;
                        }
-                       HttpConnection conn = new HttpConnection (accepted, epl, epl.secure, epl.cert, epl.key);
+                       HttpConnection conn = new HttpConnection (accepted, epl, epl.secure, epl.cert);
                        lock (epl.unregistered) {
                                epl.unregistered [conn] = conn;
                        }
index a4ee4a24ad13def9f5c74834acce2ded6f06ff6c..6db036a7f02a3e0c14431511ac0c6cafbc69a915 100644 (file)
@@ -107,7 +107,7 @@ namespace System.Net {
                        if (p.ContainsKey (port)) {
                                epl = (EndPointListener) p [port];
                        } else {
-                               epl = new EndPointListener (addr, port, secure);
+                               epl = new EndPointListener (listener, addr, port, secure);
                                p [port] = epl;
                        }
 
index d3cacbc4ba48698dd66723bbbbcebc45b03d414d..729ee39cbca5237550c80b568a0a26d0030f6c27 100644 (file)
 //
 
 #if SECURITY_DEP
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+#if MONO_X509_ALIAS
+extern alias PrebuiltSystem;
+#endif
 
-#if MONOTOUCH || MONODROID
-using Mono.Security.Protocol.Tls;
+#if MONO_SECURITY_ALIAS
+using MSI = MonoSecurity::Mono.Security.Interface;
 #else
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Protocol.Tls;
+using MSI = Mono.Security.Interface;
+#endif
+#if MONO_X509_ALIAS
+using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
+#else
+using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 #endif
 
 using System.IO;
 using System.Net.Sockets;
 using System.Text;
 using System.Threading;
+using System.Security.Authentication;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
+using Mono.Net.Security;
 
 namespace System.Net {
        sealed class HttpConnection
@@ -62,27 +74,35 @@ namespace System.Net {
                int reuses;
                bool context_bound;
                bool secure;
-               AsymmetricAlgorithm key;
+               X509Certificate2 cert;
                int s_timeout = 90000; // 90k ms for first request, 15k ms from then on
                Timer timer;
                IPEndPoint local_ep;
                HttpListener last_listener;
                int [] client_cert_errors;
                X509Certificate2 client_cert;
+               IMonoSslStream ssl_stream;
 
-               public HttpConnection (Socket sock, EndPointListener epl, bool secure, X509Certificate2 cert, AsymmetricAlgorithm key)
+               public HttpConnection (Socket sock, EndPointListener epl, bool secure, X509Certificate2 cert)
                {
                        this.sock = sock;
                        this.epl = epl;
                        this.secure = secure;
-                       this.key = key;
+                       this.cert = cert;
                        if (secure == false) {
                                stream = new NetworkStream (sock, false);
                        } else {
-                               SslServerStream ssl_stream = new SslServerStream (new NetworkStream (sock, false), cert, false, true, false);
-                               ssl_stream.PrivateKeyCertSelectionDelegate += OnPVKSelection;
-                               ssl_stream.ClientCertValidationDelegate += OnClientCertificateValidation;
-                               stream = ssl_stream;
+                               ssl_stream = epl.Listener.CreateSslStream (new NetworkStream (sock, false), false, (t, c, ch, e) => {
+                                       if (c == null)
+                                               return true;
+                                       var c2 = c as X509Certificate2;
+                                       if (c2 == null)
+                                               c2 = new X509Certificate2 (c.GetRawCertData ());
+                                       client_cert = c2;
+                                       client_cert_errors = new int[] { (int)e };
+                                       return true;
+                               });
+                               stream = ssl_stream.AuthenticatedStream;
                        }
                        timer = new Timer (OnTimeout, null, Timeout.Infinite, Timeout.Infinite);
                        Init ();
@@ -96,25 +116,12 @@ namespace System.Net {
                        get { return client_cert; }
                }
 
-               bool OnClientCertificateValidation (X509Certificate certificate, int[] errors)
-               {
-                       if (certificate == null)
-                               return true;
-                       X509Certificate2 cert = certificate as X509Certificate2;
-                       if (cert == null)
-                               cert = new X509Certificate2 (certificate.GetRawCertData ());
-                       client_cert = cert;
-                       client_cert_errors = errors;
-                       return true;
-               }
-
-               AsymmetricAlgorithm OnPVKSelection (X509Certificate certificate, string targetHost)
-               {
-                       return key;
-               }
-
                void Init ()
                {
+                       if (ssl_stream != null) {
+                               ssl_stream.AuthenticateAsServer (cert, true, (SslProtocols)ServicePointManager.SecurityProtocol, false);
+                       }
+
                        context_bound = false;
                        i_stream = null;
                        o_stream = null;
@@ -305,18 +312,25 @@ namespace System.Net {
                        int used = 0;
                        string line;
 
-                       try {
-                               line = ReadLine (buffer, position, len - position, ref used);
-                               position += used;
-                       } catch {
-                               context.ErrorMessage = "Bad request";
-                               context.ErrorStatus = 400;
-                               return true;
-                       }
+                       while (true) {
+                               if (context.HaveError)
+                                       return true;
+
+                               if (position >= len)
+                                       break;
+
+                               try {
+                                       line = ReadLine (buffer, position, len - position, ref used);
+                                       position += used;
+                               } catch {
+                                       context.ErrorMessage = "Bad request";
+                                       context.ErrorStatus = 400;
+                                       return true;
+                               }
 
-                       do {
                                if (line == null)
                                        break;
+
                                if (line == "") {
                                        if (input_state == InputState.RequestLine)
                                                continue;
@@ -337,21 +351,7 @@ namespace System.Net {
                                                return true;
                                        }
                                }
-
-                               if (context.HaveError)
-                                       return true;
-
-                               if (position >= len)
-                                       break;
-                               try {
-                                       line = ReadLine (buffer, position, len - position, ref used);
-                                       position += used;
-                               } catch {
-                                       context.ErrorMessage = "Bad request";
-                                       context.ErrorStatus = 400;
-                                       return true;
-                               }
-                       } while (line != null);
+                       }
 
                        if (used == len) {
                                ms.SetLength (0);
index 82cf8bda9eb4b076db9e88955333c62dca950d95..4bba9e31f9c79d38da44d98cc2e0e8fa27e8d92c 100644 (file)
 //
 
 #if SECURITY_DEP
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+using MonoSecurity::Mono.Security.Authenticode;
+using MSI = MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Authenticode;
+using MSI = Mono.Security.Interface;
+#endif
 
+using System.IO;
 using System.Collections;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+
+using Mono.Net.Security;
+
 
 //TODO: logging
 namespace System.Net {
@@ -46,6 +60,10 @@ namespace System.Net {
                bool listening;
                bool disposed;
 
+               IMonoTlsProvider tlsProvider;
+               MSI.MonoTlsSettings tlsSettings;
+               X509Certificate2 certificate;
+
                Hashtable registry;   // Dictionary<HttpListenerContext,HttpListenerContext> 
                ArrayList ctx_queue;  // List<HttpListenerContext> ctx_queue;
                ArrayList wait_queue; // List<ListenerAsyncResult> wait_queue;
@@ -61,6 +79,55 @@ namespace System.Net {
                        auth_schemes = AuthenticationSchemes.Anonymous;
                }
 
+               internal HttpListener (X509Certificate2 certificate, IMonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
+                       : this ()
+               {
+                       this.certificate = certificate;
+                       this.tlsProvider = tlsProvider;
+                       this.tlsSettings = tlsSettings;
+               }
+
+               internal X509Certificate2 LoadCertificateAndKey (IPAddress addr, int port)
+               {
+                       lock (registry) {
+                               if (certificate != null)
+                                       return certificate;
+
+                               // Actually load the certificate
+                               try {
+                                       string dirname = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
+                                       string path = Path.Combine (dirname, ".mono");
+                                       path = Path.Combine (path, "httplistener");
+                                       string cert_file = Path.Combine (path, String.Format ("{0}.cer", port));
+                                       if (!File.Exists (cert_file))
+                                               return null;
+                                       string pvk_file = Path.Combine (path, String.Format ("{0}.pvk", port));
+                                       if (!File.Exists (pvk_file))
+                                               return null;
+                                       certificate = new X509Certificate2 (cert_file);
+                                       certificate.PrivateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
+                                       return certificate;
+                               } catch {
+                                       // ignore errors
+                                       certificate = null;
+                                       return null;
+                               }
+                       }
+               }
+
+               internal IMonoSslStream CreateSslStream (Stream innerStream, bool ownsStream, MSI.MonoRemoteCertificateValidationCallback callback)
+               {
+                       lock (registry) {
+                               if (tlsProvider == null)
+                                       tlsProvider = MonoTlsProviderFactory.GetProviderInternal ();
+                               if (tlsSettings == null)
+                                       tlsSettings = new MSI.MonoTlsSettings ();
+                               if (tlsSettings.RemoteCertificateValidationCallback == null)
+                                       tlsSettings.RemoteCertificateValidationCallback = callback;
+                               return tlsProvider.CreateSslStream (innerStream, ownsStream, tlsSettings);
+                       }
+               }
+
                // TODO: Digest, NTLM and Negotiate require ControlPrincipal
                public AuthenticationSchemes AuthenticationSchemes {
                        get { return auth_schemes; }
@@ -349,5 +416,11 @@ namespace System.Net {
                }
        }
 }
+#else // SECURITY_DEP
+namespace System.Net
+{
+       public sealed class HttpListener
+       {
+       }
+}
 #endif
-
index 8e25aa0629e3fde6425661e16f00a02a34da138a..ac59eb51cd3e72a782b009b80411e4da9ed64170 100644 (file)
 
 #if SECURITY_DEP
 
-#if MONOTOUCH || MONODROID
-using Mono.Security.Protocol.Tls;
-#else
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Protocol.Tls;
-#endif
-
 using System.Collections;
 using System.Collections.Specialized;
 using System.Globalization;
index dd3cb0733480af3a97ea6b6351e36a55fbf19960..97d15a285e04ce081f0fee2028ccea25d83c0823 100644 (file)
@@ -82,10 +82,8 @@ namespace System.Net
                NtlmAuthState connect_ntlm_auth_state;
                HttpWebRequest connect_request;
 
-               bool ssl;
                Exception connect_exception;
                static object classLock = new object ();
-               IMonoTlsProvider tlsProvider;
                MonoTlsStream tlsStream;
 
 #if MONOTOUCH
@@ -221,15 +219,6 @@ namespace System.Net
                        }
                }
 
-               void EnsureSSLStreamAvailable (HttpWebRequest request)
-               {
-                       tlsProvider = request.TlsProvider;
-                       if (tlsProvider != null)
-                               return;
-
-                       tlsProvider = MonoTlsProviderFactory.GetProviderInternal ();
-               }
-
                bool CreateTunnel (HttpWebRequest request, Uri connectUri,
                                   Stream stream, out byte[] buffer)
                {
@@ -405,8 +394,6 @@ namespace System.Net
 
                                if (request.Address.Scheme == Uri.UriSchemeHttps) {
 #if SECURITY_DEP
-                                       ssl = true;
-                                       EnsureSSLStreamAvailable (request);
                                        if (!reused || nstream == null || tlsStream == null) {
                                                byte [] buffer = null;
                                                if (sPoint.UseConnect) {
@@ -425,7 +412,6 @@ namespace System.Net
                                        throw new NotSupportedException ();
 #endif
                                } else {
-                                       ssl = false;
                                        nstream = serverStream;
                                }
                        } catch (Exception ex) {
index b2ecd95b45aa6b1e70790764ce476274e793bc56..e4f47a5d363dc9a8f593bb3602ad8a577d5caab5 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 #if SECURITY_DEP
+#if MONO_X509_ALIAS
+extern alias PrebuiltSystem;
+#endif
 
-#if MONOTOUCH || MONODROID
-using MSX = Mono.Security.X509;
+#if MONO_X509_ALIAS
+using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 #else
-extern alias MonoSecurity;
-using MSX = MonoSecurity::Mono.Security.X509;
+using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 #endif
 
 using System;
@@ -44,6 +46,9 @@ namespace System.Security.Cryptography.X509Certificates {
                [DllImport (SecurityLibrary)]
                extern static /* OSStatus */ int SecTrustCreateWithCertificates (IntPtr certOrCertArray, IntPtr policies, out IntPtr sectrustref);
                
+               [DllImport (SecurityLibrary)]
+               extern static /* OSStatus */ int SecTrustSetAnchorCertificates (IntPtr /* SecTrustRef */ trust, IntPtr /* CFArrayRef */ anchorCertificates);
+
                [DllImport (SecurityLibrary)]
                extern static IntPtr SecPolicyCreateSSL ([MarshalAs (UnmanagedType.I1)] bool server, IntPtr cfStringHostname);
                
@@ -93,24 +98,28 @@ namespace System.Security.Cryptography.X509Certificates {
                        }
                }
                
-               public static SecTrustResult TrustEvaluateSsl (X509Certificate2Collection certificates, string host)
+               public static SecTrustResult TrustEvaluateSsl (XX509CertificateCollection certificates, XX509CertificateCollection anchors, string host)
                {
                        if (certificates == null)
                                return SecTrustResult.Deny;
 
                        try {
-                               return _TrustEvaluateSsl (certificates, host);
+                               return _TrustEvaluateSsl (certificates, anchors, host);
                        } catch {
                                return SecTrustResult.Deny;
                        }
                }
 
-               static SecTrustResult _TrustEvaluateSsl (X509Certificate2Collection certificates, string hostName)
+               static SecTrustResult _TrustEvaluateSsl (XX509CertificateCollection certificates, XX509CertificateCollection anchors, string hostName)
                {
                        int certCount = certificates.Count;
+                       int anchorCount = anchors != null ? anchors.Count : 0;
                        IntPtr [] cfDataPtrs = new IntPtr [certCount];
                        IntPtr [] secCerts = new IntPtr [certCount];
+                       IntPtr [] cfDataAnchorPtrs = new IntPtr [anchorCount];
+                       IntPtr [] secCertAnchors = new IntPtr [anchorCount];
                        IntPtr certArray = IntPtr.Zero;
+                       IntPtr anchorArray = IntPtr.Zero;
                        IntPtr sslsecpolicy = IntPtr.Zero;
                        IntPtr host = IntPtr.Zero;
                        IntPtr sectrust = IntPtr.Zero;
@@ -118,33 +127,61 @@ namespace System.Security.Cryptography.X509Certificates {
 
                        try {
                                for (int i = 0; i < certCount; i++)
-                                       cfDataPtrs [i] = MakeCFData (certificates [i].RawData);
+                                       cfDataPtrs [i] = MakeCFData (certificates [i].GetRawCertData ());
+                               for (int i = 0; i < anchorCount; i++)
+                                       cfDataAnchorPtrs [i] = MakeCFData (anchors [i].GetRawCertData ());
                                
                                for (int i = 0; i < certCount; i++){
                                        secCerts [i] = SecCertificateCreateWithData (IntPtr.Zero, cfDataPtrs [i]);
                                        if (secCerts [i] == IntPtr.Zero)
                                                return SecTrustResult.Deny;
                                }
+
+                               for (int i = 0; i < anchorCount; i++) {
+                                       secCertAnchors [i] = SecCertificateCreateWithData (IntPtr.Zero, cfDataAnchorPtrs [i]);
+                                       if (secCertAnchors [i] == IntPtr.Zero)
+                                               return SecTrustResult.Deny;
+                               }
+
                                certArray = FromIntPtrs (secCerts);
+
                                host = CFStringCreateWithCharacters (IntPtr.Zero, hostName, (IntPtr) hostName.Length);
                                sslsecpolicy = SecPolicyCreateSSL (true, host);
 
                                int code = SecTrustCreateWithCertificates (certArray, sslsecpolicy, out sectrust);
-                               if (code == 0)
-                                       code = SecTrustEvaluate (sectrust, out result);
+                               if (code != 0)
+                                       return SecTrustResult.Deny;
+
+                               if (anchorCount > 0) {
+                                       anchorArray = FromIntPtrs (secCertAnchors);
+                                       SecTrustSetAnchorCertificates (sectrust, anchorArray);
+                               }
+
+                               code = SecTrustEvaluate (sectrust, out result);
                                return result;
                        } finally {
                                for (int i = 0; i < certCount; i++)
                                        if (cfDataPtrs [i] != IntPtr.Zero)
                                                CFRelease (cfDataPtrs [i]);
 
+                               for (int i = 0; i < anchorCount; i++)
+                                       if (cfDataAnchorPtrs [i] != IntPtr.Zero)
+                                               CFRelease (cfDataAnchorPtrs [i]);
+
                                if (certArray != IntPtr.Zero)
                                        CFRelease (certArray);
+
+                               if (anchorArray != IntPtr.Zero)
+                                       CFRelease (anchorArray);
                                
                                for (int i = 0; i < certCount; i++)
                                        if (secCerts [i] != IntPtr.Zero)
                                                CFRelease (secCerts [i]);
 
+                               for (int i = 0; i < anchorCount; i++)
+                                       if (secCertAnchors [i] != IntPtr.Zero)
+                                               CFRelease (secCertAnchors [i]);
+
                                if (sslsecpolicy != IntPtr.Zero)
                                        CFRelease (sslsecpolicy);
                                if (host != IntPtr.Zero)
index 073a6c1be3a384897b919fc65e7cb997e3ddac1d..1f55b8c861d75222f1eb5df76088dc728001c232 100644 (file)
@@ -626,6 +626,7 @@ Mono.Net.Security/MonoTlsProviderImpl.cs
 Mono.Net.Security/MonoTlsProviderWrapper.cs
 Mono.Net.Security/MonoTlsStream.cs
 Mono.Net.Security/NoReflectionHelper.cs
+Mono.Net.Security/SystemCertificateValidator.cs
 
 ReferenceSources/AssertWrapper.cs
 ReferenceSources/BinaryCompatibility.cs
index e690d71853c634075ee582418d4266a3d500b4e4..1f010668d722f454e024aecb54db05e68905f3a6 100644 (file)
@@ -76,11 +76,11 @@ namespace System {
                }
 
 #if SECURITY_DEP
-               internal static bool TrustEvaluateSsl (X509Certificate2Collection collection, object sender, X509Certificate2 certificate, X509Chain chain, SslPolicyErrors errors)
+               internal static bool TrustEvaluateSsl (X509CertificateCollection collection)
                {
                        var certsRawData = new List <byte[]> (collection.Count);
                        foreach (var cert in collection)
-                               certsRawData.Add (cert.RawData);
+                               certsRawData.Add (cert.GetRawCertData ());
                        return trustEvaluateSsl (certsRawData);
                }
 #endif  // SECURITY_DEP
index 822bced92518cc7066b3ea109dd0b391c5db27df..ab2901624e48fbb2e754d53d046ceb1fdadd0f3d 100644 (file)
@@ -774,5 +774,23 @@ namespace MonoTests.System.Net {
                        var c = new TcpClient ("localhost", port);
                        h.Stop ();
                }
+
+               // Test case for bug #31209
+               [Test]
+               public void Test_EmptyLineAtStart ()
+               {
+                       var listener = HttpListener2Test.CreateAndStartListener ("http://127.0.0.1:9124/");
+                       var ns = HttpListener2Test.CreateNS (9124);
+
+                       HttpListener2Test.Send (ns, "\r\nGET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n");
+
+                       bool timedout;
+                       HttpListener2Test.GetContextWithTimeout (listener, 1000, out timedout);
+
+                       Assert.IsFalse (timedout, "timed out");
+
+                       ns.Close ();
+                       listener.Close ();
+               }
        }
 }
index b8e7bdb8b321e1c29ba38899603ccf37b671a6fc..270ea6b23047769a05dd0539873ba973bb78b5f0 100644 (file)
@@ -361,6 +361,7 @@ Mono.Net.Security/MonoTlsProviderImpl.cs
 Mono.Net.Security/MonoTlsProviderWrapper.cs
 Mono.Net.Security/MonoTlsStream.cs
 Mono.Net.Security/NoReflectionHelper.cs
+Mono.Net.Security/SystemCertificateValidator.cs
 
 ReferenceSources/AssertWrapper.cs
 ReferenceSources/Internal.cs
index e07d2e85b62917446160a44c05574c47afa90d0f..7b6b4923842067847bc9a421e96aae5ad1db0672 100644 (file)
@@ -248,7 +248,7 @@ namespace System
 
                        info.AddValue ("ClassName", ClassName);
                        info.AddValue ("Message", _message);
-                       info.AddValue ("InnerException", inner_exception);
+                       info.AddValue ("InnerException", inner_exception, typeof (Exception));
                        info.AddValue ("HelpURL", help_link);
                        info.AddValue ("StackTraceString", StackTrace);
                        info.AddValue ("RemoteStackTraceString", _remoteStackTraceString);
index 622396e2212603ef33fc28e3a51f09cd89cb606d..8be40d46b9a604c42c2b0d1527bc2186ec9b3ea1 100644 (file)
@@ -15,7 +15,7 @@ using System.Security.Principal;
 using System.Threading;
 using System.Reflection;
 using System.Collections.Generic;
-using System.Diagnostics;
+using SD = System.Diagnostics;
 
 using NUnit.Framework;
 
@@ -1257,7 +1257,7 @@ namespace MonoTests.System.Threading
                public void GetStackTraces () {
                        var m = typeof (Thread).GetMethod ("Mono_GetStackTraces", BindingFlags.NonPublic|BindingFlags.Static);
                        if (m != null) {
-                               var res = (Dictionary<Thread,StackTrace>)typeof (Thread).GetMethod ("Mono_GetStackTraces", BindingFlags.NonPublic|BindingFlags.Static).Invoke (null, null);
+                               var res = (Dictionary<Thread,SD.StackTrace>)typeof (Thread).GetMethod ("Mono_GetStackTraces", BindingFlags.NonPublic|BindingFlags.Static).Invoke (null, null);
                                foreach (var t in res.Keys) {
                                        var st = res [t].ToString ();
                                }
index 537604ec2b73a8ea6bd62446e47732f0f48d8b20..f41b62c1df16551fd182a6094d6ebab18aecd8c7 100644 (file)
@@ -16,8 +16,7 @@ namespace MonoTests.System
        [TestFixture]
        public class MathTest
        {
-               private static double double_epsilon =
-                       double.Epsilon;
+               private static double double_epsilon = 2.2204460492503131e-16; /* DBL_EPSILON = 2^-52 */
 
                static double x = 0.1234;
                static double y = 12.345;
@@ -481,7 +480,6 @@ namespace MonoTests.System
                public void TestPow ()
                {
                        double precision;
-                       int iTest = 1;
 #if MONODROID
                        // It fails on Nexus 9 with
                        //
index c46fbc92f5477cee2195e0fed0b33adc6d53505e..e07fdcaf6e6437c1a4a39bb53cfc2283bdb25918 100644 (file)
@@ -1095,6 +1095,7 @@ namespace Mono.CSharp
                                                case Token.DECIMAL:
                                                case Token.BOOL:
                                                case Token.STRING:
+                                               case Token.SBYTE:
                                                        return Token.OPEN_PARENS_CAST;
                                                }
                                        }
index f3bde1607cbb59d7728eccb21143b870dda1fc0f..ba58d1f1380ebbb95642eab2d2d03541b839967e 100644 (file)
@@ -1408,6 +1408,10 @@ namespace Mono.CSharp {
 
                protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
                {
+                       // Goto to unreachable label
+                       if (label == null)
+                               return true;
+
                        if (fc.AddReachedLabel (label))
                                return true;
 
@@ -1424,12 +1428,12 @@ namespace Mono.CSharp {
 
                        if (try_finally != null) {
                                if (try_finally.FinallyBlock.HasReachableClosingBrace) {
-                                       label.AddGotoReference (rc, false);
+                                       label.AddGotoReference (rc);
                                } else {
-                                       label.AddGotoReference (rc, true);
+                                       label = null;
                                }
                        } else {
-                               label.AddGotoReference (rc, false);
+                               label.AddGotoReference (rc);
                        }
 
                        return Reachability.CreateUnreachable ();
@@ -1442,8 +1446,9 @@ namespace Mono.CSharp {
 
                protected override void DoEmit (EmitContext ec)
                {
+                       // This should only happen for goto from try block to unrechable label
                        if (label == null)
-                               throw new InternalErrorException ("goto emitted before target resolved");
+                               return;
 
                        Label l = label.LabelTarget (ec);
 
@@ -1478,7 +1483,6 @@ namespace Mono.CSharp {
                string name;
                bool defined;
                bool referenced;
-               bool finalTarget;
                Label label;
                Block block;
                
@@ -1525,9 +1529,6 @@ namespace Mono.CSharp {
                {
                        LabelTarget (ec);
                        ec.MarkLabel (label);
-
-                       if (finalTarget)
-                               ec.Emit (OpCodes.Br_S, label);
                }
 
                protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
@@ -1549,7 +1550,7 @@ namespace Mono.CSharp {
                        return rc;
                }
 
-               public void AddGotoReference (Reachability rc, bool finalTarget)
+               public void AddGotoReference (Reachability rc)
                {
                        if (referenced)
                                return;
@@ -1557,17 +1558,6 @@ namespace Mono.CSharp {
                        referenced = true;
                        MarkReachable (rc);
 
-                       //
-                       // Label is final target when goto jumps out of try block with
-                       // finally clause. In that case we need leave with target but in C#
-                       // terms the label is unreachable. Using finalTarget we emit
-                       // explicit label not just marker
-                       //
-                       if (finalTarget) {
-                               this.finalTarget = true;
-                               return;
-                       }
-
                        block.ScanGotoJump (this);
                }
 
@@ -2992,18 +2982,30 @@ namespace Mono.CSharp {
                                if (end_unreachable) {
                                        bool after_goto_case = goto_flow_analysis && s is GotoCase;
 
-                                       for (++startIndex; startIndex < statements.Count; ++startIndex) {
-                                               s = statements[startIndex];
-                                               if (s is SwitchLabel) {
-                                                       if (!after_goto_case)
-                                                               s.FlowAnalysis (fc);
+                                       var f = s as TryFinally;
+                                       if (f != null && !f.FinallyBlock.HasReachableClosingBrace) {
+                                               //
+                                               // Special case for try-finally with unreachable code after
+                                               // finally block. Try block has to include leave opcode but there is
+                                               // no label to leave to after unreachable finally block closing
+                                               // brace. This sentinel ensures there is always IL instruction to
+                                               // leave to even if we know it'll never be reached.
+                                               //
+                                               statements.Insert (startIndex + 1, new SentinelStatement ());
+                                       } else {
+                                               for (++startIndex; startIndex < statements.Count; ++startIndex) {
+                                                       s = statements [startIndex];
+                                                       if (s is SwitchLabel) {
+                                                               if (!after_goto_case)
+                                                                       s.FlowAnalysis (fc);
 
-                                                       break;
-                                               }
+                                                               break;
+                                                       }
 
-                                               if (s.IsUnreachable) {
-                                                       s.FlowAnalysis (fc);
-                                                       statements [startIndex] = RewriteUnreachableStatement (s);
+                                                       if (s.IsUnreachable) {
+                                                               s.FlowAnalysis (fc);
+                                                               statements [startIndex] = RewriteUnreachableStatement (s);
+                                                       }
                                                }
                                        }
 
@@ -3043,7 +3045,7 @@ namespace Mono.CSharp {
                        // L:
                        //      v = 1;
 
-                       if (s is BlockVariable || s is EmptyStatement)
+                       if (s is BlockVariable || s is EmptyStatement || s is SentinelStatement)
                                return s;
 
                        return new EmptyStatement (s.loc);
@@ -8210,4 +8212,23 @@ namespace Mono.CSharp {
                        return visitor.Visit (this);
                }
        }
+
+       class SentinelStatement: Statement
+       {
+               protected override void CloneTo (CloneContext clonectx, Statement target)
+               {
+               }
+
+               protected override void DoEmit (EmitContext ec)
+               {
+                       var l = ec.DefineLabel ();
+                       ec.MarkLabel (l);
+                       ec.Emit (OpCodes.Br_S, l);
+               }
+
+               protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
 }
index 45d03a328a7594325bb797c3cfc42f5aca1b1c24..d8fee033830cf1a65ea14b44a462ef8c0dc6eb77 100644 (file)
@@ -165,6 +165,11 @@ public class ConditionalParsing
                var t = (Object)string.Empty;
        }
 
+       void Test_21 ()
+       {
+               var t = (Int32)sbyte.MaxValue;
+       }
+
        static void Helper<T> (T arg)
        {
        }
diff --git a/mcs/tests/test-930.cs b/mcs/tests/test-930.cs
new file mode 100644 (file)
index 0000000..daf7b2a
--- /dev/null
@@ -0,0 +1,63 @@
+using System;
+
+class X
+{
+       public static int Main ()
+       {
+               try {
+                       Test1 ();
+                       return 1;
+               } catch (ApplicationException) {
+               }
+
+               try {
+                       Test2 ();
+                       return 2;
+               } catch (ApplicationException) {
+               }
+
+               try {
+                       Test3 ();
+                       return 3;
+               } catch (ApplicationException) {
+               }
+
+               return 0;
+       }
+
+       static void Test1 ()
+       {
+               try
+               {
+               }
+               finally
+               {
+                       throw new ApplicationException ();
+               }
+       }
+
+       static void Test2 ()
+       {
+               try
+               {
+               }
+               catch
+               {
+               }
+               finally
+               {
+                       throw new ApplicationException ();
+               }
+       }
+
+       static void Test3 ()
+       {
+               try
+               {
+                       throw new ApplicationException ();
+               }
+               finally
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-null-operator-19.cs b/mcs/tests/test-null-operator-19.cs
new file mode 100644 (file)
index 0000000..16a536e
--- /dev/null
@@ -0,0 +1,26 @@
+using System;
+
+class C
+{
+       public S Acceleration { get; set;}
+}
+
+struct S
+{
+       public double X;
+}
+
+class X
+{
+       public static int Main ()
+       {
+               var c = new C();
+
+               var g = c?.Acceleration.X;
+               Console.WriteLine (g.GetType ());
+               if (g.GetType () != typeof(double))
+                       return 1;
+
+               return 0;
+       }
+}
\ No newline at end of file
index 52dcbe508f5f26f548d9977ed8025aef5b71b192..b56a09422e550b974ee2f5f34930c23ebb56c00e 100644 (file)
       <method name="Void Test_20()" attrs="129">
         <size>8</size>
       </method>
+      <method name="Void Test_21()" attrs="129">
+        <size>5</size>
+      </method>
     </type>
   </test>
   <test name="gtest-410.cs">
   <test name="test-505.cs">
     <type name="T">
       <method name="Int32 f()" attrs="145">
-        <size>20</size>
+        <size>22</size>
       </method>
       <method name="Void Main()" attrs="150">
         <size>37</size>
       </method>
     </type>
   </test>
+  <test name="test-930.cs">
+    <type name="X">
+      <method name="Int32 Main()" attrs="150">
+        <size>73</size>
+      </method>
+      <method name="Void Test1()" attrs="145">
+        <size>17</size>
+      </method>
+      <method name="Void Test2()" attrs="145">
+        <size>25</size>
+      </method>
+      <method name="Void Test3()" attrs="145">
+        <size>11</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-94.cs">
     <type name="Base">
       <method name="Int32 IVehicle.Start()" attrs="481">
     </type>
     <type name="Tester+&lt;TestException_4&gt;c__async3">
       <method name="Void MoveNext()" attrs="486">
-        <size>239</size>
+        <size>236</size>
       </method>
     </type>
     <type name="Tester+&lt;TestException_5&gt;c__async4">
index a0fe3934cac49a2b6e37f020a10d14b5033355bb..6a797c16e4ecd0baeb9d8ac9945c2729f4a9a84b 100644 (file)
@@ -129,15 +129,24 @@ namespace Mono.Linker.Steps {
                        return new Regex (pattern.Replace(".", @"\.").Replace("*", "(.*)"));
                }
 
+               void MatchType (TypeDefinition type, Regex regex, XPathNavigator nav)
+               {
+                       if (regex.Match (type.FullName).Success)
+                               ProcessType (type, nav);
+
+                       if (!type.HasNestedTypes)
+                               return;
+
+                       foreach (var nt in type.NestedTypes)
+                               MatchType (nt, regex, nav);
+               }
+
                void ProcessTypePattern (string fullname, AssemblyDefinition assembly, XPathNavigator nav)
                {
                        Regex regex = CreateRegexFromPattern (fullname);
 
                        foreach (TypeDefinition type in assembly.MainModule.Types) {
-                               if (!regex.Match (type.FullName).Success)
-                                       continue;
-
-                               ProcessType (type, nav);
+                               MatchType (type, regex, nav);
                        }
                }
 
index 54bb7ffdb51d9be60191ea4a70d3becbe24db516..8d1488a5ac87b2523b9d8ed925dc51db92bb7d2e 100644 (file)
@@ -7,6 +7,7 @@ using Mono.Options;
 
 namespace Mono.Documentation
 {
+       [Obsolete ("This functionality is no longer supported.")]
        public class MDocPreserve : MDocCommand
        {
                MDocUpdater updater;
@@ -18,6 +19,8 @@ namespace Mono.Documentation
 
                public override void Run (IEnumerable<string> args)
                {
+                       Message (System.Diagnostics.TraceLevel.Warning, "This functionality is no longer supported, and will be removed in a future release.");
+
                        string preserveName = string.Empty;
                        var p = new OptionSet () { { "name=",
                                        "Root {DIRECTORY} to generate/update documentation.",
index 1d32ae1b0bae491313a0ca6a6365f0d8f1c473f0..5575d4461fccba102de1a5c1cb171674be112b65 100644 (file)
@@ -67,6 +67,10 @@ install-pcl-targets:
        $(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.VisualBasic.targets
        $(INSTALL_DATA) targets/Microsoft.Portable.Core.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.targets
        $(INSTALL_DATA) targets/Microsoft.Portable.Core.props $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.props
+       $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6
+       $(INSTALL_DATA) targets/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6/Microsoft.Portable.Common.targets
+       $(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6/Microsoft.Portable.CSharp.targets
+       $(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.6/Microsoft.Portable.VisualBasic.targets
 
 install-web-targets:
        $(MKINSTALLDIRS) $(DESTDIR)$(VS_TARGETS_DIR)/v9.0/WebApplications
index 9e219a3b61f84fd86b40dd52f95fc3a15847360e..4c3cd243520ea41e3330a8f5bb811b8bd03ff736 100644 (file)
@@ -137,6 +137,42 @@ typedef enum {
        s390_fpc = 256,
 } S390SpecialRegister;
 
+typedef enum {
+       s390_VR0 = 0,
+       s390_VR1 = 1,
+       s390_VR2 = 2,
+       s390_VR3 = 3,
+       s390_VR4 = 4,
+       s390_VR5 = 5,
+       s390_VR6 = 6,
+       s390_VR7 = 7,
+       s390_VR8 = 8,
+       s390_VR9 = 9,
+       s390_VR10 = 10,
+       s390_VR11 = 11,
+       s390_VR12 = 12,
+       s390_VR13 = 13,
+       s390_VR14 = 14,
+       s390_VR15 = 15,
+       s390_VR16 = 16,
+       s390_VR17 = 17,
+       s390_VR18 = 18,
+       s390_VR19 = 19,
+       s390_VR20 = 20,
+       s390_VR21 = 21,
+       s390_VR22 = 22,
+       s390_VR23 = 23,
+       s390_VR24 = 24,
+       s390_VR25 = 25,
+       s390_VR26 = 26,
+       s390_VR27 = 27,
+       s390_VR28 = 28,
+       s390_VR29 = 29,
+       s390_VR30 = 30,
+       s390_VR31 = 31,
+       s390_VR_NREG = 32,
+} s390_VR_Reg_No;
+
 #define s390_is_imm16(val)             ((glong)val >= (glong) SHRT_MIN && \
                                         (glong)val <= (glong) SHRT_MAX)
 #define s390_is_imm32(val)             ((glong)val >= (glong) INT_MIN && \
@@ -205,12 +241,34 @@ typedef struct {
        int     im;
 } I_Format;
 
+typedef struct {
+       short   op;
+       char    xx;
+       char    ri1 : 4;
+       char    ri2 : 4;
+} IE_Format;
+
+typedef struct {
+       short   op;
+       short   m1 : 4;
+       short   ri2 : 12;
+       short   i3;     
+} MII_Format;
+
 typedef struct {
        char    op;
        char    r1 : 4;
        char    r2 : 4;
 } RR_Format;
 
+typedef struct {
+       short   op;
+       char    r1 : 4;
+       char    xx : 4;
+       char    r3 : 4;
+       char    r4 : 4;
+} __attribute__ ((packed)) RRD_Format;
+
 typedef struct {
        short   op;
        char    xx;
@@ -251,29 +309,30 @@ typedef struct {
 } RRF_Format_4;
 
 typedef struct {
-       char    op;
+       char    op1;
        char    r1 : 4;
-       char    x2 : 4;
-       char    b2 : 4;
-       short   d2 : 12;
-} RX_Format;
+       char    r2 : 4;
+       short   b4 : 4;
+       short   d4 : 12;
+       char    m3 : 4;
+       char    xx : 4;
+       char    op2;
+} RRS_Format;
 
 typedef struct {
-       char    op1;
+       char    op;
        char    r1 : 4;
        char    x2 : 4;
-       char    b2 : 4;
-       int     d2 : 12;
-       char    xx;
-       char    op2;
-} RXE_Format;
+       short   b2 : 4;
+       short   d2 : 12;
+} RX_Format;
 
 typedef struct {
        char    op1;
        char    r3 : 4;
        char    x2 : 4;
-       char    b2 : 4;
-       int     d2 : 12;
+       short   b2 : 4;
+       short   d2 : 12;
        char    r1 : 4;
        char    xx : 4;
        char    op2;
@@ -283,7 +342,7 @@ typedef struct {
        char    op1;
        char    r1 : 4;
        char    x2 : 4;
-       char    b2 : 4;
+       int     b2 : 4;
        int     d2 : 20;
        char    op2;
 } __attribute__ ((packed)) RXY_Format;
@@ -292,32 +351,34 @@ typedef struct {
        char    op;
        char    r1 : 4;
        char    r3 : 4;
-       char    b2 : 4;
-       int     d2 : 12;
+       short   b2 : 4;
+       short   d2 : 12;
 } RS_Format_1;
 
 typedef struct {
        char    op;
        char    r1 : 4;
        char    m3 : 4;
-       char    b2 : 4;
-       int     d2 : 12;
+       short   b2 : 4;
+       short   d2 : 12;
 } RS_Format_2;
 
 typedef struct {
        char    op;
        char    r1 : 4;
        char    xx : 4;
-       char    b2 : 4;
-       int     d2 : 12;
+       short   b2 : 4;
+       short   dl2 : 12;
+       char    dh2;
 } RS_Format_3;
 
 typedef struct {
        char    op1;
        char    r1 : 4;
        char    r3 : 4;
-       char    b2 : 4;
-       int     d2 : 20;
+       short   b2 : 4;
+       short   dl2 : 12;
+       char    dh2;
        char    op2;
 } __attribute__ ((packed)) RSY_Format_1;
 
@@ -325,8 +386,9 @@ typedef struct {
        char    op1;
        char    r1 : 4;
        char    m3 : 4;
-       char    b2 : 4;
-       int     d2 : 20;
+       short   b2 : 4;
+       short   dl2 : 12;
+       char    dh2;
        char    op2;
 } __attribute__ ((packed)) RSY_Format_2;
 
@@ -334,25 +396,25 @@ typedef struct {
        char    op1;
        char    l1 : 4;
        char    xx : 4;
-       char    b1 : 4;
-       int     d1 : 12;
+       short   b1 : 4;
+       short   d1 : 12;
        char    yy;
        char    op2;
-} RSL_Format;
+} __attribute__ ((packed)) RSL_Format;
 
 typedef struct {
        char    op;
        char    r1 : 4;
        char    r3 : 4;
        short   i2;
-} RSI_Format;
+} __attribute__ ((packed)) RSI_Format;
 
 typedef struct {
        char    op1;
        char    m1 : 4;
        char    op2 : 4;
        short   i2;
-} RI_Format;
+} __attribute__ ((packed)) RI_Format;
 
 typedef struct {
        char    op1;
@@ -361,7 +423,7 @@ typedef struct {
        short   i2;
        char    xx;
        char    op2;
-} RIE_Format_1;
+} __attribute__ ((packed)) RIE_Format_1;
 
 typedef struct {
        char    op1;
@@ -371,7 +433,7 @@ typedef struct {
        char    m2 : 4;
        char    xx : 4;
        char    op2;
-} RIE_Format_2;
+} __attribute__ ((packed)) RIE_Format_2;
 
 typedef struct {
        char    op1;
@@ -380,7 +442,7 @@ typedef struct {
        short   d;
        char    i;
        char    op2;
-} RIE_Format_3;
+} __attribute__ ((packed)) RIE_Format_3;
 
 typedef struct {
        char    op1;
@@ -390,7 +452,45 @@ typedef struct {
        char    m3 : 4;
        char    xx : 4;
        char    op2;
-} RIE_Format_4;
+} __attribute__ ((packed)) RIE_Format_4;
+
+typedef struct {
+       char    op1;
+       char    r1 : 4;
+       char    r3 : 4;
+       short   ri2;
+       char    xx;
+       char    op2;
+} __attribute__ ((packed)) RIE_Format_5;
+
+typedef struct {
+       char    op1;
+       char    r1 : 4;
+       char    r2 : 4;
+       char    i3;
+       char    i4;
+       char    i5;
+       char    op2;
+} __attribute__ ((packed)) RIE_Format_6;
+
+typedef struct {
+       char    op1;
+       char    r1 : 4;
+       char    m3 : 4;
+       short   i2;
+       char    xx;
+       char    op2;
+} __attribute__ ((packed)) RIE_Format_7;
+
+typedef struct {
+       char    op1;
+       char    r1 : 4;
+       char    m3 : 4;
+       int     b4 : 4;
+       int     d4 : 12;
+       char    i2;
+       char    op2;
+} __attribute__ ((packed)) RIS_Format;
 
 typedef struct {
        char    op1;
@@ -406,12 +506,30 @@ typedef struct {
        int     i2;
 } __attribute__ ((packed)) RIL_Format_2;
 
+typedef struct {
+       short   op1;
+       char    r1 : 4;
+       char    x2 : 4;
+       short   b2 : 4;
+       short   d1 : 12;
+       char    m3 : 4;
+       char    xx : 4;
+       char    op2;
+} __attribute__ ((packed)) RXE_Format;
+
 typedef struct {
        char    op;
        char    i2;
+       short   b1 : 4;
+       short   d1 : 12;
+} __attribute__ ((packed)) SI_Format;
+
+typedef struct {
+       short   op;
        char    b1 : 4;
        short   d1 : 12;
-} SI_Format;
+       short   i2;
+} __attribute__ ((packed)) SIL_Format;
 
 typedef struct {
        char    op1;
@@ -421,50 +539,59 @@ typedef struct {
        char    op2;
 } __attribute__ ((packed)) SIY_Format;
 
+typedef struct {
+       char    op1;
+       char    m1 : 4;
+       char    xx : 4;
+       short   b3 : 4;
+       short   d3 : 12;
+       short   ri2;
+} __attribute__ ((packed)) SMI_Format;
+
 typedef struct {
        short   op;
-       char    b2 : 4;
+       short   b2 : 4;
        short   d2 : 12;
-} S_Format;
+} __attribute__ ((packed)) S_Format;
 
 typedef struct {
        char    op;
        char    ll;
-       char    b1 : 4;
+       short   b1 : 4;
        short   d1 : 12;
-       char    b2 : 4;
+       short   b2 : 4;
        short   d2 : 12;
-} SS_Format_1;
+} __attribute__ ((packed)) SS_Format_1;
 
 typedef struct {
        char    op;
        char    l1 : 4;
        char    l2 : 4;
-       char    b1 : 4; 
+       short   b1 : 4; 
        short   d1 : 12;
-       char    b2 : 4;
+       short   b2 : 4;
        short   d2 : 12;
-} SS_Format_2;
+} __attribute__ ((packed)) SS_Format_2;
 
 typedef struct {
        char    op;
        char    r1 : 4;
        char    r3 : 4;
-       char    b1 : 4; 
+       short   b1 : 4; 
        short   d1 : 12;
-       char    b2 : 4;
+       short   b2 : 4;
        short   d2 : 12;
-} SS_Format_3; 
+} __attribute__ ((packed)) SS_Format_3;        
 
 typedef struct {
        char    op;
        char    r1 : 4;
        char    r3 : 4;
-       char    b2 : 4; 
+       short   b2 : 4; 
        short   d2 : 12;
-       char    b4 : 4;
+       short   b4 : 4;
        short   d4 : 12;
-} SS_Format_4; 
+} __attribute__ ((packed)) SS_Format_4;        
 
 typedef struct {
        short   op;
@@ -484,6 +611,189 @@ typedef struct {
        short   d2 : 12;
 } __attribute__ ((packed)) SSF_Format;
 
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    xx : 4;
+       short   i2;
+       char    m3 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRIa_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    xx : 4;
+       char    i2;
+       char    i3;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRIb_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v3 : 4;
+       short   i2;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRIc_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    v3 : 4;
+       char    xx : 4;
+       char    i4;
+       char    m5 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRId_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       short   i3 : 12;
+       char    m5 : 4;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRIe_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    xx;
+       char    m5 : 4;
+       char    m4 : 4;
+       char    m3 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRRa_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    v3 : 4;
+       char    xx : 4;
+       char    m5 : 4;
+       char    yy : 4;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRRb_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    v3 : 4;
+       char    xx : 4;
+       char    m5 : 4;
+       char    m4 : 4;
+       char    m3 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRRc_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    v3 : 4;
+       char    m5 : 4;
+       char    m6 : 4;
+       char    xx : 4;
+       char    v4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRRd_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    v3 : 4;
+       char    m6 : 4;
+       char    xx : 4;
+       char    m5 : 4;
+       char    v4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRRe_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    r2 : 4;
+       char    r3 : 4;
+       short   xx;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRRf_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v3 : 4;
+       char    b2 : 4;
+       short   d2 : 12;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRSa_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    r3 : 4;
+       char    b2 : 4;
+       short   d2 : 12;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRSb_Format;
+
+typedef struct {
+       short   op1;
+       char    r1 : 4;
+       char    v3 : 4;
+       char    b2 : 4;
+       short   d2 : 12;
+       char    m4 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRSc_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    v2 : 4;
+       char    b2 : 4;
+       short   d2 : 12;
+       char    m3 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRV_Format;
+
+typedef struct {
+       short   op1;
+       char    v1 : 4;
+       char    x2 : 4;
+       char    b2 : 4;
+       short   d2 : 12;
+       char    m3 : 4;
+       char    rxb : 4;
+       char    op2;
+} __attribute__ ((packed)) VRX_Format;
+
 #define s390_emit16(c, x) do                   \
 {                                              \
        *((guint16 *) c) = (guint16) x;         \
@@ -677,6 +987,140 @@ typedef struct {
        s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff)));                  \
 } while (0)
 
+#define S390_VRIa(c,opc,v1,i2,m3) do                           \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4));          \
+       s390_emit16(c, (i2));                                           \
+       s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRIb(c,opc,v1,i2,i3,m4) do                                \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4));          \
+       s390_emit16(c, (((i2) << 8) | (i3)));                           \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRIc(c,opc,v1,v3,i2,m4) do                                \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) |            \
+                  (((v3) > 15) << 5);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, (v4));                                           \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRId(c,opc,v1,v2,v3,i4,m5) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) |            \
+                  (((v3) > 15) << 5);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, ((v3) << 12) | (i2));                            \
+       s390_emit16(c, (((m5) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRIe(c,opc,v1,v2,i3,m4,m5) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6);             \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, ((i2) << 8) | (m5));                             \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRRa(c,opc,v1,v2,m3,m4,m5) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6);             \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, ((m5) << 4) | (m4));                             \
+       s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRRb(c,opc,v1,v2,v3,m4,m5) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) |            \
+                  (((v3) > 15) << 5);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, ((v3) << 12) | ((m5) << 4) | (m4));              \
+       s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRRc(c,opc,v1,v2,m3,m4,m5) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) |            \
+                  (((v3) > 15) << 5);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, (((v3) << 12)| (m5) << 4));                      \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRRd(c,opc,v1,v2,v3,v4,m5,m6) do                          \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) |            \
+                  (((v3) > 15) << 5) | (((v4) > 15) << 4);             \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, (((v3) << 12)| ((m6) << 8)) | ((m5) << 4));      \
+       s390_emit16(c, (((v4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRRe(c,opc,v1,v2,v3,m4,m5,m6) do                          \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) |            \
+                  (((v3) > 15) << 5);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, (((v3) << 12)| ((m6) << 8)) | (m5));             \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRRf(c,opc,v1,r2) do                                      \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6);             \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, ((r2) << 12)| ((r3) << r8) | (m5));              \
+       s390_emit16(c, (((rxb) << 8) | ((opc) & 0xff)));                \
+} while (0)
+
+#define S390_VRSa(c,opc,v1,v3,b2,d2,m4) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6);             \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v3))); \
+       s390_emit16(c, ((b2) << 12)| (d2));                             \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRSb(c,opc,v1,r3,b2,d2,m4) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((r3))); \
+       s390_emit16(c, ((b2) << 12)| (d2));                             \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRSc(c,opc,r1,v3,b2,d2,m4) do                             \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7);                                  \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((r1) << 4) | ((v3))); \
+       s390_emit16(c, ((b2) << 12)| (d2));                             \
+       s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRV(c,opc,v1,v2,b2,d2,m3) do                              \
+{                                                                      \
+       char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6);             \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \
+       s390_emit16(c, ((b2) << 12)| (d2));                             \
+       s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
+#define S390_VRX(c,opc,v1,x2,b2,d2,m3) do                              \
+{                                                                      \
+       char rxb = ((v1) > 15) << 7;                                    \
+       s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((x2))); \
+       s390_emit16(c, ((b2) << 12)| (d2));                             \
+       s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \
+} while (0)
+
 #define s390_a(c, r, x, b, d)          S390_RX(c, 0x5a, r, x, b, d)
 #define s390_adb(c, r, x, b, d)                S390_RXE(c, 0xed1a, r, x, b, d)
 #define s390_adbr(c, r1, r2)           S390_RRE(c, 0xb31a, r1, r2)
index a78324d012f8f136f75fb2a059b6d53b0dc2b4b0..c034e8fc71bd09996e397f8bce965ffeeecf054d 100755 (executable)
@@ -1322,13 +1322,13 @@ get_type (MonoImage *m, const char *ptr, char **result, gboolean is_def, MonoGen
        }
 
        default:
-               t = mono_metadata_parse_type_full (m, container, MONO_PARSE_TYPE, 0, start, &ptr);
+               t = mono_metadata_parse_type_full (m, container, 0, start, &ptr);
                if (t) {
                        *result = dis_stringify_type (m, t, is_def);
                } else {
                        GString *err = g_string_new ("@!#$<InvalidType>$#!@");
                        if (container)
-                               t = mono_metadata_parse_type_full (m, NULL, MONO_PARSE_TYPE, 0, start, &ptr);
+                               t = mono_metadata_parse_type_full (m, NULL, 0, start, &ptr);
                        if (t) {
                                char *name = dis_stringify_type (m, t, is_def);
                                g_warning ("Encountered a generic type inappropriate for its context");
index 20b8b7c9797e99e384a30f4de95aacf7fa4e106f..4d4a51cd8e77fedf3e286e921b33e2cb2adb4e17 100644 (file)
@@ -980,7 +980,7 @@ dis_property_signature (MonoImage *m, guint32 prop_idx, MonoGenericContainer *co
                g_string_append (res, "instance ");
        ptr++;
        pcount = mono_metadata_decode_value (ptr, &ptr);
-       type = mono_metadata_parse_type_full (m, container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+       type = mono_metadata_parse_type_full (m, container, 0, ptr, &ptr);
        blurb = dis_stringify_type (m, type, TRUE);
        if (prop_flags & 0x0200)
                g_string_append (res, "specialname ");
@@ -993,7 +993,7 @@ dis_property_signature (MonoImage *m, guint32 prop_idx, MonoGenericContainer *co
        for (i = 0; i < pcount; i++) {
                if (i)
                        g_string_append (res, ", ");
-               param = mono_metadata_parse_type_full (m, container, MONO_PARSE_PARAM, 0, ptr, &ptr);
+               param = mono_metadata_parse_type_full (m, container, 0, ptr, &ptr);
                blurb = dis_stringify_param (m, param);
                g_string_append (res, blurb);
                g_free (blurb);
index 94938f53704a8d4213ef0bd118ba658488cc124c..96e72675c6acfb4ee1ce40c83136c8b0a6d9da67 100644 (file)
@@ -1780,7 +1780,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
                        return FALSE;
                }
                pid = process_handle->id;
-               proc_name = process_handle->proc_name;
+               proc_name = g_strdup (process_handle->proc_name);
        }
        
 #if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__)
@@ -1798,6 +1798,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
                 */
                modules[0] = NULL;
                *needed = sizeof(gpointer);
+               g_free (proc_name);
                return TRUE;
        }
        mods = load_modules (fp);
@@ -1831,7 +1832,8 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
                free_procmodule (g_slist_nth_data (mods, i));
        }
        g_slist_free (mods);
-
+       g_free (proc_name);
+       
        return TRUE;
 }
 
index 540c2b94cf647416e3ff835678b41e4d44454795..ed83c055c01aaa0bfacfe048b83039d2f9263569 100644 (file)
@@ -180,7 +180,7 @@ mono_gc_base_init (void)
                        for (char **ptr = opts; ptr && *ptr; ptr ++) {
                                char *opt = *ptr;
                                if (!strcmp (opt, "do-not-finalize")) {
-                                       do_not_finalize = 1;
+                                       mono_do_not_finalize = 1;
                                } else if (!strcmp (opt, "log-finalizers")) {
                                        log_finalizers = 1;
                                }
@@ -840,7 +840,7 @@ create_allocator (int atype, int tls_key, gboolean slowpath)
        MonoMethod *res;
        MonoMethodSignature *csig;
        const char *name = NULL;
-       AllocatorWrapperInfo *info;
+       WrapperInfo *info;
 
        if (atype == ATYPE_FREEPTR) {
                name = slowpath ? "SlowAllocPtrfree" : "AllocPtrfree";
@@ -1038,15 +1038,14 @@ create_allocator (int atype, int tls_key, gboolean slowpath)
 
        mono_mb_emit_byte (mb, MONO_CEE_RET);
 
-       res = mono_mb_create_method (mb, csig, 8);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.alloc.gc_name = "boehm";
+       info->d.alloc.alloc_type = atype;
+
+       res = mono_mb_create (mb, csig, 8, info);
        mono_mb_free (mb);
        mono_method_get_header (res)->init_locals = FALSE;
 
-       info = mono_image_alloc0 (mono_defaults.corlib, sizeof (AllocatorWrapperInfo));
-       info->gc_name = "boehm";
-       info->alloc_type = atype;
-       mono_marshal_set_wrapper_info (res, info);
-
        return res;
 }
 
index 3bf13ec045e599e2e9b18527e40e7663f82b04e5..63ff5967f7c27ffe0e4263f4c91fde7ab6899a83 100644 (file)
@@ -1340,7 +1340,7 @@ mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
                        goto fail;
                }
 
-               ftype = mono_metadata_parse_type_full (m, container, MONO_PARSE_FIELD, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
+               ftype = mono_metadata_parse_type_full (m, container, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
                if (!ftype) {
                        if (mono_loader_get_last_error ()) /*FIXME plug the above to not leak errors*/
                                mono_error_set_from_loader_error (error);
@@ -10548,7 +10548,7 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
                mono_metadata_decode_value (sig, &sig);
                /* FIELD signature == 0x06 */
                g_assert (*sig == 0x06);
-               field->type = mono_metadata_parse_type_full (image, container, MONO_PARSE_FIELD, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
+               field->type = mono_metadata_parse_type_full (image, container, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
                if (!field->type)
                        mono_class_set_failure_from_loader_error (class, error, g_strdup_printf ("Could not load field %s type", field->name));
        }
index 0b288e960d7870eaea6159c48bb9721969fddfb1..8f4220eead563a11693368e78c18ec231a9d2806 100644 (file)
@@ -97,7 +97,7 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
        MonoPPDBFile *ppdb;
 
        if (raw_contents) {
-               ppdb_image = mono_image_open_from_data_internal ((char*)raw_contents, size, TRUE, NULL, FALSE, TRUE, NULL);
+               ppdb_image = mono_image_open_from_data_internal ((char*)raw_contents, size, TRUE, &status, FALSE, TRUE, NULL);
        } else {
                /* ppdb files drop the .exe/.dll extension */
                filename = mono_image_get_filename (image);
index 11c94b40f4e18e0387da1c170acb47d99e93cd45..c8c26200e084852d322867b2e59c7ba4abc37693 100644 (file)
@@ -191,12 +191,6 @@ void  mono_gc_finalize_threadpool_threads (void);
 
 /* fast allocation support */
 
-/* Accessible using mono_marshal_wrapper_info_from_wrapper () */
-typedef struct {
-       const char *gc_name;
-       int alloc_type;
-} AllocatorWrapperInfo;
-
 int mono_gc_get_aligned_size_for_allocator (int size);
 MonoMethod* mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box, gboolean known_instance_size);
 MonoMethod* mono_gc_get_managed_array_allocator (MonoClass *klass);
@@ -370,7 +364,9 @@ void mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer alts
 extern gboolean log_finalizers;
 
 /* If set, do not run finalizers. */
-extern gboolean do_not_finalize;
+extern gboolean mono_do_not_finalize;
+/* List of names of classes not to finalize. */
+extern gchar **mono_do_not_finalize_class_names;
 
 #endif /* __MONO_METADATA_GC_INTERNAL_H__ */
 
index 94fd827510296d02f912064e346d15ca42e1f941..39929e411f13a769324656a152486e2a0de182ec 100644 (file)
@@ -53,7 +53,8 @@ static gboolean gc_disabled = FALSE;
 static gboolean finalizing_root_domain = FALSE;
 
 gboolean log_finalizers = FALSE;
-gboolean do_not_finalize = FALSE;
+gboolean mono_do_not_finalize = FALSE;
+gchar **mono_do_not_finalize_class_names = NULL;
 
 #define mono_finalizer_lock() mono_mutex_lock (&finalizer_mutex)
 #define mono_finalizer_unlock() mono_mutex_unlock (&finalizer_mutex)
@@ -106,9 +107,6 @@ static gboolean suspend_finalizers = FALSE;
 void
 mono_gc_run_finalize (void *obj, void *data)
 {
-       if (do_not_finalize)
-               return;
-
        MonoObject *exc = NULL;
        MonoObject *o;
 #ifndef HAVE_SGEN_GC
@@ -120,10 +118,27 @@ mono_gc_run_finalize (void *obj, void *data)
        RuntimeInvokeFunction runtime_invoke;
 
        // This function is called from the innards of the GC, so our best alternative for now is to do polling here
-       MONO_SUSPEND_CHECK ();
+       mono_threads_safepoint ();
 
        o = (MonoObject*)((char*)obj + GPOINTER_TO_UINT (data));
 
+       if (mono_do_not_finalize) {
+               if (!mono_do_not_finalize_class_names)
+                       return;
+
+               size_t namespace_len = strlen (o->vtable->klass->name_space);
+               for (int i = 0; mono_do_not_finalize_class_names [i]; ++i) {
+                       const char *name = mono_do_not_finalize_class_names [i];
+                       if (strncmp (name, o->vtable->klass->name_space, namespace_len))
+                               break;
+                       if (name [namespace_len] != '.')
+                               break;
+                       if (strcmp (name + namespace_len + 1, o->vtable->klass->name))
+                               break;
+                       return;
+               }
+       }
+
        if (log_finalizers)
                g_log ("mono-gc-finalizers", G_LOG_LEVEL_DEBUG, "<%s at %p> Starting finalizer checks.", o->vtable->klass->name, o);
 
index a670e0fec5827cdd38e5faff90c2cd0bb82ebf60..c9b2131e70e97e32bc3228c6c103f1fe4d94b150 100644 (file)
@@ -1196,12 +1196,9 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i
        ptr++;
        param_count = mono_metadata_decode_value (ptr, &ptr);
 
-       inst = mono_metadata_parse_generic_inst (image, NULL, param_count, ptr, &ptr);
-       if (!inst) {
-               mono_loader_assert_no_error ();
-               mono_error_set_bad_image (error, image, "Cannot parse generic instance for methodspec 0x%08x", idx);
+       inst = mono_metadata_parse_generic_inst (image, NULL, param_count, ptr, &ptr, error);
+       if (!inst)
                return NULL;
-       }
 
        if (context && inst->is_open) {
                inst = mono_metadata_inflate_generic_inst (inst, context, error);
index 5504e83b3fdd2d304139ad864b708146916b8d7b..88f3125f070e69fc5185b9644639438fed0a7592 100644 (file)
@@ -241,12 +241,12 @@ mono_marshal_init (void)
                mono_cominterop_init ();
                mono_remoting_init ();
 
-#ifdef USE_COOP_GC
-               register_icall (mono_threads_prepare_blocking, "mono_threads_prepare_blocking", "ptr ptr", FALSE);
-               register_icall (mono_threads_finish_blocking, "mono_threads_finish_blocking", "void ptr ptr", FALSE);
-               register_icall (mono_threads_reset_blocking_start, "mono_threads_reset_blocking_start","ptr ptr", TRUE);
-               register_icall (mono_threads_reset_blocking_end, "mono_threads_reset_blocking_end","void ptr ptr", TRUE);
-#endif
+               if (mono_threads_is_coop_enabled ()) {
+                       register_icall (mono_threads_prepare_blocking, "mono_threads_prepare_blocking", "ptr ptr", FALSE);
+                       register_icall (mono_threads_finish_blocking, "mono_threads_finish_blocking", "void ptr ptr", FALSE);
+                       register_icall (mono_threads_reset_blocking_start, "mono_threads_reset_blocking_start","ptr ptr", TRUE);
+                       register_icall (mono_threads_reset_blocking_end, "mono_threads_reset_blocking_end","void ptr ptr", TRUE);
+               }
        }
 }
 
@@ -2402,10 +2402,7 @@ mono_mb_create_and_cache_full (GHashTable *cache, gpointer key,
                if (!res) {
                        res = newm;
                        g_hash_table_insert (cache, key, res);
-                       if (info)
-                               mono_marshal_set_wrapper_info (res, info);
-                       else
-                               mono_marshal_set_wrapper_info (res, key);
+                       mono_marshal_set_wrapper_info (res, info);
                        mono_marshal_unlock ();
                } else {
                        if (out_found)
@@ -2429,22 +2426,20 @@ mono_mb_create_and_cache (GHashTable *cache, gpointer key,
 MonoMethod *
 mono_marshal_method_from_wrapper (MonoMethod *wrapper)
 {
-       gpointer res;
+       MonoMethod *m;
        int wrapper_type = wrapper->wrapper_type;
        WrapperInfo *info;
 
        if (wrapper_type == MONO_WRAPPER_NONE || wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
                return wrapper;
 
+       info = mono_marshal_get_wrapper_info (wrapper);
+
        switch (wrapper_type) {
        case MONO_WRAPPER_REMOTING_INVOKE:
        case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK:
        case MONO_WRAPPER_XDOMAIN_INVOKE:
-       case MONO_WRAPPER_SYNCHRONIZED:
-       case MONO_WRAPPER_UNBOX:
-               res = mono_marshal_get_wrapper_info (wrapper);
-               if (res == NULL)
-                       return wrapper;
+               m = info->d.remoting.method;
                if (wrapper->is_inflated) {
                        MonoError error;
                        MonoMethod *result;
@@ -2452,19 +2447,21 @@ mono_marshal_method_from_wrapper (MonoMethod *wrapper)
                         * A method cannot be inflated and a wrapper at the same time, so the wrapper info
                         * contains an uninflated method.
                         */
-                       result = mono_class_inflate_generic_method_checked (res, mono_method_get_context (wrapper), &error);
+                       result = mono_class_inflate_generic_method_checked (m, mono_method_get_context (wrapper), &error);
                        g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
                        return result;
                }
-               return res;
+               return m;
+       case MONO_WRAPPER_SYNCHRONIZED:
+               return info->d.synchronized.method;
+       case MONO_WRAPPER_UNBOX:
+               return info->d.unbox.method;
        case MONO_WRAPPER_MANAGED_TO_NATIVE:
-               info = mono_marshal_get_wrapper_info (wrapper);
                if (info && (info->subtype == WRAPPER_SUBTYPE_NONE || info->subtype == WRAPPER_SUBTYPE_NATIVE_FUNC_AOT || info->subtype == WRAPPER_SUBTYPE_PINVOKE))
                        return info->d.managed_to_native.method;
                else
                        return NULL;
        case MONO_WRAPPER_RUNTIME_INVOKE:
-               info = mono_marshal_get_wrapper_info (wrapper);
                if (info && (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT || info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL))
                        return info->d.runtime_invoke.method;
                else
@@ -2477,11 +2474,9 @@ mono_marshal_method_from_wrapper (MonoMethod *wrapper)
 /*
  * mono_marshal_get_wrapper_info:
  *
- *   Retrieve the pointer stored by mono_marshal_set_wrapper_info. The type of data
- * returned depends on the wrapper type. It is usually a method, a class, or a
- * WrapperInfo structure.
+ *   Retrieve the WrapperInfo structure associated with WRAPPER.
  */
-gpointer
+WrapperInfo*
 mono_marshal_get_wrapper_info (MonoMethod *wrapper)
 {
        g_assert (wrapper->wrapper_type);
@@ -2492,12 +2487,11 @@ mono_marshal_get_wrapper_info (MonoMethod *wrapper)
 /*
  * mono_marshal_set_wrapper_info:
  *
- *   Store an arbitrary pointer inside the wrapper which is retrievable by 
- * mono_marshal_get_wrapper_info. The format of the data depends on the type of the
- * wrapper (method->wrapper_type).
+ *   Set the WrapperInfo structure associated with the wrapper
+ * method METHOD to INFO.
  */
 void
-mono_marshal_set_wrapper_info (MonoMethod *method, gpointer data)
+mono_marshal_set_wrapper_info (MonoMethod *method, WrapperInfo *info)
 {
        void **datav;
        /* assert */
@@ -2505,7 +2499,7 @@ mono_marshal_set_wrapper_info (MonoMethod *method, gpointer data)
                return;
 
        datav = ((MonoMethodWrapper *)method)->method_data;
-       datav [1] = data;
+       datav [1] = info;
 }
 
 WrapperInfo*
@@ -5625,10 +5619,11 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                conv_arg = mono_mb_add_local (mb, &klass->byval_arg);
 
                if (klass->delegate) {
-                       g_assert (!t->byref);
                        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
                        mono_mb_emit_op (mb, CEE_MONO_CLASSCONST, klass);
                        mono_mb_emit_ldarg (mb, argnum);
+                       if (t->byref)
+                               mono_mb_emit_byte (mb, CEE_LDIND_I);
                        mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_FTN_DEL));
                        mono_mb_emit_stloc (mb, conv_arg);
                        break;
@@ -5701,6 +5696,16 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                break;
 
        case MARSHAL_ACTION_MANAGED_CONV_OUT:
+               if (klass->delegate) {
+                       if (t->byref) {
+                               mono_mb_emit_ldarg (mb, argnum);
+                               mono_mb_emit_ldloc (mb, conv_arg);
+                               mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_DEL_FTN));
+                               mono_mb_emit_byte (mb, CEE_STIND_I);
+                               break;
+                       }
+               }
+
                if (t->byref) {
                        /* Check for null */
                        mono_mb_emit_ldloc (mb, conv_arg);
@@ -7060,9 +7065,7 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM
        int i, argnum, *tmp_locals;
        int type, param_shift = 0;
        static MonoMethodSignature *get_last_error_sig = NULL;
-#ifdef USE_COOP_GC
        int coop_gc_stack_dummy, coop_gc_var;
-#endif
 
        memset (&m, 0, sizeof (m));
        m.mb = mb;
@@ -7100,12 +7103,12 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM
                mono_mb_add_local (mb, sig->ret);
        }
 
-#ifdef USE_COOP_GC
-       /* local 4, dummy local used to get a stack address for suspend funcs */
-       coop_gc_stack_dummy = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-       /* local 5, the local to be used when calling the suspend funcs */
-       coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               /* local 4, dummy local used to get a stack address for suspend funcs */
+               coop_gc_stack_dummy = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+               /* local 5, the local to be used when calling the suspend funcs */
+               coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+       }
 
        if (mspecs [0] && mspecs [0]->native == MONO_NATIVE_CUSTOM) {
                /* Return type custom marshaling */
@@ -7134,11 +7137,11 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM
                emit_marshal (&m, i + param_shift, sig->params [i], mspecs [i + 1], tmp_locals [i], NULL, MARSHAL_ACTION_PUSH);
        }                       
 
-#ifdef USE_COOP_GC
-       mono_mb_emit_ldloc_addr (mb, coop_gc_stack_dummy);
-       mono_mb_emit_icall (mb, mono_threads_prepare_blocking);
-       mono_mb_emit_stloc (mb, coop_gc_var);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               mono_mb_emit_ldloc_addr (mb, coop_gc_stack_dummy);
+               mono_mb_emit_icall (mb, mono_threads_prepare_blocking);
+               mono_mb_emit_stloc (mb, coop_gc_var);
+       }
 
        /* call the native method */
        if (func_param) {
@@ -7184,11 +7187,11 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM
 #endif
        }               
 
-#ifdef USE_COOP_GC
-       mono_mb_emit_ldloc (mb, coop_gc_var);
-       mono_mb_emit_ldloc_addr (mb, coop_gc_stack_dummy);
-       mono_mb_emit_icall (mb, mono_threads_finish_blocking);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               mono_mb_emit_ldloc (mb, coop_gc_var);
+               mono_mb_emit_ldloc_addr (mb, coop_gc_stack_dummy);
+               mono_mb_emit_icall (mb, mono_threads_finish_blocking);
+       }
 
        /* convert the result */
        if (!sig->ret->byref) {
@@ -7689,9 +7692,7 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
        MonoMethodSignature *sig, *csig;
        int i, *tmp_locals;
        gboolean closed = FALSE;
-#ifdef USE_COOP_GC
        int coop_gc_var, coop_gc_dummy_local;
-#endif
 
        sig = m->sig;
        csig = m->csig;
@@ -7717,13 +7718,14 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
                /* allocate local 3 to store the return value */
                mono_mb_add_local (mb, sig->ret);
        }
-#ifdef USE_COOP_GC
-       /* local 4, the local to be used when calling the reset_blocking funcs */
-       /* tons of code hardcode 3 to be the return var */
-       coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-       /* local 5, the local used to get a stack address for suspend funcs */
-       coop_gc_dummy_local = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-#endif
+
+       if (mono_threads_is_coop_enabled ()) {
+               /* local 4, the local to be used when calling the reset_blocking funcs */
+               /* tons of code hardcode 3 to be the return var */
+               coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+               /* local 5, the local used to get a stack address for suspend funcs */
+               coop_gc_dummy_local = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+       }
 
        mono_mb_emit_icon (mb, 0);
        mono_mb_emit_stloc (mb, 2);
@@ -7735,12 +7737,12 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
        mono_mb_emit_byte (mb, CEE_MONO_JIT_ATTACH);
 
-#ifdef USE_COOP_GC
-       /* XXX can we merge reset_blocking_start with JIT_ATTACH above and save one call? */
-       mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
-       mono_mb_emit_icall (mb, mono_threads_reset_blocking_start);
-       mono_mb_emit_stloc (mb, coop_gc_var);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               /* XXX can we merge reset_blocking_start with JIT_ATTACH above and save one call? */
+               mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
+               mono_mb_emit_icall (mb, mono_threads_reset_blocking_start);
+               mono_mb_emit_stloc (mb, coop_gc_var);
+       }
 
        /* we first do all conversions */
        tmp_locals = alloca (sizeof (int) * sig->param_count);
@@ -7870,12 +7872,12 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
                }
        }
 
-#ifdef USE_COOP_GC
-       /* XXX merge reset_blocking_end with detach */
-       mono_mb_emit_ldloc (mb, coop_gc_var);
-       mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
-       mono_mb_emit_icall (mb, mono_threads_reset_blocking_end);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               /* XXX merge reset_blocking_end with detach */
+               mono_mb_emit_ldloc (mb, coop_gc_var);
+               mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
+               mono_mb_emit_icall (mb, mono_threads_reset_blocking_end);
+       }
 
        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
        mono_mb_emit_byte (mb, CEE_MONO_JIT_DETACH);
@@ -8786,6 +8788,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        MonoMethodBuilder *mb;
        MonoMethod *res;
        GHashTable *cache;
+       WrapperInfo *info;
        int i, pos, pos2, this_local, taken_local, ret_local = 0;
        MonoGenericContext *ctx = NULL;
        MonoMethod *orig_method = NULL;
@@ -8826,6 +8829,9 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
 
        mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_SYNCHRONIZED);
 
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.synchronized.method = method;
+
 #ifndef DISABLE_JIT
        mb->skip_visibility = 1;
        /* result */
@@ -8846,8 +8852,8 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
                mono_mb_emit_byte (mb, CEE_RET);
 #endif
 
-               res = mono_mb_create_and_cache (cache, method,
-                                                                               mb, sig, sig->param_count + 16);
+               res = mono_mb_create_and_cache_full (cache, method,
+                                                                                        mb, sig, sig->param_count + 16, info, NULL);
                mono_mb_free (mb);
 
                return res;
@@ -8949,11 +8955,11 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
 
        if (ctx) {
                MonoMethod *def;
-               def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+               def = mono_mb_create_and_cache_full (cache, method, mb, sig, sig->param_count + 16, info, NULL);
                res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
        } else {
-               res = mono_mb_create_and_cache (cache, method,
-                                                                               mb, sig, sig->param_count + 16);
+               res = mono_mb_create_and_cache_full (cache, method,
+                                                                                        mb, sig, sig->param_count + 16, info, NULL);
        }
        mono_mb_free (mb);
 
@@ -8972,6 +8978,7 @@ mono_marshal_get_unbox_wrapper (MonoMethod *method)
        MonoMethodBuilder *mb;
        MonoMethod *res;
        GHashTable *cache;
+       WrapperInfo *info;
 
        cache = get_cache (&mono_method_get_wrapper_cache (method)->unbox_wrapper_cache, mono_aligned_addr_hash, NULL);
 
@@ -8992,8 +8999,11 @@ mono_marshal_get_unbox_wrapper (MonoMethod *method)
        mono_mb_emit_byte (mb, CEE_RET);
 #endif
 
-       res = mono_mb_create_and_cache (cache, method,
-                                                                                mb, sig, sig->param_count + 16);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.unbox.method = method;
+
+       res = mono_mb_create_and_cache_full (cache, method,
+                                                                                mb, sig, sig->param_count + 16, info, NULL);
        mono_mb_free (mb);
 
        /* mono_method_print_code (res); */
@@ -9975,14 +9985,14 @@ mono_marshal_get_array_accessor_wrapper (MonoMethod *method)
        mono_mb_emit_byte (mb, CEE_RET);
 #endif
 
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ARRAY_ACCESSOR);
+       info->d.array_accessor.method = method;
+
        if (ctx) {
                MonoMethod *def;
-               def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+               def = mono_mb_create_and_cache_full (cache, method, mb, sig, sig->param_count + 16, info, NULL);
                res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
        } else {
-               info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ARRAY_ACCESSOR);
-               info->d.array_accessor.method = method;
-
                res = mono_mb_create_and_cache_full (cache, method,
                                                                                         mb, sig, sig->param_count + 16,
                                                                                         info, NULL);
@@ -11203,9 +11213,7 @@ mono_marshal_get_thunk_invoke_wrapper (MonoMethod *method)
        GHashTable *cache;
        MonoMethod *res;
        int i, param_count, sig_size, pos_leave;
-#ifdef USE_COOP_GC
        int coop_gc_var, coop_gc_dummy_local;
-#endif
 
        g_assert (method);
 
@@ -11214,7 +11222,6 @@ mono_marshal_get_thunk_invoke_wrapper (MonoMethod *method)
 
        cache = get_cache (&mono_method_get_wrapper_cache (method)->thunk_invoke_cache, mono_aligned_addr_hash, NULL);
 
-
        if ((res = mono_marshal_find_in_cache (cache, method)))
                return res;
 
@@ -11259,25 +11266,25 @@ mono_marshal_get_thunk_invoke_wrapper (MonoMethod *method)
        if (!MONO_TYPE_IS_VOID (sig->ret))
                mono_mb_add_local (mb, sig->ret);
 
-#ifdef USE_COOP_GC
-       /* local 4, the local to be used when calling the reset_blocking funcs */
-       /* tons of code hardcode 3 to be the return var */
-       coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-       /* local 5, the local used to get a stack address for suspend funcs */
-       coop_gc_dummy_local = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               /* local 4, the local to be used when calling the reset_blocking funcs */
+               /* tons of code hardcode 3 to be the return var */
+               coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+               /* local 5, the local used to get a stack address for suspend funcs */
+               coop_gc_dummy_local = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+       }
 
        /* clear exception arg */
        mono_mb_emit_ldarg (mb, param_count - 1);
        mono_mb_emit_byte (mb, CEE_LDNULL);
        mono_mb_emit_byte (mb, CEE_STIND_REF);
 
-#ifdef USE_COOP_GC
-       /* FIXME this is technically wrong as the callback itself must be executed in gc unsafe context. */
-       mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
-       mono_mb_emit_icall (mb, mono_threads_reset_blocking_start);
-       mono_mb_emit_stloc (mb, coop_gc_var);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               /* FIXME this is technically wrong as the callback itself must be executed in gc unsafe context. */
+               mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
+               mono_mb_emit_icall (mb, mono_threads_reset_blocking_start);
+               mono_mb_emit_stloc (mb, coop_gc_var);
+       }
 
        /* try */
        clause = mono_image_alloc0 (image, sizeof (MonoExceptionClause));
@@ -11348,12 +11355,12 @@ mono_marshal_get_thunk_invoke_wrapper (MonoMethod *method)
                        mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type (sig->ret));
        }
 
-#ifdef USE_COOP_GC
-       /* XXX merge reset_blocking_end with detach */
-       mono_mb_emit_ldloc (mb, coop_gc_var);
-       mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
-       mono_mb_emit_icall (mb, mono_threads_reset_blocking_end);
-#endif
+       if (mono_threads_is_coop_enabled ()) {
+               /* XXX merge reset_blocking_end with detach */
+               mono_mb_emit_ldloc (mb, coop_gc_var);
+               mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
+               mono_mb_emit_icall (mb, mono_threads_reset_blocking_end);
+       }
 
        mono_mb_emit_byte (mb, CEE_RET);
 #endif
index 49e555798c42c6e6fe23e6de201637a368048575..ff3c39ed251511f714e418a1baad5397dda8c095 100644 (file)
@@ -146,6 +146,10 @@ typedef struct {
        MonoMethod *method;
 } ManagedToNativeWrapperInfo;
 
+typedef struct {
+       MonoMethod *method;
+} SynchronizedWrapperInfo;
+
 typedef struct {
        MonoMethod *method;
 } SynchronizedInnerWrapperInfo;
@@ -166,6 +170,23 @@ typedef struct {
        MonoClass *klass;
 } ProxyWrapperInfo;
 
+typedef struct {
+       int nursery_bits;
+} WriteBarrierWrapperInfo;
+
+typedef struct {
+       const char *gc_name;
+       int alloc_type;
+} AllocatorWrapperInfo;
+
+typedef struct {
+       MonoMethod *method;
+} UnboxWrapperInfo;
+
+typedef struct {
+       MonoMethod *method;
+} RemotingWrapperInfo;
+
 /*
  * This structure contains additional information to uniquely identify a given wrapper
  * method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types
@@ -186,6 +207,8 @@ typedef struct {
                NativeToManagedWrapperInfo native_to_managed;
                /* MONO_WRAPPER_MANAGED_TO_NATIVE */
                ManagedToNativeWrapperInfo managed_to_native;
+               /* SYNCHRONIZED */
+               SynchronizedWrapperInfo synchronized;
                /* SYNCHRONIZED_INNER */
                SynchronizedInnerWrapperInfo synchronized_inner;
                /* GENERIC_ARRAY_HELPER */
@@ -196,6 +219,14 @@ typedef struct {
                ArrayAccessorWrapperInfo array_accessor;
                /* PROXY_ISINST etc. */
                ProxyWrapperInfo proxy;
+               /* WRITE_BARRIER */
+               WriteBarrierWrapperInfo wbarrier;
+               /* ALLOC */
+               AllocatorWrapperInfo alloc;
+               /* UNBOX */
+               UnboxWrapperInfo unbox;
+               /* MONO_WRAPPER_REMOTING_INVOKE/MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK/MONO_WRAPPER_XDOMAIN_INVOKE */
+               RemotingWrapperInfo remoting;
        } d;
 } WrapperInfo;
 
@@ -295,9 +326,9 @@ WrapperInfo*
 mono_wrapper_info_create (MonoMethodBuilder *mb, WrapperSubtype subtype);
 
 void
-mono_marshal_set_wrapper_info (MonoMethod *method, gpointer data);
+mono_marshal_set_wrapper_info (MonoMethod *method, WrapperInfo *info);
 
-gpointer
+WrapperInfo*
 mono_marshal_get_wrapper_info (MonoMethod *wrapper);
 
 MonoMethod *
index 57f9376738fef1c694b5e36db78c39c685612efa..710cdf0b5020e83f78a1075f428df17ffc3d8d91 100644 (file)
@@ -724,7 +724,6 @@ mono_metadata_parse_array_full              (MonoImage             *image,
 MONO_API MonoType *
 mono_metadata_parse_type_full               (MonoImage             *image,
                                             MonoGenericContainer  *container,
-                                            MonoParseTypeMode      mode,
                                             short                  opt_attrs,
                                             const char            *ptr,
                                             const char           **rptr);
@@ -760,7 +759,8 @@ mono_metadata_parse_generic_inst            (MonoImage             *image,
                                             MonoGenericContainer  *container,
                                             int                    count,
                                             const char            *ptr,
-                                            const char           **rptr);
+                                            const char           **rptr,
+                                                MonoError *error);
 
 MonoGenericInst *
 mono_metadata_get_generic_inst              (int                   type_argc,
@@ -896,5 +896,8 @@ mono_method_get_wrapper_cache (MonoMethod *method);
 MonoWrapperCaches*
 mono_method_get_wrapper_cache (MonoMethod *method);
 
+MonoType*
+mono_metadata_parse_type_checked (MonoImage *m, MonoGenericContainer *container, short opt_attrs, gboolean transient, const char *ptr, const char **rptr, MonoError *error);
+
 #endif /* __MONO_METADATA_INTERNALS_H__ */
 
index 4b56402b6ad4e7db3a544383a67aa59beaf225c5..a3b9257b848818d282574b1d8c525062f0e1fc87 100644 (file)
@@ -36,7 +36,7 @@ typedef struct {
 } MonoInflatedMethodSignature;
 
 static gboolean do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer *container, gboolean transient,
-                                        const char *ptr, const char **rptr);
+                                        const char *ptr, const char **rptr, MonoError *error);
 
 static gboolean do_mono_metadata_type_equal (MonoType *t1, MonoType *t2, gboolean signature_only);
 static gboolean mono_metadata_class_equal (MonoClass *c1, MonoClass *c2, gboolean signature_only);
@@ -1322,16 +1322,17 @@ mono_metadata_parse_custom_mod (MonoImage *m, MonoCustomMod *dest, const char *p
  */
 static MonoArrayType *
 mono_metadata_parse_array_internal (MonoImage *m, MonoGenericContainer *container,
-                                                                       gboolean transient, const char *ptr, const char **rptr)
+                                                                       gboolean transient, const char *ptr, const char **rptr, MonoError *error)
 {
        int i;
        MonoArrayType *array;
        MonoType *etype;
        
-       array = transient ? g_malloc0 (sizeof (MonoArrayType)) : mono_image_alloc0 (m, sizeof (MonoArrayType));
-       etype = mono_metadata_parse_type_full (m, container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+       etype = mono_metadata_parse_type_checked (m, container, 0, FALSE, ptr, &ptr, error); //FIXME this doesn't respect @transient
        if (!etype)
                return NULL;
+
+       array = transient ? g_malloc0 (sizeof (MonoArrayType)) : mono_image_alloc0 (m, sizeof (MonoArrayType));
        array->eklass = mono_class_from_mono_type (etype);
        array->rank = mono_metadata_decode_value (ptr, &ptr);
 
@@ -1356,7 +1357,13 @@ MonoArrayType *
 mono_metadata_parse_array_full (MonoImage *m, MonoGenericContainer *container,
                                                                const char *ptr, const char **rptr)
 {
-       return mono_metadata_parse_array_internal (m, container, FALSE, ptr, rptr);
+       MonoError error;
+       MonoArrayType *ret = mono_metadata_parse_array_internal (m, container, FALSE, ptr, rptr, &error);
+       if (!ret) {
+               mono_loader_set_error_from_mono_error (&error);
+               mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
+       }
+       return ret;
 }
 
 MonoArrayType *
@@ -1595,9 +1602,10 @@ mono_metadata_cleanup (void)
  * Returns: a #MonoType structure representing the decoded type.
  */
 static MonoType*
-mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container, MonoParseTypeMode mode,
+mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container,
                                                                   short opt_attrs, gboolean transient, const char *ptr, const char **rptr)
 {
+       MonoError error;
        MonoType *type, *cached;
        MonoType stype;
        gboolean byref = FALSE;
@@ -1677,7 +1685,9 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container
        type->byref = byref;
        type->pinned = pinned ? 1 : 0;
 
-       if (!do_mono_metadata_parse_type (type, m, container, transient, ptr, &ptr)) {
+       if (!do_mono_metadata_parse_type (type, m, container, transient, ptr, &ptr, &error)) {
+               mono_loader_set_error_from_mono_error (&error);
+               mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
                return NULL;
        }
 
@@ -1726,11 +1736,33 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container
        return type;
 }
 
+
+MonoType*
+mono_metadata_parse_type_checked (MonoImage *m, MonoGenericContainer *container,
+                                                          short opt_attrs, gboolean transient, const char *ptr, const char **rptr, MonoError *error)
+{
+       MonoType *ret;
+
+       mono_error_init (error);
+
+       ret = mono_metadata_parse_type_internal (m, container, opt_attrs, transient, ptr, rptr);
+
+       if (!ret) {
+               if (mono_loader_get_last_error ())
+                       mono_error_set_from_loader_error (error);
+               else
+                       mono_error_set_bad_image (error, m, "Could not parse type at %p due to unknown reasons", ptr);
+       }
+
+       return ret;
+}
+
+
 MonoType*
-mono_metadata_parse_type_full (MonoImage *m, MonoGenericContainer *container, MonoParseTypeMode mode,
+mono_metadata_parse_type_full (MonoImage *m, MonoGenericContainer *container,
                                                           short opt_attrs, const char *ptr, const char **rptr)
 {
-       return mono_metadata_parse_type_internal (m, container, mode, opt_attrs, FALSE, ptr, rptr);
+       return mono_metadata_parse_type_internal (m, container, opt_attrs, FALSE, ptr, rptr);
 }
 
 /*
@@ -1740,7 +1772,7 @@ MonoType*
 mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
                          const char *ptr, const char **rptr)
 {
-       return mono_metadata_parse_type_full (m, NULL, mode, opt_attrs, ptr, rptr);
+       return mono_metadata_parse_type_full (m, NULL, opt_attrs, ptr, rptr);
 }
 
 gboolean
@@ -2022,14 +2054,10 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
        method->generic_param_count = gen_param_count;
 
        if (call_convention != 0xa) {
-               method->ret = mono_metadata_parse_type_full (m, container, MONO_PARSE_RET, pattrs ? pattrs [0] : 0, ptr, &ptr);
+               method->ret = mono_metadata_parse_type_checked (m, container, pattrs ? pattrs [0] : 0, FALSE, ptr, &ptr, error);
                if (!method->ret) {
                        mono_metadata_free_method_signature (method);
                        g_free (pattrs);
-                       if (mono_loader_get_last_error ())
-                               mono_error_set_from_loader_error (error);
-                       else
-                               mono_error_set_bad_image (error, m, "Could not parse return type signature");
                        return NULL;
                }
                is_open = mono_class_is_open_constructed_type (method->ret);
@@ -2052,12 +2080,8 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
                        method->sentinelpos = i;
                        ptr++;
                }
-               method->params [i] = mono_metadata_parse_type_full (m, container, MONO_PARSE_PARAM, pattrs ? pattrs [i+1] : 0, ptr, &ptr);
+               method->params [i] = mono_metadata_parse_type_checked (m, container, pattrs ? pattrs [i+1] : 0, FALSE, ptr, &ptr, error);
                if (!method->params [i]) {
-                       if (mono_loader_get_last_error ())
-                               mono_error_set_from_loader_error (error);
-                       else
-                               mono_error_set_bad_image (error, m, "Could not parse type argument %d on method signature", i);
                        mono_metadata_free_method_signature (method);
                        g_free (pattrs);
                        return NULL;
@@ -2104,13 +2128,16 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
 MonoMethodSignature *
 mono_metadata_parse_method_signature (MonoImage *m, int def, const char *ptr, const char **rptr)
 {
+       /*
+        * This function MUST NOT be called by runtime code as it does error handling incorrectly.
+        * Use mono_metadata_parse_method_signature_full instead.
+        * It's ok to asser on failure as we no longer use it.
+        */
        MonoError error;
        MonoMethodSignature *ret;
        ret = mono_metadata_parse_method_signature_full (m, NULL, def, ptr, rptr, &error);
-       if (!ret) {
-               mono_loader_set_error_from_mono_error (&error);
-               mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
-       }
+       g_assert (mono_error_ok (&error));
+
        return ret;
 }
 
@@ -3079,16 +3106,17 @@ cleanup:
 
 MonoGenericInst *
 mono_metadata_parse_generic_inst (MonoImage *m, MonoGenericContainer *container,
-                                 int count, const char *ptr, const char **rptr)
+                                 int count, const char *ptr, const char **rptr, MonoError *error)
 {
        MonoType **type_argv;
        MonoGenericInst *ginst;
        int i;
 
+       mono_error_init (error);
        type_argv = g_new0 (MonoType*, count);
 
        for (i = 0; i < count; i++) {
-               MonoType *t = mono_metadata_parse_type_full (m, container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+               MonoType *t = mono_metadata_parse_type_checked (m, container, 0, FALSE, ptr, &ptr, error);
                if (!t) {
                        g_free (type_argv);
                        return NULL;
@@ -3108,23 +3136,28 @@ mono_metadata_parse_generic_inst (MonoImage *m, MonoGenericContainer *container,
 
 static gboolean
 do_mono_metadata_parse_generic_class (MonoType *type, MonoImage *m, MonoGenericContainer *container,
-                                     const char *ptr, const char **rptr)
+                                     const char *ptr, const char **rptr, MonoError *error)
 {
        MonoGenericInst *inst;
        MonoClass *gklass;
        MonoType *gtype;
        int count;
 
-       gtype = mono_metadata_parse_type (m, MONO_PARSE_TYPE, 0, ptr, &ptr);
+       mono_error_init (error);
+
+       // XXX how about transient?
+       gtype = mono_metadata_parse_type_checked (m, NULL, 0, FALSE, ptr, &ptr, error);
        if (gtype == NULL)
                return FALSE;
 
        gklass = mono_class_from_mono_type (gtype);
-       if (!gklass->generic_container)
+       if (!gklass->generic_container) {
+               mono_error_set_bad_image (error, m, "Generic instance with non-generic definition");
                return FALSE;
+       }
 
        count = mono_metadata_decode_value (ptr, &ptr);
-       inst = mono_metadata_parse_generic_inst (m, container, count, ptr, &ptr);
+       inst = mono_metadata_parse_generic_inst (m, container, count, ptr, &ptr, error);
        if (inst == NULL)
                return FALSE;
 
@@ -3171,12 +3204,14 @@ select_container (MonoGenericContainer *gc, MonoTypeEnum type)
  */
 static MonoGenericParam *
 mono_metadata_parse_generic_param (MonoImage *m, MonoGenericContainer *generic_container,
-                                  MonoTypeEnum type, const char *ptr, const char **rptr)
+                                  MonoTypeEnum type, const char *ptr, const char **rptr, MonoError *error)
 {
        int index = mono_metadata_decode_value (ptr, &ptr);
        if (rptr)
                *rptr = ptr;
 
+       mono_error_init (error);
+
        generic_container = select_container (generic_container, type);
        if (!generic_container) {
                /* Create dummy MonoGenericParam */
@@ -3189,9 +3224,14 @@ mono_metadata_parse_generic_param (MonoImage *m, MonoGenericContainer *generic_c
                return param;
        }
 
-       if (index >= generic_container->type_argc)
+       if (index >= generic_container->type_argc) {
+               mono_error_set_bad_image (error, m, "Invalid generic %s parameter index %d, max index is %d",
+                       generic_container->is_method ? "method" : "type",
+                       index, generic_container->type_argc);
                return NULL;
+       }
 
+       //This can't return NULL
        return mono_generic_container_get_param (generic_container, index);
 }
 
@@ -3230,8 +3270,10 @@ mono_metadata_get_shared_type (MonoType *type)
 }
 
 static gboolean
-compare_type_literals (int class_type, int type_type)
+compare_type_literals (MonoImage *image, int class_type, int type_type, MonoError *error)
 {
+       mono_error_init (error);
+
        /* byval_arg.type can be zero if we're decoding a type that references a class been loading.
         * See mcs/test/gtest-440. and #650936.
         * FIXME This better be moved to the metadata verifier as it can catch more cases.
@@ -3244,8 +3286,13 @@ compare_type_literals (int class_type, int type_type)
        if (class_type == type_type)
                return TRUE;
 
-       if (type_type == MONO_TYPE_CLASS)
-               return class_type == MONO_TYPE_STRING || class_type == MONO_TYPE_OBJECT;
+       if (type_type == MONO_TYPE_CLASS) {
+               if (class_type == MONO_TYPE_STRING || class_type == MONO_TYPE_OBJECT)
+                       return TRUE;
+               //XXX stringify this argument
+               mono_error_set_bad_image (error, image, "Expected reference type but got type kind %d", class_type);
+               return FALSE;
+       }
 
        g_assert (type_type == MONO_TYPE_VALUETYPE);
        switch (class_type) {
@@ -3266,10 +3313,31 @@ compare_type_literals (int class_type, int type_type)
        case MONO_TYPE_CLASS:
                return TRUE;
        default:
+               //XXX stringify this argument
+               mono_error_set_bad_image (error, image, "Expected value type but got type kind %d", class_type);
                return FALSE;
        }
 }
 
+static gboolean
+verify_var_type_and_container (MonoImage *image, int var_type, MonoGenericContainer *container, MonoError *error)
+{
+       mono_error_init (error);
+       if (var_type == MONO_TYPE_MVAR) {
+               if (!container->is_method) { //MVAR and a method container
+                       mono_error_set_bad_image (error, image, "MVAR parsed in a context without a method container");
+                       return FALSE;
+               }
+       } else {
+               if (!(!container->is_method || //VAR and class container
+                       (container->is_method && container->parent))) { //VAR and method container with parent
+                       mono_error_set_bad_image (error, image, "VAR parsed in a context without a class container");
+                       return FALSE;
+               }
+       }
+       return TRUE;
+}
+
 /* 
  * do_mono_metadata_parse_type:
  * @type: MonoType to be filled in with the return value
@@ -3293,9 +3361,10 @@ compare_type_literals (int class_type, int type_type)
  */
 static gboolean
 do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer *container,
-                                                        gboolean transient, const char *ptr, const char **rptr)
+                                                        gboolean transient, const char *ptr, const char **rptr, MonoError *error)
 {
-       gboolean ok = TRUE;
+       mono_error_init (error);
+
        type->type = mono_metadata_decode_value (ptr, &ptr);
        
        switch (type->type){
@@ -3322,67 +3391,68 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer
        case MONO_TYPE_CLASS: {
                guint32 token;
                MonoClass *class;
-               MonoError error;
                token = mono_metadata_parse_typedef_or_ref (m, ptr, &ptr);
-               class = mono_class_get_checked (m, token, &error);
+               class = mono_class_get_checked (m, token, error);
                type->data.klass = class;
-               if (!class) {
-                       mono_loader_set_error_from_mono_error (&error);
-                       mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
+               if (!class)
                        return FALSE;
-               }
-               if (!compare_type_literals (class->byval_arg.type, type->type))
+
+               if (!compare_type_literals (m, class->byval_arg.type, type->type, error))
                        return FALSE;
+
                break;
        }
        case MONO_TYPE_SZARRAY: {
-               MonoType *etype = mono_metadata_parse_type_full (m, container, MONO_PARSE_MOD_TYPE, 0, ptr, &ptr);
+               MonoType *etype = mono_metadata_parse_type_checked (m, container, 0, transient, ptr, &ptr, error);
                if (!etype)
                        return FALSE;
+
                type->data.klass = mono_class_from_mono_type (etype);
-               if (!type->data.klass)
-                       return FALSE;
+               g_assert (type->data.klass); //This was previously a check for NULL, but mcfmt should never fail. It can return a borken MonoClass, but should return at least something.
                break;
        }
-       case MONO_TYPE_PTR:
-               type->data.type = mono_metadata_parse_type_internal (m, container, MONO_PARSE_MOD_TYPE, 0, transient, ptr, &ptr);
+       case MONO_TYPE_PTR: {
+               type->data.type = mono_metadata_parse_type_checked (m, container, 0, transient, ptr, &ptr, error);
                if (!type->data.type)
                        return FALSE;
                break;
+       }
        case MONO_TYPE_FNPTR: {
-               MonoError error;
-               type->data.method = mono_metadata_parse_method_signature_full (m, container, 0, ptr, &ptr, &error);
-               if (!type->data.method) {
-                       mono_loader_set_error_from_mono_error (&error);
-                       mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
+               type->data.method = mono_metadata_parse_method_signature_full (m, container, 0, ptr, &ptr, error);
+               if (!type->data.method)
                        return FALSE;
-               }
                break;
        }
-       case MONO_TYPE_ARRAY:
-               type->data.array = mono_metadata_parse_array_internal (m, container, transient, ptr, &ptr);
+       case MONO_TYPE_ARRAY: {
+               type->data.array = mono_metadata_parse_array_internal (m, container, transient, ptr, &ptr, error);
                if (!type->data.array)
                        return FALSE;
                break;
+       }
        case MONO_TYPE_MVAR:
-               if (container && !container->is_method)
+       case MONO_TYPE_VAR: {
+               if (container && !verify_var_type_and_container (m, type->type, container, error))
                        return FALSE;
-       case MONO_TYPE_VAR:
-               type->data.generic_param = mono_metadata_parse_generic_param (m, container, type->type, ptr, &ptr);
+
+               type->data.generic_param = mono_metadata_parse_generic_param (m, container, type->type, ptr, &ptr, error);
                if (!type->data.generic_param)
                        return FALSE;
+
                break;
-       case MONO_TYPE_GENERICINST:
-               ok = do_mono_metadata_parse_generic_class (type, m, container, ptr, &ptr);
+       }
+       case MONO_TYPE_GENERICINST: {
+               if (!do_mono_metadata_parse_generic_class (type, m, container, ptr, &ptr, error))
+                       return FALSE;
                break;
+       }
        default:
-               g_warning ("type 0x%02x not handled in do_mono_metadata_parse_type on image %s", type->type, m->name);
+               mono_error_set_bad_image (error, m, "type 0x%02x not handled in do_mono_metadata_parse_type on image %s", type->type, m->name);
                return FALSE;
        }
        
        if (rptr)
                *rptr = ptr;
-       return ok;
+       return TRUE;
 }
 
 /*
@@ -3691,7 +3761,7 @@ mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *container, cons
                mh->num_locals = len;
                for (i = 0; i < len; ++i) {
                        mh->locals [i] = mono_metadata_parse_type_internal (m, container,
-                                                                                                                               MONO_PARSE_LOCAL, 0, TRUE, locals_ptr, &locals_ptr);
+                                                                                                                               0, TRUE, locals_ptr, &locals_ptr);
                        if (!mh->locals [i])
                                goto fail;
                }
@@ -5525,14 +5595,9 @@ mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, Mon
 
        mono_metadata_decode_value (ptr, &ptr);
 
-       type = mono_metadata_parse_type_internal (image, NULL, MONO_PARSE_TYPE, 0, TRUE, ptr, &ptr);
-       if (!type) {
-               if (mono_loader_get_last_error ())
-                       mono_error_set_from_loader_error (error);
-               else
-                       mono_error_set_bad_image (error, image, "Could not parse type spec %08x.", type_spec);
+       type = mono_metadata_parse_type_checked (image, NULL, 0, TRUE, ptr, &ptr, error);
+       if (!type)
                return NULL;
-       }
 
        type2 = mono_metadata_type_dup (image, type);
        mono_metadata_free_type (type);
index 63a6b680c0bb0056c6e70639847ce34886a43aa5..d1685bc3ddaa9c62be6f4d353d74db30fdeda055 100644 (file)
@@ -219,12 +219,13 @@ rehash (MonoGHashTable *hash)
        data.new_size = g_spaced_primes_closest (hash->in_use);
        data.table = mg_new0 (Slot *, data.new_size);
 
-#ifdef USE_COOP_GC
-       /* We cannot be preempted */
-       old_table = do_rehash (&data);
-#else
-       old_table = mono_gc_invoke_with_gc_lock (do_rehash, &data);
-#endif
+       if (!mono_threads_is_coop_enabled ()) {
+               old_table = mono_gc_invoke_with_gc_lock (do_rehash, &data);
+       } else {
+               /* We cannot be preempted */
+               old_table = do_rehash (&data);
+       }
+
        mg_free (old_table);
 }
 
index dcc60ecc5504a93656884ca5c78eb8ad47709457..8518b79309d12dfa2b8e08b68e10361da8754db3 100644 (file)
@@ -288,7 +288,7 @@ mono_marshal_remoting_find_in_cache (MonoMethod *method, int wrapper_type)
 /* Create the method from the builder and place it in the cache */
 static inline MonoMethod*
 mono_remoting_mb_create_and_cache (MonoMethod *key, MonoMethodBuilder *mb, 
-                                                               MonoMethodSignature *sig, int max_stack)
+                                                                  MonoMethodSignature *sig, int max_stack, WrapperInfo *info)
 {
        MonoMethod **res = NULL;
        MonoRemotingMethods *wrps;
@@ -319,7 +319,7 @@ mono_remoting_mb_create_and_cache (MonoMethod *key, MonoMethodBuilder *mb,
                mono_marshal_lock_internal ();
                if (!*res) {
                        *res = newm;
-                       mono_marshal_set_wrapper_info (*res, key);
+                       mono_marshal_set_wrapper_info (*res, info);
                        mono_marshal_unlock_internal ();
                } else {
                        mono_marshal_unlock_internal ();
@@ -392,6 +392,7 @@ mono_marshal_get_remoting_invoke (MonoMethod *method)
        MonoMethodBuilder *mb;
        MonoMethod *res;
        int params_var;
+       WrapperInfo *info;
 
        g_assert (method);
 
@@ -441,7 +442,9 @@ mono_marshal_get_remoting_invoke (MonoMethod *method)
        }
 #endif
 
-       res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.remoting.method = method;
+       res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16, info);
        mono_mb_free (mb);
 
        return res;
@@ -586,6 +589,7 @@ mono_marshal_get_xappdomain_dispatch (MonoMethod *method, int *marshal_types, in
        MonoExceptionClause *main_clause;
        int pos, pos_leave;
        gboolean copy_return;
+       WrapperInfo *info;
 
        if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_XDOMAIN_DISPATCH)))
                return res;
@@ -824,7 +828,9 @@ mono_marshal_get_xappdomain_dispatch (MonoMethod *method, int *marshal_types, in
        mono_mb_set_clauses (mb, 1, main_clause);
 #endif
 
-       res = mono_remoting_mb_create_and_cache (method, mb, csig, csig->param_count + 16);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.remoting.method = method;
+       res = mono_remoting_mb_create_and_cache (method, mb, csig, csig->param_count + 16, info);
        mono_mb_free (mb);
 
        return res;
@@ -848,6 +854,7 @@ mono_marshal_get_xappdomain_invoke (MonoMethod *method)
        int loc_old_domainid, loc_domainid, loc_return=0, loc_serialized_exc=0, loc_context;
        int pos, pos_dispatch, pos_noex;
        gboolean copy_return = FALSE;
+       WrapperInfo *info;
 
        g_assert (method);
        
@@ -1151,7 +1158,9 @@ mono_marshal_get_xappdomain_invoke (MonoMethod *method)
        mono_mb_emit_byte (mb, CEE_RET);
 #endif /* DISABLE_JIT */
 
-       res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.remoting.method = method;
+       res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16, info);
        mono_mb_free (mb);
 
        return res;
@@ -1190,6 +1199,7 @@ mono_marshal_get_remoting_invoke_with_check (MonoMethod *method)
        MonoMethodSignature *sig;
        MonoMethodBuilder *mb;
        MonoMethod *res, *native;
+       WrapperInfo *info;
        int i, pos, pos_rem;
 
        g_assert (method);
@@ -1236,7 +1246,9 @@ mono_marshal_get_remoting_invoke_with_check (MonoMethod *method)
        mono_mb_emit_byte (mb, CEE_RET);
 #endif
 
-       res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.remoting.method = method;
+       res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16, info);
        mono_mb_free (mb);
 
        return res;
index bd94f85cc4a0a3e002b6c489ff156146de2fca1d..c9d2236216af740bc4212c802cf4c2554eed95e4 100644 (file)
@@ -249,6 +249,7 @@ mono_gc_get_specific_write_barrier (gboolean is_concurrent)
        MonoMethodBuilder *mb;
        MonoMethodSignature *sig;
        MonoMethod **write_barrier_method_addr;
+       WrapperInfo *info;
 #ifdef MANAGED_WBARRIER
        int i, nursery_check_labels [2];
 #endif
@@ -327,6 +328,10 @@ mono_gc_get_specific_write_barrier (gboolean is_concurrent)
 #endif
 #endif
        res = mono_mb_create_method (mb, sig, 16);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       /* The generated barrier depends on this being the same at runtime */
+       info->d.wbarrier.nursery_bits = DEFAULT_NURSERY_BITS;
+       mono_marshal_set_wrapper_info (res, info);
        mono_mb_free (mb);
 
        LOCK_GC;
@@ -1052,7 +1057,7 @@ create_allocator (int atype, gboolean slowpath)
        static gboolean registered = FALSE;
        int tlab_next_addr_var, new_next_var;
        const char *name = NULL;
-       AllocatorWrapperInfo *info;
+       WrapperInfo *info;
        int num_params, i;
 
        if (!registered) {
@@ -1376,16 +1381,16 @@ create_allocator (int atype, gboolean slowpath)
        mono_mb_emit_byte (mb, CEE_RET);
 #endif
 
-       res = mono_mb_create_method (mb, csig, 8);
+       info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+       info->d.alloc.gc_name = "sgen";
+       info->d.alloc.alloc_type = atype;
+
+       res = mono_mb_create (mb, csig, 8, info);
        mono_mb_free (mb);
 #ifndef DISABLE_JIT
        mono_method_get_header (res)->init_locals = FALSE;
 #endif
 
-       info = mono_image_alloc0 (mono_defaults.corlib, sizeof (AllocatorWrapperInfo));
-       info->gc_name = "sgen";
-       info->alloc_type = atype;
-       mono_marshal_set_wrapper_info (res, info);
 
        return res;
 }
@@ -2911,7 +2916,11 @@ sgen_client_handle_gc_debug (const char *opt)
        if (!strcmp (opt, "xdomain-checks")) {
                sgen_mono_xdomain_checks = TRUE;
        } else if (!strcmp (opt, "do-not-finalize")) {
-               do_not_finalize = TRUE;
+               mono_do_not_finalize = TRUE;
+       } else if (g_str_has_prefix (opt, "do-not-finalize=")) {
+               opt = strchr (opt, '=') + 1;
+               mono_do_not_finalize = TRUE;
+               mono_do_not_finalize_class_names = g_strsplit (opt, ",", 0);
        } else if (!strcmp (opt, "log-finalizers")) {
                log_finalizers = TRUE;
        } else if (!strcmp (opt, "no-managed-allocator")) {
index 17d86487cb3f54ed069f287d39fdc8436fe521ee..8ef67fc7f43de429ece707aacc09571f7453ed08 100644 (file)
@@ -421,7 +421,7 @@ sgen_unified_suspend_stop_world (void)
                        - We haven't accepted the previous suspend as good.
                        - We haven't gave up on it for this STW (it's either bad or asked not to)
                        */
-                       if (!mono_threads_core_check_suspend_result (info)) {
+                       if (!mono_thread_info_check_suspend_result (info)) {
                                THREADS_STW_DEBUG ("[GC-STW-RESTART] SKIP thread %p failed to finish to suspend\n", mono_thread_info_get_tid (info));
                                info->client_info.skip = TRUE;
                        } else if (mono_thread_info_in_critical_location (info)) {
index 66c746b0da3e9fb00c81b0949dc3c91f1eb331e8..9622c7599dd75da07b8c5e65794f240bbaf00923 100644 (file)
@@ -108,7 +108,7 @@ void sgen_client_mark_togglerefs (char *start, char *end, ScanCopyContext ctx)
                        }
                }
        }
-       sgen_drain_gray_stack (-1, ctx);
+       sgen_drain_gray_stack (ctx);
 }
 
 void sgen_client_clear_togglerefs (char *start, char *end, ScanCopyContext ctx)
@@ -134,7 +134,7 @@ void sgen_client_clear_togglerefs (char *start, char *end, ScanCopyContext ctx)
                        }
                }
        }
-       sgen_drain_gray_stack (-1, ctx);
+       sgen_drain_gray_stack (ctx);
 }
 
 static void
index f8d36e36bd2d139e86c876862549351e24f44597..0b2efc361d21baaf7fc61ef5187342d269333282 100644 (file)
@@ -99,7 +99,7 @@
 static void
 abort_syscall (gpointer data)
 {
-       mono_thread_info_abort_socket_syscall_for_close ((MonoThreadInfo*) data);
+       mono_thread_info_abort_socket_syscall_for_close ((MonoNativeThreadId) (gsize) data);
 }
 
 static gint32
@@ -746,7 +746,7 @@ ves_icall_System_Net_Sockets_Socket_Accept_internal (SOCKET sock, gint32 *error,
 
        *error = 0;
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return NULL;
@@ -1197,7 +1197,7 @@ ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode,
        start = time (NULL);
 
        do {
-               mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+               mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
                if (interrupted) {
                        g_free (pfds);
                        *error = WSAEINTR;
@@ -1272,7 +1272,7 @@ ves_icall_System_Net_Sockets_Socket_Connect_internal (SOCKET sock, MonoObject *s
 
        LOGDEBUG (g_message("%s: connecting to %s port %d", __func__, inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), ntohs (((struct sockaddr_in *)sa)->sin_port)));
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return;
@@ -1362,7 +1362,7 @@ ves_icall_System_Net_Sockets_Socket_Disconnect_internal (SOCKET sock, MonoBoolea
                        _wapi_transmitfile = NULL;
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return;
@@ -1412,7 +1412,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_internal (SOCKET sock, MonoArray *bu
                return (0);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted)
                return 0;
 
@@ -1464,7 +1464,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_array_internal (SOCKET sock, MonoArr
                return(0);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return 0;
@@ -1521,7 +1521,7 @@ ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (SOCKET sock, MonoArray
                return (0);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                g_free(sa);
                *error = WSAEINTR;
@@ -1589,7 +1589,7 @@ ves_icall_System_Net_Sockets_Socket_Send_internal (SOCKET sock, MonoArray *buffe
                return (0);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return 0;
@@ -1635,7 +1635,7 @@ ves_icall_System_Net_Sockets_Socket_Send_array_internal(SOCKET sock, MonoArray *
                return(0);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return 0;
@@ -1697,7 +1697,7 @@ ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buff
                return (0);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                g_free (sa);
                *error = WSAEINTR;
@@ -1786,7 +1786,7 @@ ves_icall_System_Net_Sockets_Socket_Select_internal (MonoArray **sockets, gint32
        timeout = (timeout >= 0) ? (timeout / 1000) : -1;
        start = time (NULL);
        do {
-               mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+               mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
                if (interrupted) {
                        g_free (pfds);
                        *error = WSAEINTR;
@@ -2365,7 +2365,7 @@ ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock, gint32 how, g
 
        *error = 0;
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                *error = WSAEINTR;
                return;
@@ -2692,7 +2692,7 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *
                buffers.TailLength = mono_array_length (post_buffer);
        }
 
-       mono_thread_info_install_interrupt (abort_syscall, mono_thread_info_current (), &interrupted);
+       mono_thread_info_install_interrupt (abort_syscall, (gpointer) (gsize) mono_native_thread_id_get (), &interrupted);
        if (interrupted) {
                CloseHandle (file);
                SetLastError (WSAEINTR);
@@ -2748,15 +2748,11 @@ void
 icall_cancel_blocking_socket_operation (MonoThread *thread)
 {
        MonoInternalThread *internal;
-       MonoThreadInfo *info;
 
        internal = thread->internal_thread;
        g_assert (internal);
 
-       info = mono_thread_info_lookup (MONO_UINT_TO_NATIVE_THREAD_ID (internal->tid));
-       g_assert (info);
-
-       mono_thread_info_abort_socket_syscall_for_close (info);
+       mono_thread_info_abort_socket_syscall_for_close (MONO_UINT_TO_NATIVE_THREAD_ID (internal->tid));
 }
 
 #endif /* #ifndef DISABLE_SOCKETS */
index 6742fddc151c9a3f3704815c1749f03a9493fb70..f3d54ae9720c2c1c5b9b18061e71fc486cb76e98 100644 (file)
@@ -284,8 +284,8 @@ wait_callback (gint fd, gint events, gpointer user_data)
 
                        operations = get_operations_for_jobs (list);
 
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: res fd %3d, events = %2s | %2s | %2s",
-                               fd, (operations & EVENT_IN) ? "RD" : "..", (operations & EVENT_OUT) ? "WR" : "..");
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: res fd %3d, events = %2s | %2s | %3s",
+                               fd, (operations & EVENT_IN) ? "RD" : "..", (operations & EVENT_OUT) ? "WR" : "..", (operations & EVENT_ERR) ? "ERR" : "...");
 
                        threadpool_io->backend.register_fd (fd, operations, FALSE);
                } else {
@@ -344,8 +344,8 @@ selector_thread (gpointer data)
 
                                operations = get_operations_for_jobs (list);
 
-                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: %3s fd %3d, operations = %2s | %2s | %2s",
-                                       exists ? "mod" : "add", fd, (operations & EVENT_IN) ? "RD" : "..", (operations & EVENT_OUT) ? "WR" : "..");
+                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: %3s fd %3d, operations = %2s | %2s | %3s",
+                                       exists ? "mod" : "add", fd, (operations & EVENT_IN) ? "RD" : "..", (operations & EVENT_OUT) ? "WR" : "..", (operations & EVENT_ERR) ? "ERR" : "...");
 
                                threadpool_io->backend.register_fd (fd, operations, !exists);
 
index 4d0525998d5e285af8be54021c1096c52fb0dfa9..960894d8a35577ab7063fdbd3d1a48abf82bdf51 100755 (executable)
@@ -367,6 +367,16 @@ llvm_sources = \
 endif
 endif
 
+if ENABLE_LLVM
+llvm_runtime_sources = \
+       llvm-runtime.cpp
+else
+if ENABLE_LLVM_RUNTIME
+llvm_runtime_sources = \
+       llvm-runtime.cpp
+endif
+endif
+
 common_sources = \
        mini.c                  \
        mini-runtime.c  \
@@ -425,8 +435,7 @@ common_sources = \
        alias-analysis.c        \
        mini-cross-helpers.c \
        arch-stubs.c            \
-       llvm-runtime.h          \
-       llvm-runtime.cpp
+       llvm-runtime.h
 
 test_sources =                         \
        basic-calls.cs          \
@@ -539,7 +548,7 @@ os_sources = $(darwin_sources) $(posix_sources)
 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
 endif
 
-libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(arch_sources) $(os_sources)
+libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources)
 libmini_la_CFLAGS = $(mono_CFLAGS)
 
 libmonoboehm_2_0_la_SOURCES =
@@ -661,7 +670,7 @@ rcheck2: mono $(regtests)
        $(MINI_RUNTIME) --regression $(regtests)
 
 check-seq-points: mono $(regtests)
-       rm -f TestResults_op_il_seq_point.xml
+       rm -f TestResult-op_il_seq_point.xml
        for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
        for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
        $(srcdir)/test_op_il_seq_point_headerfooter.sh
@@ -764,7 +773,7 @@ docu: mini.sgm
 check-local: rcheck check-seq-points
 
 clean-local:
-       rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResults_op_il_seq_point.xml*
+       rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml*
 
 pkgconfigdir = $(libdir)/pkgconfig
 
index ab34c1bc49519fee6ff9c80ae6a0e409c322b321..509b9ef5897907c1af9e4d1a55cb741432157157 100644 (file)
@@ -2782,6 +2782,8 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                encode_value ((MONO_AOT_METHODREF_NO_AOT_TRAMPOLINE << 24), p, &p);
 
        if (method->wrapper_type) {
+               WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
                encode_value ((MONO_AOT_METHODREF_WRAPPER << 24), p, &p);
 
                encode_value (method->wrapper_type, p, &p);
@@ -2802,8 +2804,6 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                case MONO_WRAPPER_LDFLDA:
                case MONO_WRAPPER_STFLD:
                case MONO_WRAPPER_ISINST: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_klass_ref (acfg, info->d.proxy.klass, p, &p);
                        break;
@@ -2812,18 +2812,17 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                case MONO_WRAPPER_STFLD_REMOTE:
                        break;
                case MONO_WRAPPER_ALLOC: {
-                       AllocatorWrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        /* The GC name is saved once in MonoAotFileInfo */
-                       g_assert (info->alloc_type != -1);
-                       encode_value (info->alloc_type, p, &p);
+                       g_assert (info->d.alloc.alloc_type != -1);
+                       encode_value (info->d.alloc.alloc_type, p, &p);
                        break;
                }
-               case MONO_WRAPPER_WRITE_BARRIER:
+               case MONO_WRAPPER_WRITE_BARRIER: {
+                       g_assert (info);
+                       encode_value (info->d.wbarrier.nursery_bits, p, &p);
                        break;
+               }
                case MONO_WRAPPER_STELEMREF: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
                        if (info->subtype == WRAPPER_SUBTYPE_VIRTUAL_STELEMREF)
@@ -2831,8 +2830,6 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                        break;
                }
                case MONO_WRAPPER_UNKNOWN: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
                        if (info->subtype == WRAPPER_SUBTYPE_PTR_TO_STRUCTURE ||
@@ -2845,8 +2842,6 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                        break;
                }
                case MONO_WRAPPER_MANAGED_TO_NATIVE: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
                        if (info->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER) {
@@ -2870,8 +2865,6 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                        break;
                }
                case MONO_WRAPPER_MANAGED_TO_MANAGED: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
 
@@ -2886,15 +2879,11 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                        break;
                }
                case MONO_WRAPPER_CASTCLASS: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
                        break;
                }
                case MONO_WRAPPER_RUNTIME_INVOKE: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
                        encode_value (info->d.runtime_invoke.pass_rgctx, p, &p);
@@ -2923,8 +2912,6 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                        break;
                }
                case MONO_WRAPPER_NATIVE_TO_MANAGED: {
-                       WrapperInfo *info = mono_marshal_get_wrapper_info (method);
-
                        g_assert (info);
                        encode_method_ref (acfg, info->d.native_to_managed.method, p, &p);
                        encode_klass_ref (acfg, info->d.native_to_managed.klass, p, &p);
@@ -7317,6 +7304,26 @@ mono_aot_mark_unused_llvm_plt_entry (MonoJumpInfo *patch_info)
        plt_entry->llvm_used = FALSE;
 }
 
+char*
+mono_aot_get_direct_call_symbol (MonoJumpInfoType type, gconstpointer data)
+{
+       const char *sym = NULL;
+
+       if (llvm_acfg->aot_opts.direct_icalls) {
+               if (type == MONO_PATCH_INFO_JIT_ICALL_ADDR) {
+                       /* Call to a C function implementing a jit icall */
+                       sym = mono_lookup_jit_icall_symbol (data);
+               } else if (type == MONO_PATCH_INFO_ICALL_ADDR) {
+                       MonoMethod *method = (gpointer)data;
+                       if (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+                               sym = mono_lookup_icall_symbol (method);
+               }
+               if (sym)
+                       return g_strdup (sym);
+       }
+       return NULL;
+}
+
 char*
 mono_aot_get_plt_symbol (MonoJumpInfoType type, gconstpointer data)
 {
@@ -9631,6 +9638,9 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        if (mono_aot_mode_is_full (&acfg->aot_opts))
                acfg->flags |= MONO_AOT_FILE_FLAG_FULL_AOT;
 
+       if (mono_threads_is_coop_enabled ())
+               acfg->flags |= MONO_AOT_FILE_FLAG_SAFEPOINTS;
+
        if (acfg->aot_opts.instances_logfile_path) {
                acfg->instances_logfile = fopen (acfg->aot_opts.instances_logfile_path, "w");
                if (!acfg->instances_logfile) {
index ed80c9002a305b3964d7b011cd1f11bff281d497..1bd466e298688657350bad9ad181b1ac80fb076b 100644 (file)
@@ -52,7 +52,7 @@
 #include <mono/metadata/mono-endian.h>
 #include <mono/utils/mono-logger-internal.h>
 #include <mono/utils/mono-mmap.h>
-#include "mono/utils/mono-compiler.h"
+#include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-digest.h>
 
@@ -828,6 +828,7 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
        }
 
        if (image_index == MONO_AOT_METHODREF_WRAPPER) {
+               WrapperInfo *info;
                guint32 wrapper_type;
 
                wrapper_type = decode_value (p, &p);
@@ -893,9 +894,18 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                g_error ("Error: No managed allocator, but we need one for AOT.\nAre you using non-standard GC options?\n");
                        break;
                }
-               case MONO_WRAPPER_WRITE_BARRIER:
+               case MONO_WRAPPER_WRITE_BARRIER: {
+                       int nursery_bits = decode_value (p, &p);
+
                        ref->method = mono_gc_get_write_barrier ();
+                       if (ref->method) {
+                               /* Sanity check */
+                               info = mono_marshal_get_wrapper_info (ref->method);
+                               g_assert (info);
+                               g_assert (info->d.wbarrier.nursery_bits == nursery_bits);
+                       }
                        break;
+               }
                case MONO_WRAPPER_STELEMREF: {
                        int subtype = decode_value (p, &p);
 
@@ -903,7 +913,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                ref->method = mono_marshal_get_stelemref ();
                        } else if (subtype == WRAPPER_SUBTYPE_VIRTUAL_STELEMREF) {
                                int kind;
-                               WrapperInfo *info;
                                
                                kind = decode_value (p, &p);
 
@@ -987,7 +996,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
 
                                ref->method = mono_marshal_get_array_address (rank, elem_size);
                        } else if (subtype == WRAPPER_SUBTYPE_STRING_CTOR) {
-                               WrapperInfo *info;
                                MonoMethod *m;
 
                                m = decode_resolve_method_ref (module, p, &p);
@@ -1073,7 +1081,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                ref->method = mono_marshal_get_runtime_invoke (m, TRUE, pass_rgctx);
                        } else {
                                MonoMethodSignature *sig;
-                               WrapperInfo *info;
 
                                sig = decode_signature_with_target (module, NULL, p, &p);
                                info = mono_marshal_get_wrapper_info (target);
@@ -1134,8 +1141,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                        return FALSE;
 
                                if (wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
-                                       WrapperInfo *info;
-
                                        subtype = decode_value (p, &p);
                                        info = mono_marshal_get_wrapper_info (target);
                                        if (info) {
@@ -1651,7 +1656,7 @@ check_usable (MonoAssembly *assembly, MonoAotFileInfo *info, char **out_msg)
        char *build_info;
        char *msg = NULL;
        gboolean usable = TRUE;
-       gboolean full_aot;
+       gboolean full_aot, safepoints;
        guint8 *blob;
        guint32 excluded_cpu_optimizations;
 
@@ -1720,6 +1725,13 @@ check_usable (MonoAssembly *assembly, MonoAotFileInfo *info, char **out_msg)
                }
        }
 
+       safepoints = info->flags & MONO_AOT_FILE_FLAG_SAFEPOINTS;
+
+       if (!safepoints && mono_threads_is_coop_enabled ()) {
+               msg = g_strdup_printf ("not compiled with safepoints");
+               usable = FALSE;
+       }
+
        *out_msg = msg;
        return usable;
 }
@@ -1794,7 +1806,8 @@ init_amodule_got (MonoAotModule *amodule)
                        if (mono_defaults.corlib) {
                                MonoAotModule *mscorlib_amodule = mono_defaults.corlib->aot_module;
 
-                               amodule->shared_got [i] = mscorlib_amodule->got;
+                               if (mscorlib_amodule)
+                                       amodule->shared_got [i] = mscorlib_amodule->got;
                        } else {
                                amodule->shared_got [i] = amodule->got;
                        }
index 6b5d709f905d335e3fb4b37267dfce4527d97797..a6d4915ee3697032916385ff1f2e81d0e5f6ba34 100644 (file)
@@ -1263,7 +1263,7 @@ mono_optimize_branches (MonoCompile *cfg)
                for (previous_bb = cfg->bb_entry, bb = cfg->bb_entry->next_bb; bb; previous_bb = bb, bb = bb->next_bb) {
                        count ++;
                        if (count == 1000) {
-                               MONO_SUSPEND_CHECK ();
+                               mono_threads_safepoint ();
                                count = 0;
                        }
                        /* dont touch code inside exception clauses */
index 0bae69301bd1ba0eab51d6cf33e51a0ce8cfd76c..69cff0e2b48b258b12301966f2d33c80b21b3ee2 100644 (file)
@@ -393,3 +393,4 @@ long_and_imm: dest:i src1:i len:48
 long_or_imm: dest:i src1:i len:48
 long_xor_imm: dest:i src1:i len:48
 
+gc_safe_point: len:0
index d6047aa98df18ea116c7754eee85d1b060a459a7..608e5132daba33655b0910e5f7d6ffe4a93053f5 100644 (file)
@@ -455,3 +455,5 @@ mips_cond_exc_iov: src1:i src2:i len:44
 mips_cond_exc_ino: src1:i src2:i len:44
 mips_cond_exc_ic: src1:i src2:i len:44
 mips_cond_exc_inc: src1:i src2:i len:44
+
+gc_safe_point: len:0
index 8109c232b0b5aa61015222287733c4b25fbb4989..b2499e111307673c044c3daa4c4956281d59b679 100644 (file)
@@ -318,3 +318,5 @@ jump_table: dest:i len:8
 
 atomic_add_i4: src1:b src2:i dest:i len:28
 atomic_cas_i4: src1:b src2:i src3:i dest:i len:38
+
+gc_safe_point: len:0
index e0789c2845bb58f1185b4efb8e4350330dd654c9..d786bbad8fcc36e2a293eb5670aabf76360f42b6 100644 (file)
@@ -386,3 +386,5 @@ atomic_add_i4: src1:b src2:i dest:i len:28
 atomic_add_i8: src1:b src2:i dest:i len:28
 atomic_cas_i4: src1:b src2:i src3:i dest:i len:38
 atomic_cas_i8: src1:b src2:i src3:i dest:i len:38
+
+gc_safe_point: len:0
index cbb566b6676df06d5dfffb20d655412c6941b923..75d4d95d44dfd04fa006ce89261033ad40e7aeb9 100644 (file)
@@ -131,8 +131,8 @@ float_rem: dest:f src1:f src2:f len:16
 float_rem_un: dest:f src1:f src2:f len:16
 float_sub: dest:f src1:f src2:f len:6
 fmove: dest:f src1:f len:4
-move_f_to_i4: dest:i src1:f len:4
-move_i4_to_f: dest:f src1:i len:8
+move_f_to_i4: dest:i src1:f len:14
+move_i4_to_f: dest:f src1:i len:14
 move_f_to_i8: dest:i src1:f len:4
 move_i8_to_f: dest:f src1:i len:8
 i8const: dest:i len:20
@@ -389,5 +389,6 @@ gc_liveness_def: len:0
 gc_liveness_use: len:0
 gc_spill_slot_liveness_def: len:0
 gc_param_slot_liveness_def: len:0
+gc_safe_point: clob:c src1:i len:32
 
 generic_class_init: src1:A len:32 clob:c
index 970f7404add6052b3292164a169c78fa6527e345..d3409bc1d91648ded646222366c9282d9a6d0981 100644 (file)
@@ -316,3 +316,5 @@ long_conv_to_ovf_i4_2: dest:i src1:i src2:i len:48
 vcall2: len:40 clob:c
 vcall2_reg: src1:i len:64 clob:c
 vcall2_membase: src1:b len:64 clob:c
+
+gc_safe_point: len:0
index 990ee09e107f394773e825d8f1711094b5a871f3..db2dc5defcfb927f74c874c9584a600c9fab007a 100644 (file)
@@ -4858,6 +4858,9 @@ process_single_step_inner (DebuggerTlsData *tls, gboolean from_signal)
                mono_arch_skip_single_step (ctx);
 
        if (suspend_count > 0) {
+               /* Fastpath during invokes, see in process_suspend () */
+               if (suspend_count - tls->resume_count == 0)
+                       return;
                process_suspend (tls, ctx);
                return;
        }
@@ -4971,10 +4974,14 @@ debugger_agent_single_step_from_context (MonoContext *ctx)
        DebuggerTlsData *tls;
        MonoThreadUnwindState orig_restore_state;
 
+       tls = mono_native_tls_get_value (debugger_tls_id);
+       /* Fastpath during invokes, see in process_suspend () */
+       if (tls && suspend_count && suspend_count - tls->resume_count == 0)
+               return;
+
        if (is_debugger_thread ())
                return;
 
-       tls = mono_native_tls_get_value (debugger_tls_id);
        g_assert (tls);
 
        /* Have to save/restore the restore_ctx as we can be called recursively during invokes etc. */
index e5ede5813749bfa93799af2203a5fd2e90bfd3fb..2008859cda6114035d9c1215c128e68485262eda 100644 (file)
@@ -2226,14 +2226,14 @@ void
 mono_jit_set_aot_only (gboolean val)
 {
        mono_aot_only = val;
-       if (mono_aot_only)
-               mono_llvm_only = TRUE;
 }
 
 void
 mono_jit_set_aot_mode (MonoAotMode mode)
 {
        mono_aot_mode = mode;
+       if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY)
+               mono_llvm_only = TRUE;
 }
 
 /**
index b511e7d8c9dc07ab2854269be6f5e805a711fe7b..63e667985fefde6e36f7bfcad7cc33eef8f8679d 100755 (executable)
@@ -35,7 +35,7 @@ foreach $line (<STDIN>) {
         } else {
             $successbool = "True";
         }
-        open (my $nunitxml, '>', 'TestResults_regression.xml') or die "Could not write to 'TestResults_regression.xml' $!";
+        open (my $nunitxml, '>', 'TestResult-regression.xml') or die "Could not write to 'TestResult-regression.xml' $!";
         print $nunitxml "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n";
         print $nunitxml "<!--This file represents the results of running a test suite-->\n";
         print $nunitxml "<test-results name=\"regression-tests.dummy\" total=\"$total\" failures=\"$failed\" not-run=\"0\" date=\"" . strftime ("%F", localtime) . "\" time=\"" . strftime ("%T", localtime) . "\">\n";
index cbff1aaa36d171bee67b7cd5fe1bbb9e823cb044..aae3ae9ffe968fbd5df33a5e8682b4fbfcf78dc0 100644 (file)
@@ -51,7 +51,9 @@ typedef enum {
        MONO_AOT_MODE_HYBRID,
        /* Enables full AOT mode, JIT is disabled and not allowed,
         * equivalent to mono_jit_set_aot_only (true) */
-       MONO_AOT_MODE_FULL
+       MONO_AOT_MODE_FULL,
+       /* Same as full, but use only llvm compiled code */
+       MONO_AOT_MODE_LLVMONLY
 } MonoAotMode;
 
 MONO_API void
index 5dcb8d1488b223474f615352c0186f53e99dee8a..3af75e6352f1cd0570edf317cc2414624c68a28e 100644 (file)
@@ -3,8 +3,6 @@
 
 #include <glib.h>
 
-#if defined(ENABLE_LLVM_RUNTIME) || defined(ENABLE_LLVM)
-
 extern "C" {
 
 void
@@ -17,17 +15,3 @@ mono_llvm_cpp_throw_exception (void)
 }
 
 }
-
-#else
-
-extern "C" {
-
-void
-mono_llvm_cpp_throw_exception (void)
-{
-       g_assert_not_reached ();
-}
-
-}
-
-#endif /* ENABLE_LLVM_RUNTIME */
index 7963f5fba74d854a0f897bc39d22a11889e8f91f..f62cb8bd952d976dbc92c4618e5a22763c491109 100644 (file)
@@ -12,8 +12,6 @@
 
 #include <glib.h>
 
-#include <unwind.h>
-
 G_BEGIN_DECLS
 
 void
index 3f4d72c9126fdcf85f020ff29fc03383efa0ecc8..d645905ecad9ee6422912eb7aead19fa9cd90c05 100644 (file)
@@ -2239,7 +2239,16 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
         * - we only pass/receive them in registers in some cases, and only 
         *   in 1 or 2 integer registers.
         */
-       if (cinfo->ret.storage == ArgValuetypeInReg) {
+       switch (cinfo->ret.storage) {
+       case ArgNone:
+               linfo->ret.storage = LLVMArgNone;
+               break;
+       case ArgInIReg:
+       case ArgInFloatSSEReg:
+       case ArgInDoubleSSEReg:
+               linfo->ret.storage = LLVMArgNormal;
+               break;
+       case ArgValuetypeInReg:
                if (sig->pinvoke) {
                        cfg->exception_message = g_strdup ("pinvoke + vtypes");
                        cfg->disable_llvm = TRUE;
@@ -2249,12 +2258,15 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                linfo->ret.storage = LLVMArgVtypeInReg;
                for (j = 0; j < 2; ++j)
                        linfo->ret.pair_storage [j] = arg_storage_to_llvm_arg_storage (cfg, cinfo->ret.pair_storage [j]);
-       }
-
-       if (cinfo->ret.storage == ArgValuetypeAddrInIReg) {
+               break;
+       case ArgValuetypeAddrInIReg:
                /* Vtype returned using a hidden argument */
                linfo->ret.storage = LLVMArgVtypeRetAddr;
                linfo->vret_arg_index = cinfo->vret_arg_index;
+               break;
+       default:
+               g_assert_not_reached ();
+               break;
        }
 
        for (i = 0; i < n; ++i) {
@@ -2269,24 +2281,17 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
 
                switch (ainfo->storage) {
                case ArgInIReg:
-                       linfo->args [i].storage = LLVMArgInIReg;
+                       linfo->args [i].storage = LLVMArgNormal;
                        break;
                case ArgInDoubleSSEReg:
                case ArgInFloatSSEReg:
-                       linfo->args [i].storage = LLVMArgInFPReg;
+                       linfo->args [i].storage = LLVMArgNormal;
                        break;
                case ArgOnStack:
-                       if (MONO_TYPE_ISSTRUCT (t)) {
+                       if (MONO_TYPE_ISSTRUCT (t))
                                linfo->args [i].storage = LLVMArgVtypeByVal;
-                       } else {
-                               linfo->args [i].storage = LLVMArgInIReg;
-                               if (!t->byref) {
-                                       if (t->type == MONO_TYPE_R4)
-                                               linfo->args [i].storage = LLVMArgInFPReg;
-                                       else if (t->type == MONO_TYPE_R8)
-                                               linfo->args [i].storage = LLVMArgInFPReg;
-                               }
-                       }
+                       else
+                               linfo->args [i].storage = LLVMArgNormal;
                        break;
                case ArgValuetypeInReg:
                        if (sig->pinvoke) {
@@ -3658,6 +3663,35 @@ mono_amd64_have_tls_get (void)
                       ins [9] == 0xc3;
 
        tls_gs_offset = ins[5];
+
+       /*
+        * Apple now loads a different version of pthread_getspecific when launched from Xcode
+        * For that version we're looking for these instructions:
+        *
+        * pushq  %rbp
+        * movq   %rsp, %rbp
+        * mov    %gs:[offset](,%rdi,8),%rax
+        * popq   %rbp
+        * retq
+        */
+       if (!have_tls_get) {
+               have_tls_get = ins [0] == 0x55 &&
+                              ins [1] == 0x48 &&
+                              ins [2] == 0x89 &&
+                              ins [3] == 0xe5 &&
+                              ins [4] == 0x65 &&
+                              ins [5] == 0x48 &&
+                              ins [6] == 0x8b &&
+                              ins [7] == 0x04 &&
+                              ins [8] == 0xfd &&
+                              ins [10] == 0x00 &&
+                              ins [11] == 0x00 &&
+                              ins [12] == 0x00 &&
+                              ins [13] == 0x5d &&
+                              ins [14] == 0xc3;
+
+               tls_gs_offset = ins[9];
+       }
 #endif
 
        inited = TRUE;
@@ -6687,15 +6721,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        int compare_val = 0;
                        guint8 *br [1];
 
-#if defined (USE_COOP_GC)
-                       polling_func = "mono_threads_state_poll";
-                       compare_val = 1;
-#elif defined(__native_client_codegen__) && defined(__native_client_gc__)
+#if defined(__native_client_codegen__) && defined(__native_client_gc__)
                        polling_func = "mono_nacl_gc";
                        compare_val = 0xFFFFFFFF;
+#else
+                       g_assert (mono_threads_is_coop_enabled ());
+                       polling_func = "mono_threads_state_poll";
+                       compare_val = 1;
 #endif
-                       if (!polling_func)
-                               break;
 
                        amd64_test_membase_imm_size (code, ins->sreg1, 0, compare_val, 4);
                        br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
index 2b1f88dcb348d296c2309ab6095a83447e39d5f3..86de1ff8b17787666df8acf02872025871c7bafa 100644 (file)
@@ -357,6 +357,10 @@ typedef struct {
 #define MONO_ARCH_HAVE_PATCH_CODE_NEW 1
 #define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT 1
 
+#if defined(TARGET_OSX) || defined(__linux__)
+#define MONO_ARCH_HAVE_UNWIND_BACKTRACE 1
+#endif
+
 #if defined(TARGET_OSX) || defined(__linux__)
 #define MONO_ARCH_HAVE_TLS_GET_REG 1
 #endif
index faf8514d21493b2d06cef058d538180526e81899..08307072a203768d31225a1e2cfe47cc31c9124c 100644 (file)
@@ -2305,7 +2305,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                case RegTypeIRegPair:
                case RegTypeBase:
                case RegTypeBaseGen:
-                       linfo->args [i].storage = LLVMArgInIReg;
+                       linfo->args [i].storage = LLVMArgNormal;
                        break;
                case RegTypeStructByVal:
                        linfo->args [i].storage = LLVMArgAsIArgs;
@@ -5959,10 +5959,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        bb->spill_slot_defs = g_slist_prepend_mempool (cfg->mempool, bb->spill_slot_defs, ins);
                        break;
                case OP_GC_SAFE_POINT: {
-#if defined (USE_COOP_GC)
                        const char *polling_func = NULL;
                        guint8 *buf [1];
 
+                       g_assert (mono_threads_is_coop_enabled ());
+
                        polling_func = "mono_threads_state_poll";
                        ARM_LDR_IMM (code, ARMREG_IP, ins->sreg1, 0);
                        ARM_CMP_REG_IMM (code, ARMREG_IP, 0, 0);
@@ -5971,7 +5972,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, polling_func);
                        code = emit_call_seq (cfg, code);
                        arm_patch (buf [0], code);
-#endif
                        break;
                }
 
index a6fc7a4122f47c25cbf78e12224bd75c69ef454c..9129c800a45727924ec85a502a05b1643755b43c 100644 (file)
@@ -419,6 +419,12 @@ static const char* const patch_info_str[] = {
 #undef PATCH_INFO
 };
 
+const char*
+mono_ji_type_to_string (MonoJumpInfoType type)
+{
+       return patch_info_str [type];
+}
+
 void
 mono_print_ji (const MonoJumpInfo *ji)
 {
@@ -737,6 +743,12 @@ print_regtrack (RegTrack *t, int num)
 }
 #else
 
+const char*
+mono_ji_type_to_string (MonoJumpInfoType type)
+{
+       return "";
+}
+
 void
 mono_print_ji (const MonoJumpInfo *ji)
 {
index 092050879e0483f4f63e41134523b0d5c19b8861..f26568502bcb28daa7aece7df5c228c6fec7ebb5 100644 (file)
 #include <sys/prctl.h>
 #endif
 
+#ifdef HAVE_UNWIND_H
+#include <unwind.h>
+#endif
+
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/tabledefs.h>
 #include <mono/metadata/threads.h>
@@ -2713,6 +2717,8 @@ mono_jinfo_get_epilog_size (MonoJitInfo *ji)
  * LLVM/Bitcode exception handling.
  */
 
+#ifdef MONO_ARCH_HAVE_UNWIND_BACKTRACE
+
 #if 0
 static gboolean show_native_addresses = TRUE;
 #else
@@ -2733,6 +2739,8 @@ build_stack_trace (struct _Unwind_Context *frame_ctx, void *state)
        return _URC_NO_REASON;
 }
 
+#endif
+
 static void
 throw_exception (MonoObject *ex, gboolean rethrow)
 {
@@ -2748,10 +2756,10 @@ throw_exception (MonoObject *ex, gboolean rethrow)
        jit_tls->thrown_exc = mono_gchandle_new ((MonoObject*)mono_ex, FALSE);
 
        if (!rethrow) {
+#ifdef MONO_ARCH_HAVE_UNWIND_BACKTRACE
                GList *l, *ips = NULL;
                GList *trace;
 
-               // FIXME: Move this to mini-exceptions.c
                _Unwind_Backtrace (build_stack_trace, &ips);
                /* The list contains gshared info-ip pairs */
                trace = NULL;
@@ -2764,6 +2772,7 @@ throw_exception (MonoObject *ex, gboolean rethrow)
                MONO_OBJECT_SETREF (mono_ex, trace_ips, mono_glist_to_array (trace, mono_defaults.int_class));
                g_list_free (l);
                g_list_free (trace);
+#endif
        }
 
        mono_llvm_cpp_throw_exception ();
@@ -2895,9 +2904,17 @@ mono_llvm_match_exception (MonoJitInfo *jinfo, guint32 region_start, guint32 reg
        return index;
 }
 
+#ifdef ENABLE_LLVM
 _Unwind_Reason_Code 
 mono_debug_personality (int a, _Unwind_Action b,
 uint64_t c, struct _Unwind_Exception *d, struct _Unwind_Context *e)
 {
        g_assert_not_reached ();
 }
+#else
+void
+mono_debug_personality (void)
+{
+       g_assert_not_reached ();
+}
+#endif
index e1ca51ba9806b76ac01465f7ad6d8b5f0638ea26..0e8838ae1223cea4ff0b043ee10d77de394a83e8 100644 (file)
@@ -3102,6 +3102,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 
                        ia64_break_i (code, 0);
                        break;
+               case OP_GC_SAFE_POINT:
+                       break;
 
                default:
                        g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
index 87d069ce5c002f38717818431f7ca5c28826ae87..3f04bbf35cabac51efd66b21a550e5dbf947cbcc 100644 (file)
@@ -46,7 +46,7 @@ void bzero (void *to, size_t count) { memset (to, 0, count); }
   * Information associated by mono with LLVM modules.
   */
 typedef struct {
-       LLVMModuleRef module;
+       LLVMModuleRef lmodule;
        LLVMValueRef throw_icall, rethrow, match_exc, throw_corlib_exception, resume_eh;
        GHashTable *llvm_types;
        LLVMValueRef got_var;
@@ -56,6 +56,7 @@ typedef struct {
        GHashTable *plt_entries;
        GHashTable *plt_entries_ji;
        GHashTable *method_to_lmethod;
+       GHashTable *direct_callables;
        char **bb_names;
        int bb_names_len;
        GPtrArray *used;
@@ -122,8 +123,8 @@ typedef struct {
 
        MonoCompile *cfg;
        LLVMValueRef lmethod;
-       MonoLLVMModule *lmodule;
-       LLVMModuleRef module;
+       MonoLLVMModule *module;
+       LLVMModuleRef lmodule;
        BBInfo *bblocks;
        int sindex, default_index, ex_index;
        LLVMBuilderRef builder;
@@ -144,7 +145,6 @@ typedef struct {
        gboolean *unreachable;
        gboolean llvm_only;
        gboolean has_got_access;
-       int *pindexes;
        int this_arg_pindex, rgctx_arg_pindex;
        LLVMValueRef imt_rgctx_loc;
        GHashTable *llvm_types;
@@ -266,7 +266,7 @@ static void init_jit_module (MonoDomain *domain);
 
 static void emit_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder, const unsigned char *cil_code);
 static LLVMValueRef emit_dbg_subprogram (EmitContext *ctx, MonoCompile *cfg, LLVMValueRef method, const char *name);
-static void emit_dbg_info (MonoLLVMModule *lmodule, const char *filename, const char *cu_name);
+static void emit_dbg_info (MonoLLVMModule *module, const char *filename, const char *cu_name);
 
 /*
  * IntPtrType:
@@ -369,7 +369,7 @@ type_to_simd_type (int type)
 }
 
 static LLVMTypeRef
-create_llvm_type_for_type (MonoLLVMModule *lmodule, MonoClass *klass)
+create_llvm_type_for_type (MonoLLVMModule *module, MonoClass *klass)
 {
        int i, size, nfields, esize;
        LLVMTypeRef *eltypes;
@@ -397,7 +397,7 @@ create_llvm_type_for_type (MonoLLVMModule *lmodule, MonoClass *klass)
        }
 
        name = mono_type_full_name (&klass->byval_arg);
-       ltype = LLVMStructCreateNamed (lmodule->context, name);
+       ltype = LLVMStructCreateNamed (module->context, name);
        LLVMStructSetBody (ltype, eltypes, size, FALSE);
        g_free (eltypes);
        g_free (name);
@@ -474,10 +474,10 @@ type_to_llvm_type (EmitContext *ctx, MonoType *t)
                if (klass->enumtype)
                        return type_to_llvm_type (ctx, mono_class_enum_basetype (klass));
 
-               ltype = (LLVMTypeRef)g_hash_table_lookup (ctx->lmodule->llvm_types, klass);
+               ltype = (LLVMTypeRef)g_hash_table_lookup (ctx->module->llvm_types, klass);
                if (!ltype) {
-                       ltype = create_llvm_type_for_type (ctx->lmodule, klass);
-                       g_hash_table_insert (ctx->lmodule->llvm_types, klass, ltype);
+                       ltype = create_llvm_type_for_type (ctx->module, klass);
+                       g_hash_table_insert (ctx->module->llvm_types, klass, ltype);
                }
                return ltype;
        }
@@ -990,18 +990,18 @@ get_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        sprintf (bb_name_buf, "EH_CLAUSE%d_BB%d", clause_index, bb->block_num);
                        bb_name = bb_name_buf;
                } else if (bb->block_num < 256) {
-                       if (!ctx->lmodule->bb_names) {
-                               ctx->lmodule->bb_names_len = 256;
-                               ctx->lmodule->bb_names = g_new0 (char*, ctx->lmodule->bb_names_len);
+                       if (!ctx->module->bb_names) {
+                               ctx->module->bb_names_len = 256;
+                               ctx->module->bb_names = g_new0 (char*, ctx->module->bb_names_len);
                        }
-                       if (!ctx->lmodule->bb_names [bb->block_num]) {
+                       if (!ctx->module->bb_names [bb->block_num]) {
                                char *n;
 
                                n = g_strdup_printf ("BB%d", bb->block_num);
                                mono_memory_barrier ();
-                               ctx->lmodule->bb_names [bb->block_num] = n;
+                               ctx->module->bb_names [bb->block_num] = n;
                        }
-                       bb_name = ctx->lmodule->bb_names [bb->block_num];
+                       bb_name = ctx->module->bb_names [bb->block_num];
                } else {
                        sprintf (bb_name_buf, "BB%d", bb->block_num);
                        bb_name = bb_name_buf;
@@ -1167,121 +1167,137 @@ emit_volatile_store (EmitContext *ctx, int vreg)
        }
 }
 
-typedef struct {
-       /* 
-        * Maps parameter indexes in the original signature to parameter indexes
-        * in the LLVM signature.
-        */
-       int *pindexes;
-       /* The indexes of various special arguments in the LLVM signature */
-       int vret_arg_pindex, this_arg_pindex, rgctx_arg_pindex, imt_arg_pindex;
-} LLVMSigInfo;
+static LLVMTypeRef
+sig_to_llvm_sig_no_cinfo (EmitContext *ctx, MonoMethodSignature *sig)
+{
+       LLVMTypeRef ret_type;
+       LLVMTypeRef *param_types = NULL;
+       LLVMTypeRef res;
+       int i, pindex;
+       MonoType *rtype;
+
+       rtype = mini_get_underlying_type (sig->ret);
+       ret_type = type_to_llvm_type (ctx, rtype);
+       CHECK_FAILURE (ctx);
+
+       param_types = g_new0 (LLVMTypeRef, (sig->param_count * 8) + 3);
+       pindex = 0;
+
+       if (sig->hasthis)
+               param_types [pindex ++] = ThisType ();
+       for (i = 0; i < sig->param_count; ++i)
+               param_types [pindex ++] = type_to_llvm_arg_type (ctx, sig->params [i]);
+
+       CHECK_FAILURE (ctx);
+
+       res = LLVMFunctionType (ret_type, param_types, pindex, FALSE);
+       g_free (param_types);
+
+       return res;
+
+ FAILURE:
+       g_free (param_types);
+
+       return NULL;
+}
 
 /*
  * sig_to_llvm_sig_full:
  *
  *   Return the LLVM signature corresponding to the mono signature SIG using the
- * calling convention information in CINFO. Return parameter mapping information in SINFO.
+ * calling convention information in CINFO. Fill out the parameter mapping information in CINFO.
  */
 static LLVMTypeRef
-sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *cinfo,
-                                         LLVMSigInfo *sinfo)
+sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *cinfo)
 {
        LLVMTypeRef ret_type;
        LLVMTypeRef *param_types = NULL;
        LLVMTypeRef res;
        int i, j, pindex, vret_arg_pindex = 0;
-       int *pindexes;
        gboolean vretaddr = FALSE;
        MonoType *rtype;
 
-       if (sinfo)
-               memset (sinfo, 0, sizeof (LLVMSigInfo));
+       if (!cinfo)
+               return sig_to_llvm_sig_no_cinfo (ctx, sig);
 
        rtype = mini_get_underlying_type (sig->ret);
        ret_type = type_to_llvm_type (ctx, rtype);
        CHECK_FAILURE (ctx);
 
-       if (cinfo) {
-               switch (cinfo->ret.storage) {
-               case LLVMArgVtypeInReg:
-                       /* LLVM models this by returning an aggregate value */
-                       if (cinfo->ret.pair_storage [0] == LLVMArgInIReg && cinfo->ret.pair_storage [1] == LLVMArgNone) {
-                               LLVMTypeRef members [2];
-
-                               members [0] = IntPtrType ();
-                               ret_type = LLVMStructType (members, 1, FALSE);
-                       } else if (cinfo->ret.pair_storage [0] == LLVMArgNone && cinfo->ret.pair_storage [1] == LLVMArgNone) {
-                               /* Empty struct */
-                               ret_type = LLVMVoidType ();
-                       } else if (cinfo->ret.pair_storage [0] == LLVMArgInIReg && cinfo->ret.pair_storage [1] == LLVMArgInIReg) {
-                               LLVMTypeRef members [2];
-
-                               members [0] = IntPtrType ();
-                               members [1] = IntPtrType ();
-                               ret_type = LLVMStructType (members, 2, FALSE);
-                       } else {
-                               g_assert_not_reached ();
-                       }
-                       break;
-               case LLVMArgVtypeByVal:
-                       /* Vtype returned normally by val */
-                       break;
-               case LLVMArgVtypeAsScalar:
-                       /* LLVM models this by returning an int */
-                       g_assert (cinfo->ret.nslots == 1 || cinfo->ret.nslots == 2);
-                       ret_type = LLVMIntType (cinfo->ret.nslots * sizeof (mgreg_t) * 8);
-                       break;
-               case LLVMArgFpStruct: {
-                       /* Vtype returned as a fp struct */
-                       LLVMTypeRef members [16];
+       switch (cinfo->ret.storage) {
+       case LLVMArgVtypeInReg:
+               /* LLVM models this by returning an aggregate value */
+               if (cinfo->ret.pair_storage [0] == LLVMArgInIReg && cinfo->ret.pair_storage [1] == LLVMArgNone) {
+                       LLVMTypeRef members [2];
 
-                       /* Have to create our own structure since we don't map fp structures to LLVM fp structures yet */
-                       for (i = 0; i < cinfo->ret.nslots; ++i)
-                               members [i] = cinfo->ret.esize == 8 ? LLVMDoubleType () : LLVMFloatType ();
-                       ret_type = LLVMStructType (members, cinfo->ret.nslots, FALSE);
-                       break;
-               }
-               case LLVMArgVtypeByRef:
-                       /* Vtype returned using a hidden argument */
+                       members [0] = IntPtrType ();
+                       ret_type = LLVMStructType (members, 1, FALSE);
+               } else if (cinfo->ret.pair_storage [0] == LLVMArgNone && cinfo->ret.pair_storage [1] == LLVMArgNone) {
+                       /* Empty struct */
                        ret_type = LLVMVoidType ();
-                       break;
-               default:
-                       if (mini_type_is_vtype (rtype)) {
-                               g_assert (cinfo->ret.storage == LLVMArgVtypeRetAddr);
-                               vretaddr = TRUE;
-                               ret_type = LLVMVoidType ();
-                       }
-                       break;
+               } else if (cinfo->ret.pair_storage [0] == LLVMArgInIReg && cinfo->ret.pair_storage [1] == LLVMArgInIReg) {
+                       LLVMTypeRef members [2];
+
+                       members [0] = IntPtrType ();
+                       members [1] = IntPtrType ();
+                       ret_type = LLVMStructType (members, 2, FALSE);
+               } else {
+                       g_assert_not_reached ();
                }
+               break;
+       case LLVMArgVtypeByVal:
+               /* Vtype returned normally by val */
+               break;
+       case LLVMArgVtypeAsScalar:
+               /* LLVM models this by returning an int */
+               g_assert (cinfo->ret.nslots == 1 || cinfo->ret.nslots == 2);
+               ret_type = LLVMIntType (cinfo->ret.nslots * sizeof (mgreg_t) * 8);
+               break;
+       case LLVMArgFpStruct: {
+               /* Vtype returned as a fp struct */
+               LLVMTypeRef members [16];
+
+               /* Have to create our own structure since we don't map fp structures to LLVM fp structures yet */
+               for (i = 0; i < cinfo->ret.nslots; ++i)
+                       members [i] = cinfo->ret.esize == 8 ? LLVMDoubleType () : LLVMFloatType ();
+               ret_type = LLVMStructType (members, cinfo->ret.nslots, FALSE);
+               break;
+       }
+       case LLVMArgVtypeByRef:
+               /* Vtype returned using a hidden argument */
+               ret_type = LLVMVoidType ();
+               break;
+       case LLVMArgVtypeRetAddr:
+       case LLVMArgScalarRetAddr:
+               vretaddr = TRUE;
+               ret_type = LLVMVoidType ();
+               break;
+       default:
+               break;
        }
 
-       pindexes = g_new0 (int, sig->param_count);
        param_types = g_new0 (LLVMTypeRef, (sig->param_count * 8) + 3);
        pindex = 0;
-       if (cinfo && cinfo->ret.storage == LLVMArgVtypeByRef) {
+       if (cinfo->ret.storage == LLVMArgVtypeByRef) {
                /*
                 * Has to be the first argument because of the sret argument attribute
                 * FIXME: This might conflict with passing 'this' as the first argument, but
                 * this is only used on arm64 which has a dedicated struct return register.
                 */
-               if (sinfo)
-                       sinfo->vret_arg_pindex = pindex;
+               cinfo->vret_arg_pindex = pindex;
                param_types [pindex] = type_to_llvm_arg_type (ctx, sig->ret);
                CHECK_FAILURE (ctx);
                param_types [pindex] = LLVMPointerType (param_types [pindex], 0);
                pindex ++;
        }
-       if (!ctx->llvm_only && cinfo && cinfo->rgctx_arg) {
-               if (sinfo)
-                       sinfo->rgctx_arg_pindex = pindex;
-               param_types [pindex] = ctx->lmodule->ptr_type;
+       if (!ctx->llvm_only && cinfo->rgctx_arg) {
+               cinfo->rgctx_arg_pindex = pindex;
+               param_types [pindex] = ctx->module->ptr_type;
                pindex ++;
        }
-       if (cinfo && cinfo->imt_arg) {
-               if (sinfo)
-                       sinfo->imt_arg_pindex = pindex;
-               param_types [pindex] = ctx->lmodule->ptr_type;
+       if (cinfo->imt_arg) {
+               cinfo->imt_arg_pindex = pindex;
+               param_types [pindex] = ctx->module->ptr_type;
                pindex ++;
        }
        if (vretaddr) {
@@ -1302,30 +1318,23 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
                        }
                }
 
-               if (sinfo)
-                       sinfo->vret_arg_pindex = vret_arg_pindex;
+               cinfo->vret_arg_pindex = vret_arg_pindex;
        }                               
 
        if (vretaddr && vret_arg_pindex == pindex)
                param_types [pindex ++] = IntPtrType ();
        if (sig->hasthis) {
-               if (sinfo)
-                       sinfo->this_arg_pindex = pindex;
+               cinfo->this_arg_pindex = pindex;
                param_types [pindex ++] = ThisType ();
        }
        if (vretaddr && vret_arg_pindex == pindex)
                param_types [pindex ++] = IntPtrType ();
        for (i = 0; i < sig->param_count; ++i) {
-               LLVMArgInfo *ainfo = cinfo ? &cinfo->args [i + sig->hasthis] : NULL;
+               LLVMArgInfo *ainfo = &cinfo->args [i + sig->hasthis];
 
                if (vretaddr && vret_arg_pindex == pindex)
                        param_types [pindex ++] = IntPtrType ();
-               pindexes [i] = pindex;
-
-               if (!ainfo) {
-                       param_types [pindex ++] = type_to_llvm_arg_type (ctx, sig->params [i]);
-                       continue;
-               }
+               ainfo->pindex = pindex;
 
                switch (ainfo->storage) {
                case LLVMArgVtypeInReg:
@@ -1342,7 +1351,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
                        }
                        break;
                case LLVMArgVtypeByVal:
-                       param_types [pindex] = type_to_llvm_arg_type (ctx, sig->params [i]);
+                       param_types [pindex] = type_to_llvm_arg_type (ctx, ainfo->type);
                        CHECK_FAILURE (ctx);
                        param_types [pindex] = LLVMPointerType (param_types [pindex], 0);
                        pindex ++;
@@ -1352,7 +1361,8 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
                        pindex ++;
                        break;
                case LLVMArgVtypeByRef:
-                       param_types [pindex] = type_to_llvm_arg_type (ctx, sig->params [i]);
+               case LLVMArgScalarByRef:
+                       param_types [pindex] = type_to_llvm_arg_type (ctx, ainfo->type);
                        CHECK_FAILURE (ctx);
                        param_types [pindex] = LLVMPointerType (param_types [pindex], 0);
                        pindex ++;
@@ -1369,17 +1379,16 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
                        g_assert_not_reached ();
                        break;
                default:
-                       param_types [pindex ++] = type_to_llvm_arg_type (ctx, sig->params [i]);
+                       param_types [pindex ++] = type_to_llvm_arg_type (ctx, ainfo->type);
                        break;
                }
        }
        if (vretaddr && vret_arg_pindex == pindex)
                param_types [pindex ++] = IntPtrType ();
-       if (ctx->llvm_only && cinfo && cinfo->rgctx_arg) {
+       if (ctx->llvm_only && cinfo->rgctx_arg) {
                /* Pass the rgctx as the last argument */
-               if (sinfo)
-                       sinfo->rgctx_arg_pindex = pindex;
-               param_types [pindex] = ctx->lmodule->ptr_type;
+               cinfo->rgctx_arg_pindex = pindex;
+               param_types [pindex] = ctx->module->ptr_type;
                pindex ++;
        }
 
@@ -1388,12 +1397,6 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
        res = LLVMFunctionType (ret_type, param_types, pindex, FALSE);
        g_free (param_types);
 
-       if (sinfo) {
-               sinfo->pindexes = pindexes;
-       } else {
-               g_free (pindexes);
-       }
-
        return res;
 
  FAILURE:
@@ -1405,7 +1408,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
 static LLVMTypeRef
 sig_to_llvm_sig (EmitContext *ctx, MonoMethodSignature *sig)
 {
-       return sig_to_llvm_sig_full (ctx, sig, NULL, NULL);
+       return sig_to_llvm_sig_full (ctx, sig, NULL);
 }
 
 /*
@@ -1492,6 +1495,23 @@ create_builder (EmitContext *ctx)
        return builder;
 }
 
+static char*
+get_aotconst_name (MonoJumpInfoType type, gconstpointer data, int got_offset)
+{
+       char *name;
+
+       switch (type) {
+       case MONO_PATCH_INFO_INTERNAL_METHOD:
+               name = g_strdup_printf ("jit_icall_%s", data);
+               break;
+       default:
+               name = g_strdup_printf ("%s_%d", mono_ji_type_to_string (type), got_offset);
+               break;
+       }
+
+       return name;
+}
+
 static LLVMValueRef
 get_aotconst (EmitContext *ctx, MonoJumpInfoType type, gconstpointer data)
 {
@@ -1515,7 +1535,7 @@ get_aotconst (EmitContext *ctx, MonoJumpInfoType type, gconstpointer data)
        cfg->patch_info = ji;
 
        got_offset = mono_aot_get_got_offset (cfg->patch_info);
-       ctx->lmodule->max_got_offset = MAX (ctx->lmodule->max_got_offset, got_offset);
+       ctx->module->max_got_offset = MAX (ctx->module->max_got_offset, got_offset);
        /* 
         * If the got slot is shared, it means its initialized when the aot image is loaded, so we don't need to
         * explicitly initialize it.
@@ -1528,16 +1548,9 @@ get_aotconst (EmitContext *ctx, MonoJumpInfoType type, gconstpointer data)
 
        indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
        indexes [1] = LLVMConstInt (LLVMInt32Type (), (gssize)got_offset, FALSE);
-       got_entry_addr = LLVMBuildGEP (builder, ctx->lmodule->got_var, indexes, 2, "");
-
-       switch (type) {
-       case MONO_PATCH_INFO_INTERNAL_METHOD:
-               name = g_strdup_printf ("jit_icall_%s", data);
-               break;
-       default:
-               break;
-       }
+       got_entry_addr = LLVMBuildGEP (builder, ctx->module->got_var, indexes, 2, "");
 
+       name = get_aotconst_name (type, data, got_offset);
        load = LLVMBuildLoad (builder, got_entry_addr, name ? name : "");
        g_free (name);
        //set_invariant_load_flag (load);
@@ -1548,9 +1561,28 @@ get_aotconst (EmitContext *ctx, MonoJumpInfoType type, gconstpointer data)
 static LLVMValueRef
 get_callee (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType type, gconstpointer data)
 {
+       LLVMValueRef callee;
+       char *callee_name;
        if (ctx->llvm_only) {
                LLVMValueRef load;
 
+               callee_name = mono_aot_get_direct_call_symbol (type, data);
+               if (callee_name) {
+                       /* Directly callable */
+                       // FIXME: Locking
+                       callee = (LLVMValueRef)g_hash_table_lookup (ctx->module->direct_callables, callee_name);
+                       if (!callee) {
+                               callee = LLVMAddFunction (ctx->lmodule, callee_name, llvm_sig);
+
+                               LLVMSetVisibility (callee, LLVMHiddenVisibility);
+
+                               g_hash_table_insert (ctx->module->direct_callables, (char*)callee_name, callee);
+                       } else {
+                               g_free (callee_name);
+                       }
+                       return callee;
+               }
+
                /*
                 * Calls are made through the GOT.
                 */
@@ -1558,10 +1590,9 @@ get_callee (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType type, gcons
 
                return convert (ctx, load, LLVMPointerType (llvm_sig, 0));
        } else {
-               char *callee_name = mono_aot_get_plt_symbol (type, data);
-               LLVMValueRef callee;
                MonoJumpInfo *ji = NULL;
 
+               callee_name = mono_aot_get_plt_symbol (type, data);
                if (!callee_name)
                        return NULL;
 
@@ -1570,13 +1601,13 @@ get_callee (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType type, gcons
                        mono_add_patch_info (ctx->cfg, 0, type, data);
 
                // FIXME: Locking
-               callee = (LLVMValueRef)g_hash_table_lookup (ctx->lmodule->plt_entries, callee_name);
+               callee = (LLVMValueRef)g_hash_table_lookup (ctx->module->plt_entries, callee_name);
                if (!callee) {
-                       callee = LLVMAddFunction (ctx->module, callee_name, llvm_sig);
+                       callee = LLVMAddFunction (ctx->lmodule, callee_name, llvm_sig);
 
                        LLVMSetVisibility (callee, LLVMHiddenVisibility);
 
-                       g_hash_table_insert (ctx->lmodule->plt_entries, (char*)callee_name, callee);
+                       g_hash_table_insert (ctx->module->plt_entries, (char*)callee_name, callee);
                }
 
                if (ctx->cfg->compile_aot) {
@@ -1584,7 +1615,7 @@ get_callee (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType type, gcons
                        ji->type = type;
                        ji->data.target = data;
 
-                       g_hash_table_insert (ctx->lmodule->plt_entries_ji, ji, callee);
+                       g_hash_table_insert (ctx->module->plt_entries_ji, ji, callee);
                }
 
                return callee;
@@ -1810,7 +1841,7 @@ emit_load_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder
                args [1] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
                args [2] = LLVMConstInt (LLVMInt1Type (), TRUE, FALSE);
                args [3] = LLVMConstInt (LLVMInt32Type (), ordering, FALSE);
-               res = emit_call (ctx, bb, builder_ref, LLVMGetNamedFunction (ctx->module, intrins_name), args, 4);
+               res = emit_call (ctx, bb, builder_ref, LLVMGetNamedFunction (ctx->lmodule, intrins_name), args, 4);
 
                if (addr_type == LLVMPointerType (LLVMDoubleType (), 0))
                        res = LLVMBuildBitCast (*builder_ref, res, LLVMDoubleType (), "");
@@ -1895,7 +1926,7 @@ emit_store_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builde
                args [2] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
                args [3] = LLVMConstInt (LLVMInt1Type (), TRUE, FALSE);
                args [4] = LLVMConstInt (LLVMInt32Type (), ordering, FALSE);
-               emit_call (ctx, bb, builder_ref, LLVMGetNamedFunction (ctx->module, intrins_name), args, 5);
+               emit_call (ctx, bb, builder_ref, LLVMGetNamedFunction (ctx->lmodule, intrins_name), args, 5);
        } else {
                mono_llvm_build_store (*builder_ref, value, addr, is_faulting, barrier);
        }
@@ -1961,7 +1992,7 @@ emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *ex
                return;
        }
 
-       callee = ctx->lmodule->throw_corlib_exception;
+       callee = ctx->module->throw_corlib_exception;
        if (!callee) {
                LLVMTypeRef sig;
                const char *icall_name;
@@ -1972,17 +2003,17 @@ emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *ex
                if (ctx->cfg->compile_aot) {
                        callee = get_callee (ctx, sig, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
-                       callee = LLVMAddFunction (ctx->module, "llvm_throw_corlib_exception_trampoline", sig);
+                       callee = LLVMAddFunction (ctx->lmodule, "llvm_throw_corlib_exception_trampoline", sig);
 
                        /*
                         * Differences between the LLVM/non-LLVM throw corlib exception trampoline:
                         * - On x86, LLVM generated code doesn't push the arguments
                         * - The trampoline takes the throw address as an arguments, not a pc offset.
                         */
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
+                       LLVMAddGlobalMapping (ctx->module->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
 
                        mono_memory_barrier ();
-                       ctx->lmodule->throw_corlib_exception = callee;
+                       ctx->module->throw_corlib_exception = callee;
                }
        }
 
@@ -2139,7 +2170,7 @@ emit_vtype_to_args (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMV
 }
 
 static LLVMValueRef
-build_alloca_llvm_type (EmitContext *ctx, LLVMTypeRef t, int align)
+build_alloca_llvm_type_name (EmitContext *ctx, LLVMTypeRef t, int align, const char *name)
 {
        /*
         * Have to place all alloca's at the end of the entry bb, since otherwise they would
@@ -2147,10 +2178,16 @@ build_alloca_llvm_type (EmitContext *ctx, LLVMTypeRef t, int align)
         */
        LLVMPositionBuilder (ctx->alloca_builder, get_bb (ctx, ctx->cfg->bb_entry), ctx->last_alloca);
 
-       ctx->last_alloca = mono_llvm_build_alloca (ctx->alloca_builder, t, NULL, align, "");
+       ctx->last_alloca = mono_llvm_build_alloca (ctx->alloca_builder, t, NULL, align, name);
        return ctx->last_alloca;
 }
 
+static LLVMValueRef
+build_alloca_llvm_type (EmitContext *ctx, LLVMTypeRef t, int align)
+{
+       return build_alloca_llvm_type_name (ctx, t, align, "");
+}
+
 static LLVMValueRef
 build_alloca (EmitContext *ctx, MonoType *t)
 {
@@ -2173,30 +2210,30 @@ build_alloca (EmitContext *ctx, MonoType *t)
  * Put the global into the 'llvm.used' array to prevent it from being optimized away.
  */
 static void
-mark_as_used (MonoLLVMModule *lmodule, LLVMValueRef global)
+mark_as_used (MonoLLVMModule *module, LLVMValueRef global)
 {
-       if (!lmodule->used)
-               lmodule->used = g_ptr_array_sized_new (16);
-       g_ptr_array_add (lmodule->used, global);
+       if (!module->used)
+               module->used = g_ptr_array_sized_new (16);
+       g_ptr_array_add (module->used, global);
 }
 
 static void
-emit_llvm_used (MonoLLVMModule *lmodule)
+emit_llvm_used (MonoLLVMModule *module)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMTypeRef used_type;
        LLVMValueRef used, *used_elem;
        int i;
                
-       if (!lmodule->used)
+       if (!module->used)
                return;
 
-       used_type = LLVMArrayType (LLVMPointerType (LLVMInt8Type (), 0), lmodule->used->len);
-       used = LLVMAddGlobal (module, used_type, "llvm.used");
-       used_elem = g_new0 (LLVMValueRef, lmodule->used->len);
-       for (i = 0; i < lmodule->used->len; ++i)
-               used_elem [i] = LLVMConstBitCast ((LLVMValueRef)g_ptr_array_index (lmodule->used, i), LLVMPointerType (LLVMInt8Type (), 0));
-       LLVMSetInitializer (used, LLVMConstArray (LLVMPointerType (LLVMInt8Type (), 0), used_elem, lmodule->used->len));
+       used_type = LLVMArrayType (LLVMPointerType (LLVMInt8Type (), 0), module->used->len);
+       used = LLVMAddGlobal (lmodule, used_type, "llvm.used");
+       used_elem = g_new0 (LLVMValueRef, module->used->len);
+       for (i = 0; i < module->used->len; ++i)
+               used_elem [i] = LLVMConstBitCast ((LLVMValueRef)g_ptr_array_index (module->used, i), LLVMPointerType (LLVMInt8Type (), 0));
+       LLVMSetInitializer (used, LLVMConstArray (LLVMPointerType (LLVMInt8Type (), 0), used_elem, module->used->len));
        LLVMSetLinkage (used, LLVMAppendingLinkage);
        LLVMSetSection (used, "llvm.metadata");
 }
@@ -2207,9 +2244,9 @@ emit_llvm_used (MonoLLVMModule *lmodule)
  *   Emit a function mapping method indexes to their code
  */
 static void
-emit_get_method (MonoLLVMModule *lmodule)
+emit_get_method (MonoLLVMModule *module)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMValueRef func, switch_ins, m;
        LLVMBasicBlockRef entry_bb, fail_bb, bb, code_start_bb, code_end_bb;
        LLVMBasicBlockRef *bbs;
@@ -2223,11 +2260,11 @@ emit_get_method (MonoLLVMModule *lmodule)
         * but generating code seems safer.
         */
        rtype = LLVMPointerType (LLVMInt8Type (), 0);
-       func = LLVMAddFunction (module, lmodule->get_method_symbol, LLVMFunctionType1 (rtype, LLVMInt32Type (), FALSE));
+       func = LLVMAddFunction (lmodule, module->get_method_symbol, LLVMFunctionType1 (rtype, LLVMInt32Type (), FALSE));
        LLVMSetLinkage (func, LLVMExternalLinkage);
        LLVMSetVisibility (func, LLVMHiddenVisibility);
        LLVMAddFunctionAttr (func, LLVMNoUnwindAttribute);
-       lmodule->get_method = func;
+       module->get_method = func;
 
        entry_bb = LLVMAppendBasicBlock (func, "ENTRY");
 
@@ -2242,17 +2279,17 @@ emit_get_method (MonoLLVMModule *lmodule)
        g_free (name);
        builder = LLVMCreateBuilder ();
        LLVMPositionBuilderAtEnd (builder, code_start_bb);
-       LLVMBuildRet (builder, LLVMBuildBitCast (builder, lmodule->code_start, rtype, ""));
+       LLVMBuildRet (builder, LLVMBuildBitCast (builder, module->code_start, rtype, ""));
 
        name = g_strdup_printf ("BB_CODE_END");
        code_end_bb = LLVMAppendBasicBlock (func, name);
        g_free (name);
        builder = LLVMCreateBuilder ();
        LLVMPositionBuilderAtEnd (builder, code_end_bb);
-       LLVMBuildRet (builder, LLVMBuildBitCast (builder, lmodule->code_end, rtype, ""));
+       LLVMBuildRet (builder, LLVMBuildBitCast (builder, module->code_end, rtype, ""));
 
-       bbs = g_new0 (LLVMBasicBlockRef, lmodule->max_method_idx + 1);
-       for (i = 0; i < lmodule->max_method_idx + 1; ++i) {
+       bbs = g_new0 (LLVMBasicBlockRef, module->max_method_idx + 1);
+       for (i = 0; i < module->max_method_idx + 1; ++i) {
                name = g_strdup_printf ("BB_%d", i);
                bb = LLVMAppendBasicBlock (func, name);
                g_free (name);
@@ -2261,7 +2298,7 @@ emit_get_method (MonoLLVMModule *lmodule)
                builder = LLVMCreateBuilder ();
                LLVMPositionBuilderAtEnd (builder, bb);
 
-               m = (LLVMValueRef)g_hash_table_lookup (lmodule->idx_to_lmethod, GINT_TO_POINTER (i));
+               m = (LLVMValueRef)g_hash_table_lookup (module->idx_to_lmethod, GINT_TO_POINTER (i));
                if (m)
                        LLVMBuildRet (builder, LLVMBuildBitCast (builder, m, rtype, ""));
                else
@@ -2279,11 +2316,11 @@ emit_get_method (MonoLLVMModule *lmodule)
        switch_ins = LLVMBuildSwitch (builder, LLVMGetParam (func, 0), fail_bb, 0);
        LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), -1, FALSE), code_start_bb);
        LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), -2, FALSE), code_end_bb);
-       for (i = 0; i < lmodule->max_method_idx + 1; ++i) {
+       for (i = 0; i < module->max_method_idx + 1; ++i) {
                LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), i, FALSE), bbs [i]);
        }
 
-       mark_as_used (lmodule, func);
+       mark_as_used (module, func);
 }
 
 /*
@@ -2292,9 +2329,9 @@ emit_get_method (MonoLLVMModule *lmodule)
  *   Emit a function mapping method indexes to their unbox trampoline
  */
 static void
-emit_get_unbox_tramp (MonoLLVMModule *lmodule)
+emit_get_unbox_tramp (MonoLLVMModule *module)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMValueRef func, switch_ins, m;
        LLVMBasicBlockRef entry_bb, fail_bb, bb;
        LLVMBasicBlockRef *bbs;
@@ -2306,17 +2343,17 @@ emit_get_unbox_tramp (MonoLLVMModule *lmodule)
        /* Similar to emit_get_method () */
 
        rtype = LLVMPointerType (LLVMInt8Type (), 0);
-       func = LLVMAddFunction (module, lmodule->get_unbox_tramp_symbol, LLVMFunctionType1 (rtype, LLVMInt32Type (), FALSE));
+       func = LLVMAddFunction (lmodule, module->get_unbox_tramp_symbol, LLVMFunctionType1 (rtype, LLVMInt32Type (), FALSE));
        LLVMSetLinkage (func, LLVMExternalLinkage);
        LLVMSetVisibility (func, LLVMHiddenVisibility);
        LLVMAddFunctionAttr (func, LLVMNoUnwindAttribute);
-       lmodule->get_unbox_tramp = func;
+       module->get_unbox_tramp = func;
 
        entry_bb = LLVMAppendBasicBlock (func, "ENTRY");
 
-       bbs = g_new0 (LLVMBasicBlockRef, lmodule->max_method_idx + 1);
-       for (i = 0; i < lmodule->max_method_idx + 1; ++i) {
-               m = (LLVMValueRef)g_hash_table_lookup (lmodule->idx_to_unbox_tramp, GINT_TO_POINTER (i));
+       bbs = g_new0 (LLVMBasicBlockRef, module->max_method_idx + 1);
+       for (i = 0; i < module->max_method_idx + 1; ++i) {
+               m = (LLVMValueRef)g_hash_table_lookup (module->idx_to_unbox_tramp, GINT_TO_POINTER (i));
                if (!m)
                        continue;
 
@@ -2340,30 +2377,30 @@ emit_get_unbox_tramp (MonoLLVMModule *lmodule)
        LLVMPositionBuilderAtEnd (builder, entry_bb);
 
        switch_ins = LLVMBuildSwitch (builder, LLVMGetParam (func, 0), fail_bb, 0);
-       for (i = 0; i < lmodule->max_method_idx + 1; ++i) {
-               m = (LLVMValueRef)g_hash_table_lookup (lmodule->idx_to_unbox_tramp, GINT_TO_POINTER (i));
+       for (i = 0; i < module->max_method_idx + 1; ++i) {
+               m = (LLVMValueRef)g_hash_table_lookup (module->idx_to_unbox_tramp, GINT_TO_POINTER (i));
                if (!m)
                        continue;
 
                LLVMAddCase (switch_ins, LLVMConstInt (LLVMInt32Type (), i, FALSE), bbs [i]);
        }
 
-       mark_as_used (lmodule, func);
+       mark_as_used (module, func);
 }
 
 /* Add a function to mark the beginning of LLVM code */
 static void
-emit_llvm_code_start (MonoLLVMModule *lmodule)
+emit_llvm_code_start (MonoLLVMModule *module)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMValueRef func;
        LLVMBasicBlockRef entry_bb;
        LLVMBuilderRef builder;
 
-       func = LLVMAddFunction (module, "llvm_code_start", LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE));
+       func = LLVMAddFunction (lmodule, "llvm_code_start", LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE));
        LLVMSetLinkage (func, LLVMInternalLinkage);
        LLVMAddFunctionAttr (func, LLVMNoUnwindAttribute);
-       lmodule->code_start = func;
+       module->code_start = func;
        entry_bb = LLVMAppendBasicBlock (func, "ENTRY");
        builder = LLVMCreateBuilder ();
        LLVMPositionBuilderAtEnd (builder, entry_bb);
@@ -2371,9 +2408,9 @@ emit_llvm_code_start (MonoLLVMModule *lmodule)
 }
 
 static LLVMValueRef
-emit_init_icall_wrapper (MonoLLVMModule *lmodule, const char *name, const char *icall_name, int subtype)
+emit_init_icall_wrapper (MonoLLVMModule *module, const char *name, const char *icall_name, int subtype)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMValueRef func, indexes [2], got_entry_addr, args [16], callee;
        LLVMBasicBlockRef entry_bb;
        LLVMBuilderRef builder;
@@ -2383,15 +2420,15 @@ emit_init_icall_wrapper (MonoLLVMModule *lmodule, const char *name, const char *
 
        switch (subtype) {
        case 0:
-               func = LLVMAddFunction (module, name, LLVMFunctionType1 (LLVMVoidType (), LLVMInt32Type (), FALSE));
+               func = LLVMAddFunction (lmodule, name, LLVMFunctionType1 (LLVMVoidType (), LLVMInt32Type (), FALSE));
                sig = LLVMFunctionType2 (LLVMVoidType (), IntPtrType (), LLVMInt32Type (), FALSE);
                break;
        case 1:
-               func = LLVMAddFunction (module, name, LLVMFunctionType2 (LLVMVoidType (), LLVMInt32Type (), IntPtrType (), FALSE));
+               func = LLVMAddFunction (lmodule, name, LLVMFunctionType2 (LLVMVoidType (), LLVMInt32Type (), IntPtrType (), FALSE));
                sig = LLVMFunctionType3 (LLVMVoidType (), IntPtrType (), LLVMInt32Type (), IntPtrType (), FALSE);
                break;
        case 2:
-               func = LLVMAddFunction (module, name, LLVMFunctionType2 (LLVMVoidType (), LLVMInt32Type (), ObjRefType (), FALSE));
+               func = LLVMAddFunction (lmodule, name, LLVMFunctionType2 (LLVMVoidType (), LLVMInt32Type (), ObjRefType (), FALSE));
                sig = LLVMFunctionType3 (LLVMVoidType (), IntPtrType (), LLVMInt32Type (), ObjRefType (), FALSE);
                break;
        default:
@@ -2409,10 +2446,10 @@ emit_init_icall_wrapper (MonoLLVMModule *lmodule, const char *name, const char *
        ji->type = MONO_PATCH_INFO_AOT_MODULE;
        ji = mono_aot_patch_info_dup (ji);
        got_offset = mono_aot_get_got_offset (ji);
-       lmodule->max_got_offset = MAX (lmodule->max_got_offset, got_offset);
+       module->max_got_offset = MAX (module->max_got_offset, got_offset);
        indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
        indexes [1] = LLVMConstInt (LLVMInt32Type (), got_offset, FALSE);
-       got_entry_addr = LLVMBuildGEP (builder, lmodule->got_var, indexes, 2, "");
+       got_entry_addr = LLVMBuildGEP (builder, module->got_var, indexes, 2, "");
        args [0] = LLVMBuildPtrToInt (builder, LLVMBuildLoad (builder, got_entry_addr, ""), IntPtrType (), "");
        args [1] = LLVMGetParam (func, 0);
        if (subtype)
@@ -2423,10 +2460,10 @@ emit_init_icall_wrapper (MonoLLVMModule *lmodule, const char *name, const char *
        ji->data.name = icall_name;
        ji = mono_aot_patch_info_dup (ji);
        got_offset = mono_aot_get_got_offset (ji);
-       lmodule->max_got_offset = MAX (lmodule->max_got_offset, got_offset);
+       module->max_got_offset = MAX (module->max_got_offset, got_offset);
        indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
        indexes [1] = LLVMConstInt (LLVMInt32Type (), got_offset, FALSE);
-       got_entry_addr = LLVMBuildGEP (builder, lmodule->got_var, indexes, 2, "");
+       got_entry_addr = LLVMBuildGEP (builder, module->got_var, indexes, 2, "");
        callee = LLVMBuildLoad (builder, got_entry_addr, "");
        callee = LLVMBuildBitCast (builder, callee, LLVMPointerType (sig, 0), "");
        LLVMBuildCall (builder, callee, args, LLVMCountParamTypes (sig), "");
@@ -2434,7 +2471,7 @@ emit_init_icall_wrapper (MonoLLVMModule *lmodule, const char *name, const char *
        // Set the inited flag
        indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
        indexes [1] = LLVMGetParam (func, 0);
-       LLVMBuildStore (builder, LLVMConstInt (LLVMInt8Type (), 1, FALSE), LLVMBuildGEP (builder, lmodule->inited_var, indexes, 2, ""));
+       LLVMBuildStore (builder, LLVMConstInt (LLVMInt8Type (), 1, FALSE), LLVMBuildGEP (builder, module->inited_var, indexes, 2, ""));
 
        LLVMBuildRetVoid (builder);
 
@@ -2448,25 +2485,25 @@ emit_init_icall_wrapper (MonoLLVMModule *lmodule, const char *name, const char *
  * PreserveAll calling convention.
  */
 static void
-emit_init_icall_wrappers (MonoLLVMModule *lmodule)
+emit_init_icall_wrappers (MonoLLVMModule *module)
 {
-       lmodule->init_method = emit_init_icall_wrapper (lmodule, "init_method", "mono_aot_init_llvm_method", 0);
-       lmodule->init_method_gshared_rgctx = emit_init_icall_wrapper (lmodule, "init_method_gshared_rgctx", "mono_aot_init_gshared_method_rgctx", 1);
-       lmodule->init_method_gshared_this = emit_init_icall_wrapper (lmodule, "init_method_gshared_this", "mono_aot_init_gshared_method_this", 2);
+       module->init_method = emit_init_icall_wrapper (module, "init_method", "mono_aot_init_llvm_method", 0);
+       module->init_method_gshared_rgctx = emit_init_icall_wrapper (module, "init_method_gshared_rgctx", "mono_aot_init_gshared_method_rgctx", 1);
+       module->init_method_gshared_this = emit_init_icall_wrapper (module, "init_method_gshared_this", "mono_aot_init_gshared_method_this", 2);
 }
 
 static void
-emit_llvm_code_end (MonoLLVMModule *lmodule)
+emit_llvm_code_end (MonoLLVMModule *module)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMValueRef func;
        LLVMBasicBlockRef entry_bb;
        LLVMBuilderRef builder;
 
-       func = LLVMAddFunction (module, "llvm_code_end", LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE));
+       func = LLVMAddFunction (lmodule, "llvm_code_end", LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE));
        LLVMSetLinkage (func, LLVMInternalLinkage);
        LLVMAddFunctionAttr (func, LLVMNoUnwindAttribute);
-       lmodule->code_end = func;
+       module->code_end = func;
        entry_bb = LLVMAppendBasicBlock (func, "ENTRY");
        builder = LLVMCreateBuilder ();
        LLVMPositionBuilderAtEnd (builder, entry_bb);
@@ -2546,16 +2583,16 @@ emit_init_method (EmitContext *ctx)
        LLVMBuilderRef builder = ctx->builder;
        MonoCompile *cfg = ctx->cfg;
 
-       ctx->lmodule->max_inited_idx = MAX (ctx->lmodule->max_inited_idx, cfg->method_index);
-       ctx->lmodule->max_method_idx = MAX (ctx->lmodule->max_method_idx, cfg->method_index);
+       ctx->module->max_inited_idx = MAX (ctx->module->max_inited_idx, cfg->method_index);
+       ctx->module->max_method_idx = MAX (ctx->module->max_method_idx, cfg->method_index);
 
        indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
        indexes [1] = LLVMConstInt (LLVMInt32Type (), cfg->method_index, FALSE);
-       inited_var = LLVMBuildLoad (builder, LLVMBuildGEP (builder, ctx->lmodule->inited_var, indexes, 2, ""), "");
+       inited_var = LLVMBuildLoad (builder, LLVMBuildGEP (builder, ctx->module->inited_var, indexes, 2, ""), "is_inited");
 
        args [0] = inited_var;
        args [1] = LLVMConstInt (LLVMInt8Type (), 1, FALSE);
-       inited_var = LLVMBuildCall (ctx->builder, LLVMGetNamedFunction (ctx->module, "llvm.expect.i8"), args, 2, "");
+       inited_var = LLVMBuildCall (ctx->builder, LLVMGetNamedFunction (ctx->lmodule, "llvm.expect.i8"), args, 2, "");
 
        cmp = LLVMBuildICmp (builder, LLVMIntEQ, inited_var, LLVMConstInt (LLVMTypeOf (inited_var), 0, FALSE), "");
 
@@ -2571,16 +2608,16 @@ emit_init_method (EmitContext *ctx)
        if (ctx->rgctx_arg) {
                args [0] = LLVMConstInt (LLVMInt32Type (), cfg->method_index, 0);
                args [1] = convert (ctx, ctx->rgctx_arg, IntPtrType ());
-               callee = ctx->lmodule->init_method_gshared_rgctx;
+               callee = ctx->module->init_method_gshared_rgctx;
                call = LLVMBuildCall (builder, callee, args, 2, "");
        } else if (cfg->gshared) {
                args [0] = LLVMConstInt (LLVMInt32Type (), cfg->method_index, 0);
                args [1] = convert (ctx, ctx->this_arg, ObjRefType ());
-               callee = ctx->lmodule->init_method_gshared_this;
+               callee = ctx->module->init_method_gshared_this;
                call = LLVMBuildCall (builder, callee, args, 2, "");
        } else {
                args [0] = LLVMConstInt (LLVMInt32Type (), cfg->method_index, 0);
-               callee = ctx->lmodule->init_method;
+               callee = ctx->module->init_method;
                call = LLVMBuildCall (builder, callee, args, 1, "");
        }
 
@@ -2610,7 +2647,7 @@ emit_unbox_tramp (EmitContext *ctx, const char *method_name, LLVMTypeRef method_
        int i, nargs;
 
        tramp_name = g_strdup_printf ("ut_%s", method_name);
-       tramp = LLVMAddFunction (ctx->lmodule->module, tramp_name, method_type);
+       tramp = LLVMAddFunction (ctx->module->lmodule, tramp_name, method_type);
        LLVMSetLinkage (tramp, LLVMInternalLinkage);
        LLVMAddFunctionAttr (tramp, LLVMNoUnwindAttribute);
        if (!ctx->llvm_only && ctx->rgctx_arg_pindex != -1)
@@ -2641,7 +2678,7 @@ emit_unbox_tramp (EmitContext *ctx, const char *method_name, LLVMTypeRef method_
        else
                LLVMBuildRet (builder, call);
 
-       g_hash_table_insert (ctx->lmodule->idx_to_unbox_tramp, GINT_TO_POINTER (method_index), tramp);
+       g_hash_table_insert (ctx->module->idx_to_unbox_tramp, GINT_TO_POINTER (method_index), tramp);
 }
 
 /*
@@ -2657,6 +2694,7 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
        MonoMethodSignature *sig = ctx->sig;
        LLVMCallInfo *linfo = ctx->linfo;
        MonoBasicBlock *bb;
+       char **names;
 
        LLVMBuilderRef old_builder = ctx->builder;
        ctx->builder = builder;
@@ -2681,9 +2719,15 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                }
        }
 
+       names = g_new (char *, sig->param_count);
+       mono_method_get_param_names (cfg->method, (const char **) names);
+
        for (i = 0; i < sig->param_count; ++i) {
                LLVMArgInfo *ainfo = &linfo->args [i + sig->hasthis];
                int reg = cfg->args [i + sig->hasthis]->dreg;
+               char *name;
+
+               pindex = ainfo->pindex;
 
                switch (ainfo->storage) {
                case LLVMArgVtypeInReg:
@@ -2693,7 +2737,6 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
 
                        /* The argument is received as a set of int/fp arguments, store them into the real argument */
                        memset (args, 0, sizeof (args));
-                       pindex = ctx->pindexes [i];
                        if (ainfo->storage == LLVMArgVtypeInReg) {
                                args [0] = LLVMGetParam (ctx->lmethod, pindex);
                                if (ainfo->pair_storage [1] != LLVMArgNone)
@@ -2701,22 +2744,22 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                        } else {
                                g_assert (ainfo->nslots <= 8);
                                for (j = 0; j < ainfo->nslots; ++j)
-                                       args [j] = LLVMGetParam (ctx->lmethod, ctx->pindexes [i] + j);
+                                       args [j] = LLVMGetParam (ctx->lmethod, pindex + j);
                        }
-                       ctx->addresses [reg] = build_alloca (ctx, sig->params [i]);
+                       ctx->addresses [reg] = build_alloca (ctx, ainfo->type);
 
-                       emit_args_to_vtype (ctx, builder, sig->params [i], ctx->addresses [reg], ainfo, args);
+                       emit_args_to_vtype (ctx, builder, ainfo->type, ctx->addresses [reg], ainfo, args);
 
-                       if (ainfo->storage == LLVMArgVtypeInReg && MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (sig->params [i]))) {
+                       if (ainfo->storage == LLVMArgVtypeInReg && MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (ainfo->type))) {
                                /* Treat these as normal values */
                                ctx->values [reg] = LLVMBuildLoad (builder, ctx->addresses [reg], "");
                        }
                        break;
                }
                case LLVMArgVtypeByVal: {
-                       ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, ctx->pindexes [i]);
+                       ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex);
 
-                       if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (sig->params [i]))) {
+                       if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (ainfo->type))) {
                                /* Treat these as normal values */
                                ctx->values [reg] = LLVMBuildLoad (builder, ctx->addresses [reg], "");
                        }
@@ -2724,13 +2767,22 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                }
                case LLVMArgVtypeByRef: {
                        /* The argument is passed by ref */
-                       ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, ctx->pindexes [i]);
+                       ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex);
+                       break;
+               }
+               case LLVMArgScalarByRef: {
+                       if (names [i])
+                               name = g_strdup_printf ("arg_%s", names [i]);
+                       else
+                               name = g_strdup_printf ("arg_%d", i);
+                       ctx->values [reg] = LLVMBuildLoad (builder, LLVMGetParam (ctx->lmethod, pindex), name);
+                       g_free (name);
                        break;
                }
                case LLVMArgAsIArgs: {
-                       LLVMValueRef arg = LLVMGetParam (ctx->lmethod, ctx->pindexes [i]);
+                       LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex);
 
-                       ctx->addresses [reg] = build_alloca (ctx, sig->params [i]);
+                       ctx->addresses [reg] = build_alloca (ctx, ainfo->type);
 
                        /* The argument is received as an array of ints, store it into the real argument */
                        LLVMBuildStore (ctx->builder, arg, convert (ctx, ctx->addresses [reg], LLVMPointerType (LLVMTypeOf (arg), 0)));
@@ -2740,10 +2792,11 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                        g_assert_not_reached ();
                        break;
                default:
-                       ctx->values [reg] = convert_full (ctx, ctx->values [reg], llvm_type_to_stack_type (cfg, type_to_llvm_type (ctx, sig->params [i])), type_is_unsigned (ctx, sig->params [i]));
+                       ctx->values [reg] = convert_full (ctx, ctx->values [reg], llvm_type_to_stack_type (cfg, type_to_llvm_type (ctx, ainfo->type)), type_is_unsigned (ctx, ainfo->type));
                        break;
                }
        }
+       g_free (names);
 
        if (cfg->vret_addr)
                emit_volatile_store (ctx, cfg->vret_addr->dreg);
@@ -2856,7 +2909,7 @@ static void
 process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, MonoInst *ins)
 {
        MonoCompile *cfg = ctx->cfg;
-       LLVMModuleRef module = ctx->module;
+       LLVMModuleRef lmodule = ctx->lmodule;
        LLVMValueRef *values = ctx->values;
        LLVMValueRef *addresses = ctx->addresses;
        MonoCallInst *call = (MonoCallInst*)ins;
@@ -2871,20 +2924,20 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
        gpointer target;
        gboolean is_virtual, calli;
        LLVMBuilderRef builder = *builder_ref;
-       LLVMSigInfo sinfo;
 
        if (call->signature->call_convention != MONO_CALL_DEFAULT)
                LLVM_FAILURE (ctx, "non-default callconv");
 
        cinfo = call->cinfo;
+       g_assert (cinfo);
        if (call->rgctx_arg_reg)
                cinfo->rgctx_arg = TRUE;
        if (call->imt_arg_reg)
                cinfo->imt_arg = TRUE;
 
-       vretaddr = cinfo && (cinfo->ret.storage == LLVMArgVtypeRetAddr || cinfo->ret.storage == LLVMArgVtypeByRef);
+       vretaddr = (cinfo->ret.storage == LLVMArgVtypeRetAddr || cinfo->ret.storage == LLVMArgVtypeByRef || cinfo->ret.storage == LLVMArgScalarRetAddr);
 
-       llvm_sig = sig_to_llvm_sig_full (ctx, sig, cinfo, &sinfo);
+       llvm_sig = sig_to_llvm_sig_full (ctx, sig, cinfo);
        CHECK_FAILURE (ctx);
 
        is_virtual = (ins->opcode == OP_VOIDCALL_MEMBASE || ins->opcode == OP_CALL_MEMBASE || ins->opcode == OP_VCALL_MEMBASE || ins->opcode == OP_LCALL_MEMBASE || ins->opcode == OP_FCALL_MEMBASE || ins->opcode == OP_RCALL_MEMBASE);
@@ -2901,7 +2954,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                                if (!callee)
                                        LLVM_FAILURE (ctx, "can't encode patch");
 
-                               if (cfg->llvm_only && call->method->klass->image->assembly == ctx->lmodule->assembly) {
+                               if (cfg->llvm_only && call->method->klass->image->assembly == ctx->module->assembly) {
                                        /*
                                         * Collect instructions representing the callee into a hash so they can be replaced
                                         * by the llvm method for the callee if the callee turns out to be direct
@@ -2912,12 +2965,12 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                                        g_hash_table_insert (ctx->method_to_callers, call->method, l);
                                }
                        } else {
-                               callee = LLVMAddFunction (module, "", llvm_sig);
+                               callee = LLVMAddFunction (lmodule, "", llvm_sig);
  
                                target =
                                        mono_create_jit_trampoline_in_domain (mono_domain_get (),
                                                                                                                  call->method);
-                               LLVMAddGlobalMapping (ctx->lmodule->ee, callee, target);
+                               LLVMAddGlobalMapping (ctx->module->ee, callee, target);
                        }
                }
 
@@ -2943,9 +2996,9 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                                if (!callee)
                                        LLVM_FAILURE (ctx, "can't encode patch");
                        } else {
-                               callee = LLVMAddFunction (module, "", llvm_sig);
+                               callee = LLVMAddFunction (lmodule, "", llvm_sig);
                                target = (gpointer)mono_icall_get_wrapper (info);
-                               LLVMAddGlobalMapping (ctx->lmodule->ee, callee, target);
+                               LLVMAddGlobalMapping (ctx->module->ee, callee, target);
                        }
                } else {
                        if (cfg->compile_aot) {
@@ -2961,7 +3014,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                                if (!callee)
                                        LLVM_FAILURE (ctx, "aot");
                        } else {
-                               callee = LLVMAddFunction (module, "", llvm_sig);
+                               callee = LLVMAddFunction (lmodule, "", llvm_sig);
                                target = NULL;
                                if (cfg->abs_patches) {
                                        MonoJumpInfo *abs_ji = (MonoJumpInfo*)g_hash_table_lookup (cfg->abs_patches, call->fptr);
@@ -2976,11 +3029,11 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                                                        LLVM_FAILURE (ctx, "trampoline with own cconv");
 #endif
                                                target = mono_resolve_patch_target (cfg->method, cfg->domain, NULL, abs_ji, FALSE);
-                                               LLVMAddGlobalMapping (ctx->lmodule->ee, callee, target);
+                                               LLVMAddGlobalMapping (ctx->module->ee, callee, target);
                                        }
                                }
                                if (!target)
-                                       LLVMAddGlobalMapping (ctx->lmodule->ee, callee, (gpointer)call->fptr);
+                                       LLVMAddGlobalMapping (ctx->module->ee, callee, (gpointer)call->fptr);
                        }
                }
        }
@@ -3011,7 +3064,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
 
        if (call->rgctx_arg_reg) {
                g_assert (values [call->rgctx_arg_reg]);
-               g_assert (sinfo.rgctx_arg_pindex < nargs);
+               g_assert (cinfo->rgctx_arg_pindex < nargs);
                /*
                 * On ARM, the imt/rgctx argument is passed in a caller save register, but some of our trampolines etc. clobber it, leading to
                 * problems is LLVM moves the arg assignment earlier. To work around this, save the argument into a stack slot and load
@@ -3019,49 +3072,42 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                 */
 #ifdef TARGET_ARM
                if (!ctx->imt_rgctx_loc)
-                       ctx->imt_rgctx_loc = build_alloca_llvm_type (ctx, ctx->lmodule->ptr_type, sizeof (gpointer));
-               LLVMBuildStore (builder, convert (ctx, ctx->values [call->rgctx_arg_reg], ctx->lmodule->ptr_type), ctx->imt_rgctx_loc);
-               args [sinfo.rgctx_arg_pindex] = mono_llvm_build_load (builder, ctx->imt_rgctx_loc, "", TRUE, LLVM_BARRIER_NONE);
+                       ctx->imt_rgctx_loc = build_alloca_llvm_type (ctx, ctx->module->ptr_type, sizeof (gpointer));
+               LLVMBuildStore (builder, convert (ctx, ctx->values [call->rgctx_arg_reg], ctx->module->ptr_type), ctx->imt_rgctx_loc);
+               args [cinfo->rgctx_arg_pindex] = mono_llvm_build_load (builder, ctx->imt_rgctx_loc, "", TRUE, LLVM_BARRIER_NONE);
 #else
-               args [sinfo.rgctx_arg_pindex] = convert (ctx, values [call->rgctx_arg_reg], ctx->lmodule->ptr_type);
+               args [cinfo->rgctx_arg_pindex] = convert (ctx, values [call->rgctx_arg_reg], ctx->module->ptr_type);
 #endif
        }
        if (call->imt_arg_reg) {
                g_assert (!ctx->llvm_only);
                g_assert (values [call->imt_arg_reg]);
-               g_assert (sinfo.imt_arg_pindex < nargs);
+               g_assert (cinfo->imt_arg_pindex < nargs);
 #ifdef TARGET_ARM
                if (!ctx->imt_rgctx_loc)
-                       ctx->imt_rgctx_loc = build_alloca_llvm_type (ctx, ctx->lmodule->ptr_type, sizeof (gpointer));
-               LLVMBuildStore (builder, convert (ctx, ctx->values [call->imt_arg_reg], ctx->lmodule->ptr_type), ctx->imt_rgctx_loc);
-               args [sinfo.imt_arg_pindex] = mono_llvm_build_load (builder, ctx->imt_rgctx_loc, "", TRUE, LLVM_BARRIER_NONE);
+                       ctx->imt_rgctx_loc = build_alloca_llvm_type (ctx, ctx->module->ptr_type, sizeof (gpointer));
+               LLVMBuildStore (builder, convert (ctx, ctx->values [call->imt_arg_reg], ctx->module->ptr_type), ctx->imt_rgctx_loc);
+               args [cinfo->imt_arg_pindex] = mono_llvm_build_load (builder, ctx->imt_rgctx_loc, "", TRUE, LLVM_BARRIER_NONE);
 #else
-               args [sinfo.imt_arg_pindex] = convert (ctx, values [call->imt_arg_reg], ctx->lmodule->ptr_type);
+               args [cinfo->imt_arg_pindex] = convert (ctx, values [call->imt_arg_reg], ctx->module->ptr_type);
 #endif
        }
        if (vretaddr) {
                if (!addresses [call->inst.dreg])
                        addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
-               g_assert (sinfo.vret_arg_pindex < nargs);
-               if (cinfo && cinfo->ret.storage == LLVMArgVtypeByRef)
-                       args [sinfo.vret_arg_pindex] = addresses [call->inst.dreg];
+               g_assert (cinfo->vret_arg_pindex < nargs);
+               if (cinfo->ret.storage == LLVMArgVtypeByRef)
+                       args [cinfo->vret_arg_pindex] = addresses [call->inst.dreg];
                else
-                       args [sinfo.vret_arg_pindex] = LLVMBuildPtrToInt (builder, addresses [call->inst.dreg], IntPtrType (), "");
+                       args [cinfo->vret_arg_pindex] = LLVMBuildPtrToInt (builder, addresses [call->inst.dreg], IntPtrType (), "");
        }
 
        for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
                guint32 regpair;
                int reg, pindex;
-               LLVMArgInfo *ainfo = call->cinfo ? &call->cinfo->args [i] : NULL;
+               LLVMArgInfo *ainfo = &call->cinfo->args [i];
 
-               if (sig->hasthis) {
-                       if (i == 0)
-                               pindex = sinfo.this_arg_pindex;
-                       else
-                               pindex = sinfo.pindexes [i - 1];
-               } else {
-                       pindex = sinfo.pindexes [i];
-               }
+               pindex = ainfo->pindex;
 
                regpair = (guint32)(gssize)(l->data);
                reg = regpair & 0xffffff;
@@ -3072,7 +3118,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                        guint32 nargs;
 
                        g_assert (addresses [reg]);
-                       emit_vtype_to_args (ctx, builder, sig->params [i - sig->hasthis], addresses [reg], ainfo, args + pindex, &nargs);
+                       emit_vtype_to_args (ctx, builder, ainfo->type, addresses [reg], ainfo, args + pindex, &nargs);
                        pindex += nargs;
 
                        // FIXME: alignment
@@ -3084,9 +3130,11 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                        args [pindex] = addresses [reg];
                        break;
                case LLVMArgVtypeByRef:
+               case LLVMArgScalarByRef: {
                        g_assert (addresses [reg]);
-                       args [pindex] = addresses [reg];
+                       args [pindex] = convert (ctx, addresses [reg], LLVMPointerType (type_to_llvm_arg_type (ctx, ainfo->type), 0));
                        break;
+               }
                case LLVMArgAsIArgs:
                        g_assert (addresses [reg]);
                        args [pindex] = LLVMBuildLoad (ctx->builder, convert (ctx, addresses [reg], LLVMPointerType (LLVMArrayType (IntPtrType (), ainfo->nslots), 0)), "");
@@ -3099,7 +3147,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                        if (i == 0 && sig->hasthis)
                                args [pindex] = convert (ctx, args [pindex], ThisType ());
                        else
-                               args [pindex] = convert (ctx, args [pindex], type_to_llvm_arg_type (ctx, sig->params [i - sig->hasthis]));
+                               args [pindex] = convert (ctx, args [pindex], type_to_llvm_arg_type (ctx, ainfo->type));
                        break;
                }
                g_assert (pindex <= nargs);
@@ -3126,81 +3174,72 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
        if (!sig->pinvoke && !cfg->llvm_only)
                LLVMSetInstructionCallConv (lcall, LLVMMono1CallConv);
 
-       if (cinfo && cinfo->ret.storage == LLVMArgVtypeByRef)
-               LLVMAddInstrAttribute (lcall, 1 + sinfo.vret_arg_pindex, LLVMStructRetAttribute);
+       if (cinfo->ret.storage == LLVMArgVtypeByRef)
+               LLVMAddInstrAttribute (lcall, 1 + cinfo->vret_arg_pindex, LLVMStructRetAttribute);
        if (!ctx->llvm_only && call->rgctx_arg_reg)
-               LLVMAddInstrAttribute (lcall, 1 + sinfo.rgctx_arg_pindex, LLVMInRegAttribute);
+               LLVMAddInstrAttribute (lcall, 1 + cinfo->rgctx_arg_pindex, LLVMInRegAttribute);
        if (call->imt_arg_reg)
-               LLVMAddInstrAttribute (lcall, 1 + sinfo.imt_arg_pindex, LLVMInRegAttribute);
+               LLVMAddInstrAttribute (lcall, 1 + cinfo->imt_arg_pindex, LLVMInRegAttribute);
 
        /* Add byval attributes if needed */
        for (i = 0; i < sig->param_count; ++i) {
-               LLVMArgInfo *ainfo = call->cinfo ? &call->cinfo->args [i + sig->hasthis] : NULL;
+               LLVMArgInfo *ainfo = &call->cinfo->args [i + sig->hasthis];
 
-               if (ainfo && ainfo->storage == LLVMArgVtypeByVal) {
-                       LLVMAddInstrAttribute (lcall, 1 + sinfo.pindexes [i], LLVMByValAttribute);
-               }
+               if (ainfo && ainfo->storage == LLVMArgVtypeByVal)
+                       LLVMAddInstrAttribute (lcall, 1 + ainfo->pindex, LLVMByValAttribute);
        }
 
        /*
         * Convert the result
         */
-       if (cinfo) {
-               switch (cinfo->ret.storage) {
-               case LLVMArgVtypeInReg: {
-                       LLVMValueRef regs [2];
+       switch (cinfo->ret.storage) {
+       case LLVMArgVtypeInReg: {
+               LLVMValueRef regs [2];
 
-                       if (LLVMTypeOf (lcall) == LLVMVoidType ())
-                               /* Empty struct */
-                               break;
+               if (LLVMTypeOf (lcall) == LLVMVoidType ())
+                       /* Empty struct */
+                       break;
 
-                       if (!addresses [ins->dreg])
-                               addresses [ins->dreg] = build_alloca (ctx, sig->ret);
+               if (!addresses [ins->dreg])
+                       addresses [ins->dreg] = build_alloca (ctx, sig->ret);
 
-                       regs [0] = LLVMBuildExtractValue (builder, lcall, 0, "");
-                       if (cinfo->ret.pair_storage [1] != LLVMArgNone)
-                               regs [1] = LLVMBuildExtractValue (builder, lcall, 1, "");
-                       emit_args_to_vtype (ctx, builder, sig->ret, addresses [ins->dreg], &cinfo->ret, regs);
-                       break;
-               }
-               case LLVMArgVtypeByVal:
-                       if (!addresses [call->inst.dreg])
-                               addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
-                       LLVMBuildStore (builder, lcall, addresses [call->inst.dreg]);
-                       break;
-               case LLVMArgFpStruct:
-                       if (!addresses [call->inst.dreg])
-                               addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
-                       LLVMBuildStore (builder, lcall, convert_full (ctx, addresses [call->inst.dreg], LLVMPointerType (LLVMTypeOf (lcall), 0), FALSE));
-                       break;
-               case LLVMArgVtypeAsScalar:
-                       if (!addresses [call->inst.dreg])
-                               addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
-                       LLVMBuildStore (builder, lcall, convert_full (ctx, addresses [call->inst.dreg], LLVMPointerType (LLVMTypeOf (lcall), 0), FALSE));
-                       break;
-               default:
-                       if (sig->ret->type != MONO_TYPE_VOID && !vretaddr)
-                               /* If the method returns an unsigned value, need to zext it */
-                               values [ins->dreg] = convert_full (ctx, lcall, llvm_type_to_stack_type (cfg, type_to_llvm_type (ctx, sig->ret)), type_is_unsigned (ctx, sig->ret));
-                       break;
-               }
-       } else {
-               if (sig->ret->type != MONO_TYPE_VOID && !vretaddr)
-                       /* If the method returns an unsigned value, need to zext it */
-                       values [ins->dreg] = convert_full (ctx, lcall, llvm_type_to_stack_type (cfg, type_to_llvm_type (ctx, sig->ret)), type_is_unsigned (ctx, sig->ret));
+               regs [0] = LLVMBuildExtractValue (builder, lcall, 0, "");
+               if (cinfo->ret.pair_storage [1] != LLVMArgNone)
+                       regs [1] = LLVMBuildExtractValue (builder, lcall, 1, "");
+               emit_args_to_vtype (ctx, builder, sig->ret, addresses [ins->dreg], &cinfo->ret, regs);
+               break;
        }
-
-       if (vretaddr) {
+       case LLVMArgVtypeByVal:
+               if (!addresses [call->inst.dreg])
+                       addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
+               LLVMBuildStore (builder, lcall, addresses [call->inst.dreg]);
+               break;
+       case LLVMArgFpStruct:
+               if (!addresses [call->inst.dreg])
+                       addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
+               LLVMBuildStore (builder, lcall, convert_full (ctx, addresses [call->inst.dreg], LLVMPointerType (LLVMTypeOf (lcall), 0), FALSE));
+               break;
+       case LLVMArgVtypeAsScalar:
                if (!addresses [call->inst.dreg])
                        addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
-               g_assert (sinfo.vret_arg_pindex < nargs);
-               args [sinfo.vret_arg_pindex] = LLVMBuildPtrToInt (builder, addresses [call->inst.dreg], IntPtrType (), "");
+               LLVMBuildStore (builder, lcall, convert_full (ctx, addresses [call->inst.dreg], LLVMPointerType (LLVMTypeOf (lcall), 0), FALSE));
+               break;
+       case LLVMArgVtypeRetAddr:
+       case LLVMArgVtypeByRef:
+               break;
+       case LLVMArgScalarRetAddr:
+               /* Normal scalar returned using a vtype return argument */
+               values [ins->dreg] = LLVMBuildLoad (builder, convert_full (ctx, addresses [call->inst.dreg], LLVMPointerType (type_to_llvm_type (ctx, sig->ret), 0), FALSE), "");
+               break;
+       default:
+               if (sig->ret->type != MONO_TYPE_VOID)
+                       /* If the method returns an unsigned value, need to zext it */
+                       values [ins->dreg] = convert_full (ctx, lcall, llvm_type_to_stack_type (cfg, type_to_llvm_type (ctx, sig->ret)), type_is_unsigned (ctx, sig->ret));
+               break;
        }
 
        *builder_ref = ctx->builder;
 
-       g_free (sinfo.pindexes);
-       
        return;
  FAILURE:
        return;
@@ -3210,7 +3249,7 @@ static void
 emit_llvmonly_throw (EmitContext *ctx, MonoBasicBlock *bb, gboolean rethrow, LLVMValueRef exc)
 {
        const char *icall_name = rethrow ? "mono_llvm_rethrow_exception" : "mono_llvm_throw_exception";
-       LLVMValueRef callee = rethrow ? ctx->lmodule->rethrow : ctx->lmodule->throw_icall;
+       LLVMValueRef callee = rethrow ? ctx->module->rethrow : ctx->module->throw_icall;
 
        LLVMTypeRef exc_type = type_to_llvm_type (ctx, &mono_get_exception_class ()->byval_arg);
 
@@ -3220,14 +3259,14 @@ emit_llvmonly_throw (EmitContext *ctx, MonoBasicBlock *bb, gboolean rethrow, LLV
                if (ctx->cfg->compile_aot) {
                        callee = get_callee (ctx, fun_sig, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
-                       callee = LLVMAddFunction (ctx->module, icall_name, fun_sig);
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
+                       callee = LLVMAddFunction (ctx->lmodule, icall_name, fun_sig);
+                       LLVMAddGlobalMapping (ctx->module->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
                        mono_memory_barrier ();
 
                        if (rethrow)
-                               ctx->lmodule->rethrow = callee;
+                               ctx->module->rethrow = callee;
                        else
-                               ctx->lmodule->throw_icall = callee;
+                               ctx->module->throw_icall = callee;
                }
        }
 
@@ -3248,7 +3287,7 @@ emit_throw (EmitContext *ctx, MonoBasicBlock *bb, gboolean rethrow, LLVMValueRef
        LLVMValueRef callee, arg;
        const char *icall_name;
                                
-       callee = rethrow ? ctx->lmodule->rethrow : ctx->lmodule->throw_icall;
+       callee = rethrow ? ctx->module->rethrow : ctx->module->throw_icall;
        icall_name = rethrow ? "mono_arch_rethrow_exception" : "mono_arch_throw_exception";
 
        if (!callee) {
@@ -3258,24 +3297,24 @@ emit_throw (EmitContext *ctx, MonoBasicBlock *bb, gboolean rethrow, LLVMValueRef
                if (ctx->cfg->compile_aot) {
                        callee = get_callee (ctx, sig_to_llvm_sig (ctx, throw_sig), MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
-                       callee = LLVMAddFunction (ctx->module, icall_name, sig_to_llvm_sig (ctx, throw_sig));
+                       callee = LLVMAddFunction (ctx->lmodule, icall_name, sig_to_llvm_sig (ctx, throw_sig));
 
 #ifdef TARGET_X86
                        /* 
                         * LLVM doesn't push the exception argument, so we need a different
                         * trampoline.
                         */
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, rethrow ? "llvm_rethrow_exception_trampoline" : "llvm_throw_exception_trampoline"));
+                       LLVMAddGlobalMapping (ctx->module->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, rethrow ? "llvm_rethrow_exception_trampoline" : "llvm_throw_exception_trampoline"));
 #else
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
+                       LLVMAddGlobalMapping (ctx->module->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
 #endif
                }
 
                mono_memory_barrier ();
                if (rethrow)
-                       ctx->lmodule->rethrow = callee;
+                       ctx->module->rethrow = callee;
                else
-                       ctx->lmodule->throw_icall = callee;
+                       ctx->module->throw_icall = callee;
        }
        arg = convert (ctx, exc, type_to_llvm_type (ctx, &mono_get_object_class ()->byval_arg));
        emit_call (ctx, bb, &ctx->builder, callee, &arg, 1);
@@ -3285,7 +3324,7 @@ static void
 emit_resume_eh (EmitContext *ctx, MonoBasicBlock *bb)
 {
        const char *icall_name = "mono_llvm_resume_exception";
-       LLVMValueRef callee = ctx->lmodule->resume_eh;
+       LLVMValueRef callee = ctx->module->resume_eh;
 
        LLVMTypeRef fun_sig = LLVMFunctionType0 (LLVMVoidType (), FALSE);
 
@@ -3293,11 +3332,11 @@ emit_resume_eh (EmitContext *ctx, MonoBasicBlock *bb)
                if (ctx->cfg->compile_aot) {
                        callee = get_callee (ctx, fun_sig, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
-                       callee = LLVMAddFunction (ctx->module, icall_name, fun_sig);
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
+                       callee = LLVMAddFunction (ctx->lmodule, icall_name, fun_sig);
+                       LLVMAddGlobalMapping (ctx->module->ee, callee, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
                        mono_memory_barrier ();
 
-                       ctx->lmodule->resume_eh = callee;
+                       ctx->module->resume_eh = callee;
                }
        }
 
@@ -3321,7 +3360,7 @@ mono_llvm_emit_clear_exception_call (EmitContext *ctx, LLVMBuilderRef builder)
                        callee = get_callee (ctx, call_sig, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
                        // FIXME: This is broken.
-                       callee = LLVMAddFunction (ctx->module, icall_name, call_sig);
+                       callee = LLVMAddFunction (ctx->lmodule, icall_name, call_sig);
                }
        }
 
@@ -3343,7 +3382,7 @@ mono_llvm_emit_load_exception_call (EmitContext *ctx, LLVMBuilderRef builder)
                        callee = get_callee (ctx, call_sig, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
                        // FIXME: This is broken.
-                       callee = LLVMAddFunction (ctx->module, icall_name, call_sig);
+                       callee = LLVMAddFunction (ctx->lmodule, icall_name, call_sig);
                }
        }
 
@@ -3367,7 +3406,7 @@ mono_llvm_emit_match_exception_call (EmitContext *ctx, LLVMBuilderRef builder, g
        args [2] = LLVMConstInt (LLVMInt32Type (), region_end, 0);
 
        LLVMTypeRef match_sig = LLVMFunctionType3 (LLVMInt32Type (), IntPtrType (), LLVMInt32Type (), LLVMInt32Type (), FALSE);
-       LLVMValueRef callee = ctx->lmodule->match_exc;
+       LLVMValueRef callee = ctx->module->match_exc;
 
        if (!callee) {
                if (ctx->cfg->compile_aot) {
@@ -3375,9 +3414,9 @@ mono_llvm_emit_match_exception_call (EmitContext *ctx, LLVMBuilderRef builder, g
                        // get_callee expects ctx->builder to be the emitting builder
                        callee = get_callee (ctx, match_sig, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name);
                } else {
-                       callee = ctx->lmodule->match_exc = LLVMAddFunction (ctx->module, icall_name, match_sig);
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, ctx->lmodule->match_exc, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
-                       ctx->lmodule->match_exc = callee;
+                       callee = ctx->module->match_exc = LLVMAddFunction (ctx->lmodule, icall_name, match_sig);
+                       LLVMAddGlobalMapping (ctx->module->ee, ctx->module->match_exc, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, icall_name));
+                       ctx->module->match_exc = callee;
                        mono_memory_barrier ();
                }
        }
@@ -3427,17 +3466,17 @@ get_mono_personality (EmitContext *ctx)
 
        if (!use_debug_personality) {
                if (ctx->cfg->compile_aot) {
-                               personality = LLVMGetNamedFunction (ctx->module, default_personality_name);
+                               personality = LLVMGetNamedFunction (ctx->lmodule, default_personality_name);
                } else if (InterlockedCompareExchange (&mapping_inited, 1, 0) == 0) {
-                               personality = LLVMAddFunction (ctx->module, default_personality_name, personality_type);
-                               LLVMAddGlobalMapping (ctx->lmodule->ee, personality, personality);
+                               personality = LLVMAddFunction (ctx->lmodule, default_personality_name, personality_type);
+                               LLVMAddGlobalMapping (ctx->module->ee, personality, personality);
                }
        } else {
                if (ctx->cfg->compile_aot) {
                        personality = get_callee (ctx, personality_type, MONO_PATCH_INFO_INTERNAL_METHOD, default_personality_name);
                } else {
-                       personality = LLVMAddFunction (ctx->module, default_personality_name, personality_type);
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, personality, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, default_personality_name));
+                       personality = LLVMAddFunction (ctx->lmodule, default_personality_name, personality_type);
+                       LLVMAddGlobalMapping (ctx->module->ee, personality, resolve_patch (ctx->cfg, MONO_PATCH_INFO_INTERNAL_METHOD, default_personality_name));
                        mono_memory_barrier ();
                }
        }
@@ -3470,7 +3509,7 @@ emit_landing_pad (EmitContext *ctx, int group_index, int group_size)
        LLVMValueRef landing_pad = LLVMBuildLandingPad (lpadBuilder, default_cpp_lpad_exc_signature (), personality, 0, "");
        g_assert (landing_pad);
 
-       LLVMValueRef cast = LLVMBuildBitCast (lpadBuilder, ctx->lmodule->sentinel_exception, LLVMPointerType (LLVMInt8Type (), 0), "int8TypeInfo");
+       LLVMValueRef cast = LLVMBuildBitCast (lpadBuilder, ctx->module->sentinel_exception, LLVMPointerType (LLVMInt8Type (), 0), "int8TypeInfo");
        LLVMAddClause (landing_pad, cast);
 
        LLVMBasicBlockRef resume_bb = gen_bb (ctx, "RESUME_BB");
@@ -3568,7 +3607,7 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
 {
        MonoCompile *cfg = ctx->cfg;
        LLVMValueRef *values = ctx->values;
-       LLVMModuleRef module = ctx->module;
+       LLVMModuleRef lmodule = ctx->lmodule;
        BBInfo *bblocks = ctx->bblocks;
        LLVMTypeRef i8ptr;
        LLVMValueRef personality;
@@ -3587,12 +3626,12 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
 
        if (cfg->compile_aot) {
                /* Use a dummy personality function */
-               personality = LLVMGetNamedFunction (module, "mono_personality");
+               personality = LLVMGetNamedFunction (lmodule, "mono_personality");
                g_assert (personality);
        } else {
-               personality = LLVMGetNamedFunction (module, "mono_personality");
+               personality = LLVMGetNamedFunction (lmodule, "mono_personality");
                if (InterlockedCompareExchange (&mapping_inited, 1, 0) == 0)
-                       LLVMAddGlobalMapping (ctx->lmodule->ee, personality, mono_personality);
+                       LLVMAddGlobalMapping (ctx->module->ee, personality, mono_personality);
        }
 
        i8ptr = LLVMPointerType (LLVMInt8Type (), 0);
@@ -3607,7 +3646,7 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
 
        if (cfg->compile_aot) {
                /* decode_eh_frame () in aot-runtime.c will decode this */
-               type_info = LLVMAddGlobal (module, LLVMInt32Type (), ti_name);
+               type_info = LLVMAddGlobal (lmodule, LLVMInt32Type (), ti_name);
                LLVMSetInitializer (type_info, LLVMConstInt (LLVMInt32Type (), clause_index, FALSE));
 
                /*
@@ -3623,9 +3662,9 @@ emit_handler_start (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef builder
                ti = mono_mempool_alloc (cfg->mempool, sizeof (gint32));
                *(gint32*)ti = clause_index;
 
-               type_info = LLVMAddGlobal (module, i8ptr, ti_name);
+               type_info = LLVMAddGlobal (lmodule, i8ptr, ti_name);
 
-               LLVMAddGlobalMapping (ctx->lmodule->ee, type_info, ti);
+               LLVMAddGlobalMapping (ctx->module->ee, type_info, ti);
        }
 
        {
@@ -3703,7 +3742,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
        LLVMValueRef *values = ctx->values;
        LLVMValueRef *addresses = ctx->addresses;
        LLVMCallInfo *linfo = ctx->linfo;
-       LLVMModuleRef module = ctx->module;
+       LLVMModuleRef lmodule = ctx->lmodule;
        BBInfo *bblocks = ctx->bblocks;
        MonoInst *ins;
        LLVMBasicBlockRef cbb;
@@ -3932,6 +3971,16 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                LLVMBuildRetVoid (builder);
                                break;
                        }
+                       case LLVMArgScalarRetAddr: {
+                               LLVMTypeRef ret_type = type_to_llvm_type (ctx, sig->ret);
+                               LLVMValueRef param = LLVMGetParam (method, linfo->vret_arg_pindex);
+
+                               /* sreg1 might not be set */
+                               if (lhs)
+                                       LLVMBuildStore (builder, convert (ctx, lhs, ret_type), convert (ctx, param, LLVMPointerType (ret_type, 0)));
+                               LLVMBuildRetVoid (builder);
+                               break;
+                       }
                        case LLVMArgFpStruct: {
                                LLVMTypeRef ret_type = LLVMGetReturnType (LLVMGetElementType (LLVMTypeOf (method)));
                                LLVMValueRef retval;
@@ -3941,7 +3990,8 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                LLVMBuildRet (builder, retval);
                                break;
                        }
-                       default: {
+                       case LLVMArgNone:
+                       case LLVMArgNormal: {
                                if (!lhs || ctx->is_dead [ins->sreg1]) {
                                        /*
                                         * The method did not set its return value, probably because it
@@ -3957,6 +4007,9 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                has_terminator = TRUE;
                                break;
                        }
+                       default:
+                               g_assert_not_reached ();
+                               break;
                        }
                        break;
                case OP_ICOMPARE:
@@ -4583,7 +4636,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                args [2] = LLVMConstInt (LLVMInt32Type (), size, FALSE);
                                args [3] = LLVMConstInt (LLVMInt32Type (), MONO_ARCH_FRAME_ALIGNMENT, FALSE);
                                args [4] = LLVMConstInt (LLVMInt1Type (), 0, FALSE);
-                               LLVMBuildCall (builder, LLVMGetNamedFunction (module, memset_func_name), args, memset_param_count, "");
+                               LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, memset_func_name), args, memset_param_count, "");
                        }
 
                        values [ins->dreg] = v;
@@ -4604,7 +4657,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                args [2] = size;
                                args [3] = LLVMConstInt (LLVMInt32Type (), MONO_ARCH_FRAME_ALIGNMENT, FALSE);
                                args [4] = LLVMConstInt (LLVMInt1Type (), 0, FALSE);
-                               LLVMBuildCall (builder, LLVMGetNamedFunction (module, memset_func_name), args, memset_param_count, "");
+                               LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, memset_func_name), args, memset_param_count, "");
                        }
                        values [ins->dreg] = v;
                        break;
@@ -4762,25 +4815,27 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                case OP_AOTCONST: {
                        guint32 got_offset;
                        LLVMValueRef indexes [2];
-                       MonoJumpInfo *ji;
+                       MonoJumpInfo *tmp_ji, *ji;
                        LLVMValueRef got_entry_addr;
+                       char *name;
 
                        /* 
                         * FIXME: Can't allocate from the cfg mempool since that is freed if
                         * the LLVM compile fails.
                         */
-                       ji = g_new0 (MonoJumpInfo, 1);
-                       ji->type = (MonoJumpInfoType)ins->inst_c1;
-                       ji->data.target = ins->inst_p0;
+                       tmp_ji = g_new0 (MonoJumpInfo, 1);
+                       tmp_ji->type = (MonoJumpInfoType)ins->inst_c1;
+                       tmp_ji->data.target = ins->inst_p0;
 
-                       ji = mono_aot_patch_info_dup (ji);
+                       ji = mono_aot_patch_info_dup (tmp_ji);
+                       g_free (tmp_ji);
 
                        ji->next = cfg->patch_info;
                        cfg->patch_info = ji;
                                   
                        //mono_add_patch_info (cfg, 0, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
                        got_offset = mono_aot_get_got_offset (cfg->patch_info);
-                       ctx->lmodule->max_got_offset = MAX (ctx->lmodule->max_got_offset, got_offset);
+                       ctx->module->max_got_offset = MAX (ctx->module->max_got_offset, got_offset);
                        if (!mono_aot_is_shared_got_offset (got_offset)) {
                                //mono_print_ji (ji);
                                //printf ("\n");
@@ -4789,9 +4844,11 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
  
                        indexes [0] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
                        indexes [1] = LLVMConstInt (LLVMInt32Type (), (gssize)got_offset, FALSE);
-                       got_entry_addr = LLVMBuildGEP (builder, ctx->lmodule->got_var, indexes, 2, "");
+                       got_entry_addr = LLVMBuildGEP (builder, ctx->module->got_var, indexes, 2, "");
 
-                       values [ins->dreg] = LLVMBuildLoad (builder, got_entry_addr, dname);
+                       name = get_aotconst_name (ji->type, ji->data.target, got_offset);
+                       values [ins->dreg] = LLVMBuildLoad (builder, got_entry_addr, name);
+                       g_free (name);
                        set_invariant_load_flag (values [ins->dreg]);
                        break;
                }
@@ -4825,14 +4882,14 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        LLVMValueRef args [1];
 
                        args [0] = convert (ctx, lhs, LLVMDoubleType ());
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, "llvm.sin.f64"), args, 1, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, "llvm.sin.f64"), args, 1, dname);
                        break;
                }
                case OP_COS: {
                        LLVMValueRef args [1];
 
                        args [0] = convert (ctx, lhs, LLVMDoubleType ());
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, "llvm.cos.f64"), args, 1, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, "llvm.cos.f64"), args, 1, dname);
                        break;
                }
                case OP_SQRT: {
@@ -4848,14 +4905,14 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        LLVM_FAILURE (ctx, "sqrt");
 #endif
                        args [0] = convert (ctx, lhs, LLVMDoubleType ());
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, "llvm.sqrt.f64"), args, 1, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, "llvm.sqrt.f64"), args, 1, dname);
                        break;
                }
                case OP_ABS: {
                        LLVMValueRef args [1];
 
                        args [0] = convert (ctx, lhs, LLVMDoubleType ());
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, "fabs"), args, 1, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, "fabs"), args, 1, dname);
                        break;
                }
 
@@ -5029,7 +5086,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                }
                case OP_RELAXED_NOP: {
 #if defined(TARGET_AMD64) || defined(TARGET_X86)
-                       emit_call (ctx, bb, &builder, LLVMGetNamedFunction (ctx->module, "llvm.x86.sse2.pause"), NULL, 0);
+                       emit_call (ctx, bb, &builder, LLVMGetNamedFunction (ctx->lmodule, "llvm.x86.sse2.pause"), NULL, 0);
                        break;
 #else
                        break;
@@ -5105,7 +5162,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
 
                                args [0] = convert (ctx, lhs, op_to_llvm_type (ins->opcode));
                                args [1] = convert (ctx, rhs, op_to_llvm_type (ins->opcode));
-                               func = LLVMGetNamedFunction (module, ovf_op_to_intrins (ins->opcode));
+                               func = LLVMGetNamedFunction (lmodule, ovf_op_to_intrins (ins->opcode));
                                g_assert (func);
                                val = LLVMBuildCall (builder, func, args, 2, "");
                                values [ins->dreg] = LLVMBuildExtractValue (builder, val, 0, dname);
@@ -5141,7 +5198,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        // FIXME: Alignment
                        args [3] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
                        args [4] = LLVMConstInt (LLVMInt1Type (), 0, FALSE);
-                       LLVMBuildCall (builder, LLVMGetNamedFunction (module, memset_func_name), args, memset_param_count, "");
+                       LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, memset_func_name), args, memset_param_count, "");
                        break;
                }
                case OP_DUMMY_VZERO:
@@ -5214,17 +5271,32 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        // FIXME: Alignment
                        args [3] = LLVMConstInt (LLVMInt32Type (), 0, FALSE);
                        args [4] = LLVMConstInt (LLVMInt1Type (), 0, FALSE);
-                       LLVMBuildCall (builder, LLVMGetNamedFunction (module, memcpy_func_name), args, memcpy_param_count, "");
+                       LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, memcpy_func_name), args, memcpy_param_count, "");
                        break;
                }
-               case OP_LLVM_OUTARG_VT:
-                       if (!addresses [ins->sreg1]) {
-                               addresses [ins->sreg1] = build_alloca (ctx, &ins->klass->byval_arg);
-                               g_assert (values [ins->sreg1]);
-                               LLVMBuildStore (builder, values [ins->sreg1], addresses [ins->sreg1]);
+               case OP_LLVM_OUTARG_VT: {
+                       LLVMArgInfo *ainfo = (LLVMArgInfo*)ins->inst_p0;
+                       MonoType *t = mini_get_underlying_type (ins->inst_vtype);
+
+                       if (ainfo->storage == LLVMArgScalarByRef) {
+                               LLVMTypeRef argtype;
+                               LLVMValueRef loc, v;
+
+                               argtype = type_to_llvm_arg_type (ctx, t);
+                               loc = build_alloca_llvm_type (ctx, argtype, 0);
+                               v = convert (ctx, values [ins->sreg1], argtype);
+                               LLVMBuildStore (ctx->builder, v, loc);
+                               addresses [ins->dreg] = loc;
+                       } else {
+                               if (!addresses [ins->sreg1]) {
+                                       addresses [ins->sreg1] = build_alloca (ctx, t);
+                                       g_assert (values [ins->sreg1]);
+                                       LLVMBuildStore (builder, values [ins->sreg1], addresses [ins->sreg1]);
+                               }
+                               addresses [ins->dreg] = addresses [ins->sreg1];
                        }
-                       addresses [ins->dreg] = addresses [ins->sreg1];
                        break;
+               }
 
                        /* 
                         * SIMD
@@ -5384,7 +5456,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        args [0] = lhs;
                        args [1] = rhs;
 
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, simd_op_to_intrins (ins->opcode)), args, 2, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, simd_op_to_intrins (ins->opcode)), args, 2, dname);
                        break;
                }
                case OP_PCMPEQB:
@@ -5491,7 +5563,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
 
                        v = convert (ctx, values [ins->sreg1], simd_op_to_llvm_type (ins->opcode));
 
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, simd_op_to_intrins (ins->opcode)), &v, 1, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, simd_op_to_intrins (ins->opcode)), &v, 1, dname);
                        break;
                }
 
@@ -5503,7 +5575,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        args [1] = rhs;
                        args [2] = LLVMConstInt (LLVMInt8Type (), ins->inst_c0, FALSE);
 
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, simd_op_to_intrins (ins->opcode)), args, 3, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, simd_op_to_intrins (ins->opcode)), args, 3, dname);
                        break;
                }
 
@@ -5525,7 +5597,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        args [0] = lhs;
                        args [1] = LLVMConstInt (LLVMInt32Type (), ins->inst_imm, FALSE);
 
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, simd_op_to_intrins (ins->opcode)), args, 2, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, simd_op_to_intrins (ins->opcode)), args, 2, dname);
                        break;
                }
 
@@ -5542,7 +5614,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        args [0] = lhs;
                        args [1] = values [ins->sreg2];
 
-                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (module, simd_op_to_intrins (ins->opcode)), args, 2, dname);
+                       values [ins->dreg] = LLVMBuildCall (builder, LLVMGetNamedFunction (lmodule, simd_op_to_intrins (ins->opcode)), args, 2, dname);
                        break;
                }
 
@@ -5830,7 +5902,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                if (ctx->cfg->compile_aot) {
                                        callee = get_callee (ctx, LLVMFunctionType (LLVMVoidType (), NULL, 0, FALSE), MONO_PATCH_INFO_INTERNAL_METHOD, "llvm_resume_unwind_trampoline");
                                } else {
-                                       callee = LLVMGetNamedFunction (module, "llvm_resume_unwind_trampoline");
+                                       callee = LLVMGetNamedFunction (lmodule, "llvm_resume_unwind_trampoline");
                                }
                                LLVMBuildCall (builder, callee, NULL, 0, "");
                                LLVMBuildUnreachable (builder);
@@ -5932,6 +6004,19 @@ mono_llvm_check_method_supported (MonoCompile *cfg)
                return;
 }
 
+static LLVMCallInfo*
+get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
+{
+       LLVMCallInfo *linfo;
+       int i;
+
+       linfo = mono_arch_get_llvm_call_info (cfg, sig);
+       for (i = 0; i < sig->param_count; ++i)
+               linfo->args [i + sig->hasthis].type = sig->params [i];
+
+       return linfo;
+}
+
 /*
  * mono_llvm_emit_method:
  *
@@ -5952,12 +6037,11 @@ mono_llvm_emit_method (MonoCompile *cfg)
        GPtrArray *phi_values;
        LLVMCallInfo *linfo;
        GSList *l;
-       LLVMModuleRef module;
+       LLVMModuleRef lmodule;
        BBInfo *bblocks;
        GPtrArray *bblock_list;
        MonoMethodHeader *header;
        MonoExceptionClause *clause;
-       LLVMSigInfo sinfo;
        char **names;
 
        /* The code below might acquire the loader lock, so use it for global locking */
@@ -5997,17 +6081,17 @@ mono_llvm_emit_method (MonoCompile *cfg)
        ctx->method_to_callers = g_hash_table_new (NULL, NULL);
  
        if (cfg->compile_aot) {
-               ctx->lmodule = &aot_module;
+               ctx->module = &aot_module;
                method_name = mono_aot_get_method_name (cfg);
                cfg->llvm_method_name = g_strdup (method_name);
        } else {
                init_jit_module (cfg->domain);
-               ctx->lmodule = (MonoLLVMModule*)domain_jit_info (cfg->domain)->llvm_module;
+               ctx->module = (MonoLLVMModule*)domain_jit_info (cfg->domain)->llvm_module;
                method_name = mono_method_full_name (cfg->method, TRUE);
        }
 
-       module = ctx->module = ctx->lmodule->module;
-       ctx->llvm_only = ctx->lmodule->llvm_only;
+       lmodule = ctx->lmodule = ctx->module->lmodule;
+       ctx->llvm_only = ctx->module->llvm_only;
 
        if (cfg->gsharedvt)
                LLVM_FAILURE (ctx, "gsharedvt");
@@ -6032,22 +6116,16 @@ mono_llvm_emit_method (MonoCompile *cfg)
        sig = mono_method_signature (cfg->method);
        ctx->sig = sig;
 
-       linfo = mono_arch_get_llvm_call_info (cfg, sig);
+       linfo = get_llvm_call_info (cfg, sig);
        ctx->linfo = linfo;
        CHECK_FAILURE (ctx);
 
        if (cfg->rgctx_var)
                linfo->rgctx_arg = TRUE;
-       method_type = sig_to_llvm_sig_full (ctx, sig, linfo, &sinfo);
+       method_type = sig_to_llvm_sig_full (ctx, sig, linfo);
        CHECK_FAILURE (ctx);
 
-       /* 
-        * This maps parameter indexes in the original signature to the indexes in
-        * the LLVM signature.
-        */
-       ctx->pindexes = sinfo.pindexes;
-
-       method = LLVMAddFunction (module, method_name, method_type);
+       method = LLVMAddFunction (lmodule, method_name, method_type);
        ctx->lmethod = method;
 
        if (!cfg->llvm_only)
@@ -6058,7 +6136,7 @@ mono_llvm_emit_method (MonoCompile *cfg)
 
        if (cfg->compile_aot) {
                LLVMSetLinkage (method, LLVMInternalLinkage);
-               if (ctx->lmodule->external_symbols) {
+               if (ctx->module->external_symbols) {
                        LLVMSetLinkage (method, LLVMExternalLinkage);
                        LLVMSetVisibility (method, LLVMHiddenVisibility);
                }
@@ -6083,8 +6161,8 @@ mono_llvm_emit_method (MonoCompile *cfg)
                LLVMAddFunctionAttr (method, LLVMNoInlineAttribute);
 
        if (linfo->rgctx_arg) {
-               ctx->rgctx_arg = LLVMGetParam (method, sinfo.rgctx_arg_pindex);
-               ctx->rgctx_arg_pindex = sinfo.rgctx_arg_pindex;
+               ctx->rgctx_arg = LLVMGetParam (method, linfo->rgctx_arg_pindex);
+               ctx->rgctx_arg_pindex = linfo->rgctx_arg_pindex;
                /*
                 * We mark the rgctx parameter with the inreg attribute, which is mapped to
                 * MONO_ARCH_RGCTX_REG in the Mono calling convention in llvm, i.e.
@@ -6097,16 +6175,20 @@ mono_llvm_emit_method (MonoCompile *cfg)
                ctx->rgctx_arg_pindex = -1;
        }
        if (cfg->vret_addr) {
-               values [cfg->vret_addr->dreg] = LLVMGetParam (method, sinfo.vret_arg_pindex);
+               values [cfg->vret_addr->dreg] = LLVMGetParam (method, linfo->vret_arg_pindex);
                LLVMSetValueName (values [cfg->vret_addr->dreg], "vret");
                if (linfo->ret.storage == LLVMArgVtypeByRef) {
-                       LLVMAddAttribute (LLVMGetParam (method, sinfo.vret_arg_pindex), LLVMStructRetAttribute);
-                       LLVMAddAttribute (LLVMGetParam (method, sinfo.vret_arg_pindex), LLVMNoAliasAttribute);
+                       LLVMAddAttribute (LLVMGetParam (method, linfo->vret_arg_pindex), LLVMStructRetAttribute);
+                       LLVMAddAttribute (LLVMGetParam (method, linfo->vret_arg_pindex), LLVMNoAliasAttribute);
                }
+       } else if (linfo->ret.storage == LLVMArgScalarRetAddr) {
+               LLVMValueRef param = LLVMGetParam (method, linfo->vret_arg_pindex);
+               LLVMSetValueName (param, "vret");
        }
+
        if (sig->hasthis) {
-               ctx->this_arg_pindex = sinfo.this_arg_pindex;
-               ctx->this_arg = LLVMGetParam (method, sinfo.this_arg_pindex);
+               ctx->this_arg_pindex = linfo->this_arg_pindex;
+               ctx->this_arg = LLVMGetParam (method, linfo->this_arg_pindex);
                values [cfg->args [0]->dreg] = ctx->this_arg;
                LLVMSetValueName (values [cfg->args [0]->dreg], "this");
        }
@@ -6115,26 +6197,34 @@ mono_llvm_emit_method (MonoCompile *cfg)
        mono_method_get_param_names (cfg->method, (const char **) names);
 
        for (i = 0; i < sig->param_count; ++i) {
+               LLVMArgInfo *ainfo = &linfo->args [i + sig->hasthis];
                char *name;
 
-               values [cfg->args [i + sig->hasthis]->dreg] = LLVMGetParam (method, sinfo.pindexes [i]);
-               if (names [i] && names [i][0] != '\0')
-                       name = g_strdup_printf ("arg_%s", names [i]);
-               else
-                       name = g_strdup_printf ("arg_%d", i);
+               values [cfg->args [i + sig->hasthis]->dreg] = LLVMGetParam (method, ainfo->pindex);
+               if (ainfo->storage == LLVMArgScalarByRef) {
+                       if (names [i] && names [i][0] != '\0')
+                               name = g_strdup_printf ("p_arg_%s", names [i]);
+                       else
+                               name = g_strdup_printf ("p_arg_%d", i);
+               } else {
+                       if (names [i] && names [i][0] != '\0')
+                               name = g_strdup_printf ("arg_%s", names [i]);
+                       else
+                               name = g_strdup_printf ("arg_%d", i);
+               }
                LLVMSetValueName (values [cfg->args [i + sig->hasthis]->dreg], name);
                g_free (name);
-               if (linfo->args [i + sig->hasthis].storage == LLVMArgVtypeByVal)
-                       LLVMAddAttribute (LLVMGetParam (method, sinfo.pindexes [i]), LLVMByValAttribute);
+               if (ainfo->storage == LLVMArgVtypeByVal)
+                       LLVMAddAttribute (LLVMGetParam (method, ainfo->pindex), LLVMByValAttribute);
 
-               if (linfo->args [i + sig->hasthis].storage == LLVMArgVtypeByRef) {
+               if (ainfo->storage == LLVMArgVtypeByRef) {
                        /* For OP_LDADDR */
                        cfg->args [i + sig->hasthis]->opcode = OP_VTARG_ADDR;
                }
        }
        g_free (names);
 
-       if (ctx->lmodule->emit_dwarf && cfg->compile_aot && mono_debug_enabled ()) {
+       if (ctx->module->emit_dwarf && cfg->compile_aot && mono_debug_enabled ()) {
                ctx->minfo = mono_debug_lookup_method (cfg->method);
                ctx->dbg_md = emit_dbg_subprogram (ctx, cfg, method, method_name);
        }
@@ -6386,7 +6476,7 @@ mono_llvm_emit_method (MonoCompile *cfg)
                GSList *callers, *l, *l2;
 
                /*
-                * Add the contents of ctx->method_to_callers to lmodule->method_to_callers.
+                * Add the contents of ctx->method_to_callers to module->method_to_callers.
                 * We can't do this earlier, as it contains llvm instructions which can be
                 * freed if compilation fails.
                 * FIXME: Get rid of this when all methods can be llvm compiled.
@@ -6394,9 +6484,9 @@ mono_llvm_emit_method (MonoCompile *cfg)
                g_hash_table_iter_init (&iter, ctx->method_to_callers);
                while (g_hash_table_iter_next (&iter, (void**)&method, (void**)&callers)) {
                        for (l = callers; l; l = l->next) {
-                               l2 = g_hash_table_lookup (ctx->lmodule->method_to_callers, method);
+                               l2 = g_hash_table_lookup (ctx->module->method_to_callers, method);
                                l2 = g_slist_prepend (l2, l->data);
-                               g_hash_table_insert (ctx->lmodule->method_to_callers, method, l2);
+                               g_hash_table_insert (ctx->module->method_to_callers, method, l2);
                        }
                }
        }
@@ -6405,7 +6495,7 @@ mono_llvm_emit_method (MonoCompile *cfg)
                mono_llvm_dump_value (method);
 
        if (cfg->compile_aot && !cfg->llvm_only)
-               mark_as_used (ctx->lmodule, method);
+               mark_as_used (ctx->module, method);
 
        if (cfg->compile_aot) {
                LLVMValueRef md_args [16];
@@ -6416,7 +6506,7 @@ mono_llvm_emit_method (MonoCompile *cfg)
                md_args [0] = LLVMMDString (method_name, strlen (method_name));
                md_args [1] = LLVMConstInt (LLVMInt32Type (), method_index, FALSE);
                md_node = LLVMMDNode (md_args, 2);
-               LLVMAddNamedMetadataOperand (module, "mono.function_indexes", md_node);
+               LLVMAddNamedMetadataOperand (lmodule, "mono.function_indexes", md_node);
                //LLVMSetMetadata (method, md_kind, LLVMMDNode (&md_arg, 1));
        }
 
@@ -6425,15 +6515,16 @@ mono_llvm_emit_method (MonoCompile *cfg)
                if (cfg->verbose_level)
                        printf ("%s emitted as %s\n", mono_method_full_name (cfg->method, TRUE), method_name);
 
-               LLVMVerifyFunction(method, 0);
+               int err = LLVMVerifyFunction(method,   LLVMPrintMessageAction);
+               g_assert (err == 0);
        } else {
                LLVMVerifyFunction(method, 0);
-               mono_llvm_optimize_method (ctx->lmodule->mono_ee, method);
+               mono_llvm_optimize_method (ctx->module->mono_ee, method);
 
                if (cfg->verbose_level > 1)
                        mono_llvm_dump_value (method);
 
-               cfg->native_code = LLVMGetPointerToGlobal (ctx->lmodule->ee, method);
+               cfg->native_code = LLVMGetPointerToGlobal (ctx->module->ee, method);
 
                /* Set by emit_cb */
                g_assert (cfg->code_len);
@@ -6441,10 +6532,10 @@ mono_llvm_emit_method (MonoCompile *cfg)
                /* FIXME: Free the LLVM IL for the function */
        }
 
-       if (ctx->lmodule->method_to_lmethod)
-               g_hash_table_insert (ctx->lmodule->method_to_lmethod, cfg->method, method);
-       if (ctx->lmodule->idx_to_lmethod)
-               g_hash_table_insert (ctx->lmodule->idx_to_lmethod, GINT_TO_POINTER (cfg->method_index), method);
+       if (ctx->module->method_to_lmethod)
+               g_hash_table_insert (ctx->module->method_to_lmethod, cfg->method, method);
+       if (ctx->module->idx_to_lmethod)
+               g_hash_table_insert (ctx->module->idx_to_lmethod, GINT_TO_POINTER (cfg->method_index), method);
 
        if (ctx->llvm_only && cfg->orig_method->klass->valuetype && !(cfg->orig_method->flags & METHOD_ATTRIBUTE_STATIC))
                emit_unbox_tramp (ctx, method_name, method_type, method, cfg->method_index);
@@ -6475,7 +6566,6 @@ mono_llvm_emit_method (MonoCompile *cfg)
        g_free (ctx->addresses);
        g_free (ctx->vreg_types);
        g_free (ctx->vreg_cli_types);
-       g_free (ctx->pindexes);
        g_free (ctx->is_dead);
        g_free (ctx->unreachable);
        g_ptr_array_free (phi_values, TRUE);
@@ -6515,7 +6605,7 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call)
        sig = call->signature;
        n = sig->param_count + sig->hasthis;
 
-       call->cinfo = mono_arch_get_llvm_call_info (cfg, sig);
+       call->cinfo = get_llvm_call_info (cfg, sig);
 
        if (cfg->disable_llvm)
                return;
@@ -6534,9 +6624,8 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call)
                        
                /* Simply remember the arguments */
                switch (ainfo->storage) {
-               case LLVMArgInIReg:
-               case LLVMArgInFPReg: {
-                       MonoType *t = (sig->hasthis && i == 0) ? &mono_get_intptr_class ()->byval_arg : sig->params [i - sig->hasthis];
+               case LLVMArgNormal: {
+                       MonoType *t = (sig->hasthis && i == 0) ? &mono_get_intptr_class ()->byval_arg : ainfo->type;
                        int opcode;
 
                        opcode = mono_type_to_regmove (cfg, t);
@@ -6560,15 +6649,18 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call)
                case LLVMArgVtypeByRef:
                case LLVMArgVtypeInReg:
                case LLVMArgVtypeAsScalar:
+               case LLVMArgScalarByRef:
                case LLVMArgAsIArgs:
                case LLVMArgAsFpArgs:
                        MONO_INST_NEW (cfg, ins, OP_LLVM_OUTARG_VT);
                        ins->dreg = mono_alloc_ireg (cfg);
                        ins->sreg1 = in->dreg;
-                       ins->klass = mono_class_from_mono_type (sig->params [i - sig->hasthis]);
+                       ins->inst_p0 = mono_mempool_alloc0 (cfg->mempool, sizeof (LLVMArgInfo));
+                       memcpy (ins->inst_p0, ainfo, sizeof (LLVMArgInfo));
+                       ins->inst_vtype = ainfo->type;
+                       ins->klass = mono_class_from_mono_type (ainfo->type);
                        break;
                default:
-                       call->cinfo = mono_arch_get_llvm_call_info (cfg, sig);
                        cfg->exception_message = g_strdup ("ainfo->storage");
                        cfg->disable_llvm = TRUE;
                        return;
@@ -6984,9 +7076,9 @@ add_intrinsics (LLVMModuleRef module)
 }
 
 static void
-add_types (MonoLLVMModule *lmodule)
+add_types (MonoLLVMModule *module)
 {
-       lmodule->ptr_type = LLVMPointerType (sizeof (gpointer) == 8 ? LLVMInt64Type () : LLVMInt32Type (), 0);
+       module->ptr_type = LLVMPointerType (sizeof (gpointer) == 8 ? LLVMInt64Type () : LLVMInt32Type (), 0);
 }
 
 void
@@ -7017,19 +7109,19 @@ init_jit_module (MonoDomain *domain)
        module = g_new0 (MonoLLVMModule, 1);
 
        name = g_strdup_printf ("mono-%s", domain->friendly_name);
-       module->module = LLVMModuleCreateWithName (name);
+       module->lmodule = LLVMModuleCreateWithName (name);
        module->context = LLVMGetGlobalContext ();
 
-       module->mono_ee = mono_llvm_create_ee (LLVMCreateModuleProviderForExistingModule (module->module), alloc_cb, emitted_cb, exception_cb, dlsym_cb, &module->ee);
+       module->mono_ee = mono_llvm_create_ee (LLVMCreateModuleProviderForExistingModule (module->lmodule), alloc_cb, emitted_cb, exception_cb, dlsym_cb, &module->ee);
 
-       add_intrinsics (module->module);
+       add_intrinsics (module->lmodule);
        add_types (module);
 
        module->llvm_types = g_hash_table_new (NULL, NULL);
 
        info = mono_find_jit_icall_by_name ("llvm_resume_unwind_trampoline");
        g_assert (info);
-       LLVMAddGlobalMapping (module->ee, LLVMGetNamedFunction (module->module, "llvm_resume_unwind_trampoline"), (void*)info->func);
+       LLVMAddGlobalMapping (module->ee, LLVMGetNamedFunction (module->lmodule, "llvm_resume_unwind_trampoline"), (void*)info->func);
 
        mono_memory_barrier ();
 
@@ -7041,11 +7133,13 @@ init_jit_module (MonoDomain *domain)
 void
 mono_llvm_cleanup (void)
 {
-       if (aot_module.module)
-               LLVMDisposeModule (aot_module.module);
+       MonoLLVMModule *module = &aot_module;
+
+       if (module->lmodule)
+               LLVMDisposeModule (module->lmodule);
 
-       if (aot_module.context)
-               LLVMContextDispose (aot_module.context);
+       if (module->context)
+               LLVMContextDispose (module->context);
 }
 
 void
@@ -7078,33 +7172,33 @@ mono_llvm_free_domain_info (MonoDomain *domain)
 void
 mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix, gboolean emit_dwarf, gboolean static_link, gboolean llvm_only)
 {
-       MonoLLVMModule *lmodule = &aot_module;
+       MonoLLVMModule *module = &aot_module;
 
        /* Delete previous module */
-       if (lmodule->plt_entries)
-               g_hash_table_destroy (lmodule->plt_entries);
-       if (lmodule->module)
-               LLVMDisposeModule (lmodule->module);
-
-       memset (lmodule, 0, sizeof (aot_module));
-
-       lmodule->module = LLVMModuleCreateWithName ("aot");
-       lmodule->assembly = assembly;
-       lmodule->global_prefix = g_strdup (global_prefix);
-       lmodule->got_symbol = g_strdup_printf ("%s_llvm_got", global_prefix);
-       lmodule->eh_frame_symbol = g_strdup_printf ("%s_eh_frame", global_prefix);
-       lmodule->get_method_symbol = g_strdup_printf ("%s_get_method", global_prefix);
-       lmodule->get_unbox_tramp_symbol = g_strdup_printf ("%s_get_unbox_tramp", global_prefix);
-       lmodule->external_symbols = TRUE;
-       lmodule->emit_dwarf = emit_dwarf;
-       lmodule->static_link = static_link;
-       lmodule->llvm_only = llvm_only;
+       if (module->plt_entries)
+               g_hash_table_destroy (module->plt_entries);
+       if (module->lmodule)
+               LLVMDisposeModule (module->lmodule);
+
+       memset (module, 0, sizeof (aot_module));
+
+       module->lmodule = LLVMModuleCreateWithName ("aot");
+       module->assembly = assembly;
+       module->global_prefix = g_strdup (global_prefix);
+       module->got_symbol = g_strdup_printf ("%s_llvm_got", global_prefix);
+       module->eh_frame_symbol = g_strdup_printf ("%s_eh_frame", global_prefix);
+       module->get_method_symbol = g_strdup_printf ("%s_get_method", global_prefix);
+       module->get_unbox_tramp_symbol = g_strdup_printf ("%s_get_unbox_tramp", global_prefix);
+       module->external_symbols = TRUE;
+       module->emit_dwarf = emit_dwarf;
+       module->static_link = static_link;
+       module->llvm_only = llvm_only;
        /* The first few entries are reserved */
-       lmodule->max_got_offset = 16;
-       lmodule->context = LLVMContextCreate ();
+       module->max_got_offset = 16;
+       module->context = LLVMContextCreate ();
 
-       add_intrinsics (lmodule->module);
-       add_types (lmodule);
+       add_intrinsics (module->lmodule);
+       add_types (module);
 
        /* Add GOT */
        /*
@@ -7114,47 +7208,48 @@ mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix,
         * its size is known in mono_llvm_emit_aot_module ().
         */
        {
-               LLVMTypeRef got_type = LLVMArrayType (lmodule->ptr_type, 0);
+               LLVMTypeRef got_type = LLVMArrayType (module->ptr_type, 0);
 
-               aot_module.got_var = LLVMAddGlobal (lmodule->module, got_type, "mono_dummy_got");
-               LLVMSetInitializer (lmodule->got_var, LLVMConstNull (got_type));
+               module->got_var = LLVMAddGlobal (module->lmodule, got_type, "mono_dummy_got");
+               LLVMSetInitializer (module->got_var, LLVMConstNull (got_type));
        }
 
        /* Add initialization array */
        if (llvm_only) {
                LLVMTypeRef inited_type = LLVMArrayType (LLVMInt8Type (), 0);
 
-               aot_module.inited_var = LLVMAddGlobal (aot_module.module, inited_type, "mono_inited_tmp");
-               LLVMSetInitializer (aot_module.inited_var, LLVMConstNull (inited_type));
+               module->inited_var = LLVMAddGlobal (aot_module.lmodule, inited_type, "mono_inited_tmp");
+               LLVMSetInitializer (module->inited_var, LLVMConstNull (inited_type));
        }
 
        if (llvm_only)
-               emit_init_icall_wrappers (lmodule);
+               emit_init_icall_wrappers (module);
 
-       emit_llvm_code_start (lmodule);
+       emit_llvm_code_start (module);
 
        /* Add a dummy personality function */
        if (!use_debug_personality) {
-               LLVMValueRef personality = LLVMAddFunction (lmodule->module, default_personality_name, LLVMFunctionType (LLVMInt32Type (), NULL, 0, TRUE));
+               LLVMValueRef personality = LLVMAddFunction (module->lmodule, default_personality_name, LLVMFunctionType (LLVMInt32Type (), NULL, 0, TRUE));
                LLVMSetLinkage (personality, LLVMExternalLinkage);
-               mark_as_used (lmodule, personality);
+               mark_as_used (module, personality);
        }
 
        /* Add a reference to the c++ exception we throw/catch */
        {
                LLVMTypeRef exc = LLVMPointerType (LLVMInt8Type (), 0);
-               lmodule->sentinel_exception = LLVMAddGlobal (lmodule->module, exc, "_ZTIPi");
-               LLVMSetLinkage (lmodule->sentinel_exception, LLVMExternalLinkage);
-               mono_llvm_set_is_constant (lmodule->sentinel_exception);
-       }
-
-       lmodule->llvm_types = g_hash_table_new (NULL, NULL);
-       lmodule->plt_entries = g_hash_table_new (g_str_hash, g_str_equal);
-       lmodule->plt_entries_ji = g_hash_table_new (NULL, NULL);
-       lmodule->method_to_lmethod = g_hash_table_new (NULL, NULL);
-       lmodule->idx_to_lmethod = g_hash_table_new (NULL, NULL);
-       lmodule->idx_to_unbox_tramp = g_hash_table_new (NULL, NULL);
-       lmodule->method_to_callers = g_hash_table_new (NULL, NULL);
+               module->sentinel_exception = LLVMAddGlobal (module->lmodule, exc, "_ZTIPi");
+               LLVMSetLinkage (module->sentinel_exception, LLVMExternalLinkage);
+               mono_llvm_set_is_constant (module->sentinel_exception);
+       }
+
+       module->llvm_types = g_hash_table_new (NULL, NULL);
+       module->plt_entries = g_hash_table_new (g_str_hash, g_str_equal);
+       module->plt_entries_ji = g_hash_table_new (NULL, NULL);
+       module->direct_callables = g_hash_table_new (g_str_hash, g_str_equal);
+       module->method_to_lmethod = g_hash_table_new (NULL, NULL);
+       module->idx_to_lmethod = g_hash_table_new (NULL, NULL);
+       module->idx_to_unbox_tramp = g_hash_table_new (NULL, NULL);
+       module->method_to_callers = g_hash_table_new (NULL, NULL);
 }
 
 static LLVMValueRef
@@ -7180,11 +7275,11 @@ llvm_array_from_uints (LLVMTypeRef el_type, guint32 *values, int nvalues)
 void
 mono_llvm_emit_aot_file_info (MonoAotFileInfo *info, gboolean has_jitted_code)
 {
-       MonoLLVMModule *lmodule = &aot_module;
+       MonoLLVMModule *module = &aot_module;
 
        /* Save these for later */
-       memcpy (&lmodule->aot_info, info, sizeof (MonoAotFileInfo));
-       lmodule->has_jitted_code = has_jitted_code;
+       memcpy (&module->aot_info, info, sizeof (MonoAotFileInfo));
+       module->has_jitted_code = has_jitted_code;
 }
 
 /*
@@ -7195,12 +7290,12 @@ mono_llvm_emit_aot_file_info (MonoAotFileInfo *info, gboolean has_jitted_code)
 void
 mono_llvm_emit_aot_data (const char *symbol, guint8 *data, int data_len)
 {
-       MonoLLVMModule *lmodule = &aot_module;
+       MonoLLVMModule *module = &aot_module;
        LLVMTypeRef type;
        LLVMValueRef d;
 
        type = LLVMArrayType (LLVMInt8Type (), data_len);
-       d = LLVMAddGlobal (lmodule->module, type, symbol);
+       d = LLVMAddGlobal (module->lmodule, type, symbol);
        LLVMSetVisibility (d, LLVMHiddenVisibility);
        LLVMSetLinkage (d, LLVMInternalLinkage);
        LLVMSetInitializer (d, mono_llvm_create_constant_data_array (data, data_len));
@@ -7209,19 +7304,19 @@ mono_llvm_emit_aot_data (const char *symbol, guint8 *data, int data_len)
 
 /* Add a reference to a global defined in JITted code */
 static LLVMValueRef
-AddJitGlobal (MonoLLVMModule *lmodule, LLVMTypeRef type, const char *name)
+AddJitGlobal (MonoLLVMModule *module, LLVMTypeRef type, const char *name)
 {
        char *s;
        LLVMValueRef v;
 
-       s = g_strdup_printf ("%s%s", lmodule->global_prefix, name);
-       v = LLVMAddGlobal (lmodule->module, LLVMInt8Type (), s);
+       s = g_strdup_printf ("%s%s", module->global_prefix, name);
+       v = LLVMAddGlobal (module->lmodule, LLVMInt8Type (), s);
        g_free (s);
        return v;
 }
 
 static void
-emit_aot_file_info (MonoLLVMModule *lmodule)
+emit_aot_file_info (MonoLLVMModule *module)
 {
        LLVMTypeRef file_info_type;
        LLVMTypeRef *eltypes, eltype;
@@ -7229,8 +7324,9 @@ emit_aot_file_info (MonoLLVMModule *lmodule)
        LLVMValueRef *fields;
        int i, nfields, tindex;
        MonoAotFileInfo *info;
+       LLVMModuleRef lmodule = module->lmodule;
 
-       info = &lmodule->aot_info;
+       info = &module->aot_info;
 
        /* Create an LLVM type to represent MonoAotFileInfo */
        nfields = 2 + MONO_AOT_FILE_INFO_NUM_SYMBOLS + 14 + 4;
@@ -7248,11 +7344,11 @@ emit_aot_file_info (MonoLLVMModule *lmodule)
        for (i = 0; i < 4; ++i)
                eltypes [tindex ++] = LLVMArrayType (LLVMInt32Type (), MONO_AOT_TRAMP_NUM);
        g_assert (tindex == nfields);
-       file_info_type = LLVMStructCreateNamed (aot_module.context, "MonoAotFileInfo");
+       file_info_type = LLVMStructCreateNamed (module->context, "MonoAotFileInfo");
        LLVMStructSetBody (file_info_type, eltypes, nfields, FALSE);
 
-       info_var = LLVMAddGlobal (lmodule->module, file_info_type, "mono_aot_file_info");
-       if (lmodule->static_link) {
+       info_var = LLVMAddGlobal (lmodule, file_info_type, "mono_aot_file_info");
+       if (module->static_link) {
                LLVMSetVisibility (info_var, LLVMHiddenVisibility);
                LLVMSetLinkage (info_var, LLVMInternalLinkage);
        }
@@ -7267,69 +7363,69 @@ emit_aot_file_info (MonoLLVMModule *lmodule)
         * for symbols defined in the .s file emitted by the aot compiler.
         */
        eltype = eltypes [tindex];
-       if (lmodule->llvm_only)
+       if (module->llvm_only)
                fields [tindex ++] = LLVMConstNull (eltype);
        else
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "jit_got");
-       fields [tindex ++] = lmodule->got_var;
+               fields [tindex ++] = AddJitGlobal (module, eltype, "jit_got");
+       fields [tindex ++] = module->got_var;
        /* llc defines this directly */
-       if (!lmodule->llvm_only) {
-               fields [tindex ++] = LLVMAddGlobal (lmodule->module, eltype, lmodule->eh_frame_symbol);
+       if (!module->llvm_only) {
+               fields [tindex ++] = LLVMAddGlobal (lmodule, eltype, module->eh_frame_symbol);
                fields [tindex ++] = LLVMConstNull (eltype);
                fields [tindex ++] = LLVMConstNull (eltype);
        } else {
                fields [tindex ++] = LLVMConstNull (eltype);
-               fields [tindex ++] = lmodule->get_method;
-               fields [tindex ++] = lmodule->get_unbox_tramp;
+               fields [tindex ++] = module->get_method;
+               fields [tindex ++] = module->get_unbox_tramp;
        }
-       if (lmodule->has_jitted_code) {
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "jit_code_start");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "jit_code_end");
+       if (module->has_jitted_code) {
+               fields [tindex ++] = AddJitGlobal (module, eltype, "jit_code_start");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "jit_code_end");
        } else {
                fields [tindex ++] = LLVMConstNull (eltype);
                fields [tindex ++] = LLVMConstNull (eltype);
        }
-       if (!lmodule->llvm_only)
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "method_addresses");
+       if (!module->llvm_only)
+               fields [tindex ++] = AddJitGlobal (module, eltype, "method_addresses");
        else
                fields [tindex ++] = LLVMConstNull (eltype);
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "blob");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "class_name_table");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "class_info_offsets");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "method_info_offsets");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "ex_info_offsets");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "extra_method_info_offsets");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "extra_method_table");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "got_info_offsets");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "llvm_got_info_offsets");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "blob");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "class_name_table");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "class_info_offsets");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "method_info_offsets");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "ex_info_offsets");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "extra_method_info_offsets");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "extra_method_table");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "got_info_offsets");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "llvm_got_info_offsets");
        /* Not needed (mem_end) */
        fields [tindex ++] = LLVMConstNull (eltype);
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "image_table");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "assembly_guid");
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "runtime_version");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "image_table");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "assembly_guid");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "runtime_version");
        if (info->trampoline_size [0]) {
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "specific_trampolines");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "static_rgctx_trampolines");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "imt_thunks");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "gsharedvt_arg_trampolines");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "specific_trampolines");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "static_rgctx_trampolines");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "imt_thunks");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "gsharedvt_arg_trampolines");
        } else {
                fields [tindex ++] = LLVMConstNull (eltype);
                fields [tindex ++] = LLVMConstNull (eltype);
                fields [tindex ++] = LLVMConstNull (eltype);
                fields [tindex ++] = LLVMConstNull (eltype);
        }
-       if (lmodule->static_link)
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "globals");
+       if (module->static_link)
+               fields [tindex ++] = AddJitGlobal (module, eltype, "globals");
        else
                fields [tindex ++] = LLVMConstNull (eltype);
-       fields [tindex ++] = LLVMGetNamedGlobal (lmodule->module, "assembly_name");
-       if (!lmodule->llvm_only) {
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "plt");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "plt_end");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "unwind_info");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "unbox_trampolines");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "unbox_trampolines_end");
-               fields [tindex ++] = AddJitGlobal (lmodule, eltype, "unbox_trampoline_addresses");
+       fields [tindex ++] = LLVMGetNamedGlobal (lmodule, "assembly_name");
+       if (!module->llvm_only) {
+               fields [tindex ++] = AddJitGlobal (module, eltype, "plt");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "plt_end");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "unwind_info");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "unbox_trampolines");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "unbox_trampolines_end");
+               fields [tindex ++] = AddJitGlobal (module, eltype, "unbox_trampoline_addresses");
        } else {
                fields [tindex ++] = LLVMConstNull (eltype);
                fields [tindex ++] = LLVMConstNull (eltype);
@@ -7366,20 +7462,20 @@ emit_aot_file_info (MonoLLVMModule *lmodule)
 
        LLVMSetInitializer (info_var, LLVMConstNamedStruct (file_info_type, fields, nfields));
 
-       if (lmodule->static_link) {
+       if (module->static_link) {
                char *s, *p;
                LLVMValueRef var;
 
-               s = g_strdup_printf ("mono_aot_module_%s_info", lmodule->assembly->aname.name);
+               s = g_strdup_printf ("mono_aot_module_%s_info", module->assembly->aname.name);
                /* Get rid of characters which cannot occur in symbols */
                p = s;
                for (p = s; *p; ++p) {
                        if (!(isalnum (*p) || *p == '_'))
                                *p = '_';
                }
-               var = LLVMAddGlobal (lmodule->module, LLVMPointerType (LLVMInt8Type (), 0), s);
+               var = LLVMAddGlobal (module->lmodule, LLVMPointerType (LLVMInt8Type (), 0), s);
                g_free (s);
-               LLVMSetInitializer (var, LLVMConstBitCast (LLVMGetNamedGlobal (lmodule->module, "mono_aot_file_info"), LLVMPointerType (LLVMInt8Type (), 0)));
+               LLVMSetInitializer (var, LLVMConstBitCast (LLVMGetNamedGlobal (module->lmodule, "mono_aot_file_info"), LLVMPointerType (LLVMInt8Type (), 0)));
                LLVMSetLinkage (var, LLVMExternalLinkage);
        }
 }
@@ -7400,8 +7496,8 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name)
         * Create the real got variable and replace all uses of the dummy variable with
         * the real one.
         */
-       got_type = LLVMArrayType (aot_module.ptr_type, module->max_got_offset + 1);
-       real_got = LLVMAddGlobal (aot_module.module, got_type, aot_module.got_symbol);
+       got_type = LLVMArrayType (module->ptr_type, module->max_got_offset + 1);
+       real_got = LLVMAddGlobal (module->lmodule, got_type, module->got_symbol);
        LLVMSetInitializer (real_got, LLVMConstNull (got_type));
        if (module->external_symbols) {
                LLVMSetLinkage (real_got, LLVMExternalLinkage);
@@ -7409,27 +7505,27 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name)
        } else {
                LLVMSetLinkage (real_got, LLVMInternalLinkage);
        }
-       mono_llvm_replace_uses_of (aot_module.got_var, real_got);
+       mono_llvm_replace_uses_of (module->got_var, real_got);
 
        mark_as_used (&aot_module, real_got);
 
        /* Delete the dummy got so it doesn't become a global */
-       LLVMDeleteGlobal (aot_module.got_var);
-       aot_module.got_var = real_got;
+       LLVMDeleteGlobal (module->got_var);
+       module->got_var = real_got;
 
        /*
         * Same for the init_var
         */
-       if (aot_module.llvm_only) {
+       if (module->llvm_only) {
                inited_type = LLVMArrayType (LLVMInt8Type (), module->max_inited_idx + 1);
-               real_inited = LLVMAddGlobal (aot_module.module, inited_type, "mono_inited");
+               real_inited = LLVMAddGlobal (module->lmodule, inited_type, "mono_inited");
                LLVMSetInitializer (real_inited, LLVMConstNull (inited_type));
                LLVMSetLinkage (real_inited, LLVMInternalLinkage);
-               mono_llvm_replace_uses_of (aot_module.inited_var, real_inited);
-               LLVMDeleteGlobal (aot_module.inited_var);
+               mono_llvm_replace_uses_of (module->inited_var, real_inited);
+               LLVMDeleteGlobal (module->inited_var);
        }
 
-       if (aot_module.llvm_only) {
+       if (module->llvm_only) {
                emit_get_method (&aot_module);
                emit_get_unbox_tramp (&aot_module);
        }
@@ -7444,12 +7540,12 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name)
         * their bodies, but that couldn't handle the case when a method fails to compile
         * with llvm.
         */
-       if (aot_module.llvm_only) {
+       if (module->llvm_only) {
                GHashTableIter iter;
                MonoMethod *method;
                GSList *callers, *l;
 
-               g_hash_table_iter_init (&iter, aot_module.method_to_callers);
+               g_hash_table_iter_init (&iter, module->method_to_callers);
                while (g_hash_table_iter_next (&iter, (void**)&method, (void**)&callers)) {
                        LLVMValueRef lmethod;
 
@@ -7470,7 +7566,7 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name)
                MonoJumpInfo *ji;
                LLVMValueRef callee;
 
-               g_hash_table_iter_init (&iter, aot_module.plt_entries_ji);
+               g_hash_table_iter_init (&iter, module->plt_entries_ji);
                while (g_hash_table_iter_next (&iter, (void**)&ji, (void**)&callee)) {
                        if (mono_aot_is_direct_callable (ji)) {
                                LLVMValueRef lmethod;
@@ -7489,13 +7585,13 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name)
        {
                char *verifier_err;
 
-               if (LLVMVerifyModule (aot_module.module, LLVMReturnStatusAction, &verifier_err)) {
+               if (LLVMVerifyModule (module->module, LLVMReturnStatusAction, &verifier_err)) {
                        g_assert_not_reached ();
                }
        }
 #endif
 
-       LLVMWriteBitcodeToFile (aot_module.module, filename);
+       LLVMWriteBitcodeToFile (module->lmodule, filename);
 }
 
 
@@ -7508,9 +7604,9 @@ md_string (const char *s)
 /* Debugging support */
 
 static void
-emit_dbg_info (MonoLLVMModule *lmodule, const char *filename, const char *cu_name)
+emit_dbg_info (MonoLLVMModule *module, const char *filename, const char *cu_name)
 {
-       LLVMModuleRef module = lmodule->module;
+       LLVMModuleRef lmodule = module->lmodule;
        LLVMValueRef args [16], cu_args [16], cu, ver;
        int n_cuargs;
        char *build_info, *s, *dir;
@@ -7521,7 +7617,7 @@ emit_dbg_info (MonoLLVMModule *lmodule, const char *filename, const char *cu_nam
         * and the abbrev indexes will not be correct since llvm has added its own
         * abbrevs.
         */
-       if (!lmodule->emit_dwarf)
+       if (!module->emit_dwarf)
                return;
 
        /*
@@ -7557,14 +7653,14 @@ emit_dbg_info (MonoLLVMModule *lmodule, const char *filename, const char *cu_nam
        cu_args [n_cuargs ++] = LLVMMDNode (args, 0);
        cu_args [n_cuargs ++] = LLVMMDNode (args, 0);
        /* Subprograms */
-       if (lmodule->subprogram_mds) {
+       if (module->subprogram_mds) {
                LLVMValueRef *mds;
                int i;
 
-               mds = g_new0 (LLVMValueRef, lmodule->subprogram_mds->len);
-               for (i = 0; i < lmodule->subprogram_mds->len; ++i)
-                       mds [i] = g_ptr_array_index (lmodule->subprogram_mds, i);
-               cu_args [n_cuargs ++] = LLVMMDNode (mds, lmodule->subprogram_mds->len);
+               mds = g_new0 (LLVMValueRef, module->subprogram_mds->len);
+               for (i = 0; i < module->subprogram_mds->len; ++i)
+                       mds [i] = g_ptr_array_index (module->subprogram_mds, i);
+               cu_args [n_cuargs ++] = LLVMMDNode (mds, module->subprogram_mds->len);
        } else {
                cu_args [n_cuargs ++] = LLVMMDNode (args, 0);
        }
@@ -7577,25 +7673,25 @@ emit_dbg_info (MonoLLVMModule *lmodule, const char *filename, const char *cu_nam
        /* DebugEmissionKind = FullDebug */
        cu_args [n_cuargs ++] = LLVMConstInt (LLVMInt32Type (), 1, FALSE);
        cu = LLVMMDNode (cu_args, n_cuargs);
-       LLVMAddNamedMetadataOperand (module, "llvm.dbg.cu", cu);
+       LLVMAddNamedMetadataOperand (lmodule, "llvm.dbg.cu", cu);
 
        args [0] = LLVMConstInt (LLVMInt32Type (), 1, FALSE);
        args [1] = LLVMMDString ("Dwarf Version", strlen ("Dwarf Version"));
        args [2] = LLVMConstInt (LLVMInt32Type (), 2, FALSE);
        ver = LLVMMDNode (args, 3);
-       LLVMAddNamedMetadataOperand (module, "llvm.module.flags", ver);
+       LLVMAddNamedMetadataOperand (lmodule, "llvm.module.flags", ver);
 
        args [0] = LLVMConstInt (LLVMInt32Type (), 1, FALSE);
        args [1] = LLVMMDString ("Debug Info Version", strlen ("Debug Info Version"));
        args [2] = LLVMConstInt (LLVMInt32Type (), 1, FALSE);
        ver = LLVMMDNode (args, 3);
-       LLVMAddNamedMetadataOperand (module, "llvm.module.flags", ver);
+       LLVMAddNamedMetadataOperand (lmodule, "llvm.module.flags", ver);
 }
 
 static LLVMValueRef
 emit_dbg_subprogram (EmitContext *ctx, MonoCompile *cfg, LLVMValueRef method, const char *name)
 {
-       MonoLLVMModule *module = ctx->lmodule;
+       MonoLLVMModule *module = ctx->module;
        MonoDebugMethodInfo *minfo = ctx->minfo;
        char *source_file, *dir, *filename;
        LLVMValueRef md, args [16], ctx_args [16], md_args [64], type_args [16], ctx_md, type_md;
index 362fa3a14bac36bfaf82a57b24611e83821e706b..de484d15b22cddf2b211c5f5c3624e723c13fcab 100644 (file)
@@ -4640,6 +4640,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        mono_add_patch_info (cfg, offset, (MonoJumpInfoType)ins->inst_c1, ins->inst_p0);
                        mips_load (code, ins->dreg, 0x0f0f0f0f);
                        break;
+               case OP_GC_SAFE_POINT:
+                       break;
 
 
                default:
index 4ff795aeb6cb9fb6d7bb3731a1238b0e698b2cec..758824edce980c013b35f59db9dfc853dd51f8a8 100644 (file)
@@ -1067,6 +1067,8 @@ MINI_OP(OP_GC_SPILL_SLOT_LIVENESS_DEF, "gc_spill_slot_liveness_def", NONE, NONE,
  */
 MINI_OP(OP_GC_PARAM_SLOT_LIVENESS_DEF, "gc_param_slot_liveness_def", NONE, NONE, NONE)
 
+MINI_OP(OP_GC_SAFE_POINT, "gc_safe_point", NONE, IREG, NONE)
+
 /*
  * Check if the class given by sreg1 was inited, if not, call
  * mono_generic_class_init_trampoline () though a trampoline.
@@ -1076,10 +1078,6 @@ MINI_OP(OP_GC_PARAM_SLOT_LIVENESS_DEF, "gc_param_slot_liveness_def", NONE, NONE,
 MINI_OP(OP_GENERIC_CLASS_INIT, "generic_class_init", NONE, IREG, NONE)
 
 /* Arch specific opcodes */
-#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM) || defined(TARGET_ARM64)
-MINI_OP(OP_GC_SAFE_POINT,     "gc_safe_point", NONE, IREG, NONE)
-#endif
-
 #if defined(TARGET_X86) || defined(TARGET_AMD64)
 MINI_OP(OP_X86_TEST_NULL,          "x86_test_null", NONE, IREG, NONE)
 MINI_OP(OP_X86_COMPARE_MEMBASE_REG,"x86_compare_membase_reg", NONE, IREG, IREG)
index 70c4d8cd5d0a8cf8e6fca67fee73f04e01e7fc64..4ddce9efeacacb169ebdcfe86b308954869feef0 100644 (file)
@@ -4593,6 +4593,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        ppc_mr (code, ins->dreg, ppc_r0);
                        break;
                }
+               case OP_GC_SAFE_POINT:
+                       break;
 
                default:
                        g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
index 4d2b01f941fc114a0b6a8de2480a0c69b503b9d6..35cd3c32040e6b60621b68a615ef98dc6a3ac001 100644 (file)
@@ -1429,10 +1429,9 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
        case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
 #if defined(__native_client_codegen__)
                target = (gpointer)&__nacl_thread_suspension_needed;
-#elif defined (USE_COOP_GC)
-               target = (gpointer)&mono_polling_required;
 #else
-               g_error ("Unsuported patch target");
+               g_assert (mono_threads_is_coop_enabled ());
+               target = (gpointer)&mono_polling_required;
 #endif
                break;
        case MONO_PATCH_INFO_SWITCH: {
@@ -3289,9 +3288,9 @@ register_icalls (void)
 #if defined(__native_client__) || defined(__native_client_codegen__)
        register_icall (mono_nacl_gc, "mono_nacl_gc", "void", FALSE);
 #endif
-#if defined(USE_COOP_GC)
-       register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", FALSE);
-#endif
+
+       if (mono_threads_is_coop_enabled ())
+               register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", FALSE);
 
 #ifndef MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
        register_opcode_emulation (OP_LMUL, "__emul_lmul", "long long long", mono_llmult, "mono_llmult", TRUE);
index 0805dd3aeda8e7ec822785c814265d09cf16a333..1c775f80341a30a556350c99fc5193f9b58b5b14 100644 (file)
@@ -413,6 +413,27 @@ breakpoint_t breakpointCode;
 
 static mono_mutex_t mini_arch_mutex;
 
+static const char * grNames[] = {
+       "s390_r0", "s390_sp", "s390_r2", "s390_r3", "s390_r4",
+       "s390_r5", "s390_r6", "s390_r7", "s390_r8", "s390_r9",
+       "s390_r10", "s390_r11", "s390_r12", "s390_r13", "s390_r14",
+       "s390_r15"
+};
+
+static const char * fpNames[] = {
+       "s390_f0", "s390_f1", "s390_f2", "s390_f3", "s390_f4",
+       "s390_f5", "s390_f6", "s390_f7", "s390_f8", "s390_f9",
+       "s390_f10", "s390_f11", "s390_f12", "s390_f13", "s390_f14",
+       "s390_f15"
+};
+
+static const char * vrNames[] = {
+       "vr0",  "vr1",  "vr2",  "vr3",  "vr4",  "vr5",  "vr6",  "vr7", 
+       "vr8",  "vr9",  "vr10", "vr11", "vr12", "vr13", "vr14", "vr15",
+       "vr16", "vr17", "vr18", "vr19", "vr20", "vr21", "vr22", "vr23",
+       "vr24", "vr25", "vr26", "vr27", "vr28", "vr29", "vr30", "vr31"
+};
+
 /*====================== End of Global Variables ===================*/
 
 /*------------------------------------------------------------------*/
@@ -425,16 +446,10 @@ static mono_mutex_t mini_arch_mutex;
 /*------------------------------------------------------------------*/
 
 const char*
-mono_arch_regname (int reg) {
-       static const char * rnames[] = {
-               "s390_r0", "s390_sp", "s390_r2", "s390_r3", "s390_r4",
-               "s390_r5", "s390_r6", "s390_r7", "s390_r8", "s390_r9",
-               "s390_r10", "s390_r11", "s390_r12", "s390_r13", "s390_r14",
-               "s390_r15"
-       };
-
+mono_arch_regname (int reg) 
+{
        if (reg >= 0 && reg < 16)
-               return rnames [reg];
+               return grNames [reg];
        else
                return "unknown";
 }
@@ -451,16 +466,30 @@ mono_arch_regname (int reg) {
 /*------------------------------------------------------------------*/
 
 const char*
-mono_arch_fregname (int reg) {
-       static const char * rnames[] = {
-               "s390_f0", "s390_f1", "s390_f2", "s390_f3", "s390_f4",
-               "s390_f5", "s390_f6", "s390_f7", "s390_f8", "s390_f9",
-               "s390_f10", "s390_f11", "s390_f12", "s390_f13", "s390_f14",
-               "s390_f15"
-       };
-
+mono_arch_fregname (int reg) 
+{
        if (reg >= 0 && reg < 16)
-               return rnames [reg];
+               return fpNames [reg];
+       else
+               return "unknown";
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name                - mono_arch_xregname                                */
+/*                                                                  */
+/* Function    - Returns the name of the register specified by     */
+/*               the input parameter.                              */
+/*                                                                 */
+/*------------------------------------------------------------------*/
+
+const char *
+mono_arch_xregname (int reg)
+{
+       if (reg < s390_VR_NREG)
+               return vrNames [reg];
        else
                return "unknown";
 }
@@ -1339,21 +1368,6 @@ mono_arch_cpu_optimizations (guint32 *exclude_mask)
 
 /*========================= End of Function ========================*/
 
-/*------------------------------------------------------------------*/
-/*                                                                  */
-/* Name         - mono_arch_cpu_enumerate_simd_versions             */
-/*                                                                  */
-/* Function     - Returns the SIMD instruction sets on this CPU     */
-/*                                                                  */
-/*------------------------------------------------------------------*/
-guint32
-mono_arch_cpu_enumerate_simd_versions (void)
-{
-       /* SIMD is currently unimplemented */
-       return 0;
-}
-/*========================= End of Function ========================*/
-
 /*------------------------------------------------------------------*/
 /*                                                                  */
 /* Name                - mono_arch_get_allocatable_int_vars                */
@@ -3859,11 +3873,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        s390_ldgr (code, ins->dreg, ins->sreg1);
                        break;
                case OP_MOVE_F_TO_I4:
-                       s390_lgdr (code, ins->dreg, ins->sreg1);
+                       s390_ledbr (code, s390_f0, ins->sreg1);
+                       s390_lgdr (code, ins->dreg, s390_f0);
+                       s390_srag (code, ins->dreg, ins->dreg, 0, 32);
                        break;
                case OP_MOVE_I4_TO_F: 
-                       s390_lgfr (code, s390_r0, ins->sreg1);
+                       s390_slag (code, s390_r0, ins->sreg1, 0, 32);
                        s390_ldgr (code, ins->dreg, s390_r0);
+                       s390_ldebr (code, ins->dreg, ins->dreg);
                        break;
                case OP_FCONV_TO_R4:
                        s390_ledbr (code, ins->dreg, ins->sreg1);
@@ -4327,7 +4344,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                }
                        break;
                case OP_LOADR4_MEMBASE: {
-                       S390_LONG (code, ldy, ld, s390_f15, 0, 
+                       S390_LONG (code, ley, le, s390_f15, 0, 
                                   ins->inst_basereg, ins->inst_offset);
                        s390_ldebr (code, ins->dreg, s390_f15);
                }
@@ -4677,10 +4694,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_MEMORY_BARRIER:
                        s390_mem (code);
                        break;
-#if USE_COOP_GC
                case OP_GC_SAFE_POINT: {
                        guint8 *br;
 
+                       g_assert (mono_threads_is_coop_enabled ());
+
                        s390_chi (code, ins->sreg1, 1); 
                        s390_je  (code, 0); CODEPTR(code, br);
                        mono_add_patch_info (cfg, code- cfg->native_code, MONO_PATCH_INFO_ABS,
@@ -4689,7 +4707,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        PTRSLOT (code, br);
                        break;
                }
-#endif
                case OP_GC_LIVENESS_DEF:
                case OP_GC_LIVENESS_USE:
                case OP_GC_PARAM_SLOT_LIVENESS_DEF:
@@ -4699,6 +4716,625 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        ins->backend.pc_offset = code - cfg->native_code;
                        bb->spill_slot_defs = g_slist_prepend_mempool (cfg->mempool, bb->spill_slot_defs, ins);
                        break;
+#ifdef MONO_ARCH_SIMD_INTRINSICS
+               case OP_ADDPS:
+                       s390x_addps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_DIVPS:
+                       s390x_divps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_MULPS:
+                       s390x_mulps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_SUBPS:
+                       s390x_subps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_MAXPS:
+                       s390x_maxps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_MINPS:
+                       s390x_minps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_COMPPS:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 7);
+                       s390x_cmpps_imm (code, ins->sreg1, ins->sreg2, ins->inst_c0);
+                       break;
+               case OP_ANDPS:
+                       s390x_andps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_ANDNPS:
+                       s390x_andnps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_ORPS:
+                       s390x_orps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_XORPS:
+                       s390x_xorps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_SQRTPS:
+                       s390x_sqrtps (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_RSQRTPS:
+                       s390x_rsqrtps (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_RCPPS:
+                       s390x_rcpps (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_ADDSUBPS:
+                       s390x_addsubps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_HADDPS:
+                       s390x_haddps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_HSUBPS:
+                       s390x_hsubps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_DUPPS_HIGH:
+                       s390x_movshdup (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_DUPPS_LOW:
+                       s390x_movsldup (code, ins->dreg, ins->sreg1);
+                       break;
+
+               case OP_PSHUFLEW_HIGH:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0xFF);
+                       s390x_pshufhw_imm (code, ins->dreg, ins->sreg1, ins->inst_c0);
+                       break;
+               case OP_PSHUFLEW_LOW:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0xFF);
+                       s390x_pshuflw_imm (code, ins->dreg, ins->sreg1, ins->inst_c0);
+                       break;
+               case OP_PSHUFLED:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0xFF);
+                       s390x_pshufd_imm (code, ins->dreg, ins->sreg1, ins->inst_c0);
+                       break;
+               case OP_SHUFPS:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0xFF);
+                       s390x_shufps_imm (code, ins->sreg1, ins->sreg2, ins->inst_c0);
+                       break;
+               case OP_SHUFPD:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0x3);
+                       s390x_shufpd_imm (code, ins->sreg1, ins->sreg2, ins->inst_c0);
+                       break;
+
+               case OP_ADDPD:
+                       s390x_addpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_DIVPD:
+                       s390x_divpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_MULPD:
+                       s390x_mulpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_SUBPD:
+                       s390x_subpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_MAXPD:
+                       s390x_maxpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_MINPD:
+                       s390x_minpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_COMPPD:
+                       g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 7);
+                       s390x_cmppd_imm (code, ins->sreg1, ins->sreg2, ins->inst_c0);
+                       break;
+               case OP_ANDPD:
+                       s390x_andpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_ANDNPD:
+                       s390x_andnpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_ORPD:
+                       s390x_orpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_XORPD:
+                       s390x_xorpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_SQRTPD:
+                       s390x_sqrtpd (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_ADDSUBPD:
+                       s390x_addsubpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_HADDPD:
+                       s390x_haddpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_HSUBPD:
+                       s390x_hsubpd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_DUPPD:
+                       s390x_movddup (code, ins->dreg, ins->sreg1);
+                       break;
+
+               case OP_EXTRACT_MASK:
+                       s390x_pmovmskb (code, ins->dreg, ins->sreg1);
+                       break;
+
+               case OP_PAND:
+                       s390x_pand (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_POR:
+                       s390x_por (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PXOR:
+                       s390x_pxor (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PADDB:
+                       s390x_paddb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PADDW:
+                       s390x_paddw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PADDD:
+                       s390x_paddd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PADDQ:
+                       s390x_paddq (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PSUBB:
+                       s390x_psubb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBW:
+                       s390x_psubw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBD:
+                       s390x_psubd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBQ:
+                       s390x_psubq (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PMAXB_UN:
+                       s390x_pmaxub (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMAXW_UN:
+                       s390x_pmaxuw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMAXD_UN:
+                       s390x_pmaxud (code, ins->sreg1, ins->sreg2);
+                       break;
+               
+               case OP_PMAXB:
+                       s390x_pmaxsb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMAXW:
+                       s390x_pmaxsw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMAXD:
+                       s390x_pmaxsd (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PAVGB_UN:
+                       s390x_pavgb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PAVGW_UN:
+                       s390x_pavgw (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PMINB_UN:
+                       s390x_pminub (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMINW_UN:
+                       s390x_pminuw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMIND_UN:
+                       s390x_pminud (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PMINB:
+                       s390x_pminsb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMINW:
+                       s390x_pminsw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMIND:
+                       s390x_pminsd (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PCMPEQB:
+                       s390x_pcmpeqb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PCMPEQW:
+                       s390x_pcmpeqw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PCMPEQD:
+                       s390x_pcmpeqd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PCMPEQQ:
+                       s390x_pcmpeqq (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PCMPGTB:
+                       s390x_pcmpgtb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PCMPGTW:
+                       s390x_pcmpgtw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PCMPGTD:
+                       s390x_pcmpgtd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PCMPGTQ:
+                       s390x_pcmpgtq (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PSUM_ABS_DIFF:
+                       s390x_psadbw (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_UNPACK_LOWB:
+                       s390x_punpcklbw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_LOWW:
+                       s390x_punpcklwd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_LOWD:
+                       s390x_punpckldq (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_LOWQ:
+                       s390x_punpcklqdq (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_LOWPS:
+                       s390x_unpcklps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_LOWPD:
+                       s390x_unpcklpd (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_UNPACK_HIGHB:
+                       s390x_punpckhbw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_HIGHW:
+                       s390x_punpckhwd (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_HIGHD:
+                       s390x_punpckhdq (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_HIGHQ:
+                       s390x_punpckhqdq (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_HIGHPS:
+                       s390x_unpckhps (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_UNPACK_HIGHPD:
+                       s390x_unpckhpd (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PACKW:
+                       s390x_packsswb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PACKD:
+                       s390x_packssdw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PACKW_UN:
+                       s390x_packuswb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PACKD_UN:
+                       s390x_packusdw (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PADDB_SAT_UN:
+                       s390x_paddusb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBB_SAT_UN:
+                       s390x_psubusb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PADDW_SAT_UN:
+                       s390x_paddusw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBW_SAT_UN:
+                       s390x_psubusw (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PADDB_SAT:
+                       s390x_paddsb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBB_SAT:
+                       s390x_psubsb (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PADDW_SAT:
+                       s390x_paddsw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PSUBW_SAT:
+                       s390x_psubsw (code, ins->sreg1, ins->sreg2);
+                       break;
+                       
+               case OP_PMULW:
+                       s390x_pmullw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMULD:
+                       s390x_pmulld (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMULQ:
+                       s390x_pmuludq (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMULW_HIGH_UN:
+                       s390x_pmulhuw (code, ins->sreg1, ins->sreg2);
+                       break;
+               case OP_PMULW_HIGH:
+                       s390x_pmulhw (code, ins->sreg1, ins->sreg2);
+                       break;
+
+               case OP_PSHRW:
+                       s390x_psrlw_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSHRW_REG:
+                       s390x_psrlw (code, ins->dreg, ins->sreg2);
+                       break;
+
+               case OP_PSARW:
+                       s390x_psraw_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSARW_REG:
+                       s390x_psraw (code, ins->dreg, ins->sreg2);
+                       break;
+
+               case OP_PSHLW:
+                       s390x_psllw_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSHLW_REG:
+                       s390x_psllw (code, ins->dreg, ins->sreg2);
+                       break;
+
+               case OP_PSHRD:
+                       s390x_psrld_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSHRD_REG:
+                       s390x_psrld (code, ins->dreg, ins->sreg2);
+                       break;
+
+               case OP_PSARD:
+                       s390x_psrad_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSARD_REG:
+                       s390x_psrad (code, ins->dreg, ins->sreg2);
+                       break;
+
+               case OP_PSHLD:
+                       s390x_pslld_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSHLD_REG:
+                       s390x_pslld (code, ins->dreg, ins->sreg2);
+                       break;
+
+               case OP_PSHRQ:
+                       s390x_psrlq_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSHRQ_REG:
+                       s390x_psrlq (code, ins->dreg, ins->sreg2);
+                       break;
+               
+               /*TODO: This is appart of the sse spec but not added
+               case OP_PSARQ:
+                       s390x_psraq_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSARQ_REG:
+                       s390x_psraq (code, ins->dreg, ins->sreg2);
+                       break;  
+               */
+       
+               case OP_PSHLQ:
+                       s390x_psllq_reg_imm (code, ins->dreg, ins->inst_imm);
+                       break;
+               case OP_PSHLQ_REG:
+                       s390x_psllq (code, ins->dreg, ins->sreg2);
+                       break;  
+               case OP_CVTDQ2PD:
+                       s390x_cvtdq2pd (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTDQ2PS:
+                       s390x_cvtdq2ps (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTPD2DQ:
+                       s390x_cvtpd2dq (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTPD2PS:
+                       s390x_cvtpd2ps (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTPS2DQ:
+                       s390x_cvtps2dq (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTPS2PD:
+                       s390x_cvtps2pd (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTTPD2DQ:
+                       s390x_cvttpd2dq (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_CVTTPS2DQ:
+                       s390x_cvttps2dq (code, ins->dreg, ins->sreg1);
+                       break;
+
+               case OP_ICONV_TO_X:
+                       amd64_movd_xreg_reg_size (code, ins->dreg, ins->sreg1, 4);
+                       break;
+               case OP_EXTRACT_I4:
+                       amd64_movd_reg_xreg_size (code, ins->dreg, ins->sreg1, 4);
+                       break;
+               case OP_EXTRACT_I8:
+                       if (ins->inst_c0) {
+                               amd64_movhlps (code, MONO_ARCH_FP_SCRATCH_REG, ins->sreg1);
+                               amd64_movd_reg_xreg_size (code, ins->dreg, MONO_ARCH_FP_SCRATCH_REG, 8);
+                       } else {
+                               amd64_movd_reg_xreg_size (code, ins->dreg, ins->sreg1, 8);
+                       }
+                       break;
+               case OP_EXTRACT_I1:
+               case OP_EXTRACT_U1:
+                       amd64_movd_reg_xreg_size (code, ins->dreg, ins->sreg1, 4);
+                       if (ins->inst_c0)
+                               amd64_shift_reg_imm (code, X86_SHR, ins->dreg, ins->inst_c0 * 8);
+                       amd64_widen_reg (code, ins->dreg, ins->dreg, ins->opcode == OP_EXTRACT_I1, FALSE);
+                       break;
+               case OP_EXTRACT_I2:
+               case OP_EXTRACT_U2:
+                       /*amd64_movd_reg_xreg_size (code, ins->dreg, ins->sreg1, 4);
+                       if (ins->inst_c0)
+                               amd64_shift_reg_imm_size (code, X86_SHR, ins->dreg, 16, 4);*/
+                       s390x_pextrw_imm (code, ins->dreg, ins->sreg1, ins->inst_c0);
+                       amd64_widen_reg_size (code, ins->dreg, ins->dreg, ins->opcode == OP_EXTRACT_I2, TRUE, 4);
+                       break;
+               case OP_EXTRACT_R8:
+                       if (ins->inst_c0)
+                               amd64_movhlps (code, ins->dreg, ins->sreg1);
+                       else
+                               s390x_movsd (code, ins->dreg, ins->sreg1);
+                       break;
+               case OP_INSERT_I2:
+                       s390x_pinsrw_imm (code, ins->sreg1, ins->sreg2, ins->inst_c0);
+                       break;
+               case OP_EXTRACTX_U2:
+                       s390x_pextrw_imm (code, ins->dreg, ins->sreg1, ins->inst_c0);
+                       break;
+               case OP_INSERTX_U1_SLOW:
+                       /*sreg1 is the extracted ireg (scratch)
+                       /sreg2 is the to be inserted ireg (scratch)
+                       /dreg is the xreg to receive the value*/
+
+                       /*clear the bits from the extracted word*/
+                       amd64_alu_reg_imm (code, X86_AND, ins->sreg1, ins->inst_c0 & 1 ? 0x00FF : 0xFF00);
+                       /*shift the value to insert if needed*/
+                       if (ins->inst_c0 & 1)
+                               amd64_shift_reg_imm_size (code, X86_SHL, ins->sreg2, 8, 4);
+                       /*join them together*/
+                       amd64_alu (code, X86_OR, ins->sreg1, ins->sreg2);
+                       s390x_pinsrw_imm (code, ins->dreg, ins->sreg1, ins->inst_c0 / 2);
+                       break;
+               case OP_INSERTX_I4_SLOW:
+                       s390x_pinsrw_imm (code, ins->dreg, ins->sreg2, ins->inst_c0 * 2);
+                       amd64_shift_reg_imm (code, X86_SHR, ins->sreg2, 16);
+                       s390x_pinsrw_imm (code, ins->dreg, ins->sreg2, ins->inst_c0 * 2 + 1);
+                       break;
+               case OP_INSERTX_I8_SLOW:
+                       amd64_movd_xreg_reg_size(code, MONO_ARCH_FP_SCRATCH_REG, ins->sreg2, 8);
+                       if (ins->inst_c0)
+                               amd64_movlhps (code, ins->dreg, MONO_ARCH_FP_SCRATCH_REG);
+                       else
+                               s390x_movsd (code, ins->dreg, MONO_ARCH_FP_SCRATCH_REG);
+                       break;
+
+               case OP_INSERTX_R4_SLOW:
+                       switch (ins->inst_c0) {
+                       case 0:
+                               if (cfg->r4fp)
+                                       s390x_movss (code, ins->dreg, ins->sreg2);
+                               else
+                                       s390x_cvtsd2ss (code, ins->dreg, ins->sreg2);
+                               break;
+                       case 1:
+                               s390x_pshufd_imm (code, ins->dreg, ins->dreg, mono_simd_shuffle_mask(1, 0, 2, 3));
+                               if (cfg->r4fp)
+                                       s390x_movss (code, ins->dreg, ins->sreg2);
+                               else
+                                       s390x_cvtsd2ss (code, ins->dreg, ins->sreg2);
+                               s390x_pshufd_imm (code, ins->dreg, ins->dreg, mono_simd_shuffle_mask(1, 0, 2, 3));
+                               break;
+                       case 2:
+                               s390x_pshufd_imm (code, ins->dreg, ins->dreg, mono_simd_shuffle_mask(2, 1, 0, 3));
+                               if (cfg->r4fp)
+                                       s390x_movss (code, ins->dreg, ins->sreg2);
+                               else
+                                       s390x_cvtsd2ss (code, ins->dreg, ins->sreg2);
+                               s390x_pshufd_imm (code, ins->dreg, ins->dreg, mono_simd_shuffle_mask(2, 1, 0, 3));
+                               break;
+                       case 3:
+                               s390x_pshufd_imm (code, ins->dreg, ins->dreg, mono_simd_shuffle_mask(3, 1, 2, 0));
+                               if (cfg->r4fp)
+                                       s390x_movss (code, ins->dreg, ins->sreg2);
+                               else
+                                       s390x_cvtsd2ss (code, ins->dreg, ins->sreg2);
+                               s390x_pshufd_imm (code, ins->dreg, ins->dreg, mono_simd_shuffle_mask(3, 1, 2, 0));
+                               break;
+                       }
+                       break;
+               case OP_INSERTX_R8_SLOW:
+                       if (ins->inst_c0)
+                               amd64_movlhps (code, ins->dreg, ins->sreg2);
+                       else
+                               s390x_movsd (code, ins->dreg, ins->sreg2);
+                       break;
+               case OP_STOREX_MEMBASE_REG:
+               case OP_STOREX_MEMBASE:
+                       s390x_movups_membase_reg (code, ins->dreg, ins->inst_offset, ins->sreg1);
+                       break;
+               case OP_LOADX_MEMBASE:
+                       s390x_movups_reg_membase (code, ins->dreg, ins->sreg1, ins->inst_offset);
+                       break;
+               case OP_LOADX_ALIGNED_MEMBASE:
+                       s390x_movaps_reg_membase (code, ins->dreg, ins->sreg1, ins->inst_offset);
+                       break;
+               case OP_STOREX_ALIGNED_MEMBASE_REG:
+                       s390x_movaps_membase_reg (code, ins->dreg, ins->inst_offset, ins->sreg1);
+                       break;
+               case OP_STOREX_NTA_MEMBASE_REG:
+                       s390x_movntps_reg_membase (code, ins->dreg, ins->sreg1, ins->inst_offset);
+                       break;
+               case OP_PREFETCH_MEMBASE:
+                       s390x_prefetch_reg_membase (code, ins->backend.arg_info, ins->sreg1, ins->inst_offset);
+                       break;
+
+               case OP_XMOVE:
+                       /*FIXME the peephole pass should have killed this*/
+                       if (ins->dreg != ins->sreg1)
+                               s390x_movaps (code, ins->dreg, ins->sreg1);
+                       break;          
+               case OP_XZERO:
+                       s390x_pxor (code, ins->dreg, ins->dreg);
+                       break;
+               case OP_ICONV_TO_R4_RAW:
+                       amd64_movd_xreg_reg_size (code, ins->dreg, ins->sreg1, 4);
+                       break;
+
+               case OP_FCONV_TO_R8_X:
+                       s390x_movsd (code, ins->dreg, ins->sreg1);
+                       break;
+
+               case OP_XCONV_R8_TO_I4:
+                       s390x_cvttsd2si_reg_xreg_size (code, ins->dreg, ins->sreg1, 4);
+                       switch (ins->backend.source_opcode) {
+                       case OP_FCONV_TO_I1:
+                               amd64_widen_reg (code, ins->dreg, ins->dreg, TRUE, FALSE);
+                               break;
+                       case OP_FCONV_TO_U1:
+                               amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+                               break;
+                       case OP_FCONV_TO_I2:
+                               amd64_widen_reg (code, ins->dreg, ins->dreg, TRUE, TRUE);
+                               break;
+                       case OP_FCONV_TO_U2:
+                               amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, TRUE);
+                               break;
+                       }                       
+                       break;
+
+               case OP_EXPAND_I2:
+                       s390x_pinsrw_imm (code, ins->dreg, ins->sreg1, 0);
+                       s390x_pinsrw_imm (code, ins->dreg, ins->sreg1, 1);
+                       s390x_pshufd_imm (code, ins->dreg, ins->dreg, 0);
+                       break;
+               case OP_EXPAND_I4:
+                       amd64_movd_xreg_reg_size (code, ins->dreg, ins->sreg1, 4);
+                       s390x_pshufd_imm (code, ins->dreg, ins->dreg, 0);
+                       break;
+               case OP_EXPAND_I8:
+                       amd64_movd_xreg_reg_size (code, ins->dreg, ins->sreg1, 8);
+                       s390x_pshufd_imm (code, ins->dreg, ins->dreg, 0x44);
+                       break;
+               case OP_EXPAND_R4:
+                       if (cfg->r4fp) {
+                               s390x_movsd (code, ins->dreg, ins->sreg1);
+                       } else {
+                               s390x_movsd (code, ins->dreg, ins->sreg1);
+                               s390x_cvtsd2ss (code, ins->dreg, ins->dreg);
+                       }
+                       s390x_pshufd_imm (code, ins->dreg, ins->dreg, 0);
+                       break;
+               case OP_EXPAND_R8:
+                       s390x_movsd (code, ins->dreg, ins->sreg1);
+                       s390x_pshufd_imm (code, ins->dreg, ins->dreg, 0x44);
+                       break;
+#endif
                default:
                        g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
                        g_assert_not_reached ();
@@ -6356,9 +6992,11 @@ mono_arch_get_seq_point_info (MonoDomain *domain, guint8 *code)
        return NULL;
 }
 
+/*========================= End of Function ========================*/
+
 /*------------------------------------------------------------------*/
 /*                                                                  */
-/* Name                - mono_arch_init_lmf_ext.                               */
+/* Name                - mono_arch_init_lmf_ext.                           */
 /*                                                                  */
 /* Function -                                                       */
 /*                                                                  */
@@ -6377,6 +7015,39 @@ mono_arch_init_lmf_ext (MonoLMFExt *ext, gpointer prev_lmf)
 
 #endif
 
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name            - mono_arch_cpu_enumerate_simd_versions.                */
+/*                                                                  */
+/* Function - If this CPU supports vector operations then it        */
+/*            supports the equivalent of SSE1-4.                    */
+/*                                                                  */
+/*------------------------------------------------------------------*/
+
+guint32
+mono_arch_cpu_enumerate_simd_versions (void)
+{
+       guint32 sseOpts = 0;
+
+       if (facs.vec != 0) 
+               sseOpts = (SIMD_VERSION_SSE1  | SIMD_VERSION_SSE2 |
+                          SIMD_VERSION_SSE3  | SIMD_VERSION_SSSE3 |
+                          SIMD_VERSION_SSE41 | SIMD_VERSION_SSE42 |
+                          SIMD_VERSION_SSE4a);
+
+       return (sseOpts);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name            - mono_arch_opcode_supported.                           */
+/*                                                                  */
+/* Function - Check if a given return code is supported.            */
+/*                                                                  */
+/*------------------------------------------------------------------*/
+
 gboolean
 mono_arch_opcode_supported (int opcode)
 {
@@ -6390,3 +7061,5 @@ mono_arch_opcode_supported (int opcode)
                return FALSE;
        }
 }
+
+/*========================= End of Function ========================*/
index 1de03e2fd2af0df5e8b3b4cc2ac0665ab7b6c622..2ac8cc17a3115c21155a96783b0ae6c49c4d05bc 100644 (file)
@@ -112,6 +112,14 @@ typedef struct
 #define MONO_ARCH_FRAME_ALIGNMENT 8
 #define MONO_ARCH_CODE_ALIGNMENT 32
 
+/*-----------------------------------------------*/
+/* SIMD Related Definitions                      */
+/*-----------------------------------------------*/
+
+#define MONO_MAX_XREGS                 31
+#define MONO_ARCH_CALLEE_XREGS         0x0
+#define MONO_ARCH_CALLEE_SAVED_XREGS   0x0
+
 /*-----------------------------------------------*/
 /* Macros used to generate instructions          */
 /*-----------------------------------------------*/
index 5aa8d082007347d3e00681ef66511cd42582b899..af0805adf29335282fcb7eae617ff1304bd07317 100644 (file)
@@ -3637,6 +3637,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_MEMORY_BARRIER:
                        sparc_membar (code, sparc_membar_all);
                        break;
+               case OP_GC_SAFE_POINT:
+                       break;
 
                default:
 #ifdef __GNUC__
index 9d314f7436c22fe1ba3a2d192a7996d3928da419..e84275d9d0b2be95479944ef68a78dafe0cd2e4d 100644 (file)
@@ -1347,11 +1347,11 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
 
                switch (ainfo->storage) {
                case ArgInIReg:
-                       linfo->args [i].storage = LLVMArgInIReg;
+                       linfo->args [i].storage = LLVMArgNormal;
                        break;
                case ArgInDoubleSSEReg:
                case ArgInFloatSSEReg:
-                       linfo->args [i].storage = LLVMArgInFPReg;
+                       linfo->args [i].storage = LLVMArgNormal;
                        break;
                case ArgOnStack:
                        if (mini_type_is_vtype (t)) {
@@ -1361,13 +1361,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                                else
                                        linfo->args [i].storage = LLVMArgVtypeByVal;
                        } else {
-                               linfo->args [i].storage = LLVMArgInIReg;
-                               if (t->byref) {
-                                       if (t->type == MONO_TYPE_R4)
-                                               linfo->args [i].storage = LLVMArgInFPReg;
-                                       else if (t->type == MONO_TYPE_R8)
-                                               linfo->args [i].storage = LLVMArgInFPReg;
-                               }
+                               linfo->args [i].storage = LLVMArgNormal;
                        }
                        break;
                case ArgValuetypeInReg:
@@ -2779,8 +2773,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        /* Have to use ecx as a temp reg since this can occur after OP_SETRET */
 
                        /* 
-                        * Read from the single stepping trigger page. This will cause a
-                        * SIGSEGV when single stepping is enabled.
                         * We do this _before_ the breakpoint, so single stepping after
                         * a breakpoint is hit will step to the next IL offset.
                         */
@@ -5066,15 +5058,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        int compare_val = 0;
                        guint8 *br [1];
 
-#if defined (USE_COOP_GC)
-                       polling_func = "mono_threads_state_poll";
-                       compare_val = 1;
-#elif defined(__native_client_codegen__) && defined(__native_client_gc__)
+#if defined(__native_client_codegen__) && defined(__native_client_gc__)
                        polling_func = "mono_nacl_gc";
                        compare_val = 0xFFFFFFFF;
+#else
+                       g_assert (mono_threads_is_coop_enabled ());
+                       polling_func = "mono_threads_state_poll";
+                       compare_val = 1;
 #endif
-                       if (!polling_func)
-                               break;
 
                        x86_test_membase_imm (code, ins->sreg1, 0, compare_val);
                        br[0] = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
index 2098909dedeba19bba54d76f25d2c2772570908b..d31ccb4d4e27294aae14d1713b18c0dcfcfcf026 100644 (file)
@@ -3049,8 +3049,6 @@ is_open_method (MonoMethod *method)
        return FALSE;
 }
 
-#if defined(__native_client_codegen__) || USE_COOP_GC
-
 static void
 mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
 {
@@ -3061,6 +3059,7 @@ mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
 #if defined(__native_client_codegen__)
        NEW_AOTCONST (cfg, poll_addr, MONO_PATCH_INFO_GC_SAFE_POINT_FLAG, (gpointer)&__nacl_thread_suspension_needed);
 #else
+       g_assert (mono_threads_is_coop_enabled ());
        NEW_AOTCONST (cfg, poll_addr, MONO_PATCH_INFO_GC_SAFE_POINT_FLAG, (gpointer)&mono_polling_required);
 #endif
 
@@ -3106,14 +3105,19 @@ static void
 mono_insert_safepoints (MonoCompile *cfg)
 {
        MonoBasicBlock *bb;
+
+#if !defined(__native_client_codegen__)
+       if (!mono_threads_is_coop_enabled ())
+               return;
+#endif
+
        if (cfg->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) {
                WrapperInfo *info = mono_marshal_get_wrapper_info (cfg->method);
 #if defined(__native_client__) || defined(__native_client_codegen__)
                gpointer poll_func = &mono_nacl_gc;
-#elif defined(USE_COOP_GC)
-               gpointer poll_func = &mono_threads_state_poll;
 #else
-               gpointer poll_func = NULL;
+               g_assert (mono_threads_is_coop_enabled ());
+               gpointer poll_func = &mono_threads_state_poll;
 #endif
 
                if (info && info->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER && info->d.icall.func == poll_func) {
@@ -3158,15 +3162,6 @@ mono_insert_safepoints (MonoCompile *cfg)
 
 }
 
-#else
-
-static void
-mono_insert_safepoints (MonoCompile *cfg)
-{
-}
-
-#endif
-
 static void
 init_backend (MonoBackend *backend)
 {
@@ -3350,8 +3345,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        }
 #endif
        /* coop / nacl requires loop detection to happen */
-#if defined(__native_client_codegen__) || defined(USE_COOP_GC)
+#if defined(__native_client_codegen__)
        cfg->opt |= MONO_OPT_LOOP;
+#else
+       if (mono_threads_is_coop_enabled ())
+               cfg->opt |= MONO_OPT_LOOP;
 #endif
        cfg->explicit_null_checks = debug_options.explicit_null_checks || (flags & JIT_FLAG_EXPLICIT_NULL_CHECKS);
        cfg->soft_breakpoints = debug_options.soft_breakpoints;
@@ -3687,7 +3685,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        if (!COMPILE_LLVM (cfg))
                mono_if_conversion (cfg);
 
-       MONO_SUSPEND_CHECK ();
+       mono_threads_safepoint ();
 
        /* Depth-first ordering on basic blocks */
        cfg->bblocks = mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (cfg->num_bblocks + 1));
@@ -4496,6 +4494,16 @@ void mono_llvm_emit_aot_data (const char *symbol, guint8 *data, int data_len)
 
 #endif
 
+#if !defined(ENABLE_LLVM_RUNTIME) && !defined(ENABLE_LLVM)
+
+void
+mono_llvm_cpp_throw_exception (void)
+{
+       g_assert_not_reached ();
+}
+
+#endif
+
 #ifdef DISABLE_JIT
 
 MonoCompile*
index 60f52a09379bfc3bc6101a8b9a1f9faf8143c9d6..2c014940e5f2711c3bea30c20e7ff9f36cb2aaf9 100644 (file)
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 124
+#define MONO_AOT_FILE_VERSION 125
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -176,6 +176,7 @@ typedef enum {
        MONO_AOT_FILE_FLAG_DEBUG = 4,
        MONO_AOT_FILE_FLAG_LLVM_THUMB = 8,
        MONO_AOT_FILE_FLAG_LLVM_ONLY = 16,
+       MONO_AOT_FILE_FLAG_SAFEPOINTS = 32,
 } MonoAotFileFlags;
 
 /* This structure is stored in the AOT file */
@@ -730,7 +731,11 @@ typedef struct MonoMemcpyArgs {
 
 typedef enum {
        LLVMArgNone,
+       /* Scalar argument passed by value */
+       LLVMArgNormal,
+       /* Only in ainfo->pair_storage */
        LLVMArgInIReg,
+       /* Only in ainfo->pair_storage */
        LLVMArgInFPReg,
        LLVMArgVtypeInReg,
        LLVMArgVtypeByVal,
@@ -748,6 +753,10 @@ typedef enum {
        LLVMArgVtypeByRef,
        /* Vtype returned as an int */
        LLVMArgVtypeAsScalar,
+       /* Scalar returned by ref using an additional argument */
+       LLVMArgScalarRetAddr,
+       /* Scalar passed by ref */
+       LLVMArgScalarByRef
 } LLVMArgStorage;
 
 typedef struct {
@@ -768,6 +777,9 @@ typedef struct {
        int nslots;
        /* Only if storage == LLVMArgAsFpArgs/LLVMArgFpStruct (4/8) */
        int esize;
+       /* Parameter index in the LLVM signature */
+       int pindex;
+       MonoType *type;
 } LLVMArgInfo;
 
 typedef struct {
@@ -782,6 +794,10 @@ typedef struct {
         * Should be 0 or 1.
         */
        int vret_arg_index;
+       /* The indexes of various special arguments in the LLVM signature */
+       int vret_arg_pindex, this_arg_pindex, rgctx_arg_pindex, imt_arg_pindex;
+
+       /* Inline array of argument info */
        /* args [0] is for the this argument if it exists */
        LLVMArgInfo args [1];
 } LLVMCallInfo;
@@ -2206,6 +2222,7 @@ void      mono_merge_basic_blocks           (MonoCompile *cfg, MonoBasicBlock *b
 void      mono_optimize_branches            (MonoCompile *cfg);
 
 void      mono_blockset_print               (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom);
+const char*mono_ji_type_to_string           (MonoJumpInfoType type);
 void      mono_print_ji                     (const MonoJumpInfo *ji);
 void      mono_print_ins_index              (int i, MonoInst *ins);
 void      mono_print_ins                    (MonoInst *ins);
@@ -2367,6 +2384,7 @@ char*    mono_aot_get_method_name           (MonoCompile *cfg) MONO_LLVM_INTERNA
 gboolean mono_aot_is_direct_callable        (MonoJumpInfo *patch_info) MONO_LLVM_INTERNAL;
 void     mono_aot_mark_unused_llvm_plt_entry(MonoJumpInfo *patch_info) MONO_LLVM_INTERNAL;
 char*    mono_aot_get_plt_symbol            (MonoJumpInfoType type, gconstpointer data) MONO_LLVM_INTERNAL;
+char*    mono_aot_get_direct_call_symbol    (MonoJumpInfoType type, gconstpointer data);
 int      mono_aot_get_method_index          (MonoMethod *method) MONO_LLVM_INTERNAL;
 MonoJumpInfo* mono_aot_patch_info_dup       (MonoJumpInfo* ji) MONO_LLVM_INTERNAL;
 void     mono_aot_set_make_unreadable       (gboolean unreadable);
index 5df176e4755c968607feee268744df3ab860bb28..06508eb512f0bdd1d3ebb596e052300dcc3fe420 100755 (executable)
@@ -89,27 +89,29 @@ while read line; do
        fi
 done < $TMP_FILE
 
-echo -n "              <test-case name=\"MonoTests.op_il_seq_point.${TEST_FILE}${USE_AOT}\" executed=\"True\" time=\"0\" asserts=\"0\" success=\"" >> TestResults_op_il_seq_point.xml
+TESTRESULT_FILE=TestResult-op_il_seq_point.xml
+
+echo -n "              <test-case name=\"MonoTests.op_il_seq_point.${TEST_FILE}${USE_AOT}\" executed=\"True\" time=\"0\" asserts=\"0\" success=\"" >> $TESTRESULT_FILE
 
 if [ $CHANGES != 0 ]
 then
        METHOD_NAME=$(get_method_name "$METHOD")
 
-       echo "False\">" >> TestResults_op_il_seq_point.xml
-       echo "                <failure>" >> TestResults_op_il_seq_point.xml
-       echo -n "                  <message><![CDATA[" >> TestResults_op_il_seq_point.xml
-       echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE" >> TestResults_op_il_seq_point.xml
-       echo "  $CHANGES methods differ when sequence points are enabled." >> TestResults_op_il_seq_point.xml
-       echo '  This is probably caused by a runtime optimization that is not handling OP_IL_SEQ_POINT' >> TestResults_op_il_seq_point.xml
-       echo '' >> TestResults_op_il_seq_point.xml
-       echo "Diff $METHOD_NAME" >> TestResults_op_il_seq_point.xml
-       echo "Without IL_OP_SEQ_POINT                                                         With IL_OP_SEQ_POINT" >> TestResults_op_il_seq_point.xml
-       echo -n "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)" >> TestResults_op_il_seq_point.xml
-       echo "]]></message>" >> TestResults_op_il_seq_point.xml
-       echo "                  <stack-trace>" >> TestResults_op_il_seq_point.xml
-       echo "                  </stack-trace>" >> TestResults_op_il_seq_point.xml
-       echo "                </failure>" >> TestResults_op_il_seq_point.xml
-       echo "              </test-case>" >> TestResults_op_il_seq_point.xml
+       echo "False\">" >> $TESTRESULT_FILE
+       echo "                <failure>" >> $TESTRESULT_FILE
+       echo -n "                  <message><![CDATA[" >> $TESTRESULT_FILE
+       echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE" >> $TESTRESULT_FILE
+       echo "  $CHANGES methods differ when sequence points are enabled." >> $TESTRESULT_FILE
+       echo '  This is probably caused by a runtime optimization that is not handling OP_IL_SEQ_POINT' >> $TESTRESULT_FILE
+       echo '' >> $TESTRESULT_FILE
+       echo "Diff $METHOD_NAME" >> $TESTRESULT_FILE
+       echo "Without IL_OP_SEQ_POINT                                                         With IL_OP_SEQ_POINT" >> $TESTRESULT_FILE
+       echo -n "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)" >> $TESTRESULT_FILE
+       echo "]]></message>" >> $TESTRESULT_FILE
+       echo "                  <stack-trace>" >> $TESTRESULT_FILE
+       echo "                  </stack-trace>" >> $TESTRESULT_FILE
+       echo "                </failure>" >> $TESTRESULT_FILE
+       echo "              </test-case>" >> $TESTRESULT_FILE
 
        echo ''
        echo "Detected OP_IL_SEQ_POINT incompatibility on $TEST_FILE"
@@ -122,5 +124,5 @@ then
        echo "$(diff_method $MONO_PATH $RUNTIME $TEST_FILE $METHOD_NAME $USE_AOT)"
        exit 1
 else
-       echo "True\" />" >> TestResults_op_il_seq_point.xml
+       echo "True\" />" >> $TESTRESULT_FILE
 fi
index 2eea27b5beb6ef4928ecd1e2ba427fdf5cd34d35..583945708ca2dad329e281145f30747ded3fab0b 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 
-TOTAL=$(grep -c "<test-case" TestResults_op_il_seq_point.xml)
-FAILURES=$(grep -c "<failure>" TestResults_op_il_seq_point.xml)
+TESTRESULT_FILE=TestResult-op_il_seq_point.xml
+TOTAL=$(grep -c "<test-case" $TESTRESULT_FILE)
+FAILURES=$(grep -c "<failure>" $TESTRESULT_FILE)
 if [ "$FAILURES" -eq "0" ]
 then
        PASS="True"
@@ -15,26 +16,26 @@ MYFQDN=$(hostname -f)
 MYDATE=$(date +%F)
 MYTIME=$(date +%T)
 
-echo "            </results>" >> TestResults_op_il_seq_point.xml
-echo "          </test-suite>" >> TestResults_op_il_seq_point.xml
-echo "        </results>" >> TestResults_op_il_seq_point.xml
-echo "      </test-suite>" >> TestResults_op_il_seq_point.xml
-echo "    </results>" >> TestResults_op_il_seq_point.xml
-echo "  </test-suite>" >> TestResults_op_il_seq_point.xml
-echo "</test-results>" >> TestResults_op_il_seq_point.xml
+echo "            </results>" >> $TESTRESULT_FILE
+echo "          </test-suite>" >> $TESTRESULT_FILE
+echo "        </results>" >> $TESTRESULT_FILE
+echo "      </test-suite>" >> $TESTRESULT_FILE
+echo "    </results>" >> $TESTRESULT_FILE
+echo "  </test-suite>" >> $TESTRESULT_FILE
+echo "</test-results>" >> $TESTRESULT_FILE
 
-echo "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>" > TestResults_op_il_seq_point.xml.header
-echo "<!--This file represents the results of running a test suite-->" >> TestResults_op_il_seq_point.xml.header
-echo "<test-results name=\"regression-tests.dummy\" total=\"${TOTAL}\" failures=\"${FAILURES}\" not-run=\"0\" date=\"${MYDATE}\" time=\"${MYTIME}\">" >> TestResults_op_il_seq_point.xml.header
-echo "  <environment nunit-version=\"2.4.8.0\" clr-version=\"4.0.30319.17020\" os-version=\"Unix ${MYUNAME}\" platform=\"Unix\" cwd=\"${PWD}\" machine-name=\"${MYHOSTNAME}\" user=\"${USER}\" user-domain=\"${MYFQDN}\" />" >> TestResults_op_il_seq_point.xml.header
-echo "  <culture-info current-culture=\"${MYLOCALE}\" current-uiculture=\"${MYLOCALE}\" />" >> TestResults_op_il_seq_point.xml.header
-echo "  <test-suite name=\"op_il_seq_point-tests.dummy\" success=\"${PASS}\" time=\"0\" asserts=\"0\">" >> TestResults_op_il_seq_point.xml.header
-echo "    <results>" >> TestResults_op_il_seq_point.xml.header
-echo "      <test-suite name=\"MonoTests\" success=\"${PASS}\" time=\"0\" asserts=\"0\">" >> TestResults_op_il_seq_point.xml.header
-echo "        <results>" >> TestResults_op_il_seq_point.xml.header
-echo "          <test-suite name=\"op_il_seq_point\" success=\"${PASS}\" time=\"0\" asserts=\"0\">" >> TestResults_op_il_seq_point.xml.header
-echo "            <results>" >> TestResults_op_il_seq_point.xml.header
+echo "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>" > $TESTRESULT_FILE.header
+echo "<!--This file represents the results of running a test suite-->" >> $TESTRESULT_FILE.header
+echo "<test-results name=\"regression-tests.dummy\" total=\"${TOTAL}\" failures=\"${FAILURES}\" not-run=\"0\" date=\"${MYDATE}\" time=\"${MYTIME}\">" >> $TESTRESULT_FILE.header
+echo "  <environment nunit-version=\"2.4.8.0\" clr-version=\"4.0.30319.17020\" os-version=\"Unix ${MYUNAME}\" platform=\"Unix\" cwd=\"${PWD}\" machine-name=\"${MYHOSTNAME}\" user=\"${USER}\" user-domain=\"${MYFQDN}\" />" >> $TESTRESULT_FILE.header
+echo "  <culture-info current-culture=\"${MYLOCALE}\" current-uiculture=\"${MYLOCALE}\" />" >> $TESTRESULT_FILE.header
+echo "  <test-suite name=\"op_il_seq_point-tests.dummy\" success=\"${PASS}\" time=\"0\" asserts=\"0\">" >> $TESTRESULT_FILE.header
+echo "    <results>" >> $TESTRESULT_FILE.header
+echo "      <test-suite name=\"MonoTests\" success=\"${PASS}\" time=\"0\" asserts=\"0\">" >> $TESTRESULT_FILE.header
+echo "        <results>" >> $TESTRESULT_FILE.header
+echo "          <test-suite name=\"op_il_seq_point\" success=\"${PASS}\" time=\"0\" asserts=\"0\">" >> $TESTRESULT_FILE.header
+echo "            <results>" >> $TESTRESULT_FILE.header
 
-cat TestResults_op_il_seq_point.xml.header TestResults_op_il_seq_point.xml > TestResults_op_il_seq_point.xml.new
-mv TestResults_op_il_seq_point.xml.new TestResults_op_il_seq_point.xml
-rm -f TestResults_op_il_seq_point.xml.header
+cat $TESTRESULT_FILE.header $TESTRESULT_FILE > $TESTRESULT_FILE.new
+mv $TESTRESULT_FILE.new $TESTRESULT_FILE
+rm -f $TESTRESULT_FILE.header
index d6aba0d8e0e67411ab6089de62046e4f589ea8e7..3d843f3b46bc25f4163dcac47258a9cbd0492220 100644 (file)
@@ -21,6 +21,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/assembly.h>
 #include <mono/utils/mono-time.h>
+#include <mono/utils/mono-memory-model.h>
 #include "trace.h"
 
 #if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
@@ -51,6 +52,8 @@
 
 static MonoTraceSpec trace_spec;
 
+static volatile gint32 output_lock = 0;
+
 gboolean
 mono_trace_eval_exception (MonoClass *klass)
 {
@@ -413,6 +416,9 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
        if (!trace_spec.enabled)
                return;
 
+       while (output_lock != 0 || InterlockedCompareExchange (&output_lock, 1, 0) != 0)
+               mono_thread_info_yield ();
+
        fname = mono_method_full_name (method, TRUE);
        indent (1);
        printf ("ENTER: %s(", fname);
@@ -420,8 +426,8 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
 
        if (!ebp) {
                printf (") ip: %p\n", RETURN_ADDRESS_N (1));
-               return;
-       }       
+               goto unlock;
+       }
 
        sig = mono_method_signature (method);
 
@@ -435,7 +441,7 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
                        if (gsctx && gsctx->is_gsharedvt) {
                                /* Needs a ctx to get precise method */
                                printf (") <gsharedvt>\n");
-                               return;
+                               goto unlock;
                        }
                }
        }
@@ -565,6 +571,9 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
 
        printf (")\n");
        fflush (stdout);
+
+unlock:
+       mono_atomic_store_release (&output_lock, 0);
 }
 
 void
@@ -578,6 +587,9 @@ mono_trace_leave_method (MonoMethod *method, ...)
        if (!trace_spec.enabled)
                return;
 
+       while (output_lock != 0 || InterlockedCompareExchange (&output_lock, 1, 0) != 0)
+               mono_thread_info_yield ();
+
        va_start(ap, method);
 
        fname = mono_method_full_name (method, TRUE);
@@ -593,7 +605,7 @@ mono_trace_leave_method (MonoMethod *method, ...)
                        if (gsctx && gsctx->is_gsharedvt) {
                                /* Needs a ctx to get precise method */
                                printf (") <gsharedvt>\n");
-                               return;
+                               goto unlock;
                        }
                }
        }
@@ -703,6 +715,9 @@ handle_enum:
        //printf (" ip: %p\n", RETURN_ADDRESS_N (1));
        printf ("\n");
        fflush (stdout);
+
+unlock:
+       mono_atomic_store_release (&output_lock, 0);
 }
 
 void
index 5a0e9e917b927407fb49ee421b3c8840c1428d54..83871f2689210cd08b77777f9ae207a27f101654 100644 (file)
@@ -615,8 +615,8 @@ static void
 emit_time (LogBuffer *logbuffer, uint64_t value)
 {
        uint64_t tdiff = value - logbuffer->last_time;
-       if (value < logbuffer->last_time)
-               printf ("time went backwards\n");
+       //if (value < logbuffer->last_time)
+       //      printf ("time went backwards\n");
        //if (tdiff > 1000000)
        //      printf ("large time offset: %llu\n", tdiff);
        encode_uleb128 (tdiff, logbuffer->data, &logbuffer->data);
@@ -4738,7 +4738,7 @@ mono_profiler_startup (const char *desc)
        mono_profiler_install_context (context_loaded, context_unloaded);
        mono_profiler_install_class (NULL, class_loaded, NULL, class_unloaded);
        mono_profiler_install_module (NULL, image_loaded, NULL, image_unloaded);
-       mono_profiler_install_assembly (NULL, assembly_loaded, NULL, assembly_unloaded);
+       mono_profiler_install_assembly (NULL, assembly_loaded, assembly_unloaded, NULL);
        mono_profiler_install_thread (thread_start, thread_end);
        mono_profiler_install_thread_name (thread_name);
        mono_profiler_install_enter_leave (method_enter, method_leave);
index 42946608efb263103d2e66368fcabd2c3b76c1ee..fc29b43b26003bb59b2ef5a317daec5066aa38f7 100755 (executable)
@@ -180,7 +180,7 @@ sub emit_nunit_report
        } else {
                $successbool = "True";
        }
-       open (my $nunitxml, '>', 'TestResults_profiler.xml') or die "Could not write to 'TestResults_profiler.xml' $!";
+       open (my $nunitxml, '>', 'TestResult-profiler.xml') or die "Could not write to 'TestResult-profiler.xml' $!";
        print $nunitxml "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n";
        print $nunitxml "<!--This file represents the results of running a test suite-->\n";
        print $nunitxml "<test-results name=\"profiler-tests.dummy\" total=\"$total\" failures=\"$failed\" not-run=\"0\" date=\"" . strftime ("%F", localtime) . "\" time=\"" . strftime ("%T", localtime) . "\">\n";
index fb18def266d4bd4441db6466c5f782c4bd2b80d9..21da2d0df848ba32e69c2126d1d8d9fb3ffeee3e 100644 (file)
@@ -247,7 +247,7 @@ sgen_card_table_mark_range (mword address, mword size)
        SGEN_ASSERT (0, num_cards <= CARD_COUNT_IN_BYTES, "How did we get an object larger than the card table?");
        if (end > SGEN_CARDTABLE_END) {
                memset (start, 1, SGEN_CARDTABLE_END - start);
-               memset (sgen_cardtable, 1, end - sgen_cardtable);
+               memset (sgen_cardtable, 1, end - SGEN_CARDTABLE_END);
                return;
        }
 #endif
index d3efb545d21274effb742e7f5fc3b93a293b9a6a..9a8d10806dac72c5f9f4bc06d4570a09cd97f68d 100644 (file)
@@ -539,30 +539,25 @@ sgen_add_to_global_remset (gpointer ptr, gpointer obj)
  * frequently after each object is copied, to achieve better locality and cache
  * usage.
  *
- * max_objs is the maximum number of objects to scan, or -1 to scan until the stack is
- * empty.
  */
 gboolean
-sgen_drain_gray_stack (int max_objs, ScanCopyContext ctx)
+sgen_drain_gray_stack (ScanCopyContext ctx)
 {
        ScanObjectFunc scan_func = ctx.ops->scan_object;
        GrayQueue *queue = ctx.queue;
 
-       if (current_collection_generation == GENERATION_OLD && major_collector.drain_gray_stack)
-               return major_collector.drain_gray_stack (ctx);
+       if (ctx.ops->drain_gray_stack)
+               return ctx.ops->drain_gray_stack (queue);
 
-       do {
-               int i;
-               for (i = 0; i != max_objs; ++i) {
-                       GCObject *obj;
-                       SgenDescriptor desc;
-                       GRAY_OBJECT_DEQUEUE (queue, &obj, &desc);
-                       if (!obj)
-                               return TRUE;
-                       SGEN_LOG (9, "Precise gray object scan %p (%s)", obj, sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (obj)));
-                       scan_func (obj, desc, queue);
-               }
-       } while (max_objs < 0);
+       for (;;) {
+               GCObject *obj;
+               SgenDescriptor desc;
+               GRAY_OBJECT_DEQUEUE (queue, &obj, &desc);
+               if (!obj)
+                       return TRUE;
+               SGEN_LOG (9, "Precise gray object scan %p (%s)", obj, sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (obj)));
+               scan_func (obj, desc, queue);
+       }
        return FALSE;
 }
 
@@ -1080,7 +1075,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
         *   To achieve better cache locality and cache usage, we drain the gray stack 
         * frequently, after each object is copied, and just finish the work here.
         */
-       sgen_drain_gray_stack (-1, ctx);
+       sgen_drain_gray_stack (ctx);
        TV_GETTIME (atv);
        SGEN_LOG (2, "%s generation done", generation_name (generation));
 
@@ -1102,7 +1097,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
        done_with_ephemerons = 0;
        do {
                done_with_ephemerons = sgen_client_mark_ephemerons (ctx);
-               sgen_drain_gray_stack (-1, ctx);
+               sgen_drain_gray_stack (ctx);
                ++ephemeron_rounds;
        } while (!done_with_ephemerons);
 
@@ -1110,7 +1105,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
 
        if (sgen_client_bridge_need_processing ()) {
                /*Make sure the gray stack is empty before we process bridge objects so we get liveness right*/
-               sgen_drain_gray_stack (-1, ctx);
+               sgen_drain_gray_stack (ctx);
                sgen_collect_bridge_objects (generation, ctx);
                if (generation == GENERATION_OLD)
                        sgen_collect_bridge_objects (GENERATION_NURSERY, ctx);
@@ -1134,7 +1129,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
        Make sure we drain the gray stack before processing disappearing links and finalizers.
        If we don't make sure it is empty we might wrongly see a live object as dead.
        */
-       sgen_drain_gray_stack (-1, ctx);
+       sgen_drain_gray_stack (ctx);
 
        /*
        We must clear weak links that don't track resurrection before processing object ready for
@@ -1155,7 +1150,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
                sgen_finalize_in_range (GENERATION_NURSERY, ctx);
        /* drain the new stack that might have been created */
        SGEN_LOG (6, "Precise scan of gray area post fin");
-       sgen_drain_gray_stack (-1, ctx);
+       sgen_drain_gray_stack (ctx);
 
        /*
         * This must be done again after processing finalizable objects since CWL slots are cleared only after the key is finalized.
@@ -1163,7 +1158,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
        done_with_ephemerons = 0;
        do {
                done_with_ephemerons = sgen_client_mark_ephemerons (ctx);
-               sgen_drain_gray_stack (-1, ctx);
+               sgen_drain_gray_stack (ctx);
                ++ephemeron_rounds;
        } while (!done_with_ephemerons);
 
@@ -1194,7 +1189,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx)
                        sgen_null_link_in_range (GENERATION_NURSERY, ctx, TRUE);
                if (sgen_gray_object_queue_is_empty (queue))
                        break;
-               sgen_drain_gray_stack (-1, ctx);
+               sgen_drain_gray_stack (ctx);
        }
 
        g_assert (sgen_gray_object_queue_is_empty (queue));
@@ -1424,7 +1419,7 @@ init_gray_queue (void)
 }
 
 static void
-enqueue_scan_from_roots_jobs (char *heap_start, char *heap_end, SgenObjectOperations *ops)
+enqueue_scan_from_roots_jobs (char *heap_start, char *heap_end, SgenObjectOperations *ops, gboolean enqueue)
 {
        ScanFromRegisteredRootsJob *scrrj;
        ScanThreadDataJob *stdj;
@@ -1437,33 +1432,33 @@ enqueue_scan_from_roots_jobs (char *heap_start, char *heap_end, SgenObjectOperat
        scrrj->heap_start = heap_start;
        scrrj->heap_end = heap_end;
        scrrj->root_type = ROOT_TYPE_NORMAL;
-       sgen_workers_enqueue_job (&scrrj->job);
+       sgen_workers_enqueue_job (&scrrj->job, enqueue);
 
        scrrj = (ScanFromRegisteredRootsJob*)sgen_thread_pool_job_alloc ("scan from registered roots wbarrier", job_scan_from_registered_roots, sizeof (ScanFromRegisteredRootsJob));
        scrrj->ops = ops;
        scrrj->heap_start = heap_start;
        scrrj->heap_end = heap_end;
        scrrj->root_type = ROOT_TYPE_WBARRIER;
-       sgen_workers_enqueue_job (&scrrj->job);
+       sgen_workers_enqueue_job (&scrrj->job, enqueue);
 
        /* Threads */
 
        stdj = (ScanThreadDataJob*)sgen_thread_pool_job_alloc ("scan thread data", job_scan_thread_data, sizeof (ScanThreadDataJob));
        stdj->heap_start = heap_start;
        stdj->heap_end = heap_end;
-       sgen_workers_enqueue_job (&stdj->job);
+       sgen_workers_enqueue_job (&stdj->job, enqueue);
 
        /* Scan the list of objects ready for finalization. */
 
        sfej = (ScanFinalizerEntriesJob*)sgen_thread_pool_job_alloc ("scan finalizer entries", job_scan_finalizer_entries, sizeof (ScanFinalizerEntriesJob));
        sfej->queue = &fin_ready_queue;
        sfej->ops = ops;
-       sgen_workers_enqueue_job (&sfej->job);
+       sgen_workers_enqueue_job (&sfej->job, enqueue);
 
        sfej = (ScanFinalizerEntriesJob*)sgen_thread_pool_job_alloc ("scan critical finalizer entries", job_scan_finalizer_entries, sizeof (ScanFinalizerEntriesJob));
        sfej->queue = &critical_fin_queue;
        sfej->ops = ops;
-       sgen_workers_enqueue_job (&sfej->job);
+       sgen_workers_enqueue_job (&sfej->job, enqueue);
 }
 
 /*
@@ -1565,7 +1560,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
         */
        sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan remset", job_remembered_set_scan, sizeof (ScanJob));
        sj->ops = object_ops;
-       sgen_workers_enqueue_job (&sj->job);
+       sgen_workers_enqueue_job (&sj->job, FALSE);
 
        /* we don't have complete write barrier yet, so we scan all the old generation sections */
        TV_GETTIME (btv);
@@ -1574,7 +1569,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
 
        sgen_pin_stats_print_class_stats ();
 
-       sgen_drain_gray_stack (-1, ctx);
+       sgen_drain_gray_stack (ctx);
 
        /* FIXME: Why do we do this at this specific, seemingly random, point? */
        sgen_client_collecting_minor (&fin_ready_queue, &critical_fin_queue);
@@ -1582,7 +1577,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        TV_GETTIME (atv);
        time_minor_scan_pinned += TV_ELAPSED (btv, atv);
 
-       enqueue_scan_from_roots_jobs (sgen_get_nursery_start (), nursery_next, object_ops);
+       enqueue_scan_from_roots_jobs (sgen_get_nursery_start (), nursery_next, object_ops, FALSE);
 
        TV_GETTIME (btv);
        time_minor_scan_roots += TV_ELAPSED (atv, btv);
@@ -1789,7 +1784,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
         * before pinning has finished.  For the non-concurrent
         * collector we start the workers after pinning.
         */
-       if (mode != COPY_OR_MARK_FROM_ROOTS_SERIAL) {
+       if (mode == COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT) {
                SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done when we start or finish a major collection?");
                sgen_workers_start_all_workers (object_ops);
                gray_queue_enable_redirect (WORKERS_DISTRIBUTE_GRAY_QUEUE);
@@ -1810,7 +1805,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
         * FIXME: is this the right context?  It doesn't seem to contain a copy function
         * unless we're concurrent.
         */
-       enqueue_scan_from_roots_jobs (heap_start, heap_end, object_ops);
+       enqueue_scan_from_roots_jobs (heap_start, heap_end, object_ops, mode == COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT);
 
        TV_GETTIME (btv);
        time_major_scan_roots += TV_ELAPSED (atv, btv);
@@ -1821,11 +1816,11 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
                /* Mod union card table */
                sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan mod union cardtable", job_scan_major_mod_union_card_table, sizeof (ScanJob));
                sj->ops = object_ops;
-               sgen_workers_enqueue_job (&sj->job);
+               sgen_workers_enqueue_job (&sj->job, FALSE);
 
                sj = (ScanJob*)sgen_thread_pool_job_alloc ("scan LOS mod union cardtable", job_scan_los_mod_union_card_table, sizeof (ScanJob));
                sj->ops = object_ops;
-               sgen_workers_enqueue_job (&sj->job);
+               sgen_workers_enqueue_job (&sj->job, FALSE);
 
                TV_GETTIME (atv);
                time_major_scan_mod_union += TV_ELAPSED (btv, atv);
@@ -1837,8 +1832,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
 static void
 major_finish_copy_or_mark (CopyOrMarkFromRootsMode mode)
 {
-       switch (mode) {
-       case COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT:
+       if (mode == COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT) {
                /*
                 * Prepare the pin queue for the next collection.  Since pinning runs on the worker
                 * threads we must wait for the jobs to finish before we can reset it.
@@ -1850,14 +1844,6 @@ major_finish_copy_or_mark (CopyOrMarkFromRootsMode mode)
 
                if (do_concurrent_checks)
                        sgen_debug_check_nursery_is_clean ();
-               break;
-       case COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT:
-               sgen_workers_wait_for_jobs_finished ();
-               break;
-       case COPY_OR_MARK_FROM_ROOTS_SERIAL:
-               break;
-       default:
-               g_assert_not_reached ();
        }
 }
 
@@ -1922,10 +1908,6 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
 
                major_finish_copy_or_mark (COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT);
 
-               sgen_workers_join ();
-
-               SGEN_ASSERT (0, sgen_gray_object_queue_is_empty (&gray_queue), "Why is the gray queue not empty after workers have finished working?");
-
 #ifdef SGEN_DEBUG_INTERNAL_ALLOC
                main_gc_thread = NULL;
 #endif
index 4cb4edf8bafe8ed5956e2a40c4f4cd72d332fad9..b7e1b68e0c78375a85a1648d420a5f8bd448f345 100644 (file)
@@ -411,11 +411,14 @@ gboolean sgen_is_worker_thread (MonoNativeThreadId thread);
 typedef void (*CopyOrMarkObjectFunc) (GCObject**, SgenGrayQueue*);
 typedef void (*ScanObjectFunc) (GCObject *obj, SgenDescriptor desc, SgenGrayQueue*);
 typedef void (*ScanVTypeFunc) (GCObject *full_object, char *start, SgenDescriptor desc, SgenGrayQueue* BINARY_PROTOCOL_ARG (size_t size));
+typedef gboolean (*DrainGrayStackFunc) (SgenGrayQueue *queue);
 
 typedef struct {
        CopyOrMarkObjectFunc copy_or_mark_object;
        ScanObjectFunc scan_object;
        ScanVTypeFunc scan_vtype;
+       /* Drain stack optimized for the above functions */
+       DrainGrayStackFunc drain_gray_stack;
        /*FIXME add allocation function? */
 } SgenObjectOperations;
 
@@ -618,7 +621,6 @@ struct _SgenMajorCollector {
 
        SgenObjectOperations major_ops_serial;
        SgenObjectOperations major_ops_concurrent_start;
-       SgenObjectOperations major_ops_concurrent;
        SgenObjectOperations major_ops_concurrent_finish;
 
        GCObject* (*alloc_object) (GCVTable vtable, size_t size, gboolean has_references);
@@ -648,7 +650,6 @@ struct _SgenMajorCollector {
        void (*finish_nursery_collection) (void);
        void (*start_major_collection) (void);
        void (*finish_major_collection) (ScannedObjectCounts *counts);
-       gboolean (*drain_gray_stack) (ScanCopyContext ctx);
        gboolean (*ptr_is_in_non_pinned_space) (char *ptr, char **start);
        gboolean (*ptr_is_from_pinned_alloc) (char *ptr);
        void (*report_pinned_memory_usage) (void);
@@ -801,7 +802,7 @@ void sgen_register_disappearing_link (GCObject *obj, void **link, gboolean track
 
 GCObject* sgen_weak_link_get (void **link_addr);
 
-gboolean sgen_drain_gray_stack (int max_objs, ScanCopyContext ctx);
+gboolean sgen_drain_gray_stack (ScanCopyContext ctx);
 
 enum {
        SPACE_NURSERY,
index 34d2c0f6ec47e996afd5cd0584e92c18d67980a0..11216ffd21d410171c5a4ae171e5eff1338c99c4 100644 (file)
@@ -260,18 +260,28 @@ retry:
                goto retry;
        }
        handles->slot_hint = index;
-       bucketize (index, &bucket, &offset);
-       if (!try_occupy_slot (handles, bucket, offset, obj, track))
-               goto retry;
-       /* If a GC happens shortly after a new bucket is allocated, the entire
-        * bucket could be scanned even though it's mostly empty. To avoid this, we
-        * track the maximum index seen so far, so that we can skip the empty slots.
+
+       /*
+        * If a GC happens shortly after a new bucket is allocated, the entire
+        * bucket could be scanned even though it's mostly empty. To avoid this,
+        * we track the maximum index seen so far, so that we can skip the empty
+        * slots.
+        *
+        * Note that we update `max_index` before we even try occupying the
+        * slot.  If we did it the other way around and a GC happened in
+        * between, the GC wouldn't know that the slot was occupied.  This is
+        * not a huge deal since `obj` is on the stack and thus pinned anyway,
+        * but hopefully some day it won't be anymore.
         */
        do {
                max_index = handles->max_index;
                if (index <= max_index)
                        break;
-       } while (!InterlockedCompareExchange ((volatile gint32 *)&handles->max_index, index, max_index));
+       } while (InterlockedCompareExchange ((volatile gint32 *)&handles->max_index, index, max_index) != max_index);
+
+       bucketize (index, &bucket, &offset);
+       if (!try_occupy_slot (handles, bucket, offset, obj, track))
+               goto retry;
 #ifdef HEAVY_STATISTICS
        InterlockedIncrement ((volatile gint32 *)&stat_gc_handles_allocated);
        if (stat_gc_handles_allocated > stat_gc_handles_max_allocated)
index 01d276ad06df9c15d84703b677bf3974505f655b..dce3be7344ad528c712be144fd775d38becfa295 100644 (file)
@@ -52,9 +52,12 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue)
 #endif
 
        SGEN_ASSERT (9, obj, "null object from pointer %p", ptr);
+#ifndef COPY_OR_MARK_CONCURRENT
        SGEN_ASSERT (9, current_collection_generation == GENERATION_OLD, "old gen parallel allocator called from a %d collection", current_collection_generation);
+#endif
 
        if (sgen_ptr_in_nursery (obj)) {
+#ifndef COPY_OR_MARK_CONCURRENT
                int word, bit;
                GCObject *forwarded, *old_obj;
                mword vtable_word = *(mword*)obj;
@@ -128,6 +131,7 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue)
                binary_protocol_mark (obj, (gpointer)LOAD_VTABLE (obj), sgen_safe_object_get_size (obj));
 
                return FALSE;
+#endif
        } else {
                mword vtable_word = *(mword*)obj;
                SgenDescriptor desc;
@@ -189,14 +193,14 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue)
                }
                return FALSE;
        }
-       SGEN_ASSERT (0, FALSE, "How is this happening?");
-       return FALSE;
+
+       return TRUE;
 }
 
 static void
-SCAN_OBJECT_FUNCTION_NAME (GCObject *obj, SgenDescriptor desc, SgenGrayQueue *queue)
+SCAN_OBJECT_FUNCTION_NAME (GCObject *full_object, SgenDescriptor desc, SgenGrayQueue *queue)
 {
-       char *start = (char*)obj;
+       char *start = (char*)full_object;
 
 #ifdef HEAVY_STATISTICS
        ++stat_optimized_major_scan;
@@ -211,6 +215,19 @@ SCAN_OBJECT_FUNCTION_NAME (GCObject *obj, SgenDescriptor desc, SgenGrayQueue *qu
        /* Now scan the object. */
 
 #undef HANDLE_PTR
+#ifdef COPY_OR_MARK_CONCURRENT
+#define HANDLE_PTR(ptr,obj)    do {                                    \
+               GCObject *__old = *(ptr);                               \
+               binary_protocol_scan_process_reference ((obj), (ptr), __old); \
+               if (__old && !sgen_ptr_in_nursery (__old)) {            \
+                       PREFETCH_READ (__old);                          \
+                       COPY_OR_MARK_FUNCTION_NAME ((ptr), __old, queue); \
+               } else {                                                \
+                       if (G_UNLIKELY (sgen_ptr_in_nursery (__old) && !sgen_ptr_in_nursery ((ptr)))) \
+                               mark_mod_union_card ((full_object), (void**)(ptr)); \
+                       }                                               \
+               } while (0)
+#else
 #define HANDLE_PTR(ptr,obj)    do {                                    \
                void *__old = *(ptr);                                   \
                binary_protocol_scan_process_reference ((obj), (ptr), __old); \
@@ -222,19 +239,21 @@ SCAN_OBJECT_FUNCTION_NAME (GCObject *obj, SgenDescriptor desc, SgenGrayQueue *qu
                        }                                               \
                }                                                       \
        } while (0)
+#endif
 
 #define SCAN_OBJECT_PROTOCOL
 #include "sgen-scan-object.h"
 }
 
 static gboolean
-DRAIN_GRAY_STACK_FUNCTION_NAME (ScanCopyContext ctx)
+DRAIN_GRAY_STACK_FUNCTION_NAME (SgenGrayQueue *queue)
 {
-       SgenGrayQueue *queue = ctx.queue;
-
-       SGEN_ASSERT (0, ctx.ops->scan_object == major_scan_object_with_evacuation, "Wrong scan function");
-
+#ifdef COPY_OR_MARK_CONCURRENT
+       int i;
+       for (i = 0; i < 32; i++) {
+#else
        for (;;) {
+#endif
                GCObject *obj;
                SgenDescriptor desc;
 
@@ -244,8 +263,9 @@ DRAIN_GRAY_STACK_FUNCTION_NAME (ScanCopyContext ctx)
                if (!obj)
                        return TRUE;
 
-               SCAN_OBJECT_FUNCTION_NAME (obj, desc, ctx.queue);
+               SCAN_OBJECT_FUNCTION_NAME (obj, desc, queue);
        }
+       return FALSE;
 }
 
 #undef COPY_OR_MARK_FUNCTION_NAME
index 1ed9eb8a4bb454b793c29918310c8e5970014955..8ebd8eee2a14a2a05ae799eb74d6f12b6076bd73 100644 (file)
@@ -19,8 +19,6 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-extern guint64 stat_scan_object_called_major;
-
 /*
  * FIXME: We use the same scanning function in the concurrent collector whether we scan
  * during the starting/finishing collection pause (with the world stopped) or from the
@@ -32,59 +30,6 @@ extern guint64 stat_scan_object_called_major;
  * it because we don't follow into the nursery.
  */
 
-#undef HANDLE_PTR
-#define HANDLE_PTR(ptr,obj)    do {                                    \
-               GCObject *__old = *(ptr);                                       \
-               SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP ((obj), (ptr)); \
-               binary_protocol_scan_process_reference ((obj), (ptr), __old); \
-               if (__old && !sgen_ptr_in_nursery (__old)) {            \
-                       PREFETCH_READ (__old);                  \
-                       major_copy_or_mark_object_concurrent ((ptr), __old, queue); \
-               } else {                                                \
-                       if (G_UNLIKELY (sgen_ptr_in_nursery (__old) && !sgen_ptr_in_nursery ((ptr)))) \
-                               ADD_TO_GLOBAL_REMSET ((full_object), (ptr), __old); \
-               }                                                       \
-       } while (0)
-
-/* FIXME: Unify this with optimized code in sgen-marksweep.c. */
-
-#undef ADD_TO_GLOBAL_REMSET
-#define ADD_TO_GLOBAL_REMSET(object,ptr,target)        mark_mod_union_card ((object), (void**)(ptr))
-
-static void
-major_scan_object_no_mark_concurrent_anywhere (GCObject *full_object, SgenDescriptor desc, SgenGrayQueue *queue)
-{
-       char *start = (char*)full_object;
-
-       SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP;
-
-#ifdef HEAVY_STATISTICS
-       sgen_descriptor_count_scanned_object (desc);
-#endif
-#ifdef SGEN_HEAVY_BINARY_PROTOCOL
-       add_scanned_object (start);
-#endif
-
-#define SCAN_OBJECT_PROTOCOL
-#include "sgen-scan-object.h"
-
-       SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP;
-       HEAVY_STAT (++stat_scan_object_called_major);
-}
-
-static void
-major_scan_object_no_mark_concurrent_start (GCObject *start, SgenDescriptor desc, SgenGrayQueue *queue)
-{
-       major_scan_object_no_mark_concurrent_anywhere (start, desc, queue);
-}
-
-static void
-major_scan_object_no_mark_concurrent (GCObject *start, SgenDescriptor desc, SgenGrayQueue *queue)
-{
-       SGEN_ASSERT (0, !sgen_ptr_in_nursery (start), "Why are we scanning nursery objects in the concurrent collector?");
-       major_scan_object_no_mark_concurrent_anywhere (start, desc, queue);
-}
-
 #undef HANDLE_PTR
 #define HANDLE_PTR(ptr,obj)     do {                                    \
                 void *__old = *(ptr);                                   \
index 55f40aba76e646cf0f18e0f0fbc4627b8c259d5a..e2261e20034a266192e3925f313b792da58db22c 100644 (file)
@@ -1120,36 +1120,6 @@ pin_major_object (GCObject *obj, SgenGrayQueue *queue)
 
 #include "sgen-major-copy-object.h"
 
-static void
-major_copy_or_mark_object_concurrent (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue)
-{
-       SGEN_ASSERT (9, sgen_concurrent_collection_in_progress (), "Why are we scanning concurrently when there's no concurrent collection on?");
-       SGEN_ASSERT (9, !sgen_workers_are_working () || sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ()), "We must not scan from two threads at the same time!");
-
-       g_assert (!SGEN_OBJECT_IS_FORWARDED (obj));
-
-       if (!sgen_ptr_in_nursery (obj)) {
-               mword objsize;
-
-               objsize = SGEN_ALIGN_UP (sgen_safe_object_get_size (obj));
-
-               if (objsize <= SGEN_MAX_SMALL_OBJ_SIZE) {
-                       MSBlockInfo *block = MS_BLOCK_FOR_OBJ (obj);
-                       MS_MARK_OBJECT_AND_ENQUEUE (obj, sgen_obj_get_descriptor (obj), block, queue);
-               } else {
-                       if (sgen_los_object_is_pinned (obj))
-                               return;
-
-                       binary_protocol_mark (obj, SGEN_LOAD_VTABLE (obj), sgen_safe_object_get_size (obj));
-
-                       sgen_los_pin_object (obj);
-                       if (SGEN_OBJECT_HAS_REFERENCES (obj))
-                               GRAY_OBJECT_ENQUEUE (queue, obj, sgen_obj_get_descriptor (obj));
-                       INC_NUM_MAJOR_OBJECTS_MARKED ();
-               }
-       }
-}
-
 static long long
 major_get_and_reset_num_major_objects_marked (void)
 {
@@ -1209,8 +1179,15 @@ static void major_scan_object_with_evacuation (GCObject *start, mword desc, Sgen
 #define DRAIN_GRAY_STACK_FUNCTION_NAME drain_gray_stack_with_evacuation
 #include "sgen-marksweep-drain-gray-stack.h"
 
+#undef COPY_OR_MARK_WITH_EVACUATION
+#define COPY_OR_MARK_CONCURRENT
+#define COPY_OR_MARK_FUNCTION_NAME     major_copy_or_mark_object_concurrent
+#define SCAN_OBJECT_FUNCTION_NAME      major_scan_object_concurrent
+#define DRAIN_GRAY_STACK_FUNCTION_NAME drain_gray_stack_concurrent
+#include "sgen-marksweep-drain-gray-stack.h"
+
 static gboolean
-drain_gray_stack (ScanCopyContext ctx)
+drain_gray_stack (SgenGrayQueue *queue)
 {
        gboolean evacuation = FALSE;
        int i;
@@ -1222,9 +1199,9 @@ drain_gray_stack (ScanCopyContext ctx)
        }
 
        if (evacuation)
-               return drain_gray_stack_with_evacuation (ctx);
+               return drain_gray_stack_with_evacuation (queue);
        else
-               return drain_gray_stack_no_evacuation (ctx);
+               return drain_gray_stack_no_evacuation (queue);
 }
 
 #include "sgen-marksweep-scan-object-concurrent.h"
@@ -2497,22 +2474,18 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
 
        collector->major_ops_serial.copy_or_mark_object = major_copy_or_mark_object_canonical;
        collector->major_ops_serial.scan_object = major_scan_object_with_evacuation;
+       collector->major_ops_serial.drain_gray_stack = drain_gray_stack;
        if (is_concurrent) {
                collector->major_ops_concurrent_start.copy_or_mark_object = major_copy_or_mark_object_concurrent_canonical;
-               collector->major_ops_concurrent_start.scan_object = major_scan_object_no_mark_concurrent_start;
-
-               collector->major_ops_concurrent.copy_or_mark_object = major_copy_or_mark_object_concurrent_canonical;
-               collector->major_ops_concurrent.scan_object = major_scan_object_no_mark_concurrent;
+               collector->major_ops_concurrent_start.scan_object = major_scan_object_concurrent;
+               collector->major_ops_concurrent_start.drain_gray_stack = drain_gray_stack_concurrent;
 
                collector->major_ops_concurrent_finish.copy_or_mark_object = major_copy_or_mark_object_concurrent_finish_canonical;
                collector->major_ops_concurrent_finish.scan_object = major_scan_object_no_evacuation;
                collector->major_ops_concurrent_finish.scan_vtype = major_scan_vtype_concurrent_finish;
+               collector->major_ops_concurrent_finish.drain_gray_stack = drain_gray_stack_no_evacuation;
        }
 
-#if !defined (FIXED_HEAP) && !defined (SGEN_PARALLEL_MARK)
-       if (!is_concurrent)
-               collector->drain_gray_stack = drain_gray_stack;
-
 #ifdef HEAVY_STATISTICS
        mono_counters_register ("Optimized copy", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy);
        mono_counters_register ("Optimized copy nursery", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_nursery);
@@ -2529,7 +2502,6 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr
        mono_counters_register ("Gray stack prefetch fills", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_drain_prefetch_fills);
        mono_counters_register ("Gray stack prefetch failures", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_drain_prefetch_fill_failures);
 #endif
-#endif
 
 #ifdef SGEN_HEAVY_BINARY_PROTOCOL
        mono_mutex_init (&scanned_objects_list_lock);
index 4f096f697f04b0b7d69695a2074de740ae4c7256..590e0b6dc2d017a91a6338c4fc9b587368fcf32a 100644 (file)
@@ -124,16 +124,10 @@ worker_try_finish (void)
        } while (!set_state (old_state, STATE_NOT_WORKING));
 }
 
-static gboolean
-collection_needs_workers (void)
-{
-       return sgen_collection_is_concurrent ();
-}
-
 void
-sgen_workers_enqueue_job (SgenThreadPoolJob *job)
+sgen_workers_enqueue_job (SgenThreadPoolJob *job, gboolean enqueue)
 {
-       if (!collection_needs_workers ()) {
+       if (!enqueue) {
                job->func (NULL, job);
                sgen_thread_pool_job_free (job);
                return;
@@ -231,7 +225,7 @@ marker_idle_func (void *data_untyped)
 
                SGEN_ASSERT (0, !sgen_gray_object_queue_is_empty (&data->private_gray_queue), "How is our gray queue empty if we just got work?");
 
-               sgen_drain_gray_stack (32, ctx);
+               sgen_drain_gray_stack (ctx);
        } else {
                worker_try_finish ();
        }
@@ -254,7 +248,7 @@ init_distribute_gray_queue (void)
 void
 sgen_workers_init_distribute_gray_queue (void)
 {
-       SGEN_ASSERT (0, sgen_get_major_collector ()->is_concurrent && collection_needs_workers (),
+       SGEN_ASSERT (0, sgen_get_major_collector ()->is_concurrent,
                        "Why should we init the distribute gray queue if we don't need it?");
        init_distribute_gray_queue ();
 }
@@ -290,9 +284,6 @@ sgen_workers_init (int num_workers)
 void
 sgen_workers_start_all_workers (SgenObjectOperations *object_ops)
 {
-       if (!collection_needs_workers ())
-               return;
-
        idle_func_object_ops = object_ops;
        mono_memory_write_barrier ();
 
@@ -304,9 +295,6 @@ sgen_workers_join (void)
 {
        int i;
 
-       if (!collection_needs_workers ())
-               return;
-
        sgen_thread_pool_wait_for_all_jobs ();
        sgen_thread_pool_idle_wait ();
        SGEN_ASSERT (0, workers_state == STATE_NOT_WORKING, "Can only signal enqueue work when in no work state");
index 6b549dded153c725c8317d99b83bf21396f8a058..1a5b6a77305015dcebbb99bca6b248658665083c 100644 (file)
@@ -32,7 +32,7 @@ void sgen_workers_init (int num_workers);
 void sgen_workers_start_all_workers (SgenObjectOperations *object_ops);
 void sgen_workers_ensure_awake (void);
 void sgen_workers_init_distribute_gray_queue (void);
-void sgen_workers_enqueue_job (SgenThreadPoolJob *job);
+void sgen_workers_enqueue_job (SgenThreadPoolJob *job, gboolean enqueue);
 void sgen_workers_wait_for_jobs_finished (void);
 void sgen_workers_distribute_gray_queue_sections (void);
 void sgen_workers_reset_data (void);
index ca4685a7a9514451efdef20b0026760059c50efd..03cf5a7e9bff706fd86a6d46db1c4b2b69d692e1 100644 (file)
@@ -1396,6 +1396,9 @@ test-appdomain-unload: appdomain-loader.exe appdomain-tester.exe
        MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) -O=gshared appdomain-loader.exe > appdomain-loader.exe.3.stdout || exit 1;
        MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.4.stdout || exit 1;
 
+coreclr-gcstress:
+       $(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
+
 noinst_LTLIBRARIES = libtest.la
 
 AM_CPPFLAGS = $(GLIB_CFLAGS)
index dde31cbc345b5c5bc1adff7db1d8959454b7234b..7bbfbe38545bd3b0ccef5a7488286416ecead59b 100644 (file)
@@ -2,28 +2,79 @@ using System;
 using System.Threading;
 using System.Runtime.ConstrainedExecution;
 
-class P {
+class P
+{
+       int index;
+       ManualResetEvent mre;
 
-       static public int count = 0;
-       ~P () {
-               // Console.WriteLine ("finalizer done");
-               count++;
+       public static int Count = 0;
+
+       public P (int index, ManualResetEvent mre)
+       {
+               this.index = index;
+               this.mre = mre;
+       }
+
+       ~P ()
+       {
+               mre.Set ();
+
+               Console.Write (String.Format ("[{0}] Finalize\n", index));
+               Count ++;
+               Console.Write (String.Format ("[{0}] Finalize -- end\n", index));
        }
 }
 
-class T {
-       static int Main () {
-               for (int i = 0; i < 1000; ++i) {
-                       var t = new Thread (() => {
-                                       P p = new P ();
-                               });
-                       t.Start ();
-                       t.Join ();
+class Driver
+{
+       static int Main ()
+       {
+               Thread thread;
+               ManualResetEvent mre;
+               int collected, total = 100;
+
+               for (int i = 1; i <= 1000; ++i) {
+                       P.Count = 0;
+
+                       mre = new ManualResetEvent (false);
+
+                       thread = new Thread (() => {
+                               for (int j = 0; j < total; ++j)
+                                       new P (i, mre);
+                       });
+                       thread.Start ();
+                       thread.Join ();
 
                        GC.Collect ();
+
+                       Console.Write (String.Format ("[{0}] Wait for pending finalizers\n", i));
                        GC.WaitForPendingFinalizers ();
-                       if (P.count != i + 1)
-                               return 1;
+                       Console.Write (String.Format ("[{0}] Wait for pending finalizers -- end\n", i));
+
+                       collected = P.Count;
+                       if (collected == 0) {
+                               if (!mre.WaitOne (5000)) {
+                                       Console.Write (String.Format ("[{0}] Finalizer never started\n", i));
+                                       return 1;
+                               }
+
+                               Console.Write (String.Format ("[{0}] Wait for pending finalizers (2)\n", i));
+                               GC.WaitForPendingFinalizers ();
+                               Console.Write (String.Format ("[{0}] Wait for pending finalizers (2) -- end\n", i));
+
+                               collected = P.Count;
+                               if (collected == 0) {
+                                       /* At least 1 finalizer started (as mre has been Set), but P.Count has not been incremented */
+                                       Console.Write (String.Format ("[{0}] Did not wait for finalizers to run\n", i));
+                                       return 2;
+                               }
+                       }
+
+                       if (collected != total) {
+                               /* Not all finalizer finished, before returning from WaitForPendingFinalizers. Or not all objects
+                                * have been garbage collected; this might be due to false pinning */
+                               Console.Write (String.Format ("[{0}] Finalized {1} of {2} objects\n", i, collected, total));
+                       }
                }
                return 0;
        }
index 045c6a1a860656cacdf3a17c08c182e509088c27..7a6f7d1e17225cc62eeed3efcd415b61ed187eb9 100644 (file)
@@ -876,6 +876,18 @@ mono_test_marshal_return_delegate (SimpleDelegate delegate)
        return delegate;
 }
 
+typedef int DelegateByrefDelegate (void *);
+
+LIBTEST_API int STDCALL
+mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del)
+{
+       int (*ptr) (int i);
+
+       del (&ptr);
+
+       return ptr (54);
+}
+
 static int STDCALL
 return_plus_one (int i)
 {
@@ -3545,8 +3557,8 @@ mono_test_marshal_lookup_symbol (const char *symbol_name)
        return lookup_mono_symbol (symbol_name);
 }
 
-#define MONO_BEGIN_EFRAME { void *__region_cookie = mono_threads_enter_gc_unsafe_region ? mono_threads_enter_gc_unsafe_region () : NULL;
-#define MONO_END_EFRAME if (mono_threads_exit_gc_unsafe_region) mono_threads_exit_gc_unsafe_region (__region_cookie); }
+#define MONO_BEGIN_EFRAME { void *__dummy; void *__region_cookie = mono_threads_enter_gc_unsafe_region ? mono_threads_enter_gc_unsafe_region (&__dummy) : NULL;
+#define MONO_END_EFRAME if (mono_threads_exit_gc_unsafe_region) mono_threads_exit_gc_unsafe_region (__region_cookie, &__dummy); }
 
 /**
  * test_method_thunk:
@@ -3572,10 +3584,10 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj
        gpointer (*mono_object_unbox)(gpointer)
                = lookup_mono_symbol ("mono_object_unbox");
 
-       gpointer* (*mono_threads_enter_gc_unsafe_region) ()
+       gpointer (*mono_threads_enter_gc_unsafe_region) (gpointer)
                = lookup_mono_symbol ("mono_threads_enter_gc_unsafe_region");
 
-       gpointer (*mono_threads_exit_gc_unsafe_region) (gpointer *)
+       void (*mono_threads_exit_gc_unsafe_region) (gpointer, gpointer)
                = lookup_mono_symbol ("mono_threads_exit_gc_unsafe_region");
 
        
index ae64d16e090d7af29dd027197a083e92bb2d7845..4b9a4b7f49a300186eb95ef72be806e21d897bfe 100644 (file)
@@ -188,6 +188,9 @@ public class Tests {
        [DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
        public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
 
+       [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_ref_delegate")]
+       public static extern int mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del);
+
        public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
 
        public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
@@ -210,6 +213,8 @@ public class Tests {
 
        public delegate return_int_delegate ReturnDelegateDelegate ();
 
+       public delegate int DelegateByrefDelegate (ref return_int_delegate del);
+
        public static int Main () {
                return TestDriver.RunTests (typeof (Tests));
        }
@@ -333,6 +338,20 @@ public class Tests {
                return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
        }
 
+       public static int return_plus_1 (int i) {
+               return i + 1;
+       }
+
+       public static int ref_delegate_delegate (ref return_int_delegate del) {
+               del = return_plus_1;
+               return 0;
+       }
+
+       public static int test_55_marshal_delegate_ref_delegate () {
+               var del = new DelegateByrefDelegate (ref_delegate_delegate);
+               return mono_test_marshal_delegate_ref_delegate (del);
+       }
+
        /* Passing and returning strings */
 
        public delegate String ReturnStringDelegate (String s);
index f1606197bacf480fa20aaeb9340bc47dd0389dea..9c06bbf0668c679297b2b8d8798f7157eb3a017c 100644 (file)
@@ -32,6 +32,7 @@ using System.Diagnostics;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Xml;
+using System.Text.RegularExpressions;
 
 //
 // This is a simple test runner with support for parallel execution
@@ -39,6 +40,8 @@ using System.Xml;
 
 public class TestRunner
 {
+       const string TEST_TIME_FORMAT = "mm\\:ss\\.fff";
+
        class ProcessData {
                public string test;
                public StreamWriter stdout, stderr;
@@ -55,8 +58,7 @@ public class TestRunner
                int timeout = 2 * 60; // in seconds
                int expectedExitCode = 0;
                string testsuiteName = null;
-
-               DateTime test_start_time = DateTime.UtcNow;
+               string inputFile = null;
 
                // FIXME: Add support for runtime arguments + env variables
 
@@ -69,7 +71,7 @@ public class TestRunner
                while (i < args.Length) {
                        if (args [i].StartsWith ("-")) {
                                if (args [i] == "-j") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to -j command line option.");
                                                return 1;
                                        }
@@ -79,28 +81,28 @@ public class TestRunner
                                                concurrency = Int32.Parse (args [i + 1]);
                                        i += 2;
                                } else if (args [i] == "--timeout") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to --timeout command line option.");
                                                return 1;
                                        }
                                        timeout = Int32.Parse (args [i + 1]);
                                        i += 2;
                                } else if (args [i] == "--disabled") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to --disabled command line option.");
                                                return 1;
                                        }
                                        disabled_tests = args [i + 1];
                                        i += 2;
                                } else if (args [i] == "--runtime") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to --runtime command line option.");
                                                return 1;
                                        }
                                        runtime = args [i + 1];
                                        i += 2;
                                } else if (args [i] == "--opt-sets") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to --opt-sets command line option.");
                                                return 1;
                                        }
@@ -108,19 +110,26 @@ public class TestRunner
                                                opt_sets.Add (s);
                                        i += 2;
                                } else if (args [i] == "--expected-exit-code") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to --expected-exit-code command line option.");
                                                return 1;
                                        }
                                        expectedExitCode = Int32.Parse (args [i + 1]);
                                        i += 2;
                                } else if (args [i] == "--testsuite-name") {
-                                       if (i + i >= args.Length) {
+                                       if (i + 1 >= args.Length) {
                                                Console.WriteLine ("Missing argument to --testsuite-name command line option.");
                                                return 1;
                                        }
                                        testsuiteName = args [i + 1];
                                        i += 2;
+                               } else if (args [i] == "--input-file") {
+                                       if (i + 1 >= args.Length) {
+                                               Console.WriteLine ("Missing argument to --input-file command line option.");
+                                               return 1;
+                                       }
+                                       inputFile = args [i + 1];
+                                       i += 2;
                                } else {
                                        Console.WriteLine ("Unknown command line option: '" + args [i] + "'.");
                                        return 1;
@@ -142,11 +151,16 @@ public class TestRunner
                                disabled [test] = test;
                }
 
-               // The remaining arguments are the tests
                var tests = new List<string> ();
-               for (int j = i; j < args.Length; ++j)
-                       if (!disabled.ContainsKey (args [j]))
-                               tests.Add (args [j]);
+
+               if (!String.IsNullOrEmpty (inputFile)) {
+                       tests.AddRange (File.ReadAllLines (inputFile));
+               } else {
+                       // The remaining arguments are the tests
+                       for (int j = i; j < args.Length; ++j)
+                               if (!disabled.ContainsKey (args [j]))
+                                       tests.Add (args [j]);
+               }
 
                var passed = new List<ProcessData> ();
                var failed = new List<ProcessData> ();
@@ -154,8 +168,7 @@ public class TestRunner
 
                object monitor = new object ();
 
-               if (concurrency != 1)
-                       Console.WriteLine ("Running tests: ");
+               Console.WriteLine ("Running tests: ");
 
                var test_info = new Queue<TestInfo> ();
                if (opt_sets.Count == 0) {
@@ -166,10 +179,19 @@ public class TestRunner
                                foreach (string s in tests)
                                        test_info.Enqueue (new TestInfo { test = s, opt_set = opt });
                        }
-               }               
+               }
+
+               /* compute the max length of test names, to have an optimal output width */
+               int output_width = -1;
+               foreach (TestInfo ti in test_info) {
+                       if (ti.test.Length > output_width)
+                               output_width = Math.Min (120, ti.test.Length);
+               }
 
                List<Thread> threads = new List<Thread> (concurrency);
 
+               DateTime test_start_time = DateTime.UtcNow;
+
                for (int j = 0; j < concurrency; ++j) {
                        Thread thread = new Thread (() => {
                                while (true) {
@@ -181,11 +203,12 @@ public class TestRunner
                                                ti = test_info.Dequeue ();
                                        }
 
+                                       var output = new StringWriter ();
+
                                        string test = ti.test;
                                        string opt_set = ti.opt_set;
 
-                                       if (concurrency == 1)
-                                               Console.Write ("Testing " + test + "... ");
+                                       output.Write (String.Format ("{{0,-{0}}} ", output_width), test);
 
                                        /* Spawn a new process */
                                        string process_args;
@@ -231,6 +254,8 @@ public class TestRunner
                                                }
                                        };
 
+                                       var start = DateTime.UtcNow;
+
                                        p.Start ();
 
                                        p.BeginOutputReadLine ();
@@ -241,33 +266,32 @@ public class TestRunner
                                                        timedout.Add (data);
                                                }
 
-                                               if (concurrency == 1)
-                                                       Console.WriteLine ("timed out.");
-                                               else
-                                                       Console.Write (".");
+                                               output.Write ("timed out");
 
                                                p.Kill ();
                                        } else if (p.ExitCode != expectedExitCode) {
+                                               var end = DateTime.UtcNow;
+
                                                lock (monitor) {
                                                        failed.Add (data);
                                                }
 
-                                               if (concurrency == 1)
-                                                       Console.WriteLine ("failed.");
-                                               else
-                                                       Console.Write (".");
+                                               output.Write ("failed, time: {0}, exit code: {1}", (end - start).ToString (TEST_TIME_FORMAT), p.ExitCode);
                                        } else {
+                                               var end = DateTime.UtcNow;
+
                                                lock (monitor) {
                                                        passed.Add (data);
                                                }
 
-                                               if (concurrency == 1)
-                                                       Console.WriteLine ("passed.");
-                                               else
-                                                       Console.Write (".");
+                                               output.Write ("passed, time: {0}", (end - start).ToString (TEST_TIME_FORMAT));
                                        }
 
                                        p.Close ();
+
+                                       lock (monitor) {
+                                               Console.WriteLine (output.ToString ());
+                                       }
                                }
                        });
 
@@ -279,15 +303,16 @@ public class TestRunner
                for (int j = 0; j < threads.Count; ++j)
                        threads [j].Join ();
 
+               TimeSpan test_time = DateTime.UtcNow - test_start_time;
+
                int npassed = passed.Count;
                int nfailed = failed.Count;
                int ntimedout = timedout.Count;
 
-               TimeSpan test_time = DateTime.UtcNow - test_start_time;
                XmlWriterSettings xmlWriterSettings = new XmlWriterSettings ();
                xmlWriterSettings.NewLineOnAttributes = true;
                xmlWriterSettings.Indent = true;
-               using (XmlWriter writer = XmlWriter.Create (String.Format ("TestResults_{0}.xml", testsuiteName), xmlWriterSettings)) {
+               using (XmlWriter writer = XmlWriter.Create (String.Format ("TestResult-{0}.xml", testsuiteName), xmlWriterSettings)) {
                        // <?xml version="1.0" encoding="utf-8" standalone="no"?>
                        writer.WriteStartDocument ();
                        // <!--This file represents the results of running a test suite-->
@@ -406,6 +431,8 @@ public class TestRunner
                        writer.WriteEndDocument ();
                }
 
+               Console.WriteLine ();
+               Console.WriteLine ("Time: {0}", test_time.ToString (TEST_TIME_FORMAT));
                Console.WriteLine ();
                Console.WriteLine ("{0,4} test(s) passed", npassed);
                Console.WriteLine ("{0,4} test(s) failed", nfailed);
@@ -446,8 +473,14 @@ public class TestRunner
 
        static string DumpPseudoTrace (string filename) {
                if (File.Exists (filename))
-                       return File.ReadAllText (filename);
+                       return FilterInvalidXmlChars (File.ReadAllText (filename));
                else
                        return string.Empty;
        }
+
+       static string FilterInvalidXmlChars (string text) {
+               // Spec at http://www.w3.org/TR/2008/REC-xml-20081126/#charsets says only the following chars are valid in XML:
+               // Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]      /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
+               return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", "");
+       }
 }
index 47e3454c3d93d42e2c78fd32ca54121df913d1ef..b0940d17cef4a0de25ba20d0904ff4c5ae542e1f 100644 (file)
@@ -31,8 +31,8 @@ For further explanation of what can and can't be done in GC unsafe mode:
 http://www.mono-project.com/docs/advanced/runtime/docs/coop-suspend/#gc-unsafe-mode
 
 */
-#define MONO_BEGIN_EFRAME { void *__dummy; void *__region_cookie = mono_threads_enter_gc_unsafe_region (__dummy);
-#define MONO_END_EFRAME mono_threads_exit_gc_unsafe_region (__region_cookie, __dummy); }
+#define MONO_BEGIN_EFRAME { void *__dummy; void *__region_cookie = mono_threads_enter_gc_unsafe_region (&__dummy);
+#define MONO_END_EFRAME mono_threads_exit_gc_unsafe_region (__region_cookie, &__dummy); }
 
 
 MONO_END_DECLS
index a0f161b0f04fd7661d86effb4bc38aad7c74c7bd..edfb11d6c028b7aea1737d98cfa8d0c13173af19 100644 (file)
@@ -24,6 +24,7 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-counters.h>
+#include <mono/utils/mono-threads-coop.h>
 
 #ifdef TARGET_OSX
 #include <mono/utils/mach-support.h>
 #define SAVE_REGS_ON_STACK __builtin_unwind_init ();
 #endif
 
-#ifdef USE_COOP_BACKEND
-
 volatile size_t mono_polling_required;
 
-static int coop_reset_blocking_count, coop_try_blocking_count, coop_do_blocking_count, coop_do_polling_count, coop_save_count;
+static int coop_reset_blocking_count;
+static int coop_try_blocking_count;
+static int coop_do_blocking_count;
+static int coop_do_polling_count;
+static int coop_save_count;
 
 void
 mono_threads_state_poll (void)
 {
        MonoThreadInfo *info;
+
+       g_assert (mono_threads_is_coop_enabled ());
+
        ++coop_do_polling_count;
 
        info = mono_thread_info_current_unchecked ();
@@ -77,7 +83,7 @@ mono_threads_state_poll (void)
 static void *
 return_stack_ptr ()
 {
-       int i;
+       gpointer i;
        return &i;
 }
 
@@ -93,7 +99,14 @@ copy_stack_data (MonoThreadInfo *info, void* stackdata_begin)
        state = &info->thread_saved_state [SELF_SUSPEND_STATE_INDEX];
 
        stackdata_size = (char*)stackdata_begin - (char*)stackdata_end;
-       g_assert (stackdata_size > 0);
+
+       if (((gsize) stackdata_begin & (SIZEOF_VOID_P - 1)) != 0)
+               g_error ("stackdata_begin (%p) must be %d-byte aligned", stackdata_begin, SIZEOF_VOID_P);
+       if (((gsize) stackdata_end & (SIZEOF_VOID_P - 1)) != 0)
+               g_error ("stackdata_end (%p) must be %d-byte aligned", stackdata_end, SIZEOF_VOID_P);
+
+       if (stackdata_size <= 0)
+               g_error ("stackdata_size = %d, but must be > 0, stackdata_begin = %p, stackdata_end = %p", stackdata_size, stackdata_begin, stackdata_end);
 
        g_byte_array_set_size (info->stackdata, stackdata_size);
        state->gc_stackdata = info->stackdata->data;
@@ -106,6 +119,10 @@ void*
 mono_threads_prepare_blocking (void* stackdata)
 {
        MonoThreadInfo *info;
+
+       if (!mono_threads_is_coop_enabled ())
+               return NULL;
+
        ++coop_do_blocking_count;
 
        info = mono_thread_info_current_unchecked ();
@@ -136,8 +153,12 @@ void
 mono_threads_finish_blocking (void *cookie, void* stackdata)
 {
        static gboolean warned_about_bad_transition;
-       MonoThreadInfo *info = cookie;
+       MonoThreadInfo *info;
 
+       if (!mono_threads_is_coop_enabled ())
+               return;
+
+       info = cookie;
        if (!info)
                return;
 
@@ -167,9 +188,14 @@ mono_threads_finish_blocking (void *cookie, void* stackdata)
 void*
 mono_threads_reset_blocking_start (void* stackdata)
 {
-       MonoThreadInfo *info = mono_thread_info_current_unchecked ();
+       MonoThreadInfo *info;
+
+       if (!mono_threads_is_coop_enabled ())
+               return NULL;
+
        ++coop_reset_blocking_count;
 
+       info = mono_thread_info_current_unchecked ();
        /* If the thread is not attached, it doesn't make sense prepare for suspend. */
        if (!info || !mono_thread_info_is_live (info))
                return NULL;
@@ -197,8 +223,12 @@ mono_threads_reset_blocking_start (void* stackdata)
 void
 mono_threads_reset_blocking_end (void *cookie, void* stackdata)
 {
-       MonoThreadInfo *info = cookie;
+       MonoThreadInfo *info;
 
+       if (!mono_threads_is_coop_enabled ())
+               return;
+
+       info = cookie;
        if (!info)
                return;
 
@@ -210,6 +240,10 @@ void*
 mono_threads_try_prepare_blocking (void* stackdata)
 {
        MonoThreadInfo *info;
+
+       if (!mono_threads_is_coop_enabled ())
+               return NULL;
+
        ++coop_try_blocking_count;
 
        info = mono_thread_info_current_unchecked ();
@@ -239,34 +273,18 @@ retry:
 void
 mono_threads_finish_try_blocking (void* cookie, void* stackdata)
 {
-       mono_threads_finish_blocking (cookie, stackdata);
-}
-
-gboolean
-mono_threads_core_begin_async_resume (MonoThreadInfo *info)
-{
-       g_error ("FIXME");
-       return FALSE;
-}
-
-gboolean
-mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
-{      
-       mono_threads_add_to_pending_operation_set (info);
-       /* There's nothing else to do after we async request the thread to suspend */
-       return TRUE;
-}
+       if (!mono_threads_is_coop_enabled ())
+               return;
 
-gboolean
-mono_threads_core_check_suspend_result (MonoThreadInfo *info)
-{
-       /* Async suspend can't async fail on coop */
-       return TRUE;
+       mono_threads_finish_blocking (cookie, stackdata);
 }
 
 void
-mono_threads_init_platform (void)
+mono_threads_init_coop (void)
 {
+       if (!mono_threads_is_coop_enabled ())
+               return;
+
        mono_counters_register ("Coop Reset Blocking", MONO_COUNTER_GC | MONO_COUNTER_INT, &coop_reset_blocking_count);
        mono_counters_register ("Coop Try Blocking", MONO_COUNTER_GC | MONO_COUNTER_INT, &coop_try_blocking_count);
        mono_counters_register ("Coop Do Blocking", MONO_COUNTER_GC | MONO_COUNTER_INT, &coop_do_blocking_count);
@@ -276,64 +294,33 @@ mono_threads_init_platform (void)
 }
 
 void
-mono_threads_platform_free (MonoThreadInfo *info)
+mono_threads_coop_begin_global_suspend (void)
 {
-#ifdef TARGET_MACH
-       mach_port_deallocate (current_task (), info->native_handle);
-#endif
-
-       //See the above for what's wrong here.
-}
-
-void
-mono_threads_platform_register (MonoThreadInfo *info)
-{
-#ifdef TARGET_MACH
-       char thread_name [64];
-
-       info->native_handle = mach_thread_self ();
-       snprintf (thread_name, 64, "tid_%x", (int)info->native_handle);
-       pthread_setname_np (thread_name);
-#endif
-
-       //See the above for what's wrong here.
-}
-
-void
-mono_threads_core_begin_global_suspend (void)
-{
-       mono_polling_required = 1;
+       if (mono_threads_is_coop_enabled ())
+               mono_polling_required = 1;
 }
 
 void
-mono_threads_core_end_global_suspend (void)
+mono_threads_coop_end_global_suspend (void)
 {
-       mono_polling_required = 0;
+       if (mono_threads_is_coop_enabled ())
+               mono_polling_required = 0;
 }
 
 void*
 mono_threads_enter_gc_unsafe_region (void* stackdata)
 {
+       if (!mono_threads_is_coop_enabled ())
+               return NULL;
+
        return mono_threads_reset_blocking_start (stackdata);
 }
 
 void
 mono_threads_exit_gc_unsafe_region (void *regions_cookie, void* stackdata)
 {
-       mono_threads_reset_blocking_end (regions_cookie, stackdata);
-}
-
-#else
-
-void*
-mono_threads_enter_gc_unsafe_region (void* stackdata)
-{
-       return NULL;
-}
+       if (!mono_threads_is_coop_enabled ())
+               return;
 
-void
-mono_threads_exit_gc_unsafe_region (void *regions_cookie, void* stackdata)
-{
+       mono_threads_reset_blocking_end (regions_cookie, stackdata);
 }
-
-#endif
\ No newline at end of file
index d103f42a5bd7a92469382e295205551e0ef35bbf..fa928672400754d15963d1f61fcfbcd588e159d5 100644 (file)
 #define __MONO_THREADS_COOP_H__
 
 #include <config.h>
+#include <glib.h>
 
-#ifdef USE_COOP_GC
+/* JIT specific interface */
+extern volatile size_t mono_polling_required;
 
 /* Runtime consumable API */
 
-#define MONO_SUSPEND_CHECK() do {      \
-       if (G_UNLIKELY (mono_polling_required)) mono_threads_state_poll ();     \
-} while (0);
+static gboolean G_GNUC_UNUSED
+mono_threads_is_coop_enabled (void)
+{
+#if defined(USE_COOP_GC)
+       return TRUE;
+#else
+       static gboolean is_coop_enabled = -1;
+       if (G_UNLIKELY (is_coop_enabled == -1))
+               is_coop_enabled = g_getenv ("MONO_ENABLE_COOP") != NULL ? TRUE : FALSE;
+       return is_coop_enabled;
+#endif
+}
+
+/* Internal API */
+
+void mono_threads_state_poll (void);
+void mono_threads_state_poll_stack_data (void* stackdata);
+
+void* mono_threads_prepare_blocking (void* stackdata);
+void mono_threads_finish_blocking (void* cookie, void* stackdata);
+
+void* mono_threads_reset_blocking_start (void* stackdata);
+void mono_threads_reset_blocking_end (void* cookie, void* stackdata);
+
+void* mono_threads_try_prepare_blocking (void* stackdata);
+void mono_threads_finish_try_blocking (void* cookie, void* stackdata);
+
+static inline void
+mono_threads_safepoint (void)
+{
+       if (G_UNLIKELY (mono_polling_required))
+               mono_threads_state_poll ();
+}
 
 #define MONO_PREPARE_BLOCKING  \
 {      \
        mono_threads_finish_try_blocking (__try_block_cookie, &__dummy);        \
 }
 
-/* Internal API */
-
-void mono_threads_state_poll (void);
-void mono_threads_state_poll_stack_data (void* stackdata);
-
-void* mono_threads_prepare_blocking (void* stackdata);
-void mono_threads_finish_blocking (void* cookie, void* stackdata);
-
-void* mono_threads_reset_blocking_start (void* stackdata);
-void mono_threads_reset_blocking_end (void* cookie, void* stackdata);
-
-void* mono_threads_try_prepare_blocking (void* stackdata);
-void mono_threads_finish_try_blocking (void* cookie, void* stackdata);
-
-/* JIT specific interface */
-extern volatile size_t mono_polling_required;
-
-#else
-
-#define MONO_SUSPEND_CHECK() do {      } while (0);
-#define MONO_PREPARE_BLOCKING {
-#define MONO_FINISH_BLOCKING }
-#define MONO_PREPARE_RESET_BLOCKING {
-#define MONO_FINISH_RESET_BLOCKING }
-#define MONO_TRY_BLOCKING {
-#define MONO_FINISH_TRY_BLOCKING }
-
-#endif /* USE_COOP_GC */
-
-
 #endif
index 4c30f6672bc3c271cda36d9c49a962521066901d..056a88f150a1cd72b8b5a1fb9d771ae8495c8845 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <mono/utils/mono-threads.h>
 
-#if defined(USE_MACH_SYSCALL_ABORT)
+#if defined(USE_MACH_BACKEND)
 
 #if defined(HOST_WATCHOS) || defined(HOST_TVOS)
 
index a7a199a29427cbfc443299f180e8c74ee69943ee..d48e30a2b37f5e0b13f56fd6f1674c75ff51b033 100644 (file)
@@ -31,6 +31,28 @@ mono_threads_init_platform (void)
        mono_threads_init_dead_letter ();
 }
 
+#if defined(HOST_WATCHOS) || defined(HOST_TVOS)
+
+gboolean
+mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
+{
+       g_assert_not_reached ();
+}
+
+gboolean
+mono_threads_core_check_suspend_result (MonoThreadInfo *info)
+{
+       g_assert_not_reached ();
+}
+
+gboolean
+mono_threads_core_begin_async_resume (MonoThreadInfo *info)
+{
+       g_assert_not_reached ();
+}
+
+#else /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
+
 gboolean
 mono_threads_core_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
 {
@@ -112,10 +134,18 @@ mono_threads_core_begin_async_resume (MonoThreadInfo *info)
        return ret == KERN_SUCCESS;
 }
 
+#endif /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
+
 void
 mono_threads_platform_register (MonoThreadInfo *info)
 {
+       char thread_name [64];
+
        info->native_handle = mach_thread_self ();
+
+       snprintf (thread_name, sizeof (thread_name), "tid_%x", (int) info->native_handle);
+       pthread_setname_np (thread_name);
+
        mono_threads_install_dead_letter ();
 }
 
@@ -125,16 +155,6 @@ mono_threads_platform_free (MonoThreadInfo *info)
        mach_port_deallocate (current_task (), info->native_handle);
 }
 
-void
-mono_threads_core_begin_global_suspend (void)
-{
-}
-
-void
-mono_threads_core_end_global_suspend (void)
-{
-}
-
 #endif /* USE_MACH_BACKEND */
 
 #ifdef __MACH__
index 4935bd1b3686ba986ee364e3e15ef1c9ea37de88..7e836163d67856cd520d26234228d9cebb627a90 100644 (file)
@@ -17,7 +17,7 @@
 #include "mono-threads.h"
 #include "mono-threads-posix-signals.h"
 
-#if defined(USE_POSIX_SYSCALL_ABORT)
+#if defined(USE_POSIX_BACKEND)
 
 void
 mono_threads_init_abort_syscall (void)
index 1dfdd38b571102da804e09351499527d0c5c910b..ade08008827ad746753bbaa654bb7d5a47654ae5 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "mono-threads.h"
 
-#if defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT)
+#if defined(USE_POSIX_BACKEND)
 
 #include <errno.h>
 #include <signal.h>
@@ -34,6 +34,9 @@ static int abort_signal_num;
 static sigset_t suspend_signal_mask;
 static sigset_t suspend_ack_signal_mask;
 
+//Can't avoid the circular dep on this. Will be gone pretty soon
+extern int mono_gc_get_suspend_signal (void);
+
 static int
 signal_search_alternative (int min_signal)
 {
@@ -178,7 +181,6 @@ suspend_signal_handler (int _dummy, siginfo_t *info, void *context)
        /* thread_state_init_from_sigctx return FALSE if the current thread is detaching and suspend can't continue. */
        current->suspend_can_continue = ret;
 
-
        /*
        Block the restart signal.
        We need to block the restart signal while posting to the suspend_ack semaphore or we race to sigsuspend,
@@ -186,19 +188,23 @@ suspend_signal_handler (int _dummy, siginfo_t *info, void *context)
        */
        pthread_sigmask (SIG_BLOCK, &suspend_ack_signal_mask, NULL);
 
-       /* We're done suspending */
-       mono_threads_notify_initiator_of_suspend (current);
-
        /* This thread is doomed, all we can do is give up and let the suspender recover. */
        if (!ret) {
                THREADS_SUSPEND_DEBUG ("\tThread is dying, failed to capture state %p\n", current);
                mono_threads_transition_async_suspend_compensation (current);
+
+               /* We're done suspending */
+               mono_threads_notify_initiator_of_suspend (current);
+
                /* Unblock the restart signal. */
                pthread_sigmask (SIG_UNBLOCK, &suspend_ack_signal_mask, NULL);
 
                goto done;
        }
 
+       /* We're done suspending */
+       mono_threads_notify_initiator_of_suspend (current);
+
        do {
                current->signal = 0;
                sigsuspend (&suspend_signal_mask);
@@ -258,6 +264,8 @@ mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals)
 
                sigfillset (&suspend_signal_mask);
                sigdelset (&suspend_signal_mask, restart_signal_num);
+               if (!mono_thread_info_unified_management_enabled ())
+                       sigdelset (&suspend_signal_mask, mono_gc_get_suspend_signal ());
 
                sigemptyset (&suspend_ack_signal_mask);
                sigaddset (&suspend_ack_signal_mask, restart_signal_num);
@@ -304,4 +312,4 @@ mono_threads_posix_get_abort_signal (void)
        return abort_signal_num;
 }
 
-#endif /* defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT) */
+#endif /* defined(USE_POSIX_BACKEND) */
index ccbd7606b3d35e1694b0158fe28bb4c454e402c1..437b7421ea8cf77890ddd62176a7626584bbecdf 100644 (file)
@@ -343,16 +343,6 @@ mono_threads_platform_free (MonoThreadInfo *info)
 {
 }
 
-void
-mono_threads_core_begin_global_suspend (void)
-{
-}
-
-void
-mono_threads_core_end_global_suspend (void)
-{
-}
-
 void
 mono_threads_init_platform (void)
 {
index 13d0b3dec9180ba7c3530df5aea1619d22db3331..bf3cf242f65e9fdea3656cbbf3ea61ea4815b52c 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <mono/utils/mono-threads.h>
 
-#if defined(USE_WINDOWS_SYSCALL_ABORT)
+#if defined(USE_WINDOWS_BACKEND)
 
 #include <limits.h>
 
index 29703b11f6f8a8aaeb7142eda3cdf817ff38a3b8..5f62b198075f8c7c836b8122d2ea4b3a46af3365 100644 (file)
@@ -132,16 +132,6 @@ mono_threads_platform_free (MonoThreadInfo *info)
 {
 }
 
-void
-mono_threads_core_begin_global_suspend (void)
-{
-}
-
-void
-mono_threads_core_end_global_suspend (void)
-{
-}
-
 #endif
 
 #if defined (HOST_WIN32)
index dee4b976689ebfdf53d3239415ce8f5862393254..abad3b64aaacaf2ce6acbd8b46fab97791266354 100644 (file)
@@ -96,9 +96,35 @@ mono_threads_notify_initiator_of_resume (MonoThreadInfo* info)
        MONO_SEM_POST (&suspend_semaphore);
 }
 
+static gboolean
+begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
+{
+       if (mono_threads_is_coop_enabled ()) {
+               /* There's nothing else to do after we async request the thread to suspend */
+               mono_threads_add_to_pending_operation_set (info);
+               return TRUE;
+       }
+
+       return mono_threads_core_begin_async_suspend (info, interrupt_kernel);
+}
+
+static gboolean
+check_async_suspend (MonoThreadInfo *info)
+{
+       if (mono_threads_is_coop_enabled ()) {
+               /* Async suspend can't async fail on coop */
+               return TRUE;
+       }
+
+       return mono_threads_core_check_suspend_result (info);
+}
+
 static void
 resume_async_suspended (MonoThreadInfo *info)
 {
+       if (mono_threads_is_coop_enabled ())
+               g_assert_not_reached ();
+
        g_assert (mono_threads_core_begin_async_resume (info));
 }
 
@@ -140,7 +166,7 @@ mono_threads_begin_global_suspend (void)
        THREADS_SUSPEND_DEBUG ("------ BEGIN GLOBAL OP sp %d rp %d ap %d wd %d po %d (sp + rp + ap == wd) (wd == po)\n", suspend_posts, resume_posts,
                abort_posts, waits_done, pending_ops);
        g_assert ((suspend_posts + resume_posts + abort_posts) == waits_done);
-       mono_threads_core_begin_global_suspend ();
+       mono_threads_coop_begin_global_suspend ();
 }
 
 void
@@ -152,7 +178,7 @@ mono_threads_end_global_suspend (void)
        THREADS_SUSPEND_DEBUG ("------ END GLOBAL OP sp %d rp %d ap %d wd %d po %d\n", suspend_posts, resume_posts,
                abort_posts, waits_done, pending_ops);
        g_assert ((suspend_posts + resume_posts + abort_posts) == waits_done);
-       mono_threads_core_end_global_suspend ();
+       mono_threads_coop_end_global_suspend ();
 }
 
 static void
@@ -603,7 +629,7 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
 #endif
        g_assert (res);
 
-       unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND;
+       unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || mono_threads_is_coop_enabled ();
 
        MONO_SEM_INIT (&global_suspend_semaphore, 1);
        MONO_SEM_INIT (&suspend_semaphore, 0);
@@ -611,6 +637,7 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
        mono_lls_init (&thread_list, NULL);
        mono_thread_smr_init ();
        mono_threads_init_platform ();
+       mono_threads_init_coop ();
        mono_threads_init_abort_syscall ();
 
 #if defined(__MACH__)
@@ -655,7 +682,7 @@ mono_thread_info_suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel
                mono_threads_add_to_pending_operation_set (info);
                break;
        case AsyncSuspendInitSuspend:
-               if (!mono_threads_core_begin_async_suspend (info, interrupt_kernel)) {
+               if (!begin_async_suspend (info, interrupt_kernel)) {
                        mono_hazard_pointer_clear (hp, 1);
                        *error_condition = "Could not suspend thread";
                        return NULL;
@@ -665,8 +692,7 @@ mono_thread_info_suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel
        //Wait for the pending suspend to finish
        mono_threads_wait_pending_operations ();
 
-       if (!mono_threads_core_check_suspend_result (info)) {
-
+       if (!check_async_suspend (info)) {
                mono_hazard_pointer_clear (hp, 1);
                *error_condition = "Post suspend failed";
                return NULL;
@@ -791,7 +817,7 @@ mono_thread_info_begin_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
                mono_threads_add_to_pending_operation_set (info);
                return TRUE;
        case AsyncSuspendInitSuspend:
-               return mono_threads_core_begin_async_suspend (info, interrupt_kernel);
+               return begin_async_suspend (info, interrupt_kernel);
        default:
                g_assert_not_reached ();
        }
@@ -803,6 +829,12 @@ mono_thread_info_begin_resume (MonoThreadInfo *info)
        return mono_thread_info_core_resume (info);
 }
 
+gboolean
+mono_thread_info_check_suspend_result (MonoThreadInfo *info)
+{
+       return check_async_suspend (info);
+}
+
 /*
 FIXME fix cardtable WB to be out of line and check with the runtime if the target is not the
 WB trampoline. Another option is to encode wb ranges in MonoJitInfo, but that is somewhat hard.
@@ -1010,16 +1042,16 @@ mono_thread_info_suspend_unlock (void)
  * facility.
  */
 void
-mono_thread_info_abort_socket_syscall_for_close (MonoThreadInfo *info)
+mono_thread_info_abort_socket_syscall_for_close (MonoNativeThreadId tid)
 {
        MonoThreadHazardPointers *hp;
+       MonoThreadInfo *info;
 
-       g_assert (info);
-
-       if (info == mono_thread_info_current () || !mono_threads_core_needs_abort_syscall ())
+       if (tid == mono_native_thread_id_get () || !mono_threads_core_needs_abort_syscall ())
                return;
 
        hp = mono_hazard_pointer_get ();
+       info = mono_thread_info_lookup (tid);
        if (!info)
                return;
 
index fb2cb2b09472a8105679a4f8e0013b6a9fa4069c..8a7782fad12d6bc69c507a992f9e909f06d9ac33 100644 (file)
@@ -127,40 +127,16 @@ and reduce the number of casts drastically.
 /* If this is defined, use the signals backed on Mach. Debug only as signals can't be made usable on OSX. */
 // #define USE_SIGNALS_ON_MACH
 
-
-#if defined (USE_COOP_GC)
-#define USE_COOP_BACKEND
-#define MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND 1
-
-#elif defined (_POSIX_VERSION) || defined (__native_client__)
-#define MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND 0
-
+#if defined (_POSIX_VERSION) || defined (__native_client__)
 #if defined (__MACH__) && !defined (USE_SIGNALS_ON_MACH)
 #define USE_MACH_BACKEND
 #else
 #define USE_POSIX_BACKEND
 #endif
-
 #elif HOST_WIN32
-#define MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND 0
 #define USE_WINDOWS_BACKEND
-
 #else
 #error "no backend support for current platform"
-#endif /* defined (USE_COOP_GC) */
-
-#if defined (_POSIX_VERSION) || defined (__native_client__)
-#if defined (__MACH__) && !defined (USE_SIGNALS_ON_MACH)
-#define USE_MACH_SYSCALL_ABORT
-#else
-#define USE_POSIX_SYSCALL_ABORT
-#endif
-
-#elif HOST_WIN32
-#define USE_WINDOWS_SYSCALL_ABORT
-
-#else
-#error "no syscall abort support for current platform"
 #endif /* defined (_POSIX_VERSION) || defined (__native_client__) */
 
 enum {
@@ -217,7 +193,7 @@ typedef struct {
        MonoSemType resume_semaphore;
 
        /* only needed by the posix backend */
-#if defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT)
+#if defined(USE_POSIX_BACKEND)
        MonoSemType finish_resume_semaphore;
        gboolean syscall_break_signal;
        gboolean suspend_can_continue;
@@ -414,7 +390,7 @@ void
 mono_thread_info_suspend_unlock (void);
 
 void
-mono_thread_info_abort_socket_syscall_for_close (MonoThreadInfo *info);
+mono_thread_info_abort_socket_syscall_for_close (MonoNativeThreadId tid);
 
 void
 mono_thread_info_set_is_async_context (gboolean async_context);
@@ -511,6 +487,8 @@ This is called very early in the runtime, it cannot access any runtime facilitie
 */
 void mono_threads_init_platform (void); //ok
 
+void mono_threads_init_coop (void);
+
 void mono_threads_init_abort_syscall (void);
 
 /*
@@ -555,8 +533,8 @@ HANDLE mono_threads_core_open_handle (void);
 HANDLE mono_threads_core_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
 void mono_threads_core_set_name (MonoNativeThreadId tid, const char *name);
 
-void mono_threads_core_begin_global_suspend (void);
-void mono_threads_core_end_global_suspend (void);
+void mono_threads_coop_begin_global_suspend (void);
+void mono_threads_coop_end_global_suspend (void);
 
 MonoNativeThreadId
 mono_native_thread_id_get (void);
@@ -655,6 +633,8 @@ gboolean mono_thread_info_in_critical_location (THREAD_INFO_TYPE *info);
 gboolean mono_thread_info_begin_suspend (THREAD_INFO_TYPE *info, gboolean interrupt_kernel);
 gboolean mono_thread_info_begin_resume (THREAD_INFO_TYPE *info);
 
+gboolean
+mono_thread_info_check_suspend_result (THREAD_INFO_TYPE *info);
 
 void mono_threads_add_to_pending_operation_set (THREAD_INFO_TYPE* info); //XXX rename to something to reflect the fact that this is used for both suspend and resume
 gboolean mono_threads_wait_pending_operations (void);
index 6f6ff0a4964e0010d7d7221d8a86fff656923fd8..db5b412098477f867cb29e91dbda75d9deab1044 100644 (file)
@@ -506,7 +506,6 @@ mono_mempool_alloc
 mono_mempool_alloc0
 mono_mempool_contains_addr
 mono_mempool_destroy
-mono_mempool_empty
 mono_mempool_get_allocated
 mono_mempool_invalidate
 mono_mempool_new
index d19f721a02def70bd877d85857706570a5740ac4..9509528b1a51b1be48ea82cccb766c6e1017b53c 100644 (file)
@@ -509,7 +509,6 @@ mono_mempool_alloc
 mono_mempool_alloc0
 mono_mempool_contains_addr
 mono_mempool_destroy
-mono_mempool_empty
 mono_mempool_get_allocated
 mono_mempool_invalidate
 mono_mempool_new