Merge pull request #2198 from BrzVlad/feature-concurrent-work
authorMark Probst <mark.probst@gmail.com>
Wed, 11 Nov 2015 19:26:25 +0000 (11:26 -0800)
committerMark Probst <mark.probst@gmail.com>
Wed, 11 Nov 2015 19:26:25 +0000 (11:26 -0800)
[sgen] Fix memory use of the concurrent collector

225 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
external/referencesource
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/Facades/subdirs.make [new file with mode: 0644]
mcs/class/Makefile
mcs/class/Microsoft.Build.Engine/Makefile
mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs
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/MonoSslStream.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.Drawing/System.Drawing/ColorTranslator.cs
mcs/class/System.Drawing/Test/System.Drawing/ColorTranslator.cs
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.Web/System.Web.UI.WebControls/WebColorConverter.cs [deleted file]
mcs/class/System.Web/System.Web.dll.sources
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/Array.cs
mcs/class/corlib/System/Exception.cs
mcs/class/corlib/Test/System.Threading/ThreadTest.cs
mcs/class/corlib/Test/System/ArrayTest.cs
mcs/class/corlib/Test/System/EnumTest.cs
mcs/class/corlib/Test/System/MathTest.cs
mcs/class/corlib/Test/System/TypeTest.cs
mcs/errors/cs0208-18.cs [new file with mode: 0644]
mcs/errors/cs0841-6.cs [new file with mode: 0644]
mcs/mcs/anonymous.cs
mcs/mcs/class.cs
mcs/mcs/cs-tokenizer.cs
mcs/mcs/expression.cs
mcs/mcs/generic.cs
mcs/mcs/namespace.cs
mcs/mcs/statement.cs
mcs/tests/gtest-409.cs
mcs/tests/gtest-635.cs [new file with mode: 0644]
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/corcompare/Makefile
mcs/tools/corcompare/mono-api-info.cs
mcs/tools/corcompare/mono-api-info.csproj
mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs
mcs/tools/macpack/LOADER
mcs/tools/mdoc/Mono.Documentation/preserver.cs
mcs/tools/xbuild/Makefile
mono/arch/s390x/s390x-codegen.h
mono/cil/opcode.def
mono/dis/get.c
mono/dis/main.c
mono/io-layer/processes.c
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/boehm-gc.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/cominterop.c
mono/metadata/debug-helpers.c
mono/metadata/debug-mono-ppdb.c
mono/metadata/gc-internal.h
mono/metadata/gc.c
mono/metadata/icall.c
mono/metadata/image-internals.h [new file with mode: 0644]
mono/metadata/image.c
mono/metadata/loader.c
mono/metadata/locales.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/mempool.c
mono/metadata/mempool.h
mono/metadata/metadata-internals.h
mono/metadata/metadata.c
mono/metadata/mono-hash.c
mono/metadata/null-gc.c
mono/metadata/object.c
mono/metadata/pedump.c
mono/metadata/reflection.c
mono/metadata/remoting.c
mono/metadata/security-core-clr.c
mono/metadata/sgen-bridge-internal.h
mono/metadata/sgen-bridge.c
mono/metadata/sgen-client-mono.h
mono/metadata/sgen-mono.c
mono/metadata/sgen-new-bridge.c
mono/metadata/sgen-old-bridge.c
mono/metadata/sgen-stw.c
mono/metadata/sgen-tarjan-bridge.c
mono/metadata/socket-io.c
mono/metadata/threadpool-ms-io.c
mono/metadata/verify.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/method-to-ir.c
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-cpp.cpp
mono/mini/mini-llvm-cpp.h
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/patch-info.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-gchandles.c
mono/tests/Makefile.am
mono/tests/finalizer-wait.cs
mono/tests/libtest.c
mono/tests/pinvoke3.cs
mono/tests/test-runner.cs
mono/utils/checked-build.c
mono/utils/checked-build.h
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..36967e824fb0ae496f47759aa336e4a5a2f0056b 100644 (file)
@@ -19,63 +19,82 @@ ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
 check-ms-test-suite:
        @if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
                $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -t:library -warn:1 -r:nunit.framework"; \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest"; \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml; \
                $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1"; \
                $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)"; \
        else \
                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
+       cd $(ROSLYN_PATH); \
+       sed -i -e 'N; s/bootstrapArg=".*\n.*"/bootstrapArg=""/g' cibuild.sh; \
+       sed -i -e 's#-xml Binaries/\$$BUILD_CONFIGURATION/xUnitResults/#-nunit $(abs_top_builddir)/acceptance-tests/TestResult-#g' cibuild.sh; \
+       ./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 +128,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 +157,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 +168,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 +187,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 +195,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 +204,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 +217,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 +248,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 +293,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 +310,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 +333,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 +392,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 +445,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 +456,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 +479,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 +563,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 +614,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 +643,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 +657,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 +890,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 +919,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 +945,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 +999,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 +3794,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 +3835,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 +5105,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 +5156,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 +5169,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..3cd5044f49d698f18fca4d0db4356bc289eaa302 100644 (file)
@@ -2,23 +2,23 @@
   {
     "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"
   }, 
   {
     "name": "ms-test-suite", 
     "url": "git@github.com:xamarin/ms-test-suite.git", 
-    "rev": "4caab98ae449836c2aaacb9748fe0c796b71517f", 
+    "rev": "19f2a7dd44a2bfcf6006fd38033222383e8b81bf", 
     "remote-branch": "origin/master", 
     "branch": "master", 
     "directory": "ms-test-suite"
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 327b7d0d93e0c462e80bd6bf7bc44884700300e9..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
@@ -2569,6 +2569,13 @@ if test "x$enable_nacl_gc" = "xyes"; then
 fi
 AC_SUBST(MONO_NACL_ALIGN_MASK_OFF)
 
+dnl **************************
+dnl *** AOT cross offsets  ***
+dnl **************************
+
+AC_ARG_WITH(cross-offsets, [  --with-cross-offsets=<offsets file path>    Explicit AOT cross offsets file],
+    AC_DEFINE_UNQUOTED(MONO_OFFSETS_FILE, "$withval", [AOT cross offsets file]))
+
 dnl **************
 dnl ***  LLVM  ***
 dnl **************
@@ -2576,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,)
 
@@ -2689,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 d69f20d81d23e8e924e9339552336a2d0252864a..6a908b3101dda3780a5a3461f382938c70468e3b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d69f20d81d23e8e924e9339552336a2d0252864a
+Subproject commit 6a908b3101dda3780a5a3461f382938c70468e3b
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..26bd08261f9f43107a2e91574b68a53d2c179e8a 100644 (file)
@@ -2,46 +2,7 @@ MCS_BUILD_DIR = ../../build
 
 thisdir = class/Facades
 
-monotouch_PARALLEL_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \
-       System.Diagnostics.Contracts System.Diagnostics.Debug System.Diagnostics.Tracing System.Diagnostics.Tools System.Dynamic.Runtime System.Globalization System.IO System.Linq.Expressions \
-       System.Linq.Parallel System.Linq.Queryable System.Linq System.Net.NetworkInformation System.Net.Primitives System.Net.Requests System.ObjectModel \
-       System.Reflection.Extensions System.Reflection.Primitives System.Reflection System.Resources.ResourceManager System.Runtime.Extensions \
-       System.Runtime.InteropServices System.Runtime.InteropServices.WindowsRuntime System.Runtime.Numerics System.Runtime.Serialization.Json \
-       System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml System.Runtime System.Security.Principal System.ServiceModel.Http \
-       System.ServiceModel.Primitives System.ServiceModel.Security System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \
-       System.Threading.Tasks System.Threading.Timer System.Threading System.Xml.ReaderWriter System.Xml.XDocument System.Xml.XmlSerializer \
-       System.Runtime.Handles System.ServiceModel.Duplex System.ServiceModel.NetTcp \
-       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.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 \
-       System.Security.AccessControl System.Security.Claims System.Security.Cryptography.DeriveBytes System.Security.Cryptography.Encoding System.Security.Cryptography.Encryption \
-       System.Security.Cryptography.Encryption.Aes System.Security.Cryptography.Encryption.ECDiffieHellman System.Security.Cryptography.Encryption.ECDsa System.Security.Cryptography.Hashing \
-       System.Security.Cryptography.Hashing.Algorithms System.Security.Cryptography.RSA System.Security.Cryptography.RandomNumberGenerator \
-       System.Security.Cryptography.X509Certificates System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
-       System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win32.Registry.AccessControl System.Diagnostics.StackTrace System.Globalization.Extensions \
-       System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Private.CoreLib.Threading System.Reflection.TypeExtensions \
-       System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument
-
-reflection_PARALLEL_SUBDIRS = System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit
-
-mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
-
-net_4_x_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
-       System.IO.FileSystem.Watcher System.IO.Pipes System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.Net.Http.WebRequestHandler
-
-monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
-
-xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
-xammac_net_4_5_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
-
-monotouch_watch_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
-monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
-
-PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
+include subdirs.make
 
 #OVERRIDE_TARGET_ALL = yes
 
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))]
-
-
diff --git a/mcs/class/Facades/subdirs.make b/mcs/class/Facades/subdirs.make
new file mode 100644 (file)
index 0000000..0e18045
--- /dev/null
@@ -0,0 +1,45 @@
+
+# This file should only contain SUBDIRS variables
+# Caution while renaming SUBDIRS variables as those are used outside mono repository.
+# ie: macccore/builds/Makefile
+
+monotouch_PARALLEL_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \
+System.Diagnostics.Contracts System.Diagnostics.Debug System.Diagnostics.Tracing System.Diagnostics.Tools System.Dynamic.Runtime System.Globalization System.IO System.Linq.Expressions \
+System.Linq.Parallel System.Linq.Queryable System.Linq System.Net.NetworkInformation System.Net.Primitives System.Net.Requests System.ObjectModel \
+System.Reflection.Extensions System.Reflection.Primitives System.Reflection System.Resources.ResourceManager System.Runtime.Extensions \
+System.Runtime.InteropServices System.Runtime.InteropServices.WindowsRuntime System.Runtime.Numerics System.Runtime.Serialization.Json \
+System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml System.Runtime System.Security.Principal System.ServiceModel.Http \
+System.ServiceModel.Primitives System.ServiceModel.Security System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \
+System.Threading.Tasks System.Threading.Timer System.Threading System.Xml.ReaderWriter System.Xml.XDocument System.Xml.XmlSerializer \
+System.Runtime.Handles System.ServiceModel.Duplex System.ServiceModel.NetTcp \
+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.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 \
+System.Security.AccessControl System.Security.Claims System.Security.Cryptography.DeriveBytes System.Security.Cryptography.Encoding System.Security.Cryptography.Encryption \
+System.Security.Cryptography.Encryption.Aes System.Security.Cryptography.Encryption.ECDiffieHellman System.Security.Cryptography.Encryption.ECDsa System.Security.Cryptography.Hashing \
+System.Security.Cryptography.Hashing.Algorithms System.Security.Cryptography.RSA System.Security.Cryptography.RandomNumberGenerator \
+System.Security.Cryptography.X509Certificates System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
+System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win32.Registry.AccessControl System.Diagnostics.StackTrace System.Globalization.Extensions \
+System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Private.CoreLib.Threading System.Reflection.TypeExtensions \
+System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument
+
+reflection_PARALLEL_SUBDIRS = System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit
+
+mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
+
+net_4_x_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
+System.IO.FileSystem.Watcher System.IO.Pipes System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.Net.Http.WebRequestHandler
+
+monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
+
+xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
+xammac_net_4_5_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
+
+monotouch_watch_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
+monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
+
+PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
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 a5cb54df4094ef4d71da78b5316f9efc21902607..47216dc7d240adcdc7aff86163e6c1514107b056 100644 (file)
@@ -26,13 +26,17 @@ EXTRA_DISTFILES = \
        Test/resources/*.*proj  \
        Test/resources/*.csproj
 
-Test/resources/TestTasks.dll: Test/resources/TestTasks.cs
-       $(CSCOMPILE) Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
+Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
+       $(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
 
 clean-test-resources:
-       rm -f Test/resources/TestTasks.dll      
+       rm -f Test/resources/TestTasks*.dll Test/resources/TestTasks*.dll.mdb
 
-test-local: Test/resources/TestTasks.dll
+test-local: compile-resources
+
+compile-resources: Test/resources/TestTasks-$(PROFILE).dll
+       cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
+       cp Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks.dll.mdb
 
 clean-local: clean-test-resources
 
index 57b6e1c4bcd9200cc45d6815891aafc823b0975a..74fc4a03cf2cbd4605da80b3f3059eec57089057 100644 (file)
@@ -83,6 +83,26 @@ namespace MonoTests.EvaluatorTest
                        Evaluator.Evaluate ("File.Exists (\"/etc/passwd\");");
                }
 
+               [Test]
+               public void UsingWithError ()
+               {
+                       try {
+                               Evaluator.Run ("using System.DateTime;");
+                               Assert.Fail ("#1");
+                       } catch {
+                       }
+
+                       Evaluator.Evaluate ("1+1");
+               }
+
+               [Test]
+               public void UsingAlias ()
+               {
+                       Evaluator.Run("using System;");
+                       Evaluator.Run("using MyConsole = System.Console;");
+                       Evaluator.Run("Console.WriteLine(\"Hello World\")");
+               }
+
                [Test]
                public void WithTypeBuilders ()
                {
index a82ee31d61df9ee5d51e0539ed7a1b9017a8ec52..a3891311dd562a6e4dfffc69fdfb2c2d7b4387df 100644 (file)
@@ -146,6 +146,7 @@ namespace MonoTests.Mono.Unix.Native
                public void SockOpt ()
                {
                        WithSockets (UnixAddressFamily.AF_UNIX, UnixSocketType.SOCK_STREAM, 0, (so1, so2) => {
+                               int value;
                                if (Syscall.getsockopt (so1, UnixSocketProtocol.SOL_SOCKET, UnixSocketOptionName.SO_REUSEADDR, out value) < 0)
                                        UnixMarshal.ThrowExceptionForLastError ();
                                Assert.AreEqual (0, value);
@@ -155,7 +156,6 @@ namespace MonoTests.Mono.Unix.Native
                                        UnixMarshal.ThrowExceptionForLastError ();
 
                                // Get and check SO_REUSEADDR
-                               int value;
                                if (Syscall.getsockopt (so1, UnixSocketProtocol.SOL_SOCKET, UnixSocketOptionName.SO_REUSEADDR, out value) < 0)
                                        UnixMarshal.ThrowExceptionForLastError ();
                                Assert.AreNotEqual (0, value);
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 8947ed4730138f31898a1c71169e1310f27c616a..48fc51bf4cc99d6a0463501af43d6ff0d2007276 100644 (file)
@@ -36,7 +36,7 @@ using Mono.Net.Security;
 
 namespace Mono.Security.Interface
 {
-       public abstract class MonoSslStream
+       public abstract class MonoSslStream : IDisposable
        {
                public abstract void AuthenticateAsClient (string targetHost);
 
@@ -193,6 +193,11 @@ namespace Mono.Security.Interface
                protected virtual void Dispose (bool disposing)
                {
                }
+
+               ~MonoSslStream ()
+               {
+                       Dispose (false);
+               }
        }
 }
 
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..41ff61e243e675c8b4e8bdd8187d04c6e9265c63 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 (X509Certificate 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 27e5959c353e359dce985ef0d204f47252b4278b..c17eca4d15f0463a03a572db088d6d978159017e 100644 (file)
@@ -42,12 +42,11 @@ namespace System.Drawing {
 
                public static Color FromHtml (string htmlColor)
                {
-                       if ((htmlColor == null) || (htmlColor.Length == 0))
-                               return Color.Empty;
+                       if (string.IsNullOrEmpty (htmlColor)) return Color.Empty;
 
                        switch (htmlColor.ToLowerInvariant ()) {
                        case "buttonface":
-                       case "threedface":              
+                       case "threedface":
                                return SystemColors.Control;
                        case "buttonhighlight":
                        case "threedlightshadow":
@@ -70,7 +69,13 @@ namespace System.Drawing {
                        case "lightgrey":
                                return Color.LightGray;
                        }
-                       
+
+                       if (htmlColor[0] == '#' && htmlColor.Length == 4)
+                       {
+                               char r = htmlColor[1], g = htmlColor[2], b = htmlColor[3];
+                               htmlColor = new string ( new char [] { '#', r, r, g, g, b, b } );
+                       }
+
                        TypeConverter converter = TypeDescriptor.GetConverter (typeof (Color));
                        return (Color) converter.ConvertFromString (htmlColor);
                }
index ffd4e836938236fe4b3a20304814781d109dc945..27ee0f55305493680b0b4796047f2bdd5a171aaf 100644 (file)
@@ -71,6 +71,8 @@ namespace MonoTests.System.Drawing {
                        Assert.AreEqual (0, ColorTranslator.FromHtml ("#0").ToArgb (), "#0");
                        Assert.AreEqual (1, ColorTranslator.FromHtml ("#1").ToArgb (), "#1");
                        Assert.AreEqual (255, ColorTranslator.FromHtml ("#FF").ToArgb (), "#FF");
+                       Assert.AreEqual (-15654349, ColorTranslator.FromHtml ("#123").ToArgb (), "#123");
+                       Assert.AreEqual (-1, ColorTranslator.FromHtml ("#FFF").ToArgb (), "#FFF");
                        Assert.AreEqual (65535, ColorTranslator.FromHtml ("#FFFF").ToArgb (), "#FFFF");
                        Assert.AreEqual (-15584170, ColorTranslator.FromHtml ("#123456").ToArgb (), "#123456");
                        Assert.AreEqual (-1, ColorTranslator.FromHtml ("#FFFFFF").ToArgb (), "#FFFFFF");
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);
-               }
-       }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
deleted file mode 100644 (file)
index f2965a3..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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.
-//
-// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-//     Peter Bartok    (pbartok@novell.com)
-//     Marek Safar     (marek.safar@gmail.com) 
-//
-//
-
-using System.Collections;
-using System.Drawing;
-using System.Globalization;
-using System.ComponentModel;
-using System.Security.Permissions;
-using System.Web.Util;
-
-namespace System.Web.UI.WebControls {
-
-       // CAS
-       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public class WebColorConverter : ColorConverter
-       {
-               // Converts from string to Color
-               public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) 
-               {
-                       if (value is string) {
-                               string  s = ((string)value).Trim();
-                               return ColorTranslator.FromHtml (s);
-                       }
-                       
-                       return base.ConvertFrom (context, culture, value);
-               }
-
-               // Converts from Color to string
-               public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) 
-               {
-                       if (!(value is Color) || destinationType != typeof (string))
-                               return base.ConvertTo (context, culture, value, destinationType);
-
-                       Color c = (Color) value;
-
-                       if (culture == null)
-                               culture = Helpers.InvariantCulture;
-
-                       string s = c.ToKnownColor ().ToString ();
-                       if (s != "0")
-                               return s;
-
-                       return String.Concat ("#", c.R.ToString ("X2"), c.G.ToString ("X2"), c.B.ToString ("X2"));
-               }
-       }
-}
index eab4ad5829152bd593ec637085988e1382a6f8fb..4e492be3e41bbff17053293711aa90a76b306d16 100644 (file)
@@ -1122,7 +1122,7 @@ System.Web.UI.WebControls/VerticalAlignConverter.cs
 ../../../external/referencesource/System.Web/UI/WebControls/VerticalAlign.cs
 System.Web.UI.WebControls/ViewCollection.cs
 System.Web.UI.WebControls/View.cs
-System.Web.UI.WebControls/WebColorConverter.cs
+../../../external/referencesource/System.Web/UI/WebControls/WebColorConverter.cs
 System.Web.UI.WebControls/WebControl.cs
 System.Web.UI.WebControls.WebParts/ConnectionConsumerCallback.cs
 System.Web.UI.WebControls.WebParts/ConnectionInterfaceCollection.cs
@@ -1197,6 +1197,7 @@ System.Web.Util/Helpers.cs
 System.Web.Util/HttpEncoder.cs
 System.Web.Util/ICalls.cs
 ../../../external/referencesource/System.Web/Util/IObjectFactory.cs
+../../../external/referencesource/System.Web/Util/StringUtil.cs
 System.Web.Util/IWebPropertyAccessor.cs
 System.Web.Util/MachineKeySectionUtils.cs
 System.Web.Util/RuntimeHelpers.cs
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..ac184d963f13a7e1920ec33e954345db397f5e31 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, true, 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, true, 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, false, 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..1f066e1fcfea1aae2a650886882a0a03c821f104 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 (X509Certificate 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..baf83f33e9fb1ceb6560654722d793a53d57b88a 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 ((X509Certificate)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 141cf564de732b176899755c21ff8c0f7c4094eb..f51dc2616006918a4780d9e3ec4c6c8086c8cd8e 100644 (file)
@@ -80,8 +80,6 @@ namespace System.Diagnostics {
                Thread background_wait_for_exit_thread;
                ISynchronizeInvoke synchronizingObject;
                EventHandler exited_event;
-               IntPtr stdout_rd;
-               IntPtr stderr_rd;
 
                /* Private constructor called from other methods */
                private Process(IntPtr handle, int id) {
@@ -1019,17 +1017,15 @@ namespace System.Diagnostics {
 
                                if (startInfo.RedirectStandardOutput) {
                                        CreatePipe (out stdout_read, out stdout_write, false);
-                                       process.stdout_rd = stdout_read;
                                } else {
-                                       process.stdout_rd = IntPtr.Zero;
+                                       stdout_read = IntPtr.Zero;
                                        stdout_write = MonoIO.ConsoleOutput;
                                }
 
                                if (startInfo.RedirectStandardError) {
                                        CreatePipe (out stderr_read, out stderr_write, false);
-                                       process.stderr_rd  = stderr_read;
                                } else {
-                                       process.stderr_rd = IntPtr.Zero;
+                                       stderr_read = IntPtr.Zero;
                                        stderr_write = MonoIO.ConsoleError;
                                }
 
@@ -1092,7 +1088,7 @@ namespace System.Diagnostics {
 #else
                                var stdinEncoding = Console.InputEncoding;
 #endif
-                               process.input_stream = new StreamWriter (new FileStream (new SafeFileHandle (stdin_write, true), FileAccess.Write, 8192, false), stdinEncoding) {
+                               process.input_stream = new StreamWriter (new FileStream (stdin_write, FileAccess.Write, true, 8192), stdinEncoding) {
                                        AutoFlush = true
                                };
                        }
@@ -1102,7 +1098,7 @@ namespace System.Diagnostics {
 
                                Encoding stdoutEncoding = startInfo.StandardOutputEncoding ?? Console.Out.Encoding;
 
-                               process.output_stream = new StreamReader (new FileStream (new SafeFileHandle (stdout_read, true), FileAccess.Read, 8192, false), stdoutEncoding, true, 8192);
+                               process.output_stream = new StreamReader (new FileStream (stdout_read, FileAccess.Read, true, 8192), stdoutEncoding, true);
                        }
 
                        if (startInfo.RedirectStandardError) {
@@ -1110,7 +1106,7 @@ namespace System.Diagnostics {
 
                                Encoding stderrEncoding = startInfo.StandardErrorEncoding ?? Console.Out.Encoding;
 
-                               process.error_stream = new StreamReader (new FileStream (new SafeFileHandle (stderr_read, true), FileAccess.Read, 8192, false), stderrEncoding, true, 8192);
+                               process.error_stream = new StreamReader (new FileStream (stderr_read, FileAccess.Read, true, 8192), stderrEncoding, true);
                        }
 
                        process.StartBackgroundWaitForExit ();
@@ -1220,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 ();
 
@@ -1325,27 +1297,32 @@ namespace System.Diagnostics {
                        StringBuilder sb = new StringBuilder ();
                        byte[] buffer = new byte [4096];
 
-                       public ProcessAsyncReader (Process process, IntPtr handle, bool err_out)
+                       const int ERROR_INVALID_HANDLE = 6;
+
+                       public ProcessAsyncReader (Process process, FileStream stream, bool err_out)
                                : base (null, null)
                        {
                                this.process = process;
-                               this.handle = handle;
-                               this.stream = new FileStream (handle, FileAccess.Read, false);
+                               this.handle = stream.SafeFileHandle.DangerousGetHandle ();
+                               this.stream = stream;
                                this.err_out = err_out;
                        }
 
-                       public void BeginRead ()
+                       public void BeginReadLine ()
                        {
-                               IOSelector.Add (this.handle, new IOSelectorJob (IOOperation.Read, _ => AddInput (), null));
+                               IOSelector.Add (this.handle, new IOSelectorJob (IOOperation.Read, _ => Read (), null));
                        }
 
-                       public void AddInput ()
+                       void Read ()
                        {
                                int nread = 0;
 
                                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;
@@ -1375,7 +1352,7 @@ namespace System.Diagnostics {
 
                                Flush (false);
 
-                               IOSelector.Add (this.handle, new IOSelectorJob (IOOperation.Read, _ => AddInput (), null));
+                               IOSelector.Add (this.handle, new IOSelectorJob (IOOperation.Read, _ => Read (), null));
                        }
 
                        void Flush (bool last)
@@ -1411,7 +1388,6 @@ namespace System.Diagnostics {
                        public void Close ()
                        {
                                IOSelector.Remove (handle);
-                               stream.Close ();
                        }
 
                        internal override void CompleteDisposed ()
@@ -1438,8 +1414,8 @@ namespace System.Diagnostics {
                        async_mode |= AsyncModes.AsyncOutput;
                        output_canceled = false;
                        if (async_output == null) {
-                               async_output = new ProcessAsyncReader (this, stdout_rd, true);
-                               async_output.BeginRead ();
+                               async_output = new ProcessAsyncReader (this, (FileStream) output_stream.BaseStream, true);
+                               async_output.BeginReadLine ();
                        }
                }
 
@@ -1470,8 +1446,8 @@ namespace System.Diagnostics {
                        async_mode |= AsyncModes.AsyncError;
                        error_canceled = false;
                        if (async_error == null) {
-                               async_error = new ProcessAsyncReader (this, stderr_rd, false);
-                               async_error.BeginRead ();
+                               async_error = new ProcessAsyncReader (this, (FileStream) error_stream.BaseStream, false);
+                               async_error.BeginReadLine ();
                        }
                }
 
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..8080354f806b23f753ff4af389f9cb4efe211f3a 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;
+               X509Certificate cert;
                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) {
                                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..7adfdf8d95660c51e673d3304118705a55d19d0a 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;
+               X509Certificate 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, X509Certificate 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..15580d3b70514fb650dff0c92f64886a4379a72a 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;
+               X509Certificate certificate;
+
                Hashtable registry;   // Dictionary<HttpListenerContext,HttpListenerContext> 
                ArrayList ctx_queue;  // List<HttpListenerContext> ctx_queue;
                ArrayList wait_queue; // List<ListenerAsyncResult> wait_queue;
@@ -61,6 +79,56 @@ namespace System.Net {
                        auth_schemes = AuthenticationSchemes.Anonymous;
                }
 
+               internal HttpListener (X509Certificate certificate, IMonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
+                       : this ()
+               {
+                       this.certificate = certificate;
+                       this.tlsProvider = tlsProvider;
+                       this.tlsSettings = tlsSettings;
+               }
+
+               internal X509Certificate 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;
+                                       var cert = new X509Certificate2 (cert_file);
+                                       cert.PrivateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
+                                       certificate = cert;
+                                       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 +417,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 024f3ff18f10a3ec19c4a4a211bb88adbd196964..32e873227de30ee98a4cafc752a52642ff3bdf31 100644 (file)
@@ -1689,10 +1689,10 @@ namespace System
                
                        if (keys == null)
                                throw new ArgumentNullException ("keys");
-                               
-                       if (keys.Length != items.Length)
-                               throw new ArgumentException ("Length of keys and items does not match.");
-                       
+
+                       if (keys.Length > items.Length)
+                               throw new ArgumentException ("Length of keys is larger than length of items.");
+
                        SortImpl<TKey, TValue> (keys, items, 0, keys.Length, comparer);
                }
 
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 6902f43be1e989a386ccaf9144a8dd7d1c881aa9..351d312c92d63c5d217d3f9df04524402671680b 100644 (file)
@@ -2548,6 +2548,33 @@ public class ArrayTest
                        Assert.AreEqual (4, indices [0]);
        }
 
+       [Test]
+       public void TestSortComparable()
+       {
+               int[] source = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+               int[] expected = { 6, 5, 4, 3, 2, 1, 7, 8, 9 };
+               Comp[] c = { new Comp (100), new Comp (16), new Comp (11), new Comp (9), new Comp (0), new Comp (-100) };
+               IComparer<Comp> comp = null;
+               Array.Sort<Comp, int> (c, source, comp);
+
+               Assert.AreEqual (expected, source);
+       }
+
+       class Comp : IComparable
+       {
+               readonly int val;
+
+               public Comp (int a)
+               {
+                       val = a;
+               }
+
+               int IComparable.CompareTo (object obj)
+               {
+                       return val.CompareTo ((obj as Comp).val);
+               }
+       }
+
        [Test]
        public void TestInitializeEmpty()
        {
index 0a2173d49fd892f8fd3a5f096050a0be4ab5a351..4fcf4a155bc82e0fff045530cbb3e9b4e501ebb4 100644 (file)
@@ -945,28 +945,28 @@ namespace MonoTests.System
                [Test]
                public void GetHashCode_ShouldBeEqualToUnderlyingType ()
                {
-                       Assert.AreEqual (EnInt8.A.GetHashCode(), SByte.MinValue, "i8#0");
-                       Assert.AreEqual (EnInt8.B.GetHashCode(), 44, "i8#1");
-                       Assert.AreEqual (EnInt8.C.GetHashCode(), SByte.MaxValue, "i8#2");
+                       Assert.AreEqual (EnInt8.A.GetHashCode(), SByte.MinValue.GetHashCode (), "i8#0");
+                       Assert.AreEqual (EnInt8.B.GetHashCode(), ((sbyte)44).GetHashCode (), "i8#1");
+                       Assert.AreEqual (EnInt8.C.GetHashCode(), SByte.MaxValue.GetHashCode (), "i8#2");
        
-                       Assert.AreEqual (EnUInt8.A.GetHashCode(), Byte.MinValue, "u8#0");
-                       Assert.AreEqual (EnUInt8.B.GetHashCode(), 55, "u8#1");
-                       Assert.AreEqual (EnUInt8.C.GetHashCode(), Byte.MaxValue, "u8#2");
+                       Assert.AreEqual (EnUInt8.A.GetHashCode(), Byte.MinValue.GetHashCode (), "u8#0");
+                       Assert.AreEqual (EnUInt8.B.GetHashCode(), ((byte)55).GetHashCode (), "u8#1");
+                       Assert.AreEqual (EnUInt8.C.GetHashCode(), Byte.MaxValue.GetHashCode (), "u8#2");
        
-                       Assert.AreEqual (EnInt16.A.GetHashCode(), Int16.MinValue, "i16#0");
-                       Assert.AreEqual (EnInt16.B.GetHashCode(), 66, "i16#1");
-                       Assert.AreEqual (EnInt16.C.GetHashCode(), Int16.MaxValue, "i16#2");
+                       Assert.AreEqual (EnInt16.A.GetHashCode(), Int16.MinValue.GetHashCode (), "i16#0");
+                       Assert.AreEqual (EnInt16.B.GetHashCode(), ((short)66).GetHashCode (), "i16#1");
+                       Assert.AreEqual (EnInt16.C.GetHashCode(), Int16.MaxValue.GetHashCode (), "i16#2");
        
-                       Assert.AreEqual (EnUInt16.A.GetHashCode(), UInt16.MinValue, "u16#0");
-                       Assert.AreEqual (EnUInt16.B.GetHashCode(), 77, "u16#1");
-                       Assert.AreEqual (EnUInt16.C.GetHashCode(), UInt16.MaxValue, "u16#2");
+                       Assert.AreEqual (EnUInt16.A.GetHashCode(), UInt16.MinValue.GetHashCode (), "u16#0");
+                       Assert.AreEqual (EnUInt16.B.GetHashCode(), ((ushort)77).GetHashCode (), "u16#1");
+                       Assert.AreEqual (EnUInt16.C.GetHashCode(), UInt16.MaxValue.GetHashCode (), "u16#2");
        
-                       Assert.AreEqual (EnInt32.A.GetHashCode(), Int32.MinValue, "i32#0");
-                       Assert.AreEqual (EnInt32.B.GetHashCode(), 88, "i32#1");
-                       Assert.AreEqual (EnInt32.C.GetHashCode(), Int32.MaxValue, "i32#2");
+                       Assert.AreEqual (EnInt32.A.GetHashCode(), Int32.MinValue.GetHashCode (), "i32#0");
+                       Assert.AreEqual (EnInt32.B.GetHashCode(), ((int)88).GetHashCode (), "i32#1");
+                       Assert.AreEqual (EnInt32.C.GetHashCode(), Int32.MaxValue.GetHashCode (), "i32#2");
        
-                       Assert.AreEqual (EnUInt32.A.GetHashCode(), UInt32.MinValue, "u32#0");
-                       Assert.AreEqual (EnUInt32.B.GetHashCode(), 99, "u32#1");
+                       Assert.AreEqual (EnUInt32.A.GetHashCode(), UInt32.MinValue.GetHashCode (), "u32#0");
+                       Assert.AreEqual (EnUInt32.B.GetHashCode(), ((uint)99).GetHashCode (), "u32#1");
                        Assert.AreEqual (EnUInt32.C.GetHashCode(), UInt32.MaxValue.GetHashCode (), "u32#2");
        
                        Assert.AreEqual (EnInt64.A.GetHashCode(), Int64.MinValue.GetHashCode (), "i64#0");
@@ -974,7 +974,7 @@ namespace MonoTests.System
                        Assert.AreEqual (EnInt64.C.GetHashCode(), Int64.MaxValue.GetHashCode (), "i64#2");
        
                        Assert.AreEqual (EnUInt64.A.GetHashCode(), UInt64.MinValue.GetHashCode (), "u64#0");
-                       Assert.AreEqual (EnUInt64.B.GetHashCode(), 3488924689489L.GetHashCode (), "u64#1");
+                       Assert.AreEqual (EnUInt64.B.GetHashCode(), ((ulong)3488924689489L).GetHashCode (), "u64#1");
                        Assert.AreEqual (EnUInt64.C.GetHashCode(), UInt64.MaxValue.GetHashCode (), "u64#2");
                }
 
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 accdd7bd816219d6661a7a76685f41f0f368efad..61a71406dd6557aaf08fd5bf0d8c28cdd1cff922 100644 (file)
@@ -4106,6 +4106,7 @@ namespace MonoTests.System
 
 #if !MONOTOUCH
                [Test]
+               [Category ("AndroidNotWorking")] // requires symbol writer
                public void FullNameGetTypeParseEscapeRoundtrip () // bug #26384
                {
                        var nm = new AssemblyName ("asm");
diff --git a/mcs/errors/cs0208-18.cs b/mcs/errors/cs0208-18.cs
new file mode 100644 (file)
index 0000000..ad8ab81
--- /dev/null
@@ -0,0 +1,17 @@
+// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `S'
+// Line: 9
+// Compiler options: /unsafe
+
+unsafe public class C
+{
+       S* i;
+}
+
+public struct S
+{
+       AC ac;
+}
+
+abstract class AC
+{
+}
diff --git a/mcs/errors/cs0841-6.cs b/mcs/errors/cs0841-6.cs
new file mode 100644 (file)
index 0000000..11be776
--- /dev/null
@@ -0,0 +1,20 @@
+// CS0841: A local variable `n' cannot be used before it is declared
+// Line: 17
+
+class MainClass
+{
+       public delegate void Fn (MainClass o);
+
+       public static void Call (Fn f)
+       {
+               f(null);
+       }
+
+       public static void Main ()
+       {
+               Call (delegate (MainClass o) {
+                       n = o;
+                       MainClass n = new MainClass ();
+               });
+       }
+}
\ No newline at end of file
index fc3690c78f053d31d1d73869f8acd9414f41a50a..16ce9dfee86c62e203c26c497ee00f957bebc071 100644 (file)
@@ -1154,7 +1154,8 @@ namespace Mono.CSharp {
                                        prev = null;
                                }
 
-                               var body = CompatibleMethodBody (ec, tic, null, delegate_type);
+                               HashSet<LocalVariable> undeclaredVariables = null;
+                               var body = CompatibleMethodBody (ec, tic, null, delegate_type, ref undeclaredVariables);
                                if (body != null) {
                                        am = body.Compatible (ec, body);
                                } else {
@@ -1164,6 +1165,10 @@ namespace Mono.CSharp {
                                if (TypeInferenceReportPrinter != null) {
                                        ec.Report.SetPrinter (prev);
                                }
+
+                               if (undeclaredVariables != null) {
+                                       body.Block.TopBlock.SetUndeclaredVariables (undeclaredVariables);
+                               }
                        }
 
                        if (am == null)
@@ -1209,8 +1214,8 @@ namespace Mono.CSharp {
                        // we satisfy the rule by setting the return type on the EmitContext
                        // to be the delegate type return type.
                        //
-
-                       var body = CompatibleMethodBody (ec, null, return_type, delegate_type);
+                       HashSet<LocalVariable> undeclaredVariables = null;
+                       var body = CompatibleMethodBody (ec, null, return_type, delegate_type, ref undeclaredVariables);
                        if (body == null)
                                return null;
 
@@ -1268,6 +1273,15 @@ namespace Mono.CSharp {
                                throw;
                        } catch (Exception e) {
                                throw new InternalErrorException (e, loc);
+                       } finally {
+                               //
+                               // LocalVariable is not stateless and it's not easy to clone because it's
+                               // cached in toplevel block. Unsetting any initialized variables should
+                               // be enough
+                               //
+                               if (undeclaredVariables != null) {
+                                       body.Block.TopBlock.SetUndeclaredVariables (undeclaredVariables);
+                               }
                        }
 
                        if (!ec.IsInProbingMode && !etree_conversion) {
@@ -1387,13 +1401,13 @@ namespace Mono.CSharp {
                        return ExprClassName;
                }
 
-               AnonymousMethodBody CompatibleMethodBody (ResolveContext ec, TypeInferenceContext tic, TypeSpec return_type, TypeSpec delegate_type)
+               AnonymousMethodBody CompatibleMethodBody (ResolveContext ec, TypeInferenceContext tic, TypeSpec return_type, TypeSpec delegate_type, ref HashSet<LocalVariable> undeclaredVariables)
                {
                        ParametersCompiled p = ResolveParameters (ec, tic, delegate_type);
                        if (p == null)
                                return null;
 
-                       ParametersBlock b = ec.IsInProbingMode ? (ParametersBlock) Block.PerformClone () : Block;
+                       ParametersBlock b = ec.IsInProbingMode ? (ParametersBlock) Block.PerformClone (ref undeclaredVariables) : Block;
 
                        if (b.IsAsync) {
                                var rt = return_type;
index 059f31c2c6553b6b2bfc9df2faabfd3e33c871af..edc538e7d2ed66a09ab7b5cbd397aec15b3ac3d0 100644 (file)
@@ -530,7 +530,6 @@ namespace Mono.CSharp
 
                bool has_normal_indexers;
                string indexer_name;
-               protected bool requires_delayed_unmanagedtype_check;
                bool error;
                bool members_defined;
                bool members_defined_ok;
@@ -1999,15 +1998,6 @@ namespace Mono.CSharp
                                CheckPairedOperators ();
                        }
 
-                       if (requires_delayed_unmanagedtype_check) {
-                               requires_delayed_unmanagedtype_check = false;
-                               foreach (var member in members) {
-                                       var f = member as Field;
-                                       if (f != null && f.MemberType != null && f.MemberType.IsPointer)
-                                               TypeManager.VerifyUnmanaged (Module, f.MemberType, f.Location);
-                               }
-                       }
-
                        ComputeIndexerName();
 
                        if (HasEquals && !HasGetHashCode) {
@@ -2711,6 +2701,22 @@ namespace Mono.CSharp
                        return true;
                }
 
+               public override void PrepareEmit ()
+               {
+                       var s = this as Struct;
+                       if (s == null || !s.HasUnmanagedCheckDone) {
+                               for (int i = 0; i < Members.Count; ++i) {
+                                       var f = Members [i] as Field;
+                                       if (f == null || f.MemberType == null || !f.MemberType.IsPointer)
+                                               continue;
+
+                                       TypeManager.VerifyUnmanaged (Module, f.MemberType, f.Location);
+                               }
+                       }
+
+                       base.PrepareEmit ();
+               }
+
                public override void Emit ()
                {
                        if (!has_static_constructor && HasStaticFieldInitializer) {
@@ -2959,7 +2965,7 @@ namespace Mono.CSharp
 
        public sealed class Struct : ClassOrStruct
        {
-               bool is_unmanaged, has_unmanaged_check_done;
+               bool is_unmanaged, has_unmanaged_check_done, requires_delayed_unmanagedtype_check;
                bool InTransit;
 
                // <summary>
@@ -3089,6 +3095,12 @@ namespace Mono.CSharp
                        base.Emit ();
                }
 
+               public bool HasUnmanagedCheckDone {
+                       get {
+                               return has_unmanaged_check_done;
+                       }
+               }
+
                bool HasUserDefaultConstructor ()
                {
                        foreach (var m in PartialContainer.Members) {
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 c0f61cb71c8fdd17cecd16c6c11d251e55b7a063..32831afb1f0cacf3f7fa80d44d723bebd25459a5 100644 (file)
@@ -11357,7 +11357,10 @@ namespace Mono.CSharp
 
                                single_spec = single_spec.Next;
                        } else if (single_spec.IsPointer) {
-                               if (!TypeManager.VerifyUnmanaged (ec.Module, type, loc))
+                               //
+                               // Declared fields cannot have unmanaged check done before all types are defined
+                               //
+                               if (!(ec.CurrentMemberDefinition is Field) && !TypeManager.VerifyUnmanaged (ec.Module, type, loc))
                                        return null;
 
                                if (!ec.IsUnsafe) {
index 0eb0e083601cdd0cd93c4ef6372cdf49a76a12b0..556a08b85241204a64a96bc55d4a65460576f6c9 100644 (file)
@@ -1138,7 +1138,7 @@ namespace Mono.CSharp {
                                //
                                // Iterate over inflated interfaces
                                //
-                               foreach (var iface in Interfaces) {
+                               foreach (var iface in InterfacesDefined) {
                                        found = false;
                                        if (other.InterfacesDefined != null) {
                                                foreach (var oiface in other.Interfaces) {
@@ -1171,7 +1171,7 @@ namespace Mono.CSharp {
                                //
                                // Iterate over inflated interfaces
                                //
-                               foreach (var oiface in other.Interfaces) {
+                               foreach (var oiface in other.InterfacesDefined) {
                                        found = false;
 
                                        if (InterfacesDefined != null) {
index 2639d046d1bfe1c8ce36790aab6a936847098688..d81c307ae085acd14d48606b1af9d068b0c4ee25 100644 (file)
@@ -1296,16 +1296,20 @@ namespace Mono.CSharp {
                                                continue;
                                        }
 
-                                       entry.Define (this);
+                                       try {
+                                               entry.Define (this);
+                                       } finally {
+                                               //
+                                               // It's needed for repl only, when using clause cannot be resolved don't hold it in
+                                               // global list which is resolved for every evaluation
+                                               //
+                                               if (entry.ResolvedExpression == null) {
+                                                       clauses.RemoveAt (i--);
+                                               }
+                                       }
 
-                                       //
-                                       // It's needed for repl only, when using clause cannot be resolved don't hold it in
-                                       // global list which is resolved for each evaluation
-                                       //
-                                       if (entry.ResolvedExpression == null) {
-                                               clauses.RemoveAt (i--);
+                                       if (entry.ResolvedExpression == null)
                                                continue;
-                                       }
 
                                        var using_ns = entry.ResolvedExpression as NamespaceExpression;
                                        if (using_ns == null) {
@@ -1343,7 +1347,7 @@ namespace Mono.CSharp {
                                        for (int i = 0; i < clauses.Count; ++i) {
                                                var entry = clauses[i];
                                                if (entry.Alias != null) {
-                                                       aliases.Add (entry.Alias.Value, (UsingAliasNamespace) entry);
+                                                       aliases[entry.Alias.Value] = (UsingAliasNamespace) entry;
                                                }
                                        }
                                }
@@ -1439,6 +1443,7 @@ namespace Mono.CSharp {
                        if (resolved != null) {
                                var compiler = ctx.Module.Compiler;
                                var type = resolved.Type;
+                               resolved = null;
 
                                compiler.Report.SymbolRelatedToPreviousError (type);
                                compiler.Report.Error (138, Location,
index f3bde1607cbb59d7728eccb21143b870dda1fc0f..e5c8bb4316c6b5af4ce075f1b939559bf7efd40f 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);
@@ -3879,8 +3881,10 @@ namespace Mono.CSharp {
                        return new ParameterReference (parameter_info[index], loc);
                }
 
-               public Statement PerformClone ()
+               public Statement PerformClone (ref HashSet<LocalVariable> undeclaredVariables)
                {
+                       undeclaredVariables = TopBlock.GetUndeclaredVariables ();
+
                        CloneContext clonectx = new CloneContext ();
                        return Clone (clonectx);
                }
@@ -4394,6 +4398,63 @@ namespace Mono.CSharp {
                        base.CheckControlExit (fc, dat);
                }
 
+               public HashSet<LocalVariable> GetUndeclaredVariables ()
+               {
+                       if (names == null)
+                               return null;
+
+                       HashSet<LocalVariable> variables = null;
+
+                       foreach (var entry in names) {
+                               var complex = entry.Value as List<INamedBlockVariable>;
+                               if (complex != null) {
+                                       foreach (var centry in complex) {
+                                               if (IsUndeclaredVariable (centry)) {
+                                                       if (variables == null)
+                                                               variables = new HashSet<LocalVariable> ();
+
+                                                       variables.Add ((LocalVariable) centry);
+                                               }
+                                       }
+                               } else if (IsUndeclaredVariable ((INamedBlockVariable)entry.Value)) {
+                                       if (variables == null)
+                                               variables = new HashSet<LocalVariable> ();
+
+                                       variables.Add ((LocalVariable)entry.Value);                                     
+                               }
+                       }
+
+                       return variables;
+               }
+
+               static bool IsUndeclaredVariable (INamedBlockVariable namedBlockVariable)
+               {
+                       var lv = namedBlockVariable as LocalVariable;
+                       return lv != null && !lv.IsDeclared;
+               }
+
+               public void SetUndeclaredVariables (HashSet<LocalVariable> undeclaredVariables)
+               {
+                       if (names == null)
+                               return;
+                       
+                       foreach (var entry in names) {
+                               var complex = entry.Value as List<INamedBlockVariable>;
+                               if (complex != null) {
+                                       foreach (var centry in complex) {
+                                               var lv = centry as LocalVariable;
+                                               if (lv != null && undeclaredVariables.Contains (lv)) {
+                                                       lv.Type = null;
+                                               }
+                                       }
+                               } else {
+                                       var lv = entry.Value as LocalVariable;
+                                       if (lv != null && undeclaredVariables.Contains (lv))
+                                               lv.Type = null;
+                               }
+                       }
+               }
+
                public override void Emit (EmitContext ec)
                {
                        if (Report.Errors > 0)
@@ -8210,4 +8271,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/gtest-635.cs b/mcs/tests/gtest-635.cs
new file mode 100644 (file)
index 0000000..8bb31b3
--- /dev/null
@@ -0,0 +1,27 @@
+public interface I<T>
+{
+       T Clone();
+       T1 Clone<T1>() where T1 : T;
+}
+
+public interface I2 : I<I2>
+{
+}
+
+public class TestClass : I2
+{
+       public I2 Clone ()
+       {
+               return null;
+       }
+
+       public T1 Clone<T1> () where T1 : I2
+       {
+               return (T1) Clone();
+       }
+
+       public static void Main () 
+       {
+               new TestClass ();
+       }
+}
\ No newline at end of file
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..6218e73ddf27abba174bf3c61885a763272ab9ab 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">
       </method>
     </type>
   </test>
+  <test name="gtest-635.cs">
+    <type name="TestClass">
+      <method name="I2 Clone()" attrs="486">
+        <size>10</size>
+      </method>
+      <method name="T1 Clone[T1]()" attrs="486">
+        <size>20</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>8</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anontype-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
   <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 15fec471cd36834ee58ddf617ba19734208b0bc7..d84398c8df69a51f3afc4595d3b7cb7d8c171769 100644 (file)
@@ -11,7 +11,10 @@ COMMON_SOURCES = \
 
 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 
-APIINFO_SOURCES = mono-api-info.cs $(COMMON_SOURCES)
+APIINFO_SOURCES = \
+       mono-api-info.cs \
+       ../../class/Mono.Options/Mono.Options/Options.cs \
+       $(COMMON_SOURCES)
 
 DISTFILES= $(COMMON_SOURCES) $(APIINFO_SOURCES)
 
index b32394dd5f79d0b8aec634b48cb236b5981f15d3..e9018e2555504459acbe2964449de9ef74bd2ea0 100644 (file)
@@ -28,38 +28,51 @@ namespace CorCompare
        {
                public static int Main (string [] args)
                {
-                       if (args.Length == 0)
-                               return 1;
-
+                       bool showHelp = false;
                        AbiMode = false;
-
-                       AssemblyCollection acoll = new AssemblyCollection ();
+                       FollowForwarders = false;
+
+                       var acoll = new AssemblyCollection ();
+
+                       var options = new Mono.Options.OptionSet {
+                               { "h|help", "Show this help", v => showHelp = true },
+                               { "abi", _ => AbiMode = true},
+                               { "f|follow-forwarders", _ => FollowForwarders = true },
+                               { "d|search-directory=", v => TypeHelper.Resolver.AddSearchDirectory (v) },
+                       };
+
+                       var asms = options.Parse (args);
+
+                       if (showHelp || asms.Count == 0) {
+                               Console.WriteLine (@"Usage: mono-api-info [options] <assemblies>");
+                               Console.WriteLine ();
+                               Console.WriteLine ("Available options:");
+                               options.WriteOptionDescriptions (Console.Out);
+                               Console.WriteLine ();
+                               return showHelp? 0 :1;
+                       }
 
                        string windir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
                        string pf = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
                        TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"assembly\GAC\MSDATASRC\7.0.3300.0__b03f5f7f11d50a3a"));
 
-                       foreach (string arg in args) {
-                               if (arg == "--abi") {
-                                       AbiMode = true;
-                               } else {
-                                       acoll.Add (arg);
-
-                                       if (arg.Contains ("v3.0")) {
-                                               TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v2.0.50727"));
-                                       } else if (arg.Contains ("v3.5")) {
-                                               TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v2.0.50727"));
-                                               TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v3.0\Windows Communication Foundation"));
-                                       } else if (arg.Contains ("v4.0")) {
-                                               if (arg.Contains ("Silverlight")) {
-                                                       TypeHelper.Resolver.AddSearchDirectory (Path.Combine (pf, @"Microsoft Silverlight\4.0.51204.0"));
-                                               } else {
-                                                       TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v4.0.30319"));
-                                                       TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v4.0.30319\WPF"));
-                                               }
+                       foreach (string arg in asms) {
+                               acoll.Add (arg);
+
+                               if (arg.Contains ("v3.0")) {
+                                       TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v2.0.50727"));
+                               } else if (arg.Contains ("v3.5")) {
+                                       TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v2.0.50727"));
+                                       TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v3.0\Windows Communication Foundation"));
+                               } else if (arg.Contains ("v4.0")) {
+                                       if (arg.Contains ("Silverlight")) {
+                                               TypeHelper.Resolver.AddSearchDirectory (Path.Combine (pf, @"Microsoft Silverlight\4.0.51204.0"));
                                        } else {
-                                               TypeHelper.Resolver.AddSearchDirectory (Path.GetDirectoryName (arg));
+                                               TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v4.0.30319"));
+                                               TypeHelper.Resolver.AddSearchDirectory (Path.Combine (windir, @"Microsoft.NET\Framework\v4.0.30319\WPF"));
                                        }
+                               } else {
+                                       TypeHelper.Resolver.AddSearchDirectory (Path.GetDirectoryName (arg));
                                }
                        }
 
@@ -75,6 +88,7 @@ namespace CorCompare
                }
 
                internal static bool AbiMode { get; private set; }
+               internal static bool FollowForwarders { get; private set; }
        }
 
        public class Utils {
@@ -223,16 +237,33 @@ namespace CorCompare
                        AddAttribute (nassembly, "name", aname.Name);
                        AddAttribute (nassembly, "version", aname.Version.ToString ());
                        parent.AppendChild (nassembly);
-                       TypeForwardedToData.OutputForwarders (document, nassembly, ass);
+
+                       if (!Driver.FollowForwarders) {
+                               TypeForwardedToData.OutputForwarders (document, nassembly, ass);
+                       }
+
                        AttributeData.OutputAttributes (document, nassembly, ass);
-                       var typesCollection = ass.MainModule.Types;
-                       if (typesCollection == null || typesCollection.Count == 0)
+
+                       var types = new List<TypeDefinition> ();
+                       if (ass.MainModule.Types != null) {
+                               types.AddRange (ass.MainModule.Types);
+                       }
+
+                       if (Driver.FollowForwarders && ass.MainModule.ExportedTypes != null) {
+                               foreach (var t in ass.MainModule.ExportedTypes) {
+                                       var forwarded = t.Resolve ();
+                                       if (forwarded == null) {
+                                               throw new Exception ("Could not resolve forwarded type " + t.FullName + " in " + ass.Name);
+                                       }
+                                       types.Add (forwarded);
+                               }
+                       }
+
+                       if (types.Count == 0) {
                                return;
-                       var typesArray = new TypeDefinition [typesCollection.Count];
-                       for (int i = 0; i < typesCollection.Count; i++) {
-                               typesArray [i] = typesCollection [i];
                        }
-                       Array.Sort (typesArray, TypeReferenceComparer.Default);
+
+                       types.Sort (TypeReferenceComparer.Default);
 
                        XmlNode nss = document.CreateElement ("namespaces", null);
                        nassembly.AppendChild (nss);
@@ -240,7 +271,7 @@ namespace CorCompare
                        string current_namespace = "$%&$&";
                        XmlNode ns = null;
                        XmlNode classes = null;
-                       foreach (TypeDefinition t in typesArray) {
+                       foreach (TypeDefinition t in types) {
                                if (string.IsNullOrEmpty (t.Namespace))
                                        continue;
 
@@ -1340,19 +1371,17 @@ namespace CorCompare
 
        }
 
-       class TypeReferenceComparer : IComparer
+       class TypeReferenceComparer : IComparer<TypeReference>
        {
                public static TypeReferenceComparer Default = new TypeReferenceComparer ();
 
-               public int Compare (object a, object b)
+               public int Compare (TypeReference a, TypeReference b)
                {
-                       TypeReference ta = (TypeReference) a;
-                       TypeReference tb = (TypeReference) b;
-                       int result = String.Compare (ta.Namespace, tb.Namespace);
+                       int result = String.Compare (a.Namespace, b.Namespace, StringComparison.Ordinal);
                        if (result != 0)
                                return result;
 
-                       return String.Compare (ta.Name, tb.Name);
+                       return String.Compare (a.Name, b.Name, StringComparison.Ordinal);
                }
        }
 
@@ -1364,7 +1393,7 @@ namespace CorCompare
                {
                        MemberReference ma = (MemberReference) a;
                        MemberReference mb = (MemberReference) b;
-                       return String.Compare (ma.Name, mb.Name);
+                       return String.Compare (ma.Name, mb.Name, StringComparison.Ordinal);
                }
        }
 
index 44ef75821a1f923b5bf00fffd867b7754b6ca601..6d926858c97ae364e320dfeb5d19993a96e929c6 100644 (file)
@@ -3,7 +3,7 @@
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProductVersion>9.0.30729</ProductVersion>\r
+    <ProductVersion>8.0.30703</ProductVersion>\r
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{6446D5E1-8F4E-4692-8EF3-B1D4CA290ECF}</ProjectGuid>\r
     <OutputType>Exe</OutputType>\r
@@ -53,9 +53,7 @@
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
-    <Reference Include="System.Core">\r
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
-    </Reference>\r
+    <Reference Include="System.Core" />\r
     <Reference Include="System.Xml" />\r
   </ItemGroup>\r
   <ItemGroup>\r
@@ -63,6 +61,9 @@
     <Compile Include="mono-api-info.cs" />\r
     <Compile Include="Util.cs" />\r
     <Compile Include="WellFormedXmlWriter.cs" />\r
+    <Compile Include="..\..\class\Mono.Options\Mono.Options\Options.cs">\r
+      <Link>Options.cs</Link>\r
+    </Compile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <BootstrapperPackage Include="Microsoft.Net.Client.3.5">\r
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 fdb2c66e2d9c2b1eeef43be1f687b8b943f25d5e..5d29a4e829dd5e73d6dd9b12e4374fc5763a0fcd 100755 (executable)
@@ -35,6 +35,14 @@ cd "$APP_PATH/Contents/Resources"
 
 if [ "$X11_MODE" -eq "1" ]; then
        open-x11 "$APP_NAME"
+
+# rcruzs00
+# El Capitan FIX: `which` wont work (system-integrity-protection)
+# elif: Keep compatibility with previous code
+elif [ -f /usr/local/bin/mono ]; then
+        DIR=$(cd "$(dirname "$0")"; pwd)
+        /usr/local/bin/mono $DIR/../Resources/"$ASSEMBLY"
+
 else
        if [ ! -d "./bin" ]; then mkdir bin ; fi
        if [ -f "./bin/$APP_NAME" ]; then rm -f "./bin/$APP_NAME" ; fi
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 037b5ef83feed1b970a367676abc3df93d6def2e..96f53eb9eef0f626ddd7f0f7f10c99026961f063 100644 (file)
@@ -315,6 +315,7 @@ OPDEF(CEE_MONO_JIT_ICALL_ADDR, "mono_jit_icall_addr", Pop0, PushI, InlineI, X, 2
 OPDEF(CEE_MONO_LDPTR_INT_REQ_FLAG, "mono_ldptr_int_req_flag", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x14, NEXT)
 OPDEF(CEE_MONO_LDPTR_CARD_TABLE, "mono_ldptr_card_table", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x15, NEXT)
 OPDEF(CEE_MONO_LDPTR_NURSERY_START, "mono_ldptr_nursery_start", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x16, NEXT)
+OPDEF(CEE_MONO_LDPTR_NURSERY_BITS, "mono_ldptr_nursery_bits", Pop0, PushI, InlineNone, X, 2, 0xF0, 0x17, NEXT)
 #ifndef OPALIAS
 #define _MONO_CIL_OPALIAS_DEFINED_
 #define OPALIAS(a,s,r)
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 d0e6fc2fa576554f18eb5aa1984da3d40d3f4d17..145ea11f951e1e33eca71409dc8997c90fb6628b 100644 (file)
@@ -133,6 +133,7 @@ common_sources = \
        icall.c                 \
        icall-def.h             \
        image.c                 \
+       image-internals.h       \
        jit-info.c              \
        loader.c                \
        locales.c               \
index 9bbbc1ebc588b3141f9a64560af4e8c6b08f30eb..84ac82eb981229445adeb9e39426b44e683ebf55 100644 (file)
@@ -225,7 +225,7 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
 {
        MonoAppDomainSetup *setup;
        MonoAppDomain *ad;
-       MonoClass *class;
+       MonoClass *klass;
 
        mono_portability_helpers_init ();
        
@@ -244,11 +244,11 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
 
        mono_thread_init (start_cb, attach_cb);
 
-       class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
-       setup = (MonoAppDomainSetup *) mono_object_new_pinned (domain, class);
+       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       setup = (MonoAppDomainSetup *) mono_object_new_pinned (domain, klass);
 
-       class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
-       ad = (MonoAppDomain *) mono_object_new_pinned (domain, class);
+       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
+       ad = (MonoAppDomain *) mono_object_new_pinned (domain, klass);
        ad->data = domain;
        domain->domain = ad;
        domain->setup = setup;
@@ -327,11 +327,11 @@ mono_check_corlib_version (void)
 void
 mono_context_init (MonoDomain *domain)
 {
-       MonoClass *class;
+       MonoClass *klass;
        MonoAppContext *context;
 
-       class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
-       context = (MonoAppContext *) mono_object_new_pinned (domain, class);
+       klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
+       context = (MonoAppContext *) mono_object_new_pinned (domain, klass);
        context->domain_id = domain->domain_id;
        context->context_id = 0;
        ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext (context);
@@ -394,10 +394,10 @@ mono_domain_create_appdomain (char *friendly_name, char *configuration_file)
 {
        MonoAppDomain *ad;
        MonoAppDomainSetup *setup;
-       MonoClass *class;
+       MonoClass *klass;
 
-       class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
-       setup = (MonoAppDomainSetup *) mono_object_new (mono_domain_get (), class);
+       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       setup = (MonoAppDomainSetup *) mono_object_new (mono_domain_get (), klass);
        setup->configuration_file = configuration_file != NULL ? mono_string_new (mono_domain_get (), configuration_file) : NULL;
 
        ad = mono_domain_create_appdomain_internal (friendly_name, setup);
@@ -2221,9 +2221,9 @@ deregister_reflection_info_roots_from_list (MonoImage *image)
        GSList *list = image->reflection_info_unregister_classes;
 
        while (list) {
-               MonoClass *class = list->data;
+               MonoClass *klass = list->data;
 
-               mono_class_free_ref_info (class);
+               mono_class_free_ref_info (klass);
 
                list = list->next;
        }
index 45038289621a96ef7e59243a0f0d311c988e586b..c44dffda11e2777e042f822e00e0d02ce301b18d 100644 (file)
@@ -1588,6 +1588,7 @@ mono_assembly_open_full (const char *filename, MonoImageOpenStatus *status, gboo
        
        image = NULL;
 
+       // If VM built with mkbundle
        loaded_from_bundle = FALSE;
        if (bundles != NULL) {
                image = mono_assembly_open_from_bundle (fname, status, refonly);
@@ -2920,6 +2921,7 @@ mono_assembly_load_corlib (const MonoRuntimeInfo *runtime, MonoImageOpenStatus *
                return corlib;
        }
 
+       // In native client, Corlib is embedded in the executable as static variable corlibData
 #if defined(__native_client__)
        if (corlibData != NULL && corlibSize != 0) {
                int status = 0;
@@ -2936,6 +2938,7 @@ mono_assembly_load_corlib (const MonoRuntimeInfo *runtime, MonoImageOpenStatus *
        }
 #endif
 
+       // A nonstandard preload hook may provide a special mscorlib assembly
        aname = mono_assembly_name_new ("mscorlib.dll");
        corlib = invoke_assembly_preload_hook (aname, assemblies_path);
        mono_assembly_name_free (aname);
@@ -2943,16 +2946,16 @@ mono_assembly_load_corlib (const MonoRuntimeInfo *runtime, MonoImageOpenStatus *
        if (corlib != NULL)
                return corlib;
 
-       if (assemblies_path) {
+       // This unusual directory layout can occur if mono is being built and run out of its own source repo
+       if (assemblies_path) { // Custom assemblies path set via MONO_PATH or mono_set_assemblies_path
                corlib = load_in_path ("mscorlib.dll", (const char**)assemblies_path, status, FALSE);
                if (corlib)
                        return corlib;
        }
 
-       /* Load corlib from mono/<version> */
-       
+       /* Normal case: Load corlib from mono/<version> */
        corlib_file = g_build_filename ("mono", runtime->framework_version, "mscorlib.dll", NULL);
-       if (assemblies_path) {
+       if (assemblies_path) { // Custom assemblies path
                corlib = load_in_path (corlib_file, (const char**)assemblies_path, status, FALSE);
                if (corlib) {
                        g_free (corlib_file);
index 540c2b94cf647416e3ff835678b41e4d44454795..1dd66072d7222c77eb438122e6e762ac9c3d0cb3 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;
 }
 
@@ -1369,10 +1368,10 @@ BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reser
 #endif
 
 guint
-mono_gc_get_vtable_bits (MonoClass *class)
+mono_gc_get_vtable_bits (MonoClass *klass)
 {
        if (fin_callbacks.is_class_finalization_aware) {
-               if (fin_callbacks.is_class_finalization_aware (class))
+               if (fin_callbacks.is_class_finalization_aware (klass))
                        return BOEHM_GC_BIT_FINALIZER_AWARE;
        }
        return 0;
index 46ea5ef635098895a28624e2a0dc101d5418e1da..920cf8292ceb6e62648c17e117d81eb96835730e 100644 (file)
@@ -583,8 +583,13 @@ struct _MonoGenericParam {
 typedef struct {
        MonoClass *pklass;              /* The corresponding `MonoClass'. */
        const char *name;
+
+       // See GenericParameterAttributes
        guint16 flags;
+
        guint32 token;
+
+       // Constraints on type parameters
        MonoClass** constraints; /* NULL means end of list */
 } MonoGenericParamInfo;
 
@@ -1135,14 +1140,14 @@ MonoClass*      \
 mono_class_get_##shortname##_class (void)      \
 {      \
        static MonoClass *tmp_class;    \
-       MonoClass *class = tmp_class;   \
-       if (!class) {   \
-               class = mono_class_from_name (mono_defaults.corlib, #namespace, #name); \
-               g_assert (class);       \
+       MonoClass *klass = tmp_class;   \
+       if (!klass) {   \
+               klass = mono_class_from_name (mono_defaults.corlib, #namespace, #name); \
+               g_assert (klass);       \
                mono_memory_barrier (); \
-               tmp_class = class;      \
+               tmp_class = klass;      \
        }       \
-       return class;   \
+       return klass;   \
 }
 
 #define GENERATE_STATIC_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
index 3bf13ec045e599e2e9b18527e40e7663f82b04e5..ec8981dbd0812245cb99ef06ce3e419a46a6ef31 100644 (file)
@@ -63,14 +63,14 @@ static MonoClass * mono_class_create_from_typedef (MonoImage *image, guint32 typ
 static gboolean mono_class_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res);
 static gboolean can_access_type (MonoClass *access_klass, MonoClass *member_klass);
 static MonoMethod* find_method_in_metadata (MonoClass *klass, const char *name, int param_count, int flags);
-static int generic_array_methods (MonoClass *class);
-static void setup_generic_array_ifaces (MonoClass *class, MonoClass *iface, MonoMethod **methods, int pos);
+static int generic_array_methods (MonoClass *klass);
+static void setup_generic_array_ifaces (MonoClass *klass, MonoClass *iface, MonoMethod **methods, int pos);
 
 static MonoMethod* mono_class_get_virtual_methods (MonoClass* klass, gpointer *iter);
 static char* mono_assembly_name_from_token (MonoImage *image, guint32 type_token);
 static void mono_field_resolve_type (MonoClassField *field, MonoError *error);
 static guint32 mono_field_resolve_flags (MonoClassField *field);
-static void mono_class_setup_vtable_full (MonoClass *class, GList *in_setup);
+static void mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup);
 static void mono_generic_class_setup_parent (MonoClass *klass, MonoClass *gklass);
 
 /*
@@ -163,9 +163,9 @@ MonoClass *
 mono_class_from_typeref (MonoImage *image, guint32 type_token)
 {
        MonoError error;
-       MonoClass *class = mono_class_from_typeref_checked (image, type_token, &error);
+       MonoClass *klass = mono_class_from_typeref_checked (image, type_token, &error);
        g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
-       return class;
+       return klass;
 }
 
 MonoClass *
@@ -584,9 +584,9 @@ mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format)
  * The inverse of mono_reflection_parse_type ().
  */
 char *
-mono_type_get_full_name (MonoClass *class)
+mono_type_get_full_name (MonoClass *klass)
 {
-       return mono_type_get_name_full (mono_class_get_type (class), MONO_TYPE_NAME_FORMAT_REFLECTION);
+       return mono_type_get_name_full (mono_class_get_type (klass), MONO_TYPE_NAME_FORMAT_REFLECTION);
 }
 
 /**
@@ -805,9 +805,9 @@ mono_generic_class_get_context (MonoGenericClass *gclass)
 }
 
 MonoGenericContext *
-mono_class_get_context (MonoClass *class)
+mono_class_get_context (MonoClass *klass)
 {
-       return class->generic_class ? mono_generic_class_get_context (class->generic_class) : NULL;
+       return klass->generic_class ? mono_generic_class_get_context (klass->generic_class) : NULL;
 }
 
 /*
@@ -1292,21 +1292,21 @@ mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* con
  * in a separate function since it is cheaper than calling mono_class_setup_fields.
  */
 static MonoType*
-mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
+mono_class_find_enum_basetype (MonoClass *klass, MonoError *error)
 {
        MonoGenericContainer *container = NULL;
-       MonoImage *m = class->image; 
-       const int top = class->field.count;
+       MonoImage *m = klass->image;
+       const int top = klass->field.count;
        int i;
 
-       g_assert (class->enumtype);
+       g_assert (klass->enumtype);
 
        mono_error_init (error);
 
-       if (class->generic_container)
-               container = class->generic_container;
-       else if (class->generic_class) {
-               MonoClass *gklass = class->generic_class->container_class;
+       if (klass->generic_container)
+               container = klass->generic_container;
+       else if (klass->generic_class) {
+               MonoClass *gklass = klass->generic_class->container_class;
 
                container = gklass->generic_container;
                g_assert (container);
@@ -1318,17 +1318,17 @@ mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
        for (i = 0; i < top; i++){
                const char *sig;
                guint32 cols [MONO_FIELD_SIZE];
-               int idx = class->field.first + i;
+               int idx = klass->field.first + i;
                MonoType *ftype;
 
-               /* class->field.first and idx points into the fieldptr table */
+               /* klass->field.first and idx points into the fieldptr table */
                mono_metadata_decode_table_row (m, MONO_TABLE_FIELD, idx, cols, MONO_FIELD_SIZE);
 
                if (cols [MONO_FIELD_FLAGS] & FIELD_ATTRIBUTE_STATIC) //no need to decode static fields
                        continue;
 
-               if (!mono_verifier_verify_field_signature (class->image, cols [MONO_FIELD_SIGNATURE], NULL)) {
-                       mono_error_set_bad_image (error, class->image, "Invalid field signature %x", cols [MONO_FIELD_SIGNATURE]);
+               if (!mono_verifier_verify_field_signature (klass->image, cols [MONO_FIELD_SIGNATURE], NULL)) {
+                       mono_error_set_bad_image (error, klass->image, "Invalid field signature %x", cols [MONO_FIELD_SIGNATURE]);
                        goto fail;
                }
 
@@ -1336,21 +1336,21 @@ mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
                mono_metadata_decode_value (sig, &sig);
                /* FIELD signature == 0x06 */
                if (*sig != 0x06) {
-                       mono_error_set_bad_image (error, class->image, "Invalid field signature %x, expected 0x6 but got %x", cols [MONO_FIELD_SIGNATURE], *sig);
+                       mono_error_set_bad_image (error, klass->image, "Invalid field signature %x, expected 0x6 but got %x", cols [MONO_FIELD_SIGNATURE], *sig);
                        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);
                        else
-                               mono_error_set_bad_image (error, class->image, "Could not parse type for field signature %x", cols [MONO_FIELD_SIGNATURE]);
+                               mono_error_set_bad_image (error, klass->image, "Could not parse type for field signature %x", cols [MONO_FIELD_SIGNATURE]);
                        goto fail;
                }
-               if (class->generic_class) {
+               if (klass->generic_class) {
                        //FIXME do we leak here?
-                       ftype = mono_class_inflate_generic_type_checked (ftype, mono_class_get_context (class), error);
+                       ftype = mono_class_inflate_generic_type_checked (ftype, mono_class_get_context (klass), error);
                        if (!mono_error_ok (error))
                                goto fail;
                        ftype->attrs = cols [MONO_FIELD_FLAGS];
@@ -1358,7 +1358,7 @@ mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
 
                return ftype;
        }
-       mono_error_set_type_load_class (error, class, "Could not find base type");
+       mono_error_set_type_load_class (error, klass, "Could not find base type");
 
 fail:
        mono_loader_assert_no_error ();
@@ -1392,50 +1392,50 @@ mono_type_has_exceptions (MonoType *type)
  * or from the heap.
  */
 static gpointer
-mono_class_alloc (MonoClass *class, int size)
+mono_class_alloc (MonoClass *klass, int size)
 {
-       if (class->generic_class)
-               return mono_image_set_alloc (class->generic_class->owner, size);
+       if (klass->generic_class)
+               return mono_image_set_alloc (klass->generic_class->owner, size);
        else
-               return mono_image_alloc (class->image, size);
+               return mono_image_alloc (klass->image, size);
 }
 
 static gpointer
-mono_class_alloc0 (MonoClass *class, int size)
+mono_class_alloc0 (MonoClass *klass, int size)
 {
        gpointer res;
 
-       res = mono_class_alloc (class, size);
+       res = mono_class_alloc (klass, size);
        memset (res, 0, size);
        return res;
 }
 
-#define mono_class_new0(class,struct_type, n_structs)          \
-    ((struct_type *) mono_class_alloc0 ((class), ((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
+#define mono_class_new0(klass,struct_type, n_structs)          \
+    ((struct_type *) mono_class_alloc0 ((klass), ((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
 
 /**
  * mono_class_setup_basic_field_info:
  * @class: The class to initialize
  *
- * Initializes the class->fields.
+ * Initializes the klass->fields.
  * LOCKING: Assumes the loader lock is held.
  */
 static void
-mono_class_setup_basic_field_info (MonoClass *class)
+mono_class_setup_basic_field_info (MonoClass *klass)
 {
        MonoClassField *field;
        MonoClass *gtd;
        MonoImage *image;
        int i, top;
 
-       if (class->fields)
+       if (klass->fields)
                return;
 
-       gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL;
-       image = class->image;
-       top = class->field.count;
+       gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       image = klass->image;
+       top = klass->field.count;
 
-       if (class->generic_class && image_is_dynamic (class->generic_class->container_class->image) && !class->generic_class->container_class->wastypebuilder) {
+       if (klass->generic_class && image_is_dynamic (klass->generic_class->container_class->image) && !klass->generic_class->container_class->wastypebuilder) {
                /*
                 * This happens when a generic instance of an unfinished generic typebuilder
                 * is used as an element type for creating an array type. We can't initialize
@@ -1449,24 +1449,24 @@ mono_class_setup_basic_field_info (MonoClass *class)
                mono_class_setup_basic_field_info (gtd);
 
                top = gtd->field.count;
-               class->field.first = gtd->field.first;
-               class->field.count = gtd->field.count;
+               klass->field.first = gtd->field.first;
+               klass->field.count = gtd->field.count;
        }
 
-       class->fields = mono_class_alloc0 (class, sizeof (MonoClassField) * top);
+       klass->fields = mono_class_alloc0 (klass, sizeof (MonoClassField) * top);
 
        /*
         * Fetch all the field information.
         */
        for (i = 0; i < top; i++){
-               field = &class->fields [i];
-               field->parent = class;
+               field = &klass->fields [i];
+               field->parent = klass;
 
                if (gtd) {
                        field->name = mono_field_get_name (&gtd->fields [i]);
                } else {
-                       int idx = class->field.first + i;
-                       /* class->field.first and idx points into the fieldptr table */
+                       int idx = klass->field.first + i;
+                       /* klass->field.first and idx points into the fieldptr table */
                        guint32 name_idx = mono_metadata_decode_table_row_col (image, MONO_TABLE_FIELD, idx, MONO_FIELD_NAME);
                        /* The name is needed for fieldrefs */
                        field->name = mono_metadata_string_heap (image, name_idx);
@@ -1478,23 +1478,23 @@ mono_class_setup_basic_field_info (MonoClass *class)
  * mono_class_setup_fields:
  * @class: The class to initialize
  *
- * Initializes the class->fields.
+ * Initializes the klass->fields.
  * LOCKING: Assumes the loader lock is held.
  */
 static void
-mono_class_setup_fields (MonoClass *class)
+mono_class_setup_fields (MonoClass *klass)
 {
        MonoError error;
-       MonoImage *m = class->image; 
+       MonoImage *m = klass->image;
        int top;
-       guint32 layout = class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
+       guint32 layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
        int i, blittable = TRUE;
        guint32 real_size = 0;
        guint32 packing_size = 0;
        gboolean explicit_size;
        MonoClassField *field;
        MonoGenericContainer *container = NULL;
-       MonoClass *gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL;
+       MonoClass *gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
 
        /*
         * FIXME: We have a race condition here.  It's possible that this function returns
@@ -1509,14 +1509,14 @@ mono_class_setup_fields (MonoClass *class)
         * This function is called for a class whenever one of its subclasses is inited.
         * For example, it's called for every subclass of Object.  What it does is this:
         *
-        *     if (class->setup_fields_called)
+        *     if (klass->setup_fields_called)
         *         return;
         *     ...
-        *     class->instance_size = 0;
+        *     klass->instance_size = 0;
         *     ...
-        *     class->setup_fields_called = 1;
+        *     klass->setup_fields_called = 1;
         *     ... critical point
-        *     class->instance_size = actual_instance_size;
+        *     klass->instance_size = actual_instance_size;
         *
         * The last two steps are sometimes reversed, but that only changes the way in which
         * the race condition works.
@@ -1527,14 +1527,14 @@ mono_class_setup_fields (MonoClass *class)
         *
         * The other case looks like this:
         *
-        *     if (class->setup_fields_called)
+        *     if (klass->setup_fields_called)
         *         return;
         *     ... critical point X
-        *     class->instance_size = 0;
+        *     klass->instance_size = 0;
         *     ... critical point Y
-        *     class->instance_size = actual_instance_size;
+        *     klass->instance_size = actual_instance_size;
         *     ...
-        *     class->setup_fields_called = 1;
+        *     klass->setup_fields_called = 1;
         *
         * Assume thread A goes through the function and makes it to critical point X.  Now
         * thread B runs through the whole of the function, returning, assuming
@@ -1542,10 +1542,10 @@ mono_class_setup_fields (MonoClass *class)
         * critical point Y, at which time `instance_size` is `0` again, invalidating thread
         * B's assumption.
         */
-       if (class->setup_fields_called)
+       if (klass->setup_fields_called)
                return;
 
-       if (class->generic_class && image_is_dynamic (class->generic_class->container_class->image) && !class->generic_class->container_class->wastypebuilder) {
+       if (klass->generic_class && image_is_dynamic (klass->generic_class->container_class->image) && !klass->generic_class->container_class->wastypebuilder) {
                /*
                 * This happens when a generic instance of an unfinished generic typebuilder
                 * is used as an element type for creating an array type. We can't initialize
@@ -1555,39 +1555,39 @@ mono_class_setup_fields (MonoClass *class)
                return;
        }
 
-       mono_class_setup_basic_field_info (class);
-       top = class->field.count;
+       mono_class_setup_basic_field_info (klass);
+       top = klass->field.count;
 
        if (gtd) {
                mono_class_setup_fields (gtd);
                if (gtd->exception_type) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        return;
                }
        }
 
-       class->instance_size = 0;
-       if (!class->rank)
-               class->sizes.class_size = 0;
+       klass->instance_size = 0;
+       if (!klass->rank)
+               klass->sizes.class_size = 0;
 
-       if (class->parent) {
-               /* For generic instances, class->parent might not have been initialized */
-               mono_class_init (class->parent);
-               if (!class->parent->size_inited) {
-                       mono_class_setup_fields (class->parent);
-                       if (class->parent->exception_type) {
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+       if (klass->parent) {
+               /* For generic instances, klass->parent might not have been initialized */
+               mono_class_init (klass->parent);
+               if (!klass->parent->size_inited) {
+                       mono_class_setup_fields (klass->parent);
+                       if (klass->parent->exception_type) {
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                return;
                        }
                }
-               class->instance_size += class->parent->instance_size;
-               class->min_align = class->parent->min_align;
+               klass->instance_size += klass->parent->instance_size;
+               klass->min_align = klass->parent->min_align;
                /* we use |= since it may have been set already */
-               class->has_references |= class->parent->has_references;
-               blittable = class->parent->blittable;
+               klass->has_references |= klass->parent->has_references;
+               blittable = klass->parent->blittable;
        } else {
-               class->instance_size = sizeof (MonoObject);
-               class->min_align = 1;
+               klass->instance_size = sizeof (MonoObject);
+               klass->min_align = 1;
        }
 
        /* We can't really enable 16 bytes alignment until the GC supports it.
@@ -1595,42 +1595,42 @@ mono_class_setup_fields (MonoClass *class)
        boxed instance, which leads to unexplainable holes at the beginning of an object embedding a simd type.
        Bug #506144 is an example of this issue.
 
-        if (class->simd_type)
-               class->min_align = 16;
+        if (klass->simd_type)
+               klass->min_align = 16;
         */
        /* Get the real size */
-       explicit_size = mono_metadata_packing_from_typedef (class->image, class->type_token, &packing_size, &real_size);
+       explicit_size = mono_metadata_packing_from_typedef (klass->image, klass->type_token, &packing_size, &real_size);
 
        if (explicit_size) {
                if ((packing_size & 0xffffff00) != 0) {
-                       char *err_msg = g_strdup_printf ("Could not load struct '%s' with packing size %d >= 256", class->name, packing_size);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                       char *err_msg = g_strdup_printf ("Could not load struct '%s' with packing size %d >= 256", klass->name, packing_size);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
                        return;
                }
-               class->packing_size = packing_size;
-               real_size += class->instance_size;
+               klass->packing_size = packing_size;
+               real_size += klass->instance_size;
        }
 
        if (!top) {
                if (explicit_size && real_size) {
-                       class->instance_size = MAX (real_size, class->instance_size);
+                       klass->instance_size = MAX (real_size, klass->instance_size);
                }
-               class->blittable = blittable;
+               klass->blittable = blittable;
                mono_memory_barrier ();
-               class->size_inited = 1;
-               class->fields_inited = 1;
-               class->setup_fields_called = 1;
+               klass->size_inited = 1;
+               klass->fields_inited = 1;
+               klass->setup_fields_called = 1;
                return;
        }
 
-       if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT && !(mono_is_corlib_image (class->image) && !strcmp (class->name_space, "System") && !strcmp (class->name, "ValueType")))
+       if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT && !(mono_is_corlib_image (klass->image) && !strcmp (klass->name_space, "System") && !strcmp (klass->name, "ValueType")))
                blittable = FALSE;
 
        /* Prevent infinite loops if the class references itself */
-       class->setup_fields_called = 1;
+       klass->setup_fields_called = 1;
 
-       if (class->generic_container) {
-               container = class->generic_container;
+       if (klass->generic_container) {
+               container = klass->generic_container;
        } else if (gtd) {
                container = gtd->generic_container;
                g_assert (container);
@@ -1640,10 +1640,10 @@ mono_class_setup_fields (MonoClass *class)
         * Fetch all the field information.
         */
        for (i = 0; i < top; i++){
-               int idx = class->field.first + i;
-               field = &class->fields [i];
+               int idx = klass->field.first + i;
+               field = &klass->fields [i];
 
-               field->parent = class;
+               field->parent = klass;
 
                if (!field->type) {
                        mono_field_resolve_type (field, &error);
@@ -1653,7 +1653,7 @@ mono_class_setup_fields (MonoClass *class)
                                return;
                        }
                        if (!field->type)
-                               g_error ("could not resolve %s:%s\n", mono_type_get_full_name(class), field->name);
+                               g_error ("could not resolve %s:%s\n", mono_type_get_full_name(klass), field->name);
                        g_assert (field->type);
                }
 
@@ -1669,15 +1669,15 @@ mono_class_setup_fields (MonoClass *class)
                                field->offset = offset;
 
                                if (field->offset == (guint32)-1 && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Missing field layout info for %s", field->name));
+                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Missing field layout info for %s", field->name));
                                        break;
                                }
                                if (field->offset < -1) { /*-1 is used to encode special static fields */
-                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Invalid negative field offset %d for %s", field->offset, field->name));
+                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Invalid negative field offset %d for %s", field->offset, field->name));
                                        break;
                                }
-                               if (class->generic_container) {
-                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Generic class cannot have explicit layout."));
+                               if (klass->generic_container) {
+                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Generic class cannot have explicit layout."));
                                        break;
                                }
                        }
@@ -1692,7 +1692,7 @@ mono_class_setup_fields (MonoClass *class)
                                if (field_class) {
                                        mono_class_setup_fields (field_class);
                                        if (field_class->exception_type) {
-                                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                                break;
                                        }
                                }
@@ -1701,16 +1701,16 @@ mono_class_setup_fields (MonoClass *class)
                        }
                }
 
-               if (class->enumtype && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                       class->cast_class = class->element_class = mono_class_from_mono_type (field->type);
-                       blittable = class->element_class->blittable;
+               if (klass->enumtype && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
+                       klass->cast_class = klass->element_class = mono_class_from_mono_type (field->type);
+                       blittable = klass->element_class->blittable;
                }
 
                if (mono_type_has_exceptions (field->type)) {
-                       char *class_name = mono_type_get_full_name (class);
+                       char *class_name = mono_type_get_full_name (klass);
                        char *type_name = mono_type_full_name (field->type);
 
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        g_warning ("Invalid type %s for instance field %s:%s", type_name, class_name, field->name);
                        g_free (class_name);
                        g_free (type_name);
@@ -1719,46 +1719,46 @@ mono_class_setup_fields (MonoClass *class)
                /* The def_value of fields is compute lazily during vtable creation */
        }
 
-       if (class == mono_defaults.string_class)
+       if (klass == mono_defaults.string_class)
                blittable = FALSE;
 
-       class->blittable = blittable;
+       klass->blittable = blittable;
 
-       if (class->enumtype && !mono_class_enum_basetype (class)) {
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+       if (klass->enumtype && !mono_class_enum_basetype (klass)) {
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                return;
        }
        if (explicit_size && real_size) {
-               class->instance_size = MAX (real_size, class->instance_size);
+               klass->instance_size = MAX (real_size, klass->instance_size);
        }
 
-       if (class->exception_type)
+       if (klass->exception_type)
                return;
-       mono_class_layout_fields (class);
+       mono_class_layout_fields (klass);
 
        /*valuetypes can't be neither bigger than 1Mb or empty. */
-       if (class->valuetype && (class->instance_size <= 0 || class->instance_size > (0x100000 + sizeof (MonoObject))))
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+       if (klass->valuetype && (klass->instance_size <= 0 || klass->instance_size > (0x100000 + sizeof (MonoObject))))
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
 
        mono_memory_barrier ();
-       class->fields_inited = 1;
+       klass->fields_inited = 1;
 }
 
 /** 
  * mono_class_setup_fields_locking:
  * @class: The class to initialize
  *
- * Initializes the class->fields array of fields.
+ * Initializes the klass->fields array of fields.
  * Aquires the loader lock.
  */
 void
-mono_class_setup_fields_locking (MonoClass *class)
+mono_class_setup_fields_locking (MonoClass *klass)
 {
        /* This can be checked without locks */
-       if (class->fields_inited)
+       if (klass->fields_inited)
                return;
        mono_loader_lock ();
-       mono_class_setup_fields (class);
+       mono_class_setup_fields (klass);
        mono_loader_unlock ();
 }
 
@@ -1827,11 +1827,11 @@ type_has_references (MonoClass *klass, MonoType *ftype)
  * LOCKING: this is supposed to be called with the loader lock held.
  */
 void
-mono_class_layout_fields (MonoClass *class)
+mono_class_layout_fields (MonoClass *klass)
 {
        int i;
-       const int top = class->field.count;
-       guint32 layout = class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
+       const int top = klass->field.count;
+       guint32 layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
        guint32 pass, passes, real_size;
        gboolean gc_aware_layout = FALSE;
        gboolean has_static_fields = FALSE;
@@ -1855,7 +1855,7 @@ mono_class_layout_fields (MonoClass *class)
         */
         /* corlib is missing [StructLayout] directives in many places */
        if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
-               if (!class->valuetype)
+               if (!klass->valuetype)
                        gc_aware_layout = TRUE;
        }
 
@@ -1867,41 +1867,41 @@ mono_class_layout_fields (MonoClass *class)
        for (i = 0; i < top; i++) {
                MonoType *ftype;
 
-               field = &class->fields [i];
+               field = &klass->fields [i];
 
                if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
                        ftype = mono_type_get_underlying_type (field->type);
                        ftype = mono_type_get_basic_type_from_generic (ftype);
-                       if (type_has_references (class, ftype))
-                               class->has_references = TRUE;
+                       if (type_has_references (klass, ftype))
+                               klass->has_references = TRUE;
                }
        }
 
        for (i = 0; i < top; i++) {
                MonoType *ftype;
 
-               field = &class->fields [i];
+               field = &klass->fields [i];
 
                if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
                        ftype = mono_type_get_underlying_type (field->type);
                        ftype = mono_type_get_basic_type_from_generic (ftype);
-                       if (type_has_references (class, ftype))
-                               class->has_static_refs = TRUE;
+                       if (type_has_references (klass, ftype))
+                               klass->has_static_refs = TRUE;
                }
        }
 
        for (i = 0; i < top; i++) {
                MonoType *ftype;
 
-               field = &class->fields [i];
+               field = &klass->fields [i];
 
                ftype = mono_type_get_underlying_type (field->type);
                ftype = mono_type_get_basic_type_from_generic (ftype);
-               if (type_has_references (class, ftype)) {
+               if (type_has_references (klass, ftype)) {
                        if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
-                               class->has_static_refs = TRUE;
+                               klass->has_static_refs = TRUE;
                        else
-                               class->has_references = TRUE;
+                               klass->has_references = TRUE;
                }
        }
 
@@ -1921,13 +1921,13 @@ mono_class_layout_fields (MonoClass *class)
                if (layout != TYPE_ATTRIBUTE_AUTO_LAYOUT)
                        passes = 1;
 
-               if (class->parent) {
-                       mono_class_setup_fields (class->parent);
-                       if (class->parent->exception_type) {
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               if (klass->parent) {
+                       mono_class_setup_fields (klass->parent);
+                       if (klass->parent->exception_type) {
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                return;
                        }
-                       real_size = class->parent->instance_size;
+                       real_size = klass->parent->instance_size;
                } else {
                        real_size = sizeof (MonoObject);
                }
@@ -1938,7 +1938,7 @@ mono_class_layout_fields (MonoClass *class)
                                guint32 size;
                                MonoType *ftype;
 
-                               field = &class->fields [i];
+                               field = &klass->fields [i];
 
                                if (mono_field_is_deleted (field))
                                        continue;
@@ -1948,7 +1948,7 @@ mono_class_layout_fields (MonoClass *class)
                                ftype = mono_type_get_underlying_type (field->type);
                                ftype = mono_type_get_basic_type_from_generic (ftype);
                                if (gc_aware_layout) {
-                                       if (type_has_references (class, ftype)) {
+                                       if (type_has_references (klass, ftype)) {
                                                if (pass == 1)
                                                        continue;
                                        } else {
@@ -1957,7 +1957,7 @@ mono_class_layout_fields (MonoClass *class)
                                        }
                                }
 
-                               if ((top == 1) && (class->instance_size == sizeof (MonoObject)) &&
+                               if ((top == 1) && (klass->instance_size == sizeof (MonoObject)) &&
                                        (strcmp (mono_field_get_name (field), "$PRIVATE$") == 0)) {
                                        /* This field is a hack inserted by MCS to empty structures */
                                        continue;
@@ -1966,29 +1966,29 @@ mono_class_layout_fields (MonoClass *class)
                                size = mono_type_size (field->type, &align);
                        
                                /* FIXME (LAMESPEC): should we also change the min alignment according to pack? */
-                               align = class->packing_size ? MIN (class->packing_size, align): align;
+                               align = klass->packing_size ? MIN (klass->packing_size, align): align;
                                /* if the field has managed references, we need to force-align it
                                 * see bug #77788
                                 */
-                               if (type_has_references (class, ftype))
+                               if (type_has_references (klass, ftype))
                                        align = MAX (align, sizeof (gpointer));
 
-                               class->min_align = MAX (align, class->min_align);
+                               klass->min_align = MAX (align, klass->min_align);
                                field->offset = real_size;
                                if (align) {
                                        field->offset += align - 1;
                                        field->offset &= ~(align - 1);
                                }
                                /*TypeBuilders produce all sort of weird things*/
-                               g_assert (image_is_dynamic (class->image) || field->offset > 0);
+                               g_assert (image_is_dynamic (klass->image) || field->offset > 0);
                                real_size = field->offset + size;
                        }
 
-                       class->instance_size = MAX (real_size, class->instance_size);
+                       klass->instance_size = MAX (real_size, klass->instance_size);
        
-                       if (class->instance_size & (class->min_align - 1)) {
-                               class->instance_size += class->min_align - 1;
-                               class->instance_size &= ~(class->min_align - 1);
+                       if (klass->instance_size & (klass->min_align - 1)) {
+                               klass->instance_size += klass->min_align - 1;
+                               klass->instance_size &= ~(klass->min_align - 1);
                        }
                }
                break;
@@ -2001,7 +2001,7 @@ mono_class_layout_fields (MonoClass *class)
                        guint32 size;
                        MonoType *ftype;
 
-                       field = &class->fields [i];
+                       field = &klass->fields [i];
 
                        /*
                         * There must be info about all the fields in a type if it
@@ -2013,8 +2013,8 @@ mono_class_layout_fields (MonoClass *class)
                                continue;
 
                        size = mono_type_size (field->type, &align);
-                       align = class->packing_size ? MIN (class->packing_size, align): align;
-                       class->min_align = MAX (align, class->min_align);
+                       align = klass->packing_size ? MIN (klass->packing_size, align): align;
+                       klass->min_align = MAX (align, klass->min_align);
 
                        /*
                         * When we get here, field->offset is already set by the
@@ -2025,9 +2025,9 @@ mono_class_layout_fields (MonoClass *class)
                        field->offset += sizeof (MonoObject);
                        ftype = mono_type_get_underlying_type (field->type);
                        ftype = mono_type_get_basic_type_from_generic (ftype);
-                       if (type_has_references (class, ftype)) {
+                       if (type_has_references (klass, ftype)) {
                                if (field->offset % sizeof (gpointer)) {
-                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                }
                        }
 
@@ -2037,14 +2037,14 @@ mono_class_layout_fields (MonoClass *class)
                        real_size = MAX (real_size, size + field->offset);
                }
 
-               if (class->has_references) {
+               if (klass->has_references) {
                        ref_bitmap = g_new0 (guint8, real_size / sizeof (gpointer));
 
                        /* Check for overlapping reference and non-reference fields */
                        for (i = 0; i < top; i++) {
                                MonoType *ftype;
 
-                               field = &class->fields [i];
+                               field = &klass->fields [i];
 
                                if (mono_field_is_deleted (field))
                                        continue;
@@ -2055,7 +2055,7 @@ mono_class_layout_fields (MonoClass *class)
                                        ref_bitmap [field->offset / sizeof (gpointer)] = 1;
                        }
                        for (i = 0; i < top; i++) {
-                               field = &class->fields [i];
+                               field = &klass->fields [i];
 
                                if (mono_field_is_deleted (field))
                                        continue;
@@ -2065,18 +2065,18 @@ mono_class_layout_fields (MonoClass *class)
                                // FIXME: Too much code does this
 #if 0
                                if (!MONO_TYPE_IS_REFERENCE (field->type) && ref_bitmap [field->offset / sizeof (gpointer)]) {
-                                       char *err_msg = g_strdup_printf ("Could not load type '%s' because it contains an object field at offset %d that is incorrectly aligned or overlapped by a non-object field.", class->name, field->offset);
-                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                                       char *err_msg = g_strdup_printf ("Could not load type '%s' because it contains an object field at offset %d that is incorrectly aligned or overlapped by a non-object field.", klass->name, field->offset);
+                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
                                }
 #endif
                        }
                        g_free (ref_bitmap);
                }
 
-               class->instance_size = MAX (real_size, class->instance_size);
-               if (class->instance_size & (class->min_align - 1)) {
-                       class->instance_size += class->min_align - 1;
-                       class->instance_size &= ~(class->min_align - 1);
+               klass->instance_size = MAX (real_size, klass->instance_size);
+               if (klass->instance_size & (klass->min_align - 1)) {
+                       klass->instance_size += klass->min_align - 1;
+                       klass->instance_size &= ~(klass->min_align - 1);
                }
                break;
        }
@@ -2092,13 +2092,13 @@ mono_class_layout_fields (MonoClass *class)
                 * unaligned accesses otherwise. See #78990 for a testcase.
                 */
                if (mono_align_small_structs) {
-                       if (class->instance_size <= sizeof (MonoObject) + sizeof (gpointer))
-                               class->min_align = MAX (class->min_align, class->instance_size - sizeof (MonoObject));
+                       if (klass->instance_size <= sizeof (MonoObject) + sizeof (gpointer))
+                               klass->min_align = MAX (klass->min_align, klass->instance_size - sizeof (MonoObject));
                }
        }
 
        mono_memory_barrier ();
-       class->size_inited = 1;
+       klass->size_inited = 1;
 
        /*
         * Compute static field layout and size
@@ -2107,7 +2107,7 @@ mono_class_layout_fields (MonoClass *class)
                gint32 align;
                guint32 size;
 
-               field = &class->fields [i];
+               field = &klass->fields [i];
                        
                if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC) || field->type->attrs & FIELD_ATTRIBUTE_LITERAL)
                        continue;
@@ -2115,32 +2115,32 @@ mono_class_layout_fields (MonoClass *class)
                        continue;
 
                if (mono_type_has_exceptions (field->type)) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        break;
                }
 
                has_static_fields = TRUE;
 
                size = mono_type_size (field->type, &align);
-               field->offset = class->sizes.class_size;
+               field->offset = klass->sizes.class_size;
                /*align is always non-zero here*/
                field->offset += align - 1;
                field->offset &= ~(align - 1);
-               class->sizes.class_size = field->offset + size;
+               klass->sizes.class_size = field->offset + size;
        }
 
-       if (has_static_fields && class->sizes.class_size == 0)
+       if (has_static_fields && klass->sizes.class_size == 0)
                /* Simplify code which depends on class_size != 0 if the class has static fields */
-               class->sizes.class_size = 8;
+               klass->sizes.class_size = 8;
 }
 
 static MonoMethod*
-create_array_method (MonoClass *class, const char *name, MonoMethodSignature *sig)
+create_array_method (MonoClass *klass, const char *name, MonoMethodSignature *sig)
 {
        MonoMethod *method;
 
-       method = (MonoMethod *) mono_image_alloc0 (class->image, sizeof (MonoMethodPInvoke));
-       method->klass = class;
+       method = (MonoMethod *) mono_image_alloc0 (klass->image, sizeof (MonoMethodPInvoke));
+       method->klass = klass;
        method->flags = METHOD_ATTRIBUTE_PUBLIC;
        method->iflags = METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL;
        method->signature = sig;
@@ -2165,47 +2165,47 @@ create_array_method (MonoClass *class, const char *name, MonoMethodSignature *si
  * Methods belonging to an interface are assigned a sequential slot starting
  * from 0.
  *
- * On failure this function sets class->exception_type
+ * On failure this function sets klass->exception_type
  */
 void
-mono_class_setup_methods (MonoClass *class)
+mono_class_setup_methods (MonoClass *klass)
 {
        int i, count;
        MonoMethod **methods;
 
-       if (class->methods)
+       if (klass->methods)
                return;
 
-       if (class->generic_class) {
+       if (klass->generic_class) {
                MonoError error;
-               MonoClass *gklass = class->generic_class->container_class;
+               MonoClass *gklass = klass->generic_class->container_class;
 
                mono_class_init (gklass);
                if (!gklass->exception_type)
                        mono_class_setup_methods (gklass);
                if (gklass->exception_type) {
                        /* FIXME make exception_data less opaque so it's possible to dup it here */
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
                        return;
                }
 
                /* The + 1 makes this always non-NULL to pass the check in mono_class_setup_methods () */
                count = gklass->method.count;
-               methods = mono_class_alloc0 (class, sizeof (MonoMethod*) * (count + 1));
+               methods = mono_class_alloc0 (klass, sizeof (MonoMethod*) * (count + 1));
 
                for (i = 0; i < count; i++) {
                        methods [i] = mono_class_inflate_generic_method_full_checked (
-                               gklass->methods [i], class, mono_class_get_context (class), &error);
+                               gklass->methods [i], klass, mono_class_get_context (klass), &error);
                        if (!mono_error_ok (&error)) {
                                char *method = mono_method_full_name (gklass->methods [i], TRUE);
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not inflate method %s due to %s", method, mono_error_get_message (&error)));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not inflate method %s due to %s", method, mono_error_get_message (&error)));
 
                                g_free (method);
                                mono_error_cleanup (&error);
                                return;                         
                        }
                }
-       } else if (class->rank) {
+       } else if (klass->rank) {
                MonoError error;
                MonoMethod *amethod;
                MonoMethodSignature *sig;
@@ -2213,104 +2213,104 @@ mono_class_setup_methods (MonoClass *class)
                int method_num = 0;
                gboolean jagged_ctor = FALSE;
 
-               count = 3 + (class->rank > 1? 2: 1);
+               count = 3 + (klass->rank > 1? 2: 1);
 
-               mono_class_setup_interfaces (class, &error);
+               mono_class_setup_interfaces (klass, &error);
                g_assert (mono_error_ok (&error)); /*FIXME can this fail for array types?*/
 
-               if (class->rank == 1 && class->element_class->rank) {
+               if (klass->rank == 1 && klass->element_class->rank) {
                        jagged_ctor = TRUE;
-                       class->method.count ++;
+                       klass->method.count ++;
                }
 
-               if (class->interface_count) {
-                       count_generic = generic_array_methods (class);
+               if (klass->interface_count) {
+                       count_generic = generic_array_methods (klass);
                        first_generic = count;
-                       count += class->interface_count * count_generic;
+                       count += klass->interface_count * count_generic;
                }
 
-               methods = mono_class_alloc0 (class, sizeof (MonoMethod*) * count);
+               methods = mono_class_alloc0 (klass, sizeof (MonoMethod*) * count);
 
-               sig = mono_metadata_signature_alloc (class->image, class->rank);
+               sig = mono_metadata_signature_alloc (klass->image, klass->rank);
                sig->ret = &mono_defaults.void_class->byval_arg;
                sig->pinvoke = TRUE;
                sig->hasthis = TRUE;
-               for (i = 0; i < class->rank; ++i)
+               for (i = 0; i < klass->rank; ++i)
                        sig->params [i] = &mono_defaults.int32_class->byval_arg;
 
-               amethod = create_array_method (class, ".ctor", sig);
+               amethod = create_array_method (klass, ".ctor", sig);
                methods [method_num++] = amethod;
-               if (class->rank > 1) {
-                       sig = mono_metadata_signature_alloc (class->image, class->rank * 2);
+               if (klass->rank > 1) {
+                       sig = mono_metadata_signature_alloc (klass->image, klass->rank * 2);
                        sig->ret = &mono_defaults.void_class->byval_arg;
                        sig->pinvoke = TRUE;
                        sig->hasthis = TRUE;
-                       for (i = 0; i < class->rank * 2; ++i)
+                       for (i = 0; i < klass->rank * 2; ++i)
                                sig->params [i] = &mono_defaults.int32_class->byval_arg;
 
-                       amethod = create_array_method (class, ".ctor", sig);
+                       amethod = create_array_method (klass, ".ctor", sig);
                        methods [method_num++] = amethod;
                }
 
                if (jagged_ctor) {
                        /* Jagged arrays have an extra ctor in .net which creates an array of arrays */
-                       sig = mono_metadata_signature_alloc (class->image, class->rank + 1);
+                       sig = mono_metadata_signature_alloc (klass->image, klass->rank + 1);
                        sig->ret = &mono_defaults.void_class->byval_arg;
                        sig->pinvoke = TRUE;
                        sig->hasthis = TRUE;
-                       for (i = 0; i < class->rank + 1; ++i)
+                       for (i = 0; i < klass->rank + 1; ++i)
                                sig->params [i] = &mono_defaults.int32_class->byval_arg;
-                       amethod = create_array_method (class, ".ctor", sig);
+                       amethod = create_array_method (klass, ".ctor", sig);
                        methods [method_num++] = amethod;
                }
 
                /* element Get (idx11, [idx2, ...]) */
-               sig = mono_metadata_signature_alloc (class->image, class->rank);
-               sig->ret = &class->element_class->byval_arg;
+               sig = mono_metadata_signature_alloc (klass->image, klass->rank);
+               sig->ret = &klass->element_class->byval_arg;
                sig->pinvoke = TRUE;
                sig->hasthis = TRUE;
-               for (i = 0; i < class->rank; ++i)
+               for (i = 0; i < klass->rank; ++i)
                        sig->params [i] = &mono_defaults.int32_class->byval_arg;
-               amethod = create_array_method (class, "Get", sig);
+               amethod = create_array_method (klass, "Get", sig);
                methods [method_num++] = amethod;
                /* element& Address (idx11, [idx2, ...]) */
-               sig = mono_metadata_signature_alloc (class->image, class->rank);
-               sig->ret = &class->element_class->this_arg;
+               sig = mono_metadata_signature_alloc (klass->image, klass->rank);
+               sig->ret = &klass->element_class->this_arg;
                sig->pinvoke = TRUE;
                sig->hasthis = TRUE;
-               for (i = 0; i < class->rank; ++i)
+               for (i = 0; i < klass->rank; ++i)
                        sig->params [i] = &mono_defaults.int32_class->byval_arg;
-               amethod = create_array_method (class, "Address", sig);
+               amethod = create_array_method (klass, "Address", sig);
                methods [method_num++] = amethod;
                /* void Set (idx11, [idx2, ...], element) */
-               sig = mono_metadata_signature_alloc (class->image, class->rank + 1);
+               sig = mono_metadata_signature_alloc (klass->image, klass->rank + 1);
                sig->ret = &mono_defaults.void_class->byval_arg;
                sig->pinvoke = TRUE;
                sig->hasthis = TRUE;
-               for (i = 0; i < class->rank; ++i)
+               for (i = 0; i < klass->rank; ++i)
                        sig->params [i] = &mono_defaults.int32_class->byval_arg;
-               sig->params [i] = &class->element_class->byval_arg;
-               amethod = create_array_method (class, "Set", sig);
+               sig->params [i] = &klass->element_class->byval_arg;
+               amethod = create_array_method (klass, "Set", sig);
                methods [method_num++] = amethod;
 
-               for (i = 0; i < class->interface_count; i++)
-                       setup_generic_array_ifaces (class, class->interfaces [i], methods, first_generic + i * count_generic);
+               for (i = 0; i < klass->interface_count; i++)
+                       setup_generic_array_ifaces (klass, klass->interfaces [i], methods, first_generic + i * count_generic);
        } else {
                MonoError error;
 
-               count = class->method.count;
-               methods = mono_class_alloc (class, sizeof (MonoMethod*) * count);
+               count = klass->method.count;
+               methods = mono_class_alloc (klass, sizeof (MonoMethod*) * count);
                for (i = 0; i < count; ++i) {
-                       int idx = mono_metadata_translate_token_index (class->image, MONO_TABLE_METHOD, class->method.first + i + 1);
-                       methods [i] = mono_get_method_checked (class->image, MONO_TOKEN_METHOD_DEF | idx, class, NULL, &error);
+                       int idx = mono_metadata_translate_token_index (klass->image, MONO_TABLE_METHOD, klass->method.first + i + 1);
+                       methods [i] = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | idx, klass, NULL, &error);
                        if (!methods [i]) {
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load method %d due to %s", i, mono_error_get_message (&error)));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load method %d due to %s", i, mono_error_get_message (&error)));
                                mono_error_cleanup (&error);
                        }
                }
        }
 
-       if (MONO_CLASS_IS_INTERFACE (class)) {
+       if (MONO_CLASS_IS_INTERFACE (klass)) {
                int slot = 0;
                /*Only assign slots to virtual methods as interfaces are allowed to have static methods.*/
                for (i = 0; i < count; ++i) {
@@ -2319,38 +2319,38 @@ mono_class_setup_methods (MonoClass *class)
                }
        }
 
-       mono_image_lock (class->image);
+       mono_image_lock (klass->image);
 
-       if (!class->methods) {
-               class->method.count = count;
+       if (!klass->methods) {
+               klass->method.count = count;
 
                /* Needed because of the double-checking locking pattern */
                mono_memory_barrier ();
 
-               class->methods = methods;
+               klass->methods = methods;
        }
 
-       mono_image_unlock (class->image);
+       mono_image_unlock (klass->image);
 }
 
 /*
  * mono_class_get_method_by_index:
  *
- *   Returns class->methods [index], initializing class->methods if neccesary.
+ *   Returns klass->methods [index], initializing klass->methods if neccesary.
  *
  * LOCKING: Acquires the loader lock.
  */
 MonoMethod*
-mono_class_get_method_by_index (MonoClass *class, int index)
+mono_class_get_method_by_index (MonoClass *klass, int index)
 {
        MonoError error;
        /* Avoid calling setup_methods () if possible */
-       if (class->generic_class && !class->methods) {
-               MonoClass *gklass = class->generic_class->container_class;
+       if (klass->generic_class && !klass->methods) {
+               MonoClass *gklass = klass->generic_class->container_class;
                MonoMethod *m;
 
                m = mono_class_inflate_generic_method_full_checked (
-                               gklass->methods [index], class, mono_class_get_context (class), &error);
+                               gklass->methods [index], klass, mono_class_get_context (klass), &error);
                g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
                /*
                 * If setup_methods () is called later for this class, no duplicates are created,
@@ -2358,16 +2358,16 @@ mono_class_get_method_by_index (MonoClass *class, int index)
                 * is created for each context.
                 */
                /*
-               mono_class_setup_methods (class);
-               g_assert (m == class->methods [index]);
+               mono_class_setup_methods (klass);
+               g_assert (m == klass->methods [index]);
                */
                return m;
        } else {
-               mono_class_setup_methods (class);
-               if (class->exception_type) /*FIXME do proper error handling*/
+               mono_class_setup_methods (klass);
+               if (klass->exception_type) /*FIXME do proper error handling*/
                        return NULL;
-               g_assert (index >= 0 && index < class->method.count);
-               return class->methods [index];
+               g_assert (index >= 0 && index < klass->method.count);
+               return klass->methods [index];
        }
 }      
 
@@ -2378,9 +2378,9 @@ mono_class_get_method_by_index (MonoClass *class, int index)
  * CLASS's generic definition, return the inflated method corresponding to METHOD.
  */
 MonoMethod*
-mono_class_get_inflated_method (MonoClass *class, MonoMethod *method)
+mono_class_get_inflated_method (MonoClass *klass, MonoMethod *method)
 {
-       MonoClass *gklass = class->generic_class->container_class;
+       MonoClass *gklass = klass->generic_class->container_class;
        int i;
 
        g_assert (method->klass == gklass);
@@ -2390,11 +2390,11 @@ mono_class_get_inflated_method (MonoClass *class, MonoMethod *method)
 
        for (i = 0; i < gklass->method.count; ++i) {
                if (gklass->methods [i] == method) {
-                       if (class->methods) {
-                               return class->methods [i];
+                       if (klass->methods) {
+                               return klass->methods [i];
                        } else {
                                MonoError error;
-                               MonoMethod *result = mono_class_inflate_generic_method_full_checked (gklass->methods [i], class, mono_class_get_context (class), &error);
+                               MonoMethod *result = mono_class_inflate_generic_method_full_checked (gklass->methods [i], klass, mono_class_get_context (klass), &error);
                                g_assert (mono_error_ok (&error)); /* FIXME don't swallow this error */
                                return result;
                        }
@@ -2407,37 +2407,37 @@ mono_class_get_inflated_method (MonoClass *class, MonoMethod *method)
 /*
  * mono_class_get_vtable_entry:
  *
- *   Returns class->vtable [offset], computing it if neccesary. Returns NULL on failure.
+ *   Returns klass->vtable [offset], computing it if neccesary. Returns NULL on failure.
  * LOCKING: Acquires the loader lock.
  */
 MonoMethod*
-mono_class_get_vtable_entry (MonoClass *class, int offset)
+mono_class_get_vtable_entry (MonoClass *klass, int offset)
 {
        MonoMethod *m;
 
-       if (class->rank == 1) {
+       if (klass->rank == 1) {
                /* 
                 * szarrays do not overwrite any methods of Array, so we can avoid
                 * initializing their vtables in some cases.
                 */
-               mono_class_setup_vtable (class->parent);
-               if (offset < class->parent->vtable_size)
-                       return class->parent->vtable [offset];
+               mono_class_setup_vtable (klass->parent);
+               if (offset < klass->parent->vtable_size)
+                       return klass->parent->vtable [offset];
        }
 
-       if (class->generic_class) {
+       if (klass->generic_class) {
                MonoError error;
-               MonoClass *gklass = class->generic_class->container_class;
+               MonoClass *gklass = klass->generic_class->container_class;
                mono_class_setup_vtable (gklass);
                m = gklass->vtable [offset];
 
-               m = mono_class_inflate_generic_method_full_checked (m, class, mono_class_get_context (class), &error);
+               m = mono_class_inflate_generic_method_full_checked (m, klass, mono_class_get_context (klass), &error);
                g_assert (mono_error_ok (&error)); /* FIXME don't swallow this error */
        } else {
-               mono_class_setup_vtable (class);
-               if (class->exception_type)
+               mono_class_setup_vtable (klass);
+               if (klass->exception_type)
                        return NULL;
-               m = class->vtable [offset];
+               m = klass->vtable [offset];
        }
 
        return m;
@@ -2459,34 +2459,34 @@ mono_class_get_vtable_size (MonoClass *klass)
 /*
  * mono_class_setup_properties:
  *
- *   Initialize class->ext.property and class->ext.properties.
+ *   Initialize klass->ext.property and klass->ext.properties.
  *
  * This method can fail the class.
  */
 static void
-mono_class_setup_properties (MonoClass *class)
+mono_class_setup_properties (MonoClass *klass)
 {
        guint startm, endm, i, j;
        guint32 cols [MONO_PROPERTY_SIZE];
-       MonoTableInfo *msemt = &class->image->tables [MONO_TABLE_METHODSEMANTICS];
+       MonoTableInfo *msemt = &klass->image->tables [MONO_TABLE_METHODSEMANTICS];
        MonoProperty *properties;
        guint32 last;
        int first, count;
 
-       if (class->ext && class->ext->properties)
+       if (klass->ext && klass->ext->properties)
                return;
 
-       if (class->generic_class) {
-               MonoClass *gklass = class->generic_class->container_class;
+       if (klass->generic_class) {
+               MonoClass *gklass = klass->generic_class->container_class;
 
                mono_class_init (gklass);
                mono_class_setup_properties (gklass);
                if (gklass->exception_type) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
                        return;
                }
 
-               properties = mono_class_new0 (class, MonoProperty, gklass->ext->property.count + 1);
+               properties = mono_class_new0 (klass, MonoProperty, gklass->ext->property.count + 1);
 
                for (i = 0; i < gklass->ext->property.count; i++) {
                        MonoError error;
@@ -2496,47 +2496,47 @@ mono_class_setup_properties (MonoClass *class)
 
                        if (prop->get)
                                prop->get = mono_class_inflate_generic_method_full_checked (
-                                       prop->get, class, mono_class_get_context (class), &error);
+                                       prop->get, klass, mono_class_get_context (klass), &error);
                        if (prop->set)
                                prop->set = mono_class_inflate_generic_method_full_checked (
-                                       prop->set, class, mono_class_get_context (class), &error);
+                                       prop->set, klass, mono_class_get_context (klass), &error);
 
                        g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
-                       prop->parent = class;
+                       prop->parent = klass;
                }
 
                first = gklass->ext->property.first;
                count = gklass->ext->property.count;
        } else {
-               first = mono_metadata_properties_from_typedef (class->image, mono_metadata_token_index (class->type_token) - 1, &last);
+               first = mono_metadata_properties_from_typedef (klass->image, mono_metadata_token_index (klass->type_token) - 1, &last);
                count = last - first;
 
                if (count) {
-                       mono_class_setup_methods (class);
-                       if (class->exception_type)
+                       mono_class_setup_methods (klass);
+                       if (klass->exception_type)
                                return;
                }
 
-               properties = mono_class_alloc0 (class, sizeof (MonoProperty) * count);
+               properties = mono_class_alloc0 (klass, sizeof (MonoProperty) * count);
                for (i = first; i < last; ++i) {
-                       mono_metadata_decode_table_row (class->image, MONO_TABLE_PROPERTY, i, cols, MONO_PROPERTY_SIZE);
-                       properties [i - first].parent = class;
+                       mono_metadata_decode_table_row (klass->image, MONO_TABLE_PROPERTY, i, cols, MONO_PROPERTY_SIZE);
+                       properties [i - first].parent = klass;
                        properties [i - first].attrs = cols [MONO_PROPERTY_FLAGS];
-                       properties [i - first].name = mono_metadata_string_heap (class->image, cols [MONO_PROPERTY_NAME]);
+                       properties [i - first].name = mono_metadata_string_heap (klass->image, cols [MONO_PROPERTY_NAME]);
 
-                       startm = mono_metadata_methods_from_property (class->image, i, &endm);
+                       startm = mono_metadata_methods_from_property (klass->image, i, &endm);
                        for (j = startm; j < endm; ++j) {
                                MonoMethod *method;
 
                                mono_metadata_decode_row (msemt, j, cols, MONO_METHOD_SEMA_SIZE);
 
-                               if (class->image->uncompressed_metadata) {
+                               if (klass->image->uncompressed_metadata) {
                                        MonoError error;
                                        /* It seems like the MONO_METHOD_SEMA_METHOD column needs no remapping */
-                                       method = mono_get_method_checked (class->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], class, NULL, &error);
+                                       method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], klass, NULL, &error);
                                        mono_error_cleanup (&error); /* FIXME don't swallow this error */
                                } else {
-                                       method = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+                                       method = klass->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - klass->method.first];
                                }
 
                                switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
@@ -2553,30 +2553,30 @@ mono_class_setup_properties (MonoClass *class)
                }
        }
 
-       mono_class_alloc_ext (class);
+       mono_class_alloc_ext (klass);
 
-       mono_image_lock (class->image);
+       mono_image_lock (klass->image);
 
-       if (class->ext->properties) {
+       if (klass->ext->properties) {
                /* We leak 'properties' which was allocated from the image mempool */
-               mono_image_unlock (class->image);
+               mono_image_unlock (klass->image);
                return;
        }
 
-       class->ext->property.first = first;
-       class->ext->property.count = count;
+       klass->ext->property.first = first;
+       klass->ext->property.count = count;
 
-       /* Flush any pending writes as we do double checked locking on class->ext->properties */
+       /* Flush any pending writes as we do double checked locking on klass->ext->properties */
        mono_memory_barrier ();
 
        /* Leave this assignment as the last op in the function */
-       class->ext->properties = properties;
+       klass->ext->properties = properties;
 
-       mono_image_unlock (class->image);
+       mono_image_unlock (klass->image);
 }
 
 static MonoMethod**
-inflate_method_listz (MonoMethod **methods, MonoClass *class, MonoGenericContext *context)
+inflate_method_listz (MonoMethod **methods, MonoClass *klass, MonoGenericContext *context)
 {
        MonoMethod **om, **retval;
        int count;
@@ -2588,7 +2588,7 @@ inflate_method_listz (MonoMethod **methods, MonoClass *class, MonoGenericContext
        count = 0;
        for (om = methods, count = 0; *om; ++om, ++count) {
                MonoError error;
-               retval [count] = mono_class_inflate_generic_method_full_checked (*om, class, context, &error);
+               retval [count] = mono_class_inflate_generic_method_full_checked (*om, klass, context, &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
        }
 
@@ -2597,35 +2597,35 @@ inflate_method_listz (MonoMethod **methods, MonoClass *class, MonoGenericContext
 
 /*This method can fail the class.*/
 static void
-mono_class_setup_events (MonoClass *class)
+mono_class_setup_events (MonoClass *klass)
 {
        int first, count;
        guint startm, endm, i, j;
        guint32 cols [MONO_EVENT_SIZE];
-       MonoTableInfo *msemt = &class->image->tables [MONO_TABLE_METHODSEMANTICS];
+       MonoTableInfo *msemt = &klass->image->tables [MONO_TABLE_METHODSEMANTICS];
        guint32 last;
        MonoEvent *events;
 
-       if (class->ext && class->ext->events)
+       if (klass->ext && klass->ext->events)
                return;
 
-       if (class->generic_class) {
-               MonoClass *gklass = class->generic_class->container_class;
+       if (klass->generic_class) {
+               MonoClass *gklass = klass->generic_class->container_class;
                MonoGenericContext *context = NULL;
 
                mono_class_setup_events (gklass);
                if (gklass->exception_type) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
                        return;
                }
 
                first = gklass->ext->event.first;
                count = gklass->ext->event.count;
 
-               events = mono_class_new0 (class, MonoEvent, count);
+               events = mono_class_new0 (klass, MonoEvent, count);
 
                if (count)
-                       context = mono_class_get_context (class);
+                       context = mono_class_get_context (klass);
 
                for (i = 0; i < count; i++) {
                        MonoError error;
@@ -2634,54 +2634,54 @@ mono_class_setup_events (MonoClass *class)
 
                        mono_error_init (&error); //since we do conditional calls, we must ensure the default value is ok
 
-                       event->parent = class;
+                       event->parent = klass;
                        event->name = gevent->name;
-                       event->add = gevent->add ? mono_class_inflate_generic_method_full_checked (gevent->add, class, context, &error) : NULL;
+                       event->add = gevent->add ? mono_class_inflate_generic_method_full_checked (gevent->add, klass, context, &error) : NULL;
                        g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
-                       event->remove = gevent->remove ? mono_class_inflate_generic_method_full_checked (gevent->remove, class, context, &error) : NULL;
+                       event->remove = gevent->remove ? mono_class_inflate_generic_method_full_checked (gevent->remove, klass, context, &error) : NULL;
                        g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
-                       event->raise = gevent->raise ? mono_class_inflate_generic_method_full_checked (gevent->raise, class, context, &error) : NULL;
+                       event->raise = gevent->raise ? mono_class_inflate_generic_method_full_checked (gevent->raise, klass, context, &error) : NULL;
                        g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
 
 #ifndef MONO_SMALL_CONFIG
-                       event->other = gevent->other ? inflate_method_listz (gevent->other, class, context) : NULL;
+                       event->other = gevent->other ? inflate_method_listz (gevent->other, klass, context) : NULL;
 #endif
                        event->attrs = gevent->attrs;
                }
        } else {
-               first = mono_metadata_events_from_typedef (class->image, mono_metadata_token_index (class->type_token) - 1, &last);
+               first = mono_metadata_events_from_typedef (klass->image, mono_metadata_token_index (klass->type_token) - 1, &last);
                count = last - first;
 
                if (count) {
-                       mono_class_setup_methods (class);
-                       if (class->exception_type) {
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
+                       mono_class_setup_methods (klass);
+                       if (klass->exception_type) {
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
                                return;
                        }
                }
 
-               events = mono_class_alloc0 (class, sizeof (MonoEvent) * count);
+               events = mono_class_alloc0 (klass, sizeof (MonoEvent) * count);
                for (i = first; i < last; ++i) {
                        MonoEvent *event = &events [i - first];
 
-                       mono_metadata_decode_table_row (class->image, MONO_TABLE_EVENT, i, cols, MONO_EVENT_SIZE);
-                       event->parent = class;
+                       mono_metadata_decode_table_row (klass->image, MONO_TABLE_EVENT, i, cols, MONO_EVENT_SIZE);
+                       event->parent = klass;
                        event->attrs = cols [MONO_EVENT_FLAGS];
-                       event->name = mono_metadata_string_heap (class->image, cols [MONO_EVENT_NAME]);
+                       event->name = mono_metadata_string_heap (klass->image, cols [MONO_EVENT_NAME]);
 
-                       startm = mono_metadata_methods_from_event (class->image, i, &endm);
+                       startm = mono_metadata_methods_from_event (klass->image, i, &endm);
                        for (j = startm; j < endm; ++j) {
                                MonoMethod *method;
 
                                mono_metadata_decode_row (msemt, j, cols, MONO_METHOD_SEMA_SIZE);
 
-                               if (class->image->uncompressed_metadata) {
+                               if (klass->image->uncompressed_metadata) {
                                        MonoError error;
                                        /* It seems like the MONO_METHOD_SEMA_METHOD column needs no remapping */
-                                       method = mono_get_method_checked (class->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], class, NULL, &error);
+                                       method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], klass, NULL, &error);
                                        mono_error_cleanup (&error); /* FIXME don't swallow this error */
                                } else {
-                                       method = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+                                       method = klass->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - klass->method.first];
                                }
 
                                switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
@@ -2718,25 +2718,25 @@ mono_class_setup_events (MonoClass *class)
                }
        }
 
-       mono_class_alloc_ext (class);
+       mono_class_alloc_ext (klass);
 
-       mono_image_lock (class->image);
+       mono_image_lock (klass->image);
 
-       if (class->ext->events) {
-               mono_image_unlock (class->image);
+       if (klass->ext->events) {
+               mono_image_unlock (klass->image);
                return;
        }
 
-       class->ext->event.first = first;
-       class->ext->event.count = count;
+       klass->ext->event.first = first;
+       klass->ext->event.count = count;
 
-       /* Flush any pending writes as we do double checked locking on class->ext.events */
+       /* Flush any pending writes as we do double checked locking on klass->ext.events */
        mono_memory_barrier ();
 
        /* Leave this assignment as the last op in the function */
-       class->ext->events = events;
+       klass->ext->events = events;
 
-       mono_image_unlock (class->image);
+       mono_image_unlock (klass->image);
 }
 
 /*
@@ -2762,11 +2762,11 @@ mono_unload_interface_ids (MonoBitSet *bitset)
 }
 
 void
-mono_unload_interface_id (MonoClass *class)
+mono_unload_interface_id (MonoClass *klass)
 {
-       if (global_interface_bitset && class->interface_id) {
+       if (global_interface_bitset && klass->interface_id) {
                classes_lock ();
-               mono_bitset_clear (global_interface_bitset, class->interface_id);
+               mono_bitset_clear (global_interface_bitset, klass->interface_id);
                classes_unlock ();
        }
 }
@@ -2781,11 +2781,11 @@ mono_unload_interface_id (MonoClass *class)
  * Returns: the new ID.
  */
 static guint
-mono_get_unique_iid (MonoClass *class)
+mono_get_unique_iid (MonoClass *klass)
 {
        int iid;
        
-       g_assert (MONO_CLASS_IS_INTERFACE (class));
+       g_assert (MONO_CLASS_IS_INTERFACE (klass));
 
        classes_lock ();
 
@@ -2803,17 +2803,17 @@ mono_get_unique_iid (MonoClass *class)
        }
        mono_bitset_set (global_interface_bitset, iid);
        /* set the bit also in the per-image set */
-       if (!class->generic_class) {
-               if (class->image->interface_bitset) {
-                       if (iid >= mono_bitset_size (class->image->interface_bitset)) {
-                               MonoBitSet *new_set = mono_bitset_clone (class->image->interface_bitset, iid + 1);
-                               mono_bitset_free (class->image->interface_bitset);
-                               class->image->interface_bitset = new_set;
+       if (!klass->generic_class) {
+               if (klass->image->interface_bitset) {
+                       if (iid >= mono_bitset_size (klass->image->interface_bitset)) {
+                               MonoBitSet *new_set = mono_bitset_clone (klass->image->interface_bitset, iid + 1);
+                               mono_bitset_free (klass->image->interface_bitset);
+                               klass->image->interface_bitset = new_set;
                        }
                } else {
-                       class->image->interface_bitset = mono_bitset_new (iid + 1, 0);
+                       klass->image->interface_bitset = mono_bitset_new (iid + 1, 0);
                }
-               mono_bitset_set (class->image->interface_bitset, iid);
+               mono_bitset_set (klass->image->interface_bitset, iid);
        }
 
        classes_unlock ();
@@ -2821,14 +2821,14 @@ mono_get_unique_iid (MonoClass *class)
 #ifndef MONO_SMALL_CONFIG
        if (mono_print_vtable) {
                int generic_id;
-               char *type_name = mono_type_full_name (&class->byval_arg);
-               if (class->generic_class && !class->generic_class->context.class_inst->is_open) {
-                       generic_id = class->generic_class->context.class_inst->id;
+               char *type_name = mono_type_full_name (&klass->byval_arg);
+               if (klass->generic_class && !klass->generic_class->context.class_inst->is_open) {
+                       generic_id = klass->generic_class->context.class_inst->id;
                        g_assert (generic_id != 0);
                } else {
                        generic_id = 0;
                }
-               printf ("Interface: assigned id %d to %s|%s|%d\n", iid, class->image->name, type_name, generic_id);
+               printf ("Interface: assigned id %d to %s|%s|%d\n", iid, klass->image->name, type_name, generic_id);
                g_free (type_name);
        }
 #endif
@@ -3009,9 +3009,9 @@ inflate_class_one_arg (MonoClass *gtype, MonoClass *arg0)
 }
 
 static MonoClass*
-array_class_get_if_rank (MonoClass *class, guint rank)
+array_class_get_if_rank (MonoClass *klass, guint rank)
 {
-       return rank ? mono_array_class_get (class, rank) :  class;
+       return rank ? mono_array_class_get (klass, rank) : klass;
 }
 
 static void
@@ -3052,9 +3052,9 @@ fill_valuetype_array_derived_types (MonoClass **valuetype_types, MonoClass *ecla
  * Fixing this should kill quite some code, save some bits and improve compatibility.
  */
 static MonoClass**
-get_implicit_generic_array_interfaces (MonoClass *class, int *num, int *is_enumerator)
+get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enumerator)
 {
-       MonoClass *eclass = class->element_class;
+       MonoClass *eclass = klass->element_class;
        static MonoClass* generic_icollection_class = NULL;
        static MonoClass* generic_ienumerable_class = NULL;
        static MonoClass* generic_ienumerator_class = NULL;
@@ -3074,12 +3074,12 @@ get_implicit_generic_array_interfaces (MonoClass *class, int *num, int *is_enume
        internal_enumerator = FALSE;
        eclass_is_valuetype = FALSE;
        original_rank = eclass->rank;
-       if (class->byval_arg.type != MONO_TYPE_SZARRAY) {
-               if (class->generic_class && class->nested_in == mono_defaults.array_class && strcmp (class->name, "InternalEnumerator`1") == 0)  {
+       if (klass->byval_arg.type != MONO_TYPE_SZARRAY) {
+               if (klass->generic_class && klass->nested_in == mono_defaults.array_class && strcmp (klass->name, "InternalEnumerator`1") == 0)  {
                        /*
                         * For a Enumerator<T[]> we need to get the list of interfaces for T.
                         */
-                       eclass = mono_class_from_mono_type (class->generic_class->context.class_inst->type_argv [0]);
+                       eclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
                        original_rank = eclass->rank;
                        if (!eclass->rank)
                                eclass = eclass->element_class;
@@ -3251,7 +3251,7 @@ get_implicit_generic_array_interfaces (MonoClass *class, int *num, int *is_enume
        }
 #if 0
        {
-       char *type_name = mono_type_get_name_full (&class->byval_arg, 0);
+       char *type_name = mono_type_get_name_full (&klass->byval_arg, 0);
        for (i = 0; i  < real_count; ++i) {
                char *name = mono_type_get_name_full (&interfaces [i]->byval_arg, 0);
                g_print ("%s implements %s\n", type_name, name);
@@ -3282,25 +3282,25 @@ find_array_interface (MonoClass *klass, const char *name)
  * FIXME It would be nice if this information could be cached somewhere.
  */
 static int
-count_virtual_methods (MonoClass *class)
+count_virtual_methods (MonoClass *klass)
 {
        int i, count = 0;
        guint32 flags;
-       class = mono_class_get_generic_type_definition (class); /*We can find this information by looking at the GTD*/
+       klass = mono_class_get_generic_type_definition (klass); /*We can find this information by looking at the GTD*/
 
-       if (class->methods || !MONO_CLASS_HAS_STATIC_METADATA (class)) {
-               mono_class_setup_methods (class);
-               if (class->exception_type)
+       if (klass->methods || !MONO_CLASS_HAS_STATIC_METADATA (klass)) {
+               mono_class_setup_methods (klass);
+               if (klass->exception_type)
                        return -1;
 
-               for (i = 0; i < class->method.count; ++i) {
-                       flags = class->methods [i]->flags;
+               for (i = 0; i < klass->method.count; ++i) {
+                       flags = klass->methods [i]->flags;
                        if (flags & METHOD_ATTRIBUTE_VIRTUAL)
                                ++count;
                }
        } else {
-               for (i = 0; i < class->method.count; ++i) {
-                       flags = mono_metadata_decode_table_row_col (class->image, MONO_TABLE_METHOD, class->method.first + i, MONO_METHOD_FLAGS);
+               for (i = 0; i < klass->method.count; ++i) {
+                       flags = mono_metadata_decode_table_row_col (klass->image, MONO_TABLE_METHOD, klass->method.first + i, MONO_METHOD_FLAGS);
 
                        if (flags & METHOD_ATTRIBUTE_VIRTUAL)
                                ++count;
@@ -3478,7 +3478,7 @@ mono_class_interface_match (const uint8_t *bitmap, int id)
  * Return -1 on failure and set exception_type
  */
 static int
-setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
+setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
 {
        MonoError error;
        MonoClass *k, *ic;
@@ -3492,20 +3492,20 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
        int num_array_interfaces;
        int is_enumerator = FALSE;
 
-       mono_class_setup_supertypes (class);
+       mono_class_setup_supertypes (klass);
        /* 
         * get the implicit generic interfaces for either the arrays or for System.Array/InternalEnumerator<T>
         * implicit interfaces have the property that they are assigned the same slot in the
         * vtables for compatible interfaces
         */
-       array_interfaces = get_implicit_generic_array_interfaces (class, &num_array_interfaces, &is_enumerator);
+       array_interfaces = get_implicit_generic_array_interfaces (klass, &num_array_interfaces, &is_enumerator);
 
        /* compute maximum number of slots and maximum interface id */
        max_iid = 0;
        num_ifaces = num_array_interfaces; /* this can include duplicated ones */
-       ifaces_array = g_new0 (GPtrArray *, class->idepth);
-       for (j = 0; j < class->idepth; j++) {
-               k = class->supertypes [j];
+       ifaces_array = g_new0 (GPtrArray *, klass->idepth);
+       for (j = 0; j < klass->idepth; j++) {
+               k = klass->supertypes [j];
                num_ifaces += k->interface_count;
                for (i = 0; i < k->interface_count; i++) {
                        ic = k->interfaces [i];
@@ -3519,7 +3519,7 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                ifaces = mono_class_get_implemented_interfaces (k, &error);
                if (!mono_error_ok (&error)) {
                        char *name = mono_type_get_full_name (k);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Error getting the interfaces of %s due to %s", name, mono_error_get_message (&error)));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Error getting the interfaces of %s due to %s", name, mono_error_get_message (&error)));
                        g_free (name);
                        mono_error_cleanup (&error);
                        cur_slot = -1;
@@ -3543,12 +3543,12 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                        max_iid = ic->interface_id;
        }
 
-       if (MONO_CLASS_IS_INTERFACE (class)) {
+       if (MONO_CLASS_IS_INTERFACE (klass)) {
                num_ifaces++;
-               if (max_iid < class->interface_id)
-                       max_iid = class->interface_id;
+               if (max_iid < klass->interface_id)
+                       max_iid = klass->interface_id;
        }
-       class->max_interface_id = max_iid;
+       klass->max_interface_id = max_iid;
        /* compute vtable offset for interfaces */
        interfaces_full = g_malloc0 (sizeof (MonoClass*) * num_ifaces);
        interface_offsets_full = g_malloc (sizeof (int) * num_ifaces);
@@ -3558,8 +3558,8 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
        }
 
        /* skip the current class */
-       for (j = 0; j < class->idepth - 1; j++) {
-               k = class->supertypes [j];
+       for (j = 0; j < klass->idepth - 1; j++) {
+               k = klass->supertypes [j];
                ifaces = ifaces_array [j];
 
                if (ifaces) {
@@ -3575,8 +3575,8 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                }
        }
 
-       g_assert (class == class->supertypes [class->idepth - 1]);
-       ifaces = ifaces_array [class->idepth - 1];
+       g_assert (klass == klass->supertypes [klass->idepth - 1]);
+       ifaces = ifaces_array [klass->idepth - 1];
        if (ifaces) {
                for (i = 0; i < ifaces->len; ++i) {
                        int count;
@@ -3586,7 +3586,7 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                        count = count_virtual_methods (ic);
                        if (count == -1) {
                                char *name = mono_type_get_full_name (ic);
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Error calculating interface offset of %s", name));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Error calculating interface offset of %s", name));
                                g_free (name);
                                cur_slot = -1;
                                goto end;
@@ -3595,13 +3595,13 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                }
        }
 
-       if (MONO_CLASS_IS_INTERFACE (class))
-               set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, class, cur_slot, TRUE);
+       if (MONO_CLASS_IS_INTERFACE (klass))
+               set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, klass, cur_slot, TRUE);
 
        if (num_array_interfaces) {
                if (is_enumerator) {
-                       int ienumerator_idx = find_array_interface (class, "IEnumerator`1");
-                       int ienumerator_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, class->interfaces [ienumerator_idx]);
+                       int ienumerator_idx = find_array_interface (klass, "IEnumerator`1");
+                       int ienumerator_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, klass->interfaces [ienumerator_idx]);
                        g_assert (ienumerator_offset >= 0);
                        for (i = 0; i < num_array_interfaces; ++i) {
                                ic = array_interfaces [i];
@@ -3609,21 +3609,21 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                                        set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, ic, ienumerator_offset, TRUE);
                                else
                                        g_assert_not_reached ();
-                               /*g_print ("type %s has %s offset at %d (%s)\n", class->name, ic->name, interface_offsets_full [ic->interface_id], class->interfaces [0]->name);*/
+                               /*g_print ("type %s has %s offset at %d (%s)\n", klass->name, ic->name, interface_offsets_full [ic->interface_id], klass->interfaces [0]->name);*/
                        }
                } else {
                        int ilist_offset, icollection_offset, ienumerable_offset, ireadonlylist_offset, ireadonlycollection_offset;
-                       int ilist_iface_idx = find_array_interface (class, "IList`1");
-                       MonoClass* ilist_class = class->interfaces [ilist_iface_idx];
-                       int ireadonlylist_iface_idx = find_array_interface (class, "IReadOnlyList`1");
-                       MonoClass* ireadonlylist_class = ireadonlylist_iface_idx != -1 ? class->interfaces [ireadonlylist_iface_idx] : NULL;
+                       int ilist_iface_idx = find_array_interface (klass, "IList`1");
+                       MonoClass* ilist_class = klass->interfaces [ilist_iface_idx];
+                       int ireadonlylist_iface_idx = find_array_interface (klass, "IReadOnlyList`1");
+                       MonoClass* ireadonlylist_class = ireadonlylist_iface_idx != -1 ? klass->interfaces [ireadonlylist_iface_idx] : NULL;
                        int icollection_iface_idx = find_array_interface (ilist_class, "ICollection`1");
                        int ienumerable_iface_idx = find_array_interface (ilist_class, "IEnumerable`1");
                        int ireadonlycollection_iface_idx = ireadonlylist_iface_idx != -1 ? find_array_interface (ireadonlylist_class, "IReadOnlyCollection`1") : -1;
-                       ilist_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, class->interfaces [ilist_iface_idx]);
+                       ilist_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, klass->interfaces [ilist_iface_idx]);
                        icollection_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, ilist_class->interfaces [icollection_iface_idx]);
                        ienumerable_offset = find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, ilist_class->interfaces [ienumerable_iface_idx]);
-                       ireadonlylist_offset = ireadonlylist_iface_idx != -1 ? find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, class->interfaces [ireadonlylist_iface_idx]) : -1;
+                       ireadonlylist_offset = ireadonlylist_iface_idx != -1 ? find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, klass->interfaces [ireadonlylist_iface_idx]) : -1;
                        ireadonlycollection_offset = ireadonlycollection_iface_idx != -1 ? find_interface_offset (num_ifaces, interfaces_full, interface_offsets_full, ireadonlylist_class->interfaces [ireadonlycollection_iface_idx]) : -1;
                        g_assert (ilist_offset >= 0 && icollection_offset >= 0 && ienumerable_offset >= 0);
                        for (i = 0; i < num_array_interfaces; ++i) {
@@ -3642,7 +3642,7 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
                                else
                                        g_assert_not_reached ();
                                set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, ic, offset, TRUE);
-                               /*g_print ("type %s has %s offset at %d (%s)\n", class->name, ic->name, offset, class->interfaces [0]->name);*/
+                               /*g_print ("type %s has %s offset at %d (%s)\n", klass->name, ic->name, offset, klass->interfaces [0]->name);*/
                        }
                }
        }
@@ -3661,36 +3661,36 @@ setup_interface_offsets (MonoClass *class, int cur_slot, gboolean overwrite)
         * mono_class_setup_interface_offsets () passes 0 as CUR_SLOT, so the computed interface offsets will be invalid. This
         * means we have to overwrite those when called from other places (#4440).
         */
-       if (class->interfaces_packed) {
+       if (klass->interfaces_packed) {
                if (!overwrite)
-                       g_assert (class->interface_offsets_count == interface_offsets_count);
+                       g_assert (klass->interface_offsets_count == interface_offsets_count);
        } else {
                uint8_t *bitmap;
                int bsize;
-               class->interface_offsets_count = interface_offsets_count;
-               class->interfaces_packed = mono_class_alloc (class, sizeof (MonoClass*) * interface_offsets_count);
-               class->interface_offsets_packed = mono_class_alloc (class, sizeof (guint16) * interface_offsets_count);
+               klass->interface_offsets_count = interface_offsets_count;
+               klass->interfaces_packed = mono_class_alloc (klass, sizeof (MonoClass*) * interface_offsets_count);
+               klass->interface_offsets_packed = mono_class_alloc (klass, sizeof (guint16) * interface_offsets_count);
                bsize = (sizeof (guint8) * ((max_iid + 1) >> 3)) + (((max_iid + 1) & 7)? 1 :0);
 #ifdef COMPRESSED_INTERFACE_BITMAP
                bitmap = g_malloc0 (bsize);
 #else
-               bitmap = mono_class_alloc0 (class, bsize);
+               bitmap = mono_class_alloc0 (klass, bsize);
 #endif
                for (i = 0; i < interface_offsets_count; i++) {
                        int id = interfaces_full [i]->interface_id;
                        bitmap [id >> 3] |= (1 << (id & 7));
-                       class->interfaces_packed [i] = interfaces_full [i];
-                       class->interface_offsets_packed [i] = interface_offsets_full [i];
+                       klass->interfaces_packed [i] = interfaces_full [i];
+                       klass->interface_offsets_packed [i] = interface_offsets_full [i];
                        /*if (num_array_interfaces)
-                         g_print ("type %s has %s offset at %d\n", mono_type_get_name_full (&class->byval_arg, 0), mono_type_get_name_full (&interfaces_full [i]->byval_arg, 0), interface_offsets_full [i]);*/
+                         g_print ("type %s has %s offset at %d\n", mono_type_get_name_full (&klass->byval_arg, 0), mono_type_get_name_full (&interfaces_full [i]->byval_arg, 0), interface_offsets_full [i]);*/
                }
 #ifdef COMPRESSED_INTERFACE_BITMAP
                i = mono_compress_bitmap (NULL, bitmap, bsize);
-               class->interface_bitmap = mono_class_alloc0 (class, i);
-               mono_compress_bitmap (class->interface_bitmap, bitmap, bsize);
+               klass->interface_bitmap = mono_class_alloc0 (klass, i);
+               mono_compress_bitmap (klass->interface_bitmap, bitmap, bsize);
                g_free (bitmap);
 #else
-               class->interface_bitmap = bitmap;
+               klass->interface_bitmap = bitmap;
 #endif
        }
 
@@ -3698,7 +3698,7 @@ end:
        g_free (interfaces_full);
        g_free (interface_offsets_full);
        g_free (array_interfaces);
-       for (i = 0; i < class->idepth; i++) {
+       for (i = 0; i < klass->idepth; i++) {
                ifaces = ifaces_array [i];
                if (ifaces)
                        g_ptr_array_free (ifaces, TRUE);
@@ -3706,7 +3706,7 @@ end:
        g_free (ifaces_array);
        
        //printf ("JUST DONE: ");
-       //print_implemented_interfaces (class);
+       //print_implemented_interfaces (klass);
  
        return cur_slot;
 }
@@ -3714,20 +3714,20 @@ end:
 /*
  * Setup interface offsets for interfaces. 
  * Initializes:
- * - class->max_interface_id
- * - class->interface_offsets_count
- * - class->interfaces_packed
- * - class->interface_offsets_packed
- * - class->interface_bitmap
+ * - klass->max_interface_id
+ * - klass->interface_offsets_count
+ * - klass->interfaces_packed
+ * - klass->interface_offsets_packed
+ * - klass->interface_bitmap
  *
  * This function can fail @class.
  */
 void
-mono_class_setup_interface_offsets (MonoClass *class)
+mono_class_setup_interface_offsets (MonoClass *klass)
 {
        mono_loader_lock ();
 
-       setup_interface_offsets (class, 0, FALSE);
+       setup_interface_offsets (klass, 0, FALSE);
 
        mono_loader_unlock ();
 }
@@ -3752,32 +3752,32 @@ mono_class_has_gtd_parent (MonoClass *klass, MonoClass *parent)
 }
 
 gboolean
-mono_class_check_vtable_constraints (MonoClass *class, GList *in_setup)
+mono_class_check_vtable_constraints (MonoClass *klass, GList *in_setup)
 {
        MonoGenericInst *ginst;
        int i;
-       if (!class->generic_class) {
-               mono_class_setup_vtable_full (class, in_setup);
-               return class->exception_type == 0;
+       if (!klass->generic_class) {
+               mono_class_setup_vtable_full (klass, in_setup);
+               return klass->exception_type == 0;
        }
 
-       mono_class_setup_vtable_full (mono_class_get_generic_type_definition (class), in_setup);
-       if (class->generic_class->container_class->exception_type) {
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Failed to load generic definition vtable"));
+       mono_class_setup_vtable_full (mono_class_get_generic_type_definition (klass), in_setup);
+       if (klass->generic_class->container_class->exception_type) {
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Failed to load generic definition vtable"));
                return FALSE;
        }
 
-       ginst = class->generic_class->context.class_inst;
+       ginst = klass->generic_class->context.class_inst;
        for (i = 0; i < ginst->type_argc; ++i) {
                MonoClass *arg;
                if (ginst->type_argv [i]->type != MONO_TYPE_GENERICINST)
                        continue;
                arg = mono_class_from_mono_type (ginst->type_argv [i]);
                /*Those 2 will be checked by mono_class_setup_vtable itself*/
-               if (mono_class_has_gtd_parent (class, arg) || mono_class_has_gtd_parent (arg, class))
+               if (mono_class_has_gtd_parent (klass, arg) || mono_class_has_gtd_parent (arg, klass))
                        continue;
                if (!mono_class_check_vtable_constraints (arg, in_setup)) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Failed to load generic parameter %d", i));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Failed to load generic parameter %d", i));
                        return FALSE;
                }
        }
@@ -3792,18 +3792,18 @@ mono_class_check_vtable_constraints (MonoClass *class, GList *in_setup)
  * - vtable
  * - vtable_size
  * Plus all the fields initialized by setup_interface_offsets ().
- * If there is an error during vtable construction, class->exception_type is set.
+ * If there is an error during vtable construction, klass->exception_type is set.
  *
  * LOCKING: Acquires the loader lock.
  */
 void
-mono_class_setup_vtable (MonoClass *class)
+mono_class_setup_vtable (MonoClass *klass)
 {
-       mono_class_setup_vtable_full (class, NULL);
+       mono_class_setup_vtable_full (klass, NULL);
 }
 
 static void
-mono_class_setup_vtable_full (MonoClass *class, GList *in_setup)
+mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup)
 {
        MonoMethod **overrides;
        MonoGenericContext *context;
@@ -3811,66 +3811,66 @@ mono_class_setup_vtable_full (MonoClass *class, GList *in_setup)
        int onum = 0;
        gboolean ok = TRUE;
 
-       if (class->vtable)
+       if (klass->vtable)
                return;
 
-       if (MONO_CLASS_IS_INTERFACE (class)) {
+       if (MONO_CLASS_IS_INTERFACE (klass)) {
                /* This sets method->slot for all methods if this is an interface */
-               mono_class_setup_methods (class);
+               mono_class_setup_methods (klass);
                return;
        }
 
-       if (class->exception_type)
+       if (klass->exception_type)
                return;
 
-       if (g_list_find (in_setup, class))
+       if (g_list_find (in_setup, klass))
                return;
 
        mono_loader_lock ();
 
-       if (class->vtable) {
+       if (klass->vtable) {
                mono_loader_unlock ();
                return;
        }
 
        mono_stats.generic_vtable_count ++;
-       in_setup = g_list_prepend (in_setup, class);
+       in_setup = g_list_prepend (in_setup, klass);
 
-       if (class->generic_class) {
-               if (!mono_class_check_vtable_constraints (class, in_setup)) {
+       if (klass->generic_class) {
+               if (!mono_class_check_vtable_constraints (klass, in_setup)) {
                        mono_loader_unlock ();
-                       g_list_remove (in_setup, class);
+                       g_list_remove (in_setup, klass);
                        return;
                }
 
-               context = mono_class_get_context (class);
-               type_token = class->generic_class->container_class->type_token;
+               context = mono_class_get_context (klass);
+               type_token = klass->generic_class->container_class->type_token;
        } else {
-               context = (MonoGenericContext *) class->generic_container;              
-               type_token = class->type_token;
+               context = (MonoGenericContext *) klass->generic_container;
+               type_token = klass->type_token;
        }
 
-       if (image_is_dynamic (class->image)) {
+       if (image_is_dynamic (klass->image)) {
                /* Generic instances can have zero method overrides without causing any harm.
                 * This is true since we don't do layout all over again for them, we simply inflate
                 * the layout of the parent.
                 */
-               mono_reflection_get_dynamic_overrides (class, &overrides, &onum);
+               mono_reflection_get_dynamic_overrides (klass, &overrides, &onum);
        } else {
                /* The following call fails if there are missing methods in the type */
                /* FIXME it's probably a good idea to avoid this for generic instances. */
-               ok = mono_class_get_overrides_full (class->image, type_token, &overrides, &onum, context);
+               ok = mono_class_get_overrides_full (klass->image, type_token, &overrides, &onum, context);
        }
 
        if (ok)
-               mono_class_setup_vtable_general (class, overrides, onum, in_setup);
+               mono_class_setup_vtable_general (klass, overrides, onum, in_setup);
        else
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not load list of method overrides"));
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not load list of method overrides"));
                
        g_free (overrides);
 
        mono_loader_unlock ();
-       g_list_remove (in_setup, class);
+       g_list_remove (in_setup, klass);
 
        return;
 }
@@ -3956,7 +3956,7 @@ is_wcf_hack_disabled (void)
 }
 
 static gboolean
-check_interface_method_override (MonoClass *class, MonoMethod *im, MonoMethod *cm, gboolean require_newslot, gboolean interface_is_explicitly_implemented_by_class, gboolean slot_is_empty)
+check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *cm, gboolean require_newslot, gboolean interface_is_explicitly_implemented_by_class, gboolean slot_is_empty)
 {
        MonoMethodSignature *cmsig, *imsig;
        if (strcmp (im->name, cm->name) == 0) {
@@ -3981,7 +3981,7 @@ check_interface_method_override (MonoClass *class, MonoMethod *im, MonoMethod *c
                cmsig = mono_method_signature (cm);
                imsig = mono_method_signature (im);
                if (!cmsig || !imsig) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not resolve the signature of a virtual method"));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not resolve the signature of a virtual method"));
                        return FALSE;
                }
 
@@ -3993,13 +3993,13 @@ check_interface_method_override (MonoClass *class, MonoMethod *im, MonoMethod *c
                }
                TRACE_INTERFACE_VTABLE (printf ("[SECURITY CHECKS]"));
                if (mono_security_core_clr_enabled ())
-                       mono_security_core_clr_check_override (class, cm, im);
+                       mono_security_core_clr_check_override (klass, cm, im);
 
                TRACE_INTERFACE_VTABLE (printf ("[NAME CHECK OK]"));
                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (cm, im, NULL)) {
                        char *body_name = mono_method_full_name (cm, TRUE);
                        char *decl_name = mono_method_full_name (im, TRUE);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
                        g_free (body_name);
                        g_free (decl_name);
                        return FALSE;
@@ -4023,7 +4023,7 @@ check_interface_method_override (MonoClass *class, MonoMethod *im, MonoMethod *c
                cmsig = mono_method_signature (cm);
                imsig = mono_method_signature (im);
                if (!cmsig || !imsig) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not resolve the signature of a virtual method"));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not resolve the signature of a virtual method"));
                        return FALSE;
                }
 
@@ -4074,13 +4074,13 @@ check_interface_method_override (MonoClass *class, MonoMethod *im, MonoMethod *c
                
                TRACE_INTERFACE_VTABLE (printf ("[SECURITY CHECKS (INJECTED CASE)]"));
                if (mono_security_core_clr_enabled ())
-                       mono_security_core_clr_check_override (class, cm, im);
+                       mono_security_core_clr_check_override (klass, cm, im);
 
                TRACE_INTERFACE_VTABLE (printf ("[INJECTED INTERFACE CHECK OK]"));
                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (cm, im, NULL)) {
                        char *body_name = mono_method_full_name (cm, TRUE);
                        char *decl_name = mono_method_full_name (im, TRUE);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
                        g_free (body_name);
                        g_free (decl_name);
                        return FALSE;
@@ -4113,20 +4113,20 @@ print_overrides (GHashTable *override_map, const char *message) {
        }
 }
 static void
-print_vtable_full (MonoClass *class, MonoMethod** vtable, int size, int first_non_interface_slot, const char *message, gboolean print_interfaces) {
-       char *full_name = mono_type_full_name (&class->byval_arg);
+print_vtable_full (MonoClass *klass, MonoMethod** vtable, int size, int first_non_interface_slot, const char *message, gboolean print_interfaces) {
+       char *full_name = mono_type_full_name (&klass->byval_arg);
        int i;
        int parent_size;
        
        printf ("*** Vtable for class '%s' at \"%s\" (size %d)\n", full_name, message, size);
        
        if (print_interfaces) {
-               print_implemented_interfaces (class);
+               print_implemented_interfaces (klass);
                printf ("* Interfaces for class '%s' done.\nStarting vtable (size %d):\n", full_name, size);
        }
        
-       if (class->parent) {
-               parent_size = class->parent->vtable_size;
+       if (klass->parent) {
+               parent_size = klass->parent->vtable_size;
        } else {
                parent_size = 0;
        }
@@ -4156,20 +4156,20 @@ mono_method_try_get_vtable_index (MonoMethod *method)
 }
 
 static void
-mono_class_verify_vtable (MonoClass *class)
+mono_class_verify_vtable (MonoClass *klass)
 {
        int i;
-       char *full_name = mono_type_full_name (&class->byval_arg);
+       char *full_name = mono_type_full_name (&klass->byval_arg);
 
        printf ("*** Verifying VTable of class '%s' \n", full_name);
        g_free (full_name);
        full_name = NULL;
        
-       if (!class->methods)
+       if (!klass->methods)
                return;
 
-       for (i = 0; i < class->method.count; ++i) {
-               MonoMethod *cm = class->methods [i];
+       for (i = 0; i < klass->method.count; ++i) {
+               MonoMethod *cm = klass->methods [i];
                int slot;
 
                if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
@@ -4180,13 +4180,13 @@ mono_class_verify_vtable (MonoClass *class)
 
                slot = mono_method_try_get_vtable_index (cm);
                if (slot >= 0) {
-                       if (slot >= class->vtable_size) {
-                               printf ("\tInvalid method %s at index %d with vtable of length %d\n", full_name, slot, class->vtable_size);
+                       if (slot >= klass->vtable_size) {
+                               printf ("\tInvalid method %s at index %d with vtable of length %d\n", full_name, slot, klass->vtable_size);
                                continue;
                        }
 
-                       if (slot >= 0 && class->vtable [slot] != cm && (class->vtable [slot])) {
-                               char *other_name = class->vtable [slot] ? mono_method_full_name (class->vtable [slot], TRUE) : g_strdup ("[null value]");
+                       if (slot >= 0 && klass->vtable [slot] != cm && (klass->vtable [slot])) {
+                               char *other_name = klass->vtable [slot] ? mono_method_full_name (klass->vtable [slot], TRUE) : g_strdup ("[null value]");
                                printf ("\tMethod %s has slot %d but vtable has %s on it\n", full_name, slot, other_name);
                                g_free (other_name);
                        }
@@ -4198,7 +4198,7 @@ mono_class_verify_vtable (MonoClass *class)
 #endif
 
 static void
-print_unimplemented_interface_method_info (MonoClass *class, MonoClass *ic, MonoMethod *im, int im_slot, MonoMethod **overrides, int onum) {
+print_unimplemented_interface_method_info (MonoClass *klass, MonoClass *ic, MonoMethod *im, int im_slot, MonoMethod **overrides, int onum) {
        int index;
        char *method_signature;
        char *type_name;
@@ -4208,20 +4208,20 @@ print_unimplemented_interface_method_info (MonoClass *class, MonoClass *ic, Mono
                         overrides [index*2+1]->slot, overrides [index*2]->name, overrides [index*2]->slot);
        }
        method_signature = mono_signature_get_desc (mono_method_signature (im), FALSE);
-       type_name = mono_type_full_name (&class->byval_arg);
+       type_name = mono_type_full_name (&klass->byval_arg);
        mono_trace_warning (MONO_TRACE_TYPE, "no implementation for interface method %s::%s(%s) in class %s\n",
                mono_type_get_name (&ic->byval_arg), im->name, method_signature, type_name);
        g_free (method_signature);
        g_free (type_name);
-       mono_class_setup_methods (class);
-       if (class->exception_type) {
-               char *name = mono_type_get_full_name (class);
+       mono_class_setup_methods (klass);
+       if (klass->exception_type) {
+               char *name = mono_type_get_full_name (klass);
                mono_trace_warning (MONO_TRACE_TYPE, "CLASS %s failed to resolve methods\n", name);
                g_free (name);
                return;
        }
-       for (index = 0; index < class->method.count; ++index) {
-               MonoMethod *cm = class->methods [index];
+       for (index = 0; index < klass->method.count; ++index) {
+               MonoMethod *cm = klass->methods [index];
                method_signature = mono_signature_get_desc (mono_method_signature (cm), TRUE);
 
                mono_trace_warning (MONO_TRACE_TYPE, "METHOD %s(%s)\n", cm->name, method_signature);
@@ -4238,7 +4238,7 @@ mono_method_get_method_definition (MonoMethod *method)
 }
 
 static gboolean
-verify_class_overrides (MonoClass *class, MonoMethod **overrides, int onum)
+verify_class_overrides (MonoClass *klass, MonoMethod **overrides, int onum)
 {
        int i;
 
@@ -4246,29 +4246,29 @@ verify_class_overrides (MonoClass *class, MonoMethod **overrides, int onum)
                MonoMethod *decl = overrides [i * 2];
                MonoMethod *body = overrides [i * 2 + 1];
 
-               if (mono_class_get_generic_type_definition (body->klass) != mono_class_get_generic_type_definition (class)) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method belongs to a different class than the declared one"));
+               if (mono_class_get_generic_type_definition (body->klass) != mono_class_get_generic_type_definition (klass)) {
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method belongs to a different class than the declared one"));
                        return FALSE;
                }
 
                if (!(body->flags & METHOD_ATTRIBUTE_VIRTUAL) || (body->flags & METHOD_ATTRIBUTE_STATIC)) {
                        if (body->flags & METHOD_ATTRIBUTE_STATIC)
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method must not be static to override a base type"));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method must not be static to override a base type"));
                        else
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method must be virtual to override a base type"));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method must be virtual to override a base type"));
                        return FALSE;
                }
 
                if (!(decl->flags & METHOD_ATTRIBUTE_VIRTUAL) || (decl->flags & METHOD_ATTRIBUTE_STATIC)) {
                        if (body->flags & METHOD_ATTRIBUTE_STATIC)
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Cannot override a static method in a base type"));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Cannot override a static method in a base type"));
                        else
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Cannot override a non virtual method in a base type"));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Cannot override a non virtual method in a base type"));
                        return FALSE;
                }
 
-               if (!mono_class_is_assignable_from_slow (decl->klass, class)) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method overrides a class or interface that extended or implemented by this type"));
+               if (!mono_class_is_assignable_from_slow (decl->klass, klass)) {
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method overrides a class or interface that extended or implemented by this type"));
                        return FALSE;
                }
 
@@ -4278,7 +4278,7 @@ verify_class_overrides (MonoClass *class, MonoMethod **overrides, int onum)
                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (body, decl, NULL)) {
                        char *body_name = mono_method_full_name (body, TRUE);
                        char *decl_name = mono_method_full_name (decl, TRUE);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
                        g_free (body_name);
                        g_free (decl_name);
                        return FALSE;
@@ -4288,16 +4288,16 @@ verify_class_overrides (MonoClass *class, MonoMethod **overrides, int onum)
 }
 
 static gboolean
-mono_class_need_stelemref_method (MonoClass *class)
+mono_class_need_stelemref_method (MonoClass *klass)
 {
-       return class->rank == 1 && MONO_TYPE_IS_REFERENCE (&class->element_class->byval_arg);
+       return klass->rank == 1 && MONO_TYPE_IS_REFERENCE (&klass->element_class->byval_arg);
 }
 
 /*
  * LOCKING: this is supposed to be called with the loader lock held.
  */
 void
-mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int onum, GList *in_setup)
+mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum, GList *in_setup)
 {
        MonoError error;
        MonoClass *k, *ic;
@@ -4312,16 +4312,16 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
        GSList *virt_methods = NULL, *l;
        int stelemref_slot = 0;
 
-       if (class->vtable)
+       if (klass->vtable)
                return;
 
-       if (overrides && !verify_class_overrides (class, overrides, onum))
+       if (overrides && !verify_class_overrides (klass, overrides, onum))
                return;
 
-       ifaces = mono_class_get_implemented_interfaces (class, &error);
+       ifaces = mono_class_get_implemented_interfaces (klass, &error);
        if (!mono_error_ok (&error)) {
-               char *name = mono_type_get_full_name (class);
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not resolve %s interfaces due to %s", name, mono_error_get_message (&error)));
+               char *name = mono_type_get_full_name (klass);
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not resolve %s interfaces due to %s", name, mono_error_get_message (&error)));
                g_free (name);
                mono_error_cleanup (&error);
                return;
@@ -4334,25 +4334,25 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                ifaces = NULL;
        }
        
-       if (class->parent) {
-               mono_class_init (class->parent);
-               mono_class_setup_vtable_full (class->parent, in_setup);
+       if (klass->parent) {
+               mono_class_init (klass->parent);
+               mono_class_setup_vtable_full (klass->parent, in_setup);
 
-               if (class->parent->exception_type) {
-                       char *name = mono_type_get_full_name (class->parent);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Parent %s failed to load", name));
+               if (klass->parent->exception_type) {
+                       char *name = mono_type_get_full_name (klass->parent);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Parent %s failed to load", name));
                        g_free (name);
                        return;
                }
 
-               max_vtsize += class->parent->vtable_size;
-               cur_slot = class->parent->vtable_size;
+               max_vtsize += klass->parent->vtable_size;
+               cur_slot = klass->parent->vtable_size;
        }
 
-       max_vtsize += class->method.count;
+       max_vtsize += klass->method.count;
 
        /*Array have a slot for stelemref*/
-       if (mono_class_need_stelemref_method (class)) {
+       if (mono_class_need_stelemref_method (klass)) {
                stelemref_slot = cur_slot;
                ++max_vtsize;
                ++cur_slot;
@@ -4361,35 +4361,35 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
        vtable = alloca (sizeof (gpointer) * max_vtsize);
        memset (vtable, 0, sizeof (gpointer) * max_vtsize);
 
-       /* printf ("METAINIT %s.%s\n", class->name_space, class->name); */
+       /* printf ("METAINIT %s.%s\n", klass->name_space, klass->name); */
 
-       cur_slot = setup_interface_offsets (class, cur_slot, TRUE);
+       cur_slot = setup_interface_offsets (klass, cur_slot, TRUE);
        if (cur_slot == -1) /*setup_interface_offsets fails the type.*/
                return;
 
-       max_iid = class->max_interface_id;
+       max_iid = klass->max_interface_id;
        DEBUG_INTERFACE_VTABLE (first_non_interface_slot = cur_slot);
 
        /* Optimized version for generic instances */
-       if (class->generic_class) {
+       if (klass->generic_class) {
                MonoError error;
-               MonoClass *gklass = class->generic_class->container_class;
+               MonoClass *gklass = klass->generic_class->container_class;
                MonoMethod **tmp;
 
                mono_class_setup_vtable_full (gklass, in_setup);
                if (gklass->exception_type != MONO_EXCEPTION_NONE) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        return;
                }
 
-               tmp = mono_class_alloc0 (class, sizeof (gpointer) * gklass->vtable_size);
-               class->vtable_size = gklass->vtable_size;
+               tmp = mono_class_alloc0 (klass, sizeof (gpointer) * gklass->vtable_size);
+               klass->vtable_size = gklass->vtable_size;
                for (i = 0; i < gklass->vtable_size; ++i)
                        if (gklass->vtable [i]) {
-                               MonoMethod *inflated = mono_class_inflate_generic_method_full_checked (gklass->vtable [i], class, mono_class_get_context (class), &error);
+                               MonoMethod *inflated = mono_class_inflate_generic_method_full_checked (gklass->vtable [i], klass, mono_class_get_context (klass), &error);
                                if (!mono_error_ok (&error)) {
                                        char *err_msg = g_strdup_printf ("Could not inflate method due to %s", mono_error_get_message (&error));
-                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
                                        g_free (err_msg);
                                        mono_error_cleanup (&error);
                                        return;
@@ -4398,20 +4398,20 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                tmp [i]->slot = gklass->vtable [i]->slot;
                        }
                mono_memory_barrier ();
-               class->vtable = tmp;
+               klass->vtable = tmp;
 
                /* Have to set method->slot for abstract virtual methods */
-               if (class->methods && gklass->methods) {
-                       for (i = 0; i < class->method.count; ++i)
-                               if (class->methods [i]->slot == -1)
-                                       class->methods [i]->slot = gklass->methods [i]->slot;
+               if (klass->methods && gklass->methods) {
+                       for (i = 0; i < klass->method.count; ++i)
+                               if (klass->methods [i]->slot == -1)
+                                       klass->methods [i]->slot = gklass->methods [i]->slot;
                }
 
                return;
        }
 
-       if (class->parent && class->parent->vtable_size) {
-               MonoClass *parent = class->parent;
+       if (klass->parent && klass->parent->vtable_size) {
+               MonoClass *parent = klass->parent;
                int i;
                
                memcpy (vtable, parent->vtable,  sizeof (gpointer) * parent->vtable_size);
@@ -4422,7 +4422,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                // classes the ".override" information is not used anymore.
                for (i = 0; i < parent->interface_offsets_count; i++) {
                        MonoClass *parent_interface = parent->interfaces_packed [i];
-                       int interface_offset = mono_class_interface_offset (class, parent_interface);
+                       int interface_offset = mono_class_interface_offset (klass, parent_interface);
                        /*FIXME this is now dead code as this condition will never hold true.
                        Since interface offsets are inherited then the offset of an interface implemented
                        by a parent will never be the out of it's vtable boundary.
@@ -4433,7 +4433,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                
                                mono_class_setup_methods (parent_interface); /*FIXME Just kill this whole chunk of dead code*/
                                TRACE_INTERFACE_VTABLE (printf ("    +++ Inheriting interface %s.%s\n", parent_interface->name_space, parent_interface->name));
-                               for (j = 0; j < parent_interface->method.count && !class->exception_type; j++) {
+                               for (j = 0; j < parent_interface->method.count && !klass->exception_type; j++) {
                                        vtable [interface_offset + j] = parent->vtable [parent_interface_offset + j];
                                        TRACE_INTERFACE_VTABLE (printf ("    --- Inheriting: [%03d][(%03d)+(%03d)] => [%03d][(%03d)+(%03d)]\n",
                                                        parent_interface_offset + j, parent_interface_offset, j,
@@ -4445,8 +4445,8 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
        }
 
        /*Array have a slot for stelemref*/
-       if (mono_class_need_stelemref_method (class)) {
-               MonoMethod *method = mono_marshal_get_virtual_stelemref (class);
+       if (mono_class_need_stelemref_method (klass)) {
+               MonoMethod *method = mono_marshal_get_virtual_stelemref (klass);
                if (!method->slot)
                        method->slot = stelemref_slot;
                else
@@ -4455,7 +4455,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                vtable [stelemref_slot] = method;
        }
 
-       TRACE_INTERFACE_VTABLE (print_vtable_full (class, vtable, cur_slot, first_non_interface_slot, "AFTER INHERITING PARENT VTABLE", TRUE));
+       TRACE_INTERFACE_VTABLE (print_vtable_full (klass, vtable, cur_slot, first_non_interface_slot, "AFTER INHERITING PARENT VTABLE", TRUE));
        /* override interface methods */
        for (i = 0; i < onum; i++) {
                MonoMethod *decl = overrides [i*2];
@@ -4463,11 +4463,11 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                        int dslot;
                        dslot = mono_method_get_vtable_slot (decl);
                        if (dslot == -1) {
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                return;
                        }
 
-                       dslot += mono_class_interface_offset (class, decl->klass);
+                       dslot += mono_class_interface_offset (klass, decl->klass);
                        vtable [dslot] = overrides [i*2 + 1];
                        vtable [dslot]->slot = dslot;
                        if (!override_map)
@@ -4476,11 +4476,11 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                        g_hash_table_insert (override_map, overrides [i * 2], overrides [i * 2 + 1]);
 
                        if (mono_security_core_clr_enabled ())
-                               mono_security_core_clr_check_override (class, vtable [dslot], decl);
+                               mono_security_core_clr_check_override (klass, vtable [dslot], decl);
                }
        }
        TRACE_INTERFACE_VTABLE (print_overrides (override_map, "AFTER OVERRIDING INTERFACE METHODS"));
-       TRACE_INTERFACE_VTABLE (print_vtable_full (class, vtable, cur_slot, first_non_interface_slot, "AFTER OVERRIDING INTERFACE METHODS", FALSE));
+       TRACE_INTERFACE_VTABLE (print_vtable_full (klass, vtable, cur_slot, first_non_interface_slot, "AFTER OVERRIDING INTERFACE METHODS", FALSE));
 
        /*
         * Create a list of virtual methods to avoid calling 
@@ -4492,22 +4492,22 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                MonoMethod *cm;
 
                virt_methods = NULL;
-               while ((cm = mono_class_get_virtual_methods (class, &iter))) {
+               while ((cm = mono_class_get_virtual_methods (klass, &iter))) {
                        virt_methods = g_slist_prepend (virt_methods, cm);
                }
-               if (class->exception_type)
+               if (klass->exception_type)
                        goto fail;
        }
        
        // Loop on all implemented interfaces...
-       for (i = 0; i < class->interface_offsets_count; i++) {
-               MonoClass *parent = class->parent;
+       for (i = 0; i < klass->interface_offsets_count; i++) {
+               MonoClass *parent = klass->parent;
                int ic_offset;
                gboolean interface_is_explicitly_implemented_by_class;
                int im_index;
                
-               ic = class->interfaces_packed [i];
-               ic_offset = mono_class_interface_offset (class, ic);
+               ic = klass->interfaces_packed [i];
+               ic_offset = mono_class_interface_offset (klass, ic);
 
                mono_class_setup_methods (ic);
                if (ic->exception_type)
@@ -4517,8 +4517,8 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                if (parent != NULL) {
                        int implemented_interfaces_index;
                        interface_is_explicitly_implemented_by_class = FALSE;
-                       for (implemented_interfaces_index = 0; implemented_interfaces_index < class->interface_count; implemented_interfaces_index++) {
-                               if (ic == class->interfaces [implemented_interfaces_index]) {
+                       for (implemented_interfaces_index = 0; implemented_interfaces_index < klass->interface_count; implemented_interfaces_index++) {
+                               if (ic == klass->interfaces [implemented_interfaces_index]) {
                                        interface_is_explicitly_implemented_by_class = TRUE;
                                        break;
                                }
@@ -4548,7 +4548,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                for (l = virt_methods; l; l = l->next) {
                                        cm = l->data;
                                        TRACE_INTERFACE_VTABLE (printf ("    For slot %d ('%s'.'%s':'%s'), trying method '%s'.'%s':'%s'... [EXPLICIT IMPLEMENTATION = %d][SLOT IS NULL = %d]", im_slot, ic->name_space, ic->name, im->name, cm->klass->name_space, cm->klass->name, cm->name, interface_is_explicitly_implemented_by_class, (vtable [im_slot] == NULL)));
-                                       if (check_interface_method_override (class, im, cm, TRUE, interface_is_explicitly_implemented_by_class, (vtable [im_slot] == NULL))) {
+                                       if (check_interface_method_override (klass, im, cm, TRUE, interface_is_explicitly_implemented_by_class, (vtable [im_slot] == NULL))) {
                                                TRACE_INTERFACE_VTABLE (printf ("[check ok]: ASSIGNING"));
                                                vtable [im_slot] = cm;
                                                /* Why do we need this? */
@@ -4557,19 +4557,19 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                                }
                                        }
                                        TRACE_INTERFACE_VTABLE (printf ("\n"));
-                                       if (class->exception_type)  /*Might be set by check_interface_method_override*/ 
+                                       if (klass->exception_type)  /*Might be set by check_interface_method_override*/
                                                goto fail;
                                }
                                
                                // If the slot is still empty, look in all the inherited virtual methods...
-                               if ((vtable [im_slot] == NULL) && class->parent != NULL) {
-                                       MonoClass *parent = class->parent;
+                               if ((vtable [im_slot] == NULL) && klass->parent != NULL) {
+                                       MonoClass *parent = klass->parent;
                                        // Reverse order, so that last added methods are preferred
                                        for (cm_index = parent->vtable_size - 1; cm_index >= 0; cm_index--) {
                                                MonoMethod *cm = parent->vtable [cm_index];
                                                
                                                TRACE_INTERFACE_VTABLE ((cm != NULL) && printf ("    For slot %d ('%s'.'%s':'%s'), trying (ancestor) method '%s'.'%s':'%s'... ", im_slot, ic->name_space, ic->name, im->name, cm->klass->name_space, cm->klass->name, cm->name));
-                                               if ((cm != NULL) && check_interface_method_override (class, im, cm, FALSE, FALSE, TRUE)) {
+                                               if ((cm != NULL) && check_interface_method_override (klass, im, cm, FALSE, FALSE, TRUE)) {
                                                        TRACE_INTERFACE_VTABLE (printf ("[everything ok]: ASSIGNING"));
                                                        vtable [im_slot] = cm;
                                                        /* Why do we need this? */
@@ -4578,7 +4578,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                                        }
                                                        break;
                                                }
-                                               if (class->exception_type) /*Might be set by check_interface_method_override*/ 
+                                               if (klass->exception_type) /*Might be set by check_interface_method_override*/
                                                        goto fail;
                                                TRACE_INTERFACE_VTABLE ((cm != NULL) && printf ("\n"));
                                        }
@@ -4594,13 +4594,13 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
        // it can happen (for injected generic array interfaces) that the same slot is
        // processed multiple times (those interfaces have overlapping slots), and it
        // will not always be the first pass the one that fills the slot.
-       if (! (class->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
-               for (i = 0; i < class->interface_offsets_count; i++) {
+       if (! (klass->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
+               for (i = 0; i < klass->interface_offsets_count; i++) {
                        int ic_offset;
                        int im_index;
                        
-                       ic = class->interfaces_packed [i];
-                       ic_offset = mono_class_interface_offset (class, ic);
+                       ic = klass->interfaces_packed [i];
+                       ic_offset = mono_class_interface_offset (klass, ic);
                        
                        for (im_index = 0; im_index < ic->method.count; im_index++) {
                                MonoMethod *im = ic->methods [im_index];
@@ -4612,14 +4612,14 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                TRACE_INTERFACE_VTABLE (printf ("      [class is not abstract, checking slot %d for interface '%s'.'%s', method %s, slot check is %d]\n",
                                                im_slot, ic->name_space, ic->name, im->name, (vtable [im_slot] == NULL)));
                                if (vtable [im_slot] == NULL) {
-                                       print_unimplemented_interface_method_info (class, ic, im, im_slot, overrides, onum);
+                                       print_unimplemented_interface_method_info (klass, ic, im, im_slot, overrides, onum);
                                        goto fail;
                                }
                        }
                }
        }
 
-       TRACE_INTERFACE_VTABLE (print_vtable_full (class, vtable, cur_slot, first_non_interface_slot, "AFTER SETTING UP INTERFACE METHODS", FALSE));
+       TRACE_INTERFACE_VTABLE (print_vtable_full (klass, vtable, cur_slot, first_non_interface_slot, "AFTER SETTING UP INTERFACE METHODS", FALSE));
        for (l = virt_methods; l; l = l->next) {
                cm = l->data;
                /*
@@ -4628,7 +4628,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                 */
                if (!(cm->flags & METHOD_ATTRIBUTE_NEW_SLOT)) {
                        int slot = -1;
-                       for (k = class->parent; k ; k = k->parent) {
+                       for (k = klass->parent; k ; k = k->parent) {
                                gpointer k_iter;
                                MonoMethod *m1;
 
@@ -4640,7 +4640,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                        m1sig = mono_method_signature (m1);
 
                                        if (!cmsig || !m1sig) {
-                                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                                return;
                                        }
 
@@ -4648,7 +4648,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                            mono_metadata_signature_equal (cmsig, m1sig)) {
 
                                                if (mono_security_core_clr_enabled ())
-                                                       mono_security_core_clr_check_override (class, cm, m1);
+                                                       mono_security_core_clr_check_override (klass, cm, m1);
 
                                                slot = mono_method_get_vtable_slot (m1);
                                                if (slot == -1)
@@ -4657,7 +4657,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                                                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (cm, m1, NULL)) {
                                                        char *body_name = mono_method_full_name (cm, TRUE);
                                                        char *decl_name = mono_method_full_name (m1, TRUE);
-                                                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Method %s overrides method '%s' which is not accessible", body_name, decl_name));
                                                        g_free (body_name);
                                                        g_free (decl_name);
                                                        goto fail;
@@ -4709,7 +4709,7 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                        g_hash_table_insert (override_map, decl, overrides [i * 2 + 1]);
 
                        if (mono_security_core_clr_enabled ())
-                               mono_security_core_clr_check_override (class, vtable [decl->slot], decl);
+                               mono_security_core_clr_check_override (klass, vtable [decl->slot], decl);
                }
        }
 
@@ -4737,12 +4737,12 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
        virt_methods = NULL;
 
        /* Ensure that all vtable slots are filled with concrete instance methods */
-       if (!(class->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
+       if (!(klass->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
                for (i = 0; i < cur_slot; ++i) {
                        if (vtable [i] == NULL || (vtable [i]->flags & (METHOD_ATTRIBUTE_ABSTRACT | METHOD_ATTRIBUTE_STATIC))) {
-                               char *type_name = mono_type_get_full_name (class);
+                               char *type_name = mono_type_get_full_name (klass);
                                char *method_name = vtable [i] ? mono_method_full_name (vtable [i], TRUE) : g_strdup ("none");
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Type %s has invalid vtable method slot %d with method %s", type_name, i, method_name));
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Type %s has invalid vtable method slot %d with method %s", type_name, i, method_name));
                                g_free (type_name);
                                g_free (method_name);
                                return;
@@ -4750,42 +4750,42 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
                }
        }
 
-       if (class->generic_class) {
-               MonoClass *gklass = class->generic_class->container_class;
+       if (klass->generic_class) {
+               MonoClass *gklass = klass->generic_class->container_class;
 
                mono_class_init (gklass);
 
-               class->vtable_size = MAX (gklass->vtable_size, cur_slot);
+               klass->vtable_size = MAX (gklass->vtable_size, cur_slot);
        } else {
                /* Check that the vtable_size value computed in mono_class_init () is correct */
-               if (class->vtable_size)
-                       g_assert (cur_slot == class->vtable_size);
-               class->vtable_size = cur_slot;
+               if (klass->vtable_size)
+                       g_assert (cur_slot == klass->vtable_size);
+               klass->vtable_size = cur_slot;
        }
 
        /* Try to share the vtable with our parent. */
-       if (class->parent && (class->parent->vtable_size == class->vtable_size) && (memcmp (class->parent->vtable, vtable, sizeof (gpointer) * class->vtable_size) == 0)) {
+       if (klass->parent && (klass->parent->vtable_size == klass->vtable_size) && (memcmp (klass->parent->vtable, vtable, sizeof (gpointer) * klass->vtable_size) == 0)) {
                mono_memory_barrier ();
-               class->vtable = class->parent->vtable;
+               klass->vtable = klass->parent->vtable;
        } else {
-               MonoMethod **tmp = mono_class_alloc0 (class, sizeof (gpointer) * class->vtable_size);
-               memcpy (tmp, vtable,  sizeof (gpointer) * class->vtable_size);
+               MonoMethod **tmp = mono_class_alloc0 (klass, sizeof (gpointer) * klass->vtable_size);
+               memcpy (tmp, vtable,  sizeof (gpointer) * klass->vtable_size);
                mono_memory_barrier ();
-               class->vtable = tmp;
+               klass->vtable = tmp;
        }
 
-       DEBUG_INTERFACE_VTABLE (print_vtable_full (class, class->vtable, class->vtable_size, first_non_interface_slot, "FINALLY", FALSE));
+       DEBUG_INTERFACE_VTABLE (print_vtable_full (klass, klass->vtable, klass->vtable_size, first_non_interface_slot, "FINALLY", FALSE));
        if (mono_print_vtable) {
                int icount = 0;
 
-               print_implemented_interfaces (class);
+               print_implemented_interfaces (klass);
                
                for (i = 0; i <= max_iid; i++)
-                       if (MONO_CLASS_IMPLEMENTS_INTERFACE (class, i))
+                       if (MONO_CLASS_IMPLEMENTS_INTERFACE (klass, i))
                                icount++;
 
-               printf ("VTable %s (vtable entries = %d, interfaces = %d)\n", mono_type_full_name (&class->byval_arg), 
-                       class->vtable_size, icount); 
+               printf ("VTable %s (vtable entries = %d, interfaces = %d)\n", mono_type_full_name (&klass->byval_arg),
+                       klass->vtable_size, icount);
 
                for (i = 0; i < cur_slot; ++i) {
                        MonoMethod *cm;
@@ -4799,34 +4799,34 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
 
 
                if (icount) {
-                       printf ("Interfaces %s.%s (max_iid = %d)\n", class->name_space, 
-                               class->name, max_iid);
+                       printf ("Interfaces %s.%s (max_iid = %d)\n", klass->name_space,
+                               klass->name, max_iid);
        
-                       for (i = 0; i < class->interface_count; i++) {
-                               ic = class->interfaces [i];
+                       for (i = 0; i < klass->interface_count; i++) {
+                               ic = klass->interfaces [i];
                                printf ("  slot offset: %03d, method count: %03d, iid: %03d %s\n",  
-                                       mono_class_interface_offset (class, ic),
+                                       mono_class_interface_offset (klass, ic),
                                        count_virtual_methods (ic), ic->interface_id, mono_type_full_name (&ic->byval_arg));
                        }
 
-                       for (k = class->parent; k ; k = k->parent) {
+                       for (k = klass->parent; k ; k = k->parent) {
                                for (i = 0; i < k->interface_count; i++) {
                                        ic = k->interfaces [i]; 
                                        printf ("  parent slot offset: %03d, method count: %03d, iid: %03d %s\n",  
-                                               mono_class_interface_offset (class, ic),
+                                               mono_class_interface_offset (klass, ic),
                                                count_virtual_methods (ic), ic->interface_id, mono_type_full_name (&ic->byval_arg));
                                }
                        }
                }
        }
 
-       VERIFY_INTERFACE_VTABLE (mono_class_verify_vtable (class));
+       VERIFY_INTERFACE_VTABLE (mono_class_verify_vtable (klass));
        return;
 
 fail:
        {
-       char *name = mono_type_get_full_name (class);
-       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("VTable setup of type %s failed", name));
+       char *name = mono_type_get_full_name (klass);
+       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("VTable setup of type %s failed", name));
        g_free (name);
        if (override_map)
                g_hash_table_destroy (override_map);
@@ -4904,15 +4904,15 @@ static int finalize_slot = -1;
 static int ghc_slot = -1;
 
 static void
-initialize_object_slots (MonoClass *class)
+initialize_object_slots (MonoClass *klass)
 {
        int i;
        if (default_ghc)
                return;
-       if (class == mono_defaults.object_class) { 
-               mono_class_setup_vtable (class);                       
-               for (i = 0; i < class->vtable_size; ++i) {
-                       MonoMethod *cm = class->vtable [i];
+       if (klass == mono_defaults.object_class) {
+               mono_class_setup_vtable (klass);
+               for (i = 0; i < klass->vtable_size; ++i) {
+                       MonoMethod *cm = klass->vtable [i];
        
                        if (!strcmp (cm->name, "GetHashCode"))
                                ghc_slot = i;
@@ -4921,10 +4921,10 @@ initialize_object_slots (MonoClass *class)
                }
 
                g_assert (ghc_slot > 0);
-               default_ghc = class->vtable [ghc_slot];
+               default_ghc = klass->vtable [ghc_slot];
 
                g_assert (finalize_slot > 0);
-               default_finalize = class->vtable [finalize_slot];
+               default_finalize = klass->vtable [finalize_slot];
        }
 }
 
@@ -4937,16 +4937,16 @@ static int generic_array_method_num = 0;
 static GenericArrayMethodInfo *generic_array_method_info = NULL;
 
 static int
-generic_array_methods (MonoClass *class)
+generic_array_methods (MonoClass *klass)
 {
        int i, count_generic = 0;
        GList *list = NULL, *tmp;
        if (generic_array_method_num)
                return generic_array_method_num;
-       mono_class_setup_methods (class->parent); /*This is setting up System.Array*/
-       g_assert (!class->parent->exception_type); /*So hitting this assert is a huge problem*/
-       for (i = 0; i < class->parent->method.count; i++) {
-               MonoMethod *m = class->parent->methods [i];
+       mono_class_setup_methods (klass->parent); /*This is setting up System.Array*/
+       g_assert (!klass->parent->exception_type); /*So hitting this assert is a huge problem*/
+       for (i = 0; i < klass->parent->method.count; i++) {
+               MonoMethod *m = klass->parent->methods [i];
                if (!strncmp (m->name, "InternalArray__", 15)) {
                        count_generic++;
                        list = g_list_prepend (list, m);
@@ -4996,7 +4996,7 @@ generic_array_methods (MonoClass *class)
 }
 
 static void
-setup_generic_array_ifaces (MonoClass *class, MonoClass *iface, MonoMethod **methods, int pos)
+setup_generic_array_ifaces (MonoClass *klass, MonoClass *iface, MonoMethod **methods, int pos)
 {
        MonoGenericContext tmp_context;
        int i;
@@ -5012,7 +5012,7 @@ setup_generic_array_ifaces (MonoClass *class, MonoClass *iface, MonoMethod **met
 
                inflated = mono_class_inflate_generic_method_checked (m, &tmp_context, &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
-               methods [pos++] = mono_marshal_get_generic_array_helper (class, iface, generic_array_method_info [i].name, inflated);
+               methods [pos++] = mono_marshal_get_generic_array_helper (klass, iface, generic_array_method_info [i].name, inflated);
        }
 }
 
@@ -5031,17 +5031,17 @@ concat_two_strings_with_zero (MonoImage *image, const char *s1, const char *s2)
 }
 
 static void
-set_failure_from_loader_error (MonoClass *class, MonoLoaderError *error)
+set_failure_from_loader_error (MonoClass *klass, MonoLoaderError *error)
 {
        gpointer exception_data = NULL;
 
        switch (error->exception_type) {
        case MONO_EXCEPTION_TYPE_LOAD:
-               exception_data = concat_two_strings_with_zero (class->image, error->class_name, error->assembly_name);
+               exception_data = concat_two_strings_with_zero (klass->image, error->class_name, error->assembly_name);
                break;
 
        case MONO_EXCEPTION_MISSING_METHOD:
-               exception_data = concat_two_strings_with_zero (class->image, error->class_name, error->member_name);
+               exception_data = concat_two_strings_with_zero (klass->image, error->class_name, error->member_name);
                break;
 
        case MONO_EXCEPTION_MISSING_FIELD: {
@@ -5053,7 +5053,7 @@ set_failure_from_loader_error (MonoClass *class, MonoLoaderError *error)
                else
                        class_name = error->klass->name;
 
-               exception_data = concat_two_strings_with_zero (class->image, class_name, error->member_name);
+               exception_data = concat_two_strings_with_zero (klass->image, class_name, error->member_name);
                
                if (name_space)
                        g_free ((void*)class_name);
@@ -5068,7 +5068,7 @@ set_failure_from_loader_error (MonoClass *class, MonoLoaderError *error)
                else
                        msg = "Could not load file or assembly '%s' or one of its dependencies.";
 
-               exception_data = concat_two_strings_with_zero (class->image, msg, error->assembly_name);
+               exception_data = concat_two_strings_with_zero (klass->image, msg, error->assembly_name);
                break;
        }
 
@@ -5080,7 +5080,7 @@ set_failure_from_loader_error (MonoClass *class, MonoLoaderError *error)
                g_assert_not_reached ();
        }
 
-       mono_class_set_failure (class, error->exception_type, exception_data);
+       mono_class_set_failure (klass, error->exception_type, exception_data);
 }
 
 /**
@@ -5095,117 +5095,117 @@ set_failure_from_loader_error (MonoClass *class, MonoLoaderError *error)
  * LOCKING: Acquires the loader lock.
  */
 gboolean
-mono_class_init (MonoClass *class)
+mono_class_init (MonoClass *klass)
 {
        int i;
        MonoCachedClassInfo cached_info;
        gboolean has_cached_info;
        
-       g_assert (class);
+       g_assert (klass);
 
        /* Double-checking locking pattern */
-       if (class->inited || class->exception_type)
-               return class->exception_type == MONO_EXCEPTION_NONE;
+       if (klass->inited || klass->exception_type)
+               return klass->exception_type == MONO_EXCEPTION_NONE;
 
-       /*g_print ("Init class %s\n", mono_type_get_full_name (class));*/
+       /*g_print ("Init class %s\n", mono_type_get_full_name (klass));*/
 
        /* We do everything inside the lock to prevent races */
        mono_loader_lock ();
 
-       if (class->inited || class->exception_type) {
+       if (klass->inited || klass->exception_type) {
                mono_loader_unlock ();
                /* Somebody might have gotten in before us */
-               return class->exception_type == MONO_EXCEPTION_NONE;
+               return klass->exception_type == MONO_EXCEPTION_NONE;
        }
 
-       if (class->init_pending) {
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Recursive type definition detected"));
+       if (klass->init_pending) {
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Recursive type definition detected"));
                goto leave;
        }
 
-       class->init_pending = 1;
+       klass->init_pending = 1;
 
-       if (mono_verifier_is_enabled_for_class (class) && !mono_verifier_verify_class (class)) {
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, concat_two_strings_with_zero (class->image, class->name, class->image->assembly_name));
+       if (mono_verifier_is_enabled_for_class (klass) && !mono_verifier_verify_class (klass)) {
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, concat_two_strings_with_zero (klass->image, klass->name, klass->image->assembly_name));
                goto leave;
        }
 
 
-       if (class->byval_arg.type == MONO_TYPE_ARRAY || class->byval_arg.type == MONO_TYPE_SZARRAY) {
-               MonoClass *element_class = class->element_class;
+       if (klass->byval_arg.type == MONO_TYPE_ARRAY || klass->byval_arg.type == MONO_TYPE_SZARRAY) {
+               MonoClass *element_class = klass->element_class;
                if (!element_class->inited) 
                        mono_class_init (element_class);
                if (element_class->exception_type != MONO_EXCEPTION_NONE) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        goto leave;
                }
        }
 
        mono_stats.initialized_class_count++;
 
-       if (class->generic_class && !class->generic_class->is_dynamic) {
-               MonoClass *gklass = class->generic_class->container_class;
+       if (klass->generic_class && !klass->generic_class->is_dynamic) {
+               MonoClass *gklass = klass->generic_class->container_class;
 
                mono_stats.generic_class_count++;
 
-               class->method = gklass->method;
-               class->field = gklass->field;
+               klass->method = gklass->method;
+               klass->field = gklass->field;
 
                mono_class_init (gklass);
                // FIXME: Why is this needed ?
                if (!gklass->exception_type)
                        mono_class_setup_methods (gklass);
                if (gklass->exception_type) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Generic Type Defintion failed to init"));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Generic Type Defintion failed to init"));
                        goto leave;
                }
 
-               if (MONO_CLASS_IS_INTERFACE (class))
-                       class->interface_id = mono_get_unique_iid (class);
+               if (MONO_CLASS_IS_INTERFACE (klass))
+                       klass->interface_id = mono_get_unique_iid (klass);
        }
 
-       if (class->parent && !class->parent->inited)
-               mono_class_init (class->parent);
+       if (klass->parent && !klass->parent->inited)
+               mono_class_init (klass->parent);
 
-       has_cached_info = mono_class_get_cached_class_info (class, &cached_info);
+       has_cached_info = mono_class_get_cached_class_info (klass, &cached_info);
 
-       if (class->generic_class || image_is_dynamic (class->image) || !class->type_token || (has_cached_info && !cached_info.has_nested_classes))
-               class->nested_classes_inited = TRUE;
+       if (klass->generic_class || image_is_dynamic (klass->image) || !klass->type_token || (has_cached_info && !cached_info.has_nested_classes))
+               klass->nested_classes_inited = TRUE;
 
        /*
         * Computes the size used by the fields, and their locations
         */
        if (has_cached_info) {
-               class->instance_size = cached_info.instance_size;
-               class->sizes.class_size = cached_info.class_size;
-               class->packing_size = cached_info.packing_size;
-               class->min_align = cached_info.min_align;
-               class->blittable = cached_info.blittable;
-               class->has_references = cached_info.has_references;
-               class->has_static_refs = cached_info.has_static_refs;
-               class->no_special_static_fields = cached_info.no_special_static_fields;
+               klass->instance_size = cached_info.instance_size;
+               klass->sizes.class_size = cached_info.class_size;
+               klass->packing_size = cached_info.packing_size;
+               klass->min_align = cached_info.min_align;
+               klass->blittable = cached_info.blittable;
+               klass->has_references = cached_info.has_references;
+               klass->has_static_refs = cached_info.has_static_refs;
+               klass->no_special_static_fields = cached_info.no_special_static_fields;
        }
        else
-               if (!class->size_inited){
-                       mono_class_setup_fields (class);
-                       if (class->exception_type || mono_loader_get_last_error ())
+               if (!klass->size_inited){
+                       mono_class_setup_fields (klass);
+                       if (klass->exception_type || mono_loader_get_last_error ())
                                goto leave;
                }
                                
        /* Initialize arrays */
-       if (class->rank) {
-               class->method.count = 3 + (class->rank > 1? 2: 1);
+       if (klass->rank) {
+               klass->method.count = 3 + (klass->rank > 1? 2: 1);
 
-               if (class->interface_count) {
-                       int count_generic = generic_array_methods (class);
-                       class->method.count += class->interface_count * count_generic;
+               if (klass->interface_count) {
+                       int count_generic = generic_array_methods (klass);
+                       klass->method.count += klass->interface_count * count_generic;
                }
        }
 
-       mono_class_setup_supertypes (class);
+       mono_class_setup_supertypes (klass);
 
        if (!default_ghc)
-               initialize_object_slots (class);
+               initialize_object_slots (klass);
 
        /* 
         * Initialize the rest of the data without creating a generic vtable if possible.
@@ -5214,74 +5214,74 @@ mono_class_init (MonoClass *class)
         */
        if (has_cached_info) {
                /* AOT case */
-               class->vtable_size = cached_info.vtable_size;
-               class->has_finalize = cached_info.has_finalize;
-               class->has_finalize_inited = TRUE;
-               class->ghcimpl = cached_info.ghcimpl;
-               class->has_cctor = cached_info.has_cctor;
-       } else if (class->rank == 1 && class->byval_arg.type == MONO_TYPE_SZARRAY) {
+               klass->vtable_size = cached_info.vtable_size;
+               klass->has_finalize = cached_info.has_finalize;
+               klass->has_finalize_inited = TRUE;
+               klass->ghcimpl = cached_info.ghcimpl;
+               klass->has_cctor = cached_info.has_cctor;
+       } else if (klass->rank == 1 && klass->byval_arg.type == MONO_TYPE_SZARRAY) {
                /* SZARRAY can have 2 vtable layouts, with and without the stelemref method.
                 * The first slot if for array with.
                 */
                static int szarray_vtable_size[2] = { 0 };
 
-               int slot = MONO_TYPE_IS_REFERENCE (&class->element_class->byval_arg) ? 0 : 1;
+               int slot = MONO_TYPE_IS_REFERENCE (&klass->element_class->byval_arg) ? 0 : 1;
 
                /* SZARRAY case */
                if (!szarray_vtable_size [slot]) {
-                       mono_class_setup_vtable (class);
-                       szarray_vtable_size [slot] = class->vtable_size;
+                       mono_class_setup_vtable (klass);
+                       szarray_vtable_size [slot] = klass->vtable_size;
                } else {
-                       class->vtable_size = szarray_vtable_size[slot];
+                       klass->vtable_size = szarray_vtable_size[slot];
                }
-       } else if (class->generic_class && !MONO_CLASS_IS_INTERFACE (class)) {
-               MonoClass *gklass = class->generic_class->container_class;
+       } else if (klass->generic_class && !MONO_CLASS_IS_INTERFACE (klass)) {
+               MonoClass *gklass = klass->generic_class->container_class;
 
                /* Generic instance case */
-               class->ghcimpl = gklass->ghcimpl;
-               class->has_cctor = gklass->has_cctor;
+               klass->ghcimpl = gklass->ghcimpl;
+               klass->has_cctor = gklass->has_cctor;
 
                mono_class_setup_vtable (gklass);
                if (gklass->exception_type) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        goto leave;
                }
 
-               class->vtable_size = gklass->vtable_size;
+               klass->vtable_size = gklass->vtable_size;
        } else {
                /* General case */
 
                /* ghcimpl is not currently used
-               class->ghcimpl = 1;
-               if (class->parent) { 
-                       MonoMethod *cmethod = class->vtable [ghc_slot];
+               klass->ghcimpl = 1;
+               if (klass->parent) {
+                       MonoMethod *cmethod = klass->vtable [ghc_slot];
                        if (cmethod->is_inflated)
                                cmethod = ((MonoMethodInflated*)cmethod)->declaring;
                        if (cmethod == default_ghc) {
-                               class->ghcimpl = 0;
+                               klass->ghcimpl = 0;
                        }
                }
                */
 
                /* C# doesn't allow interfaces to have cctors */
-               if (!MONO_CLASS_IS_INTERFACE (class) || class->image != mono_defaults.corlib) {
+               if (!MONO_CLASS_IS_INTERFACE (klass) || klass->image != mono_defaults.corlib) {
                        MonoMethod *cmethod = NULL;
 
-                       if (class->type_token) {
-                               cmethod = find_method_in_metadata (class, ".cctor", 0, METHOD_ATTRIBUTE_SPECIAL_NAME);
+                       if (klass->type_token) {
+                               cmethod = find_method_in_metadata (klass, ".cctor", 0, METHOD_ATTRIBUTE_SPECIAL_NAME);
                                /* The find_method function ignores the 'flags' argument */
                                if (cmethod && (cmethod->flags & METHOD_ATTRIBUTE_SPECIAL_NAME))
-                                       class->has_cctor = 1;
+                                       klass->has_cctor = 1;
                        } else {
-                               mono_class_setup_methods (class);
-                               if (class->exception_type)
+                               mono_class_setup_methods (klass);
+                               if (klass->exception_type)
                                        goto leave;
 
-                               for (i = 0; i < class->method.count; ++i) {
-                                       MonoMethod *method = class->methods [i];
+                               for (i = 0; i < klass->method.count; ++i) {
+                                       MonoMethod *method = klass->methods [i];
                                        if ((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) && 
                                                (strcmp (".cctor", method->name) == 0)) {
-                                               class->has_cctor = 1;
+                                               klass->has_cctor = 1;
                                                break;
                                        }
                                }
@@ -5289,58 +5289,58 @@ mono_class_init (MonoClass *class)
                }
        }
 
-       if (class->parent) {
+       if (klass->parent) {
                int first_iface_slot;
-               /* This will compute class->parent->vtable_size for some classes */
-               mono_class_init (class->parent);
-               if (class->parent->exception_type) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               /* This will compute klass->parent->vtable_size for some classes */
+               mono_class_init (klass->parent);
+               if (klass->parent->exception_type) {
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        goto leave;
                }
                if (mono_loader_get_last_error ())
                        goto leave;
-               if (!class->parent->vtable_size) {
+               if (!klass->parent->vtable_size) {
                        /* FIXME: Get rid of this somehow */
-                       mono_class_setup_vtable (class->parent);
-                       if (class->parent->exception_type) {
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_setup_vtable (klass->parent);
+                       if (klass->parent->exception_type) {
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                                goto leave;
                        }
                        if (mono_loader_get_last_error ())
                                goto leave;
                }
-               first_iface_slot = class->parent->vtable_size;
-               if (mono_class_need_stelemref_method (class))
+               first_iface_slot = klass->parent->vtable_size;
+               if (mono_class_need_stelemref_method (klass))
                        ++first_iface_slot;
-               setup_interface_offsets (class, first_iface_slot, TRUE);
+               setup_interface_offsets (klass, first_iface_slot, TRUE);
        } else {
-               setup_interface_offsets (class, 0, TRUE);
+               setup_interface_offsets (klass, 0, TRUE);
        }
 
        if (mono_security_core_clr_enabled ())
-               mono_security_core_clr_check_inheritance (class);
+               mono_security_core_clr_check_inheritance (klass);
 
        if (mono_loader_get_last_error ()) {
-               if (class->exception_type == MONO_EXCEPTION_NONE) {
-                       set_failure_from_loader_error (class, mono_loader_get_last_error ());
+               if (klass->exception_type == MONO_EXCEPTION_NONE) {
+                       set_failure_from_loader_error (klass, mono_loader_get_last_error ());
                }
                mono_loader_clear_error ();
        }
 
-       if (class->generic_class && !mono_verifier_class_is_valid_generic_instantiation (class))
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Invalid generic instantiation"));
+       if (klass->generic_class && !mono_verifier_class_is_valid_generic_instantiation (klass))
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Invalid generic instantiation"));
 
        goto leave;
 
  leave:
        /* Because of the double-checking locking pattern */
        mono_memory_barrier ();
-       class->inited = 1;
-       class->init_pending = 0;
+       klass->inited = 1;
+       klass->init_pending = 0;
 
        mono_loader_unlock ();
 
-       return class->exception_type == MONO_EXCEPTION_NONE;
+       return klass->exception_type == MONO_EXCEPTION_NONE;
 }
 
 /*
@@ -5352,40 +5352,39 @@ mono_class_init (MonoClass *class)
 gboolean
 mono_class_has_finalizer (MonoClass *klass)
 {
-       MonoClass *class = klass;
        gboolean has_finalize = FALSE;
 
        if (klass->has_finalize_inited)
                return klass->has_finalize;
 
        /* Interfaces and valuetypes are not supposed to have finalizers */
-       if (!(MONO_CLASS_IS_INTERFACE (class) || class->valuetype)) {
+       if (!(MONO_CLASS_IS_INTERFACE (klass) || klass->valuetype)) {
                MonoMethod *cmethod = NULL;
 
-               if (class->rank == 1 && class->byval_arg.type == MONO_TYPE_SZARRAY) {
-               } else if (class->generic_class) {
-                       MonoClass *gklass = class->generic_class->container_class;
+               if (klass->rank == 1 && klass->byval_arg.type == MONO_TYPE_SZARRAY) {
+               } else if (klass->generic_class) {
+                       MonoClass *gklass = klass->generic_class->container_class;
 
                        has_finalize = mono_class_has_finalizer (gklass);
-               } else if (class->parent && class->parent->has_finalize) {
+               } else if (klass->parent && klass->parent->has_finalize) {
                        has_finalize = TRUE;
                } else {
-                       if (class->parent) {
+                       if (klass->parent) {
                                /*
                                 * Can't search in metadata for a method named Finalize, because that
                                 * ignores overrides.
                                 */
-                               mono_class_setup_vtable (class);
-                               if (class->exception_type || mono_loader_get_last_error ())
+                               mono_class_setup_vtable (klass);
+                               if (klass->exception_type || mono_loader_get_last_error ())
                                        cmethod = NULL;
                                else
-                                       cmethod = class->vtable [finalize_slot];
+                                       cmethod = klass->vtable [finalize_slot];
                        }
 
                        if (cmethod) {
-                               g_assert (class->vtable_size > finalize_slot);
+                               g_assert (klass->vtable_size > finalize_slot);
 
-                               if (class->parent) {
+                               if (klass->parent) {
                                        if (cmethod->is_inflated)
                                                cmethod = ((MonoMethodInflated*)cmethod)->declaring;
                                        if (cmethod != default_finalize)
@@ -5423,42 +5422,42 @@ mono_is_corlib_image (MonoImage *image)
  * LOCKING: this assumes the loader lock is held
  */
 void
-mono_class_setup_mono_type (MonoClass *class)
+mono_class_setup_mono_type (MonoClass *klass)
 {
-       const char *name = class->name;
-       const char *nspace = class->name_space;
-       gboolean is_corlib = mono_is_corlib_image (class->image);
+       const char *name = klass->name;
+       const char *nspace = klass->name_space;
+       gboolean is_corlib = mono_is_corlib_image (klass->image);
 
-       class->this_arg.byref = 1;
-       class->this_arg.data.klass = class;
-       class->this_arg.type = MONO_TYPE_CLASS;
-       class->byval_arg.data.klass = class;
-       class->byval_arg.type = MONO_TYPE_CLASS;
+       klass->this_arg.byref = 1;
+       klass->this_arg.data.klass = klass;
+       klass->this_arg.type = MONO_TYPE_CLASS;
+       klass->byval_arg.data.klass = klass;
+       klass->byval_arg.type = MONO_TYPE_CLASS;
 
        if (is_corlib && !strcmp (nspace, "System")) {
                if (!strcmp (name, "ValueType")) {
                        /*
                         * do not set the valuetype bit for System.ValueType.
-                        * class->valuetype = 1;
+                        * klass->valuetype = 1;
                         */
-                       class->blittable = TRUE;
+                       klass->blittable = TRUE;
                } else if (!strcmp (name, "Enum")) {
                        /*
                         * do not set the valuetype bit for System.Enum.
-                        * class->valuetype = 1;
+                        * klass->valuetype = 1;
                         */
-                       class->valuetype = 0;
-                       class->enumtype = 0;
+                       klass->valuetype = 0;
+                       klass->enumtype = 0;
                } else if (!strcmp (name, "Object")) {
-                       class->this_arg.type = class->byval_arg.type = MONO_TYPE_OBJECT;
+                       klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_OBJECT;
                } else if (!strcmp (name, "String")) {
-                       class->this_arg.type = class->byval_arg.type = MONO_TYPE_STRING;
+                       klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_STRING;
                } else if (!strcmp (name, "TypedReference")) {
-                       class->this_arg.type = class->byval_arg.type = MONO_TYPE_TYPEDBYREF;
+                       klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_TYPEDBYREF;
                }
        }
 
-       if (class->valuetype) {
+       if (klass->valuetype) {
                int t = MONO_TYPE_VALUETYPE;
 
                if (is_corlib && !strcmp (nspace, "System")) {
@@ -5468,7 +5467,7 @@ mono_class_setup_mono_type (MonoClass *class)
                                        t = MONO_TYPE_BOOLEAN;
                                } else if (!strcmp(name, "Byte")) {
                                        t = MONO_TYPE_U1;
-                                       class->blittable = TRUE;                                                
+                                       klass->blittable = TRUE;                                                
                                }
                                break;
                        case 'C':
@@ -5479,52 +5478,52 @@ mono_class_setup_mono_type (MonoClass *class)
                        case 'D':
                                if (!strcmp (name, "Double")) {
                                        t = MONO_TYPE_R8;
-                                       class->blittable = TRUE;                                                
+                                       klass->blittable = TRUE;                                                
                                }
                                break;
                        case 'I':
                                if (!strcmp (name, "Int32")) {
                                        t = MONO_TYPE_I4;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                } else if (!strcmp(name, "Int16")) {
                                        t = MONO_TYPE_I2;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                } else if (!strcmp(name, "Int64")) {
                                        t = MONO_TYPE_I8;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                } else if (!strcmp(name, "IntPtr")) {
                                        t = MONO_TYPE_I;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                }
                                break;
                        case 'S':
                                if (!strcmp (name, "Single")) {
                                        t = MONO_TYPE_R4;
-                                       class->blittable = TRUE;                                                
+                                       klass->blittable = TRUE;                                                
                                } else if (!strcmp(name, "SByte")) {
                                        t = MONO_TYPE_I1;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                }
                                break;
                        case 'U':
                                if (!strcmp (name, "UInt32")) {
                                        t = MONO_TYPE_U4;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                } else if (!strcmp(name, "UInt16")) {
                                        t = MONO_TYPE_U2;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                } else if (!strcmp(name, "UInt64")) {
                                        t = MONO_TYPE_U8;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                } else if (!strcmp(name, "UIntPtr")) {
                                        t = MONO_TYPE_U;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                }
                                break;
                        case 'T':
                                if (!strcmp (name, "TypedReference")) {
                                        t = MONO_TYPE_TYPEDBYREF;
-                                       class->blittable = TRUE;
+                                       klass->blittable = TRUE;
                                }
                                break;
                        case 'V':
@@ -5536,11 +5535,11 @@ mono_class_setup_mono_type (MonoClass *class)
                                break;
                        }
                }
-               class->this_arg.type = class->byval_arg.type = t;
+               klass->this_arg.type = klass->byval_arg.type = t;
        }
 
-       if (MONO_CLASS_IS_INTERFACE (class))
-               class->interface_id = mono_get_unique_iid (class);
+       if (MONO_CLASS_IS_INTERFACE (klass))
+               klass->interface_id = mono_get_unique_iid (klass);
 
 }
 
@@ -5552,16 +5551,16 @@ mono_class_setup_mono_type (MonoClass *class)
  * lacks the types that COM depends on (e.g. Variant on Silverlight).
  */
 static void
-init_com_from_comimport (MonoClass *class)
+init_com_from_comimport (MonoClass *klass)
 {
        /* we don't always allow COM initialization under the CoreCLR (e.g. Moonlight does not require it) */
        if (mono_security_core_clr_enabled ()) {
                /* but some other CoreCLR user could requires it for their platform (i.e. trusted) code */
-               if (!mono_security_core_clr_determine_platform_image (class->image)) {
+               if (!mono_security_core_clr_determine_platform_image (klass->image)) {
                        /* but it can not be made available for application (i.e. user code) since all COM calls
                         * are considered native calls. In this case we fail with a TypeLoadException (just like
                         * Silverlight 2 does */
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        return;
                }
        }
@@ -5574,30 +5573,30 @@ init_com_from_comimport (MonoClass *class)
  * LOCKING: this assumes the loader lock is held
  */
 void
-mono_class_setup_parent (MonoClass *class, MonoClass *parent)
+mono_class_setup_parent (MonoClass *klass, MonoClass *parent)
 {
        gboolean system_namespace;
-       gboolean is_corlib = mono_is_corlib_image (class->image);
+       gboolean is_corlib = mono_is_corlib_image (klass->image);
 
-       system_namespace = !strcmp (class->name_space, "System") && is_corlib;
+       system_namespace = !strcmp (klass->name_space, "System") && is_corlib;
 
        /* if root of the hierarchy */
-       if (system_namespace && !strcmp (class->name, "Object")) {
-               class->parent = NULL;
-               class->instance_size = sizeof (MonoObject);
+       if (system_namespace && !strcmp (klass->name, "Object")) {
+               klass->parent = NULL;
+               klass->instance_size = sizeof (MonoObject);
                return;
        }
-       if (!strcmp (class->name, "<Module>")) {
-               class->parent = NULL;
-               class->instance_size = 0;
+       if (!strcmp (klass->name, "<Module>")) {
+               klass->parent = NULL;
+               klass->instance_size = 0;
                return;
        }
 
-       if (!MONO_CLASS_IS_INTERFACE (class)) {
+       if (!MONO_CLASS_IS_INTERFACE (klass)) {
                /* Imported COM Objects always derive from __ComObject. */
 #ifndef DISABLE_COM
-               if (MONO_CLASS_IS_IMPORT (class)) {
-                       init_com_from_comimport (class);
+               if (MONO_CLASS_IS_IMPORT (klass)) {
+                       init_com_from_comimport (klass);
                        if (parent == mono_defaults.object_class)
                                parent = mono_class_get_com_object_class ();
                }
@@ -5605,10 +5604,10 @@ mono_class_setup_parent (MonoClass *class, MonoClass *parent)
                if (!parent) {
                        /* set the parent to something useful and safe, but mark the type as broken */
                        parent = mono_defaults.object_class;
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                }
 
-               class->parent = parent;
+               klass->parent = parent;
 
                if (parent->generic_class && !parent->name) {
                        /*
@@ -5620,41 +5619,41 @@ mono_class_setup_parent (MonoClass *class, MonoClass *parent)
                }
 
 #ifndef DISABLE_REMOTING
-               class->marshalbyref = parent->marshalbyref;
-               class->contextbound  = parent->contextbound;
+               klass->marshalbyref = parent->marshalbyref;
+               klass->contextbound  = parent->contextbound;
 #endif
 
-               class->delegate  = parent->delegate;
+               klass->delegate  = parent->delegate;
 
-               if (MONO_CLASS_IS_IMPORT (class) || mono_class_is_com_object (parent))
-                       mono_class_set_is_com_object (class);
+               if (MONO_CLASS_IS_IMPORT (klass) || mono_class_is_com_object (parent))
+                       mono_class_set_is_com_object (klass);
                
                if (system_namespace) {
 #ifndef DISABLE_REMOTING
-                       if (*class->name == 'M' && !strcmp (class->name, "MarshalByRefObject"))
-                               class->marshalbyref = 1;
+                       if (klass->name [0] == 'M' && !strcmp (klass->name, "MarshalByRefObject"))
+                               klass->marshalbyref = 1;
 
-                       if (*class->name == 'C' && !strcmp (class->name, "ContextBoundObject")) 
-                               class->contextbound  = 1;
+                       if (klass->name [0] == 'C' && !strcmp (klass->name, "ContextBoundObject")) 
+                               klass->contextbound  = 1;
 #endif
-                       if (*class->name == 'D' && !strcmp (class->name, "Delegate")) 
-                               class->delegate  = 1;
+                       if (klass->name [0] == 'D' && !strcmp (klass->name, "Delegate")) 
+                               klass->delegate  = 1;
                }
 
-               if (class->parent->enumtype || (mono_is_corlib_image (class->parent->image) && (strcmp (class->parent->name, "ValueType") == 0) && 
-                                               (strcmp (class->parent->name_space, "System") == 0)))
-                       class->valuetype = 1;
-               if (mono_is_corlib_image (class->parent->image) && ((strcmp (class->parent->name, "Enum") == 0) && (strcmp (class->parent->name_space, "System") == 0))) {
-                       class->valuetype = class->enumtype = 1;
+               if (klass->parent->enumtype || (mono_is_corlib_image (klass->parent->image) && (strcmp (klass->parent->name, "ValueType") == 0) && 
+                                               (strcmp (klass->parent->name_space, "System") == 0)))
+                       klass->valuetype = 1;
+               if (mono_is_corlib_image (klass->parent->image) && ((strcmp (klass->parent->name, "Enum") == 0) && (strcmp (klass->parent->name_space, "System") == 0))) {
+                       klass->valuetype = klass->enumtype = 1;
                }
-               /*class->enumtype = class->parent->enumtype; */
+               /*klass->enumtype = klass->parent->enumtype; */
        } else {
                /* initialize com types if COM interfaces are present */
 #ifndef DISABLE_COM
-               if (MONO_CLASS_IS_IMPORT (class))
-                       init_com_from_comimport (class);
+               if (MONO_CLASS_IS_IMPORT (klass))
+                       init_com_from_comimport (klass);
 #endif
-               class->parent = NULL;
+               klass->parent = NULL;
        }
 
 }
@@ -5673,33 +5672,33 @@ mono_class_setup_parent (MonoClass *class, MonoClass *parent)
  * LOCKING: This function is atomic, in case of contention we waste memory.
  */
 void
-mono_class_setup_supertypes (MonoClass *class)
+mono_class_setup_supertypes (MonoClass *klass)
 {
        int ms;
        MonoClass **supertypes;
 
-       mono_atomic_load_acquire (supertypes, void*, &class->supertypes);
+       mono_atomic_load_acquire (supertypes, void*, &klass->supertypes);
        if (supertypes)
                return;
 
-       if (class->parent && !class->parent->supertypes)
-               mono_class_setup_supertypes (class->parent);
-       if (class->parent)
-               class->idepth = class->parent->idepth + 1;
+       if (klass->parent && !klass->parent->supertypes)
+               mono_class_setup_supertypes (klass->parent);
+       if (klass->parent)
+               klass->idepth = klass->parent->idepth + 1;
        else
-               class->idepth = 1;
+               klass->idepth = 1;
 
-       ms = MAX (MONO_DEFAULT_SUPERTABLE_SIZE, class->idepth);
-       supertypes = mono_class_alloc0 (class, sizeof (MonoClass *) * ms);
+       ms = MAX (MONO_DEFAULT_SUPERTABLE_SIZE, klass->idepth);
+       supertypes = mono_class_alloc0 (klass, sizeof (MonoClass *) * ms);
 
-       if (class->parent) {
-               supertypes [class->idepth - 1] = class;
-               memcpy (supertypes, class->parent->supertypes, class->parent->idepth * sizeof (gpointer));
+       if (klass->parent) {
+               supertypes [klass->idepth - 1] = klass;
+               memcpy (supertypes, klass->parent->supertypes, klass->parent->idepth * sizeof (gpointer));
        } else {
-               supertypes [0] = class;
+               supertypes [0] = klass;
        }
 
-       mono_atomic_store_release (&class->supertypes, supertypes);
+       mono_atomic_store_release (&klass->supertypes, supertypes);
 }
 
 static gboolean
@@ -5718,25 +5717,25 @@ fix_gclass_incomplete_instantiation (MonoClass *gclass, void *user_data)
 }
 
 static void
-mono_class_set_failure_and_error (MonoClass *class, MonoError *error, const char *msg)
+mono_class_set_failure_and_error (MonoClass *klass, MonoError *error, const char *msg)
 {
-       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (msg));
-       mono_error_set_type_load_class (error, class, msg);
+       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (msg));
+       mono_error_set_type_load_class (error, klass, msg);
 }
 
 static void
-mono_class_set_failure_from_loader_error (MonoClass *class, MonoError *error, char *msg)
+mono_class_set_failure_from_loader_error (MonoClass *klass, MonoError *error, char *msg)
 {
        MonoLoaderError *lerror = mono_loader_get_last_error ();
 
        if (lerror) {
-               set_failure_from_loader_error (class, lerror);
+               set_failure_from_loader_error (klass, lerror);
                mono_error_set_from_loader_error (error);
                if (msg)
                        g_free (msg);
        } else {
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, msg);
-               mono_error_set_type_load_class (error, class, msg);
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, msg);
+               mono_error_set_type_load_class (error, klass, msg);
        }
 }
 
@@ -5755,7 +5754,7 @@ static MonoClass *
 mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError *error)
 {
        MonoTableInfo *tt = &image->tables [MONO_TABLE_TYPEDEF];
-       MonoClass *class, *parent = NULL;
+       MonoClass *klass, *parent = NULL;
        guint32 cols [MONO_TYPEDEF_SIZE];
        guint32 cols_next [MONO_TYPEDEF_SIZE];
        guint tidx = mono_metadata_token_index (type_token);
@@ -5776,10 +5775,10 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        mono_loader_lock ();
 
-       if ((class = mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) {
+       if ((klass = mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) {
                mono_loader_unlock ();
                mono_loader_assert_no_error ();
-               return class;
+               return klass;
        }
 
        mono_metadata_decode_row (tt, tidx - 1, cols, MONO_TYPEDEF_SIZE);
@@ -5787,32 +5786,32 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]);
        nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
 
-       class = mono_image_alloc0 (image, sizeof (MonoClass));
+       klass = mono_image_alloc0 (image, sizeof (MonoClass));
 
-       class->name = name;
-       class->name_space = nspace;
+       klass->name = name;
+       klass->name_space = nspace;
 
-       mono_profiler_class_event (class, MONO_PROFILE_START_LOAD);
+       mono_profiler_class_event (klass, MONO_PROFILE_START_LOAD);
 
-       class->image = image;
-       class->type_token = type_token;
-       class->flags = cols [MONO_TYPEDEF_FLAGS];
+       klass->image = image;
+       klass->type_token = type_token;
+       klass->flags = cols [MONO_TYPEDEF_FLAGS];
 
-       mono_internal_hash_table_insert (&image->class_cache, GUINT_TO_POINTER (type_token), class);
+       mono_internal_hash_table_insert (&image->class_cache, GUINT_TO_POINTER (type_token), klass);
 
        classes_size += sizeof (MonoClass);
 
        /*
         * Check whether we're a generic type definition.
         */
-       class->generic_container = mono_metadata_load_generic_params (image, class->type_token, NULL);
-       if (class->generic_container) {
-               class->is_generic = 1;
-               class->generic_container->owner.klass = class;
-               context = &class->generic_container->context;
+       klass->generic_container = mono_metadata_load_generic_params (image, klass->type_token, NULL);
+       if (klass->generic_container) {
+               klass->is_generic = 1;
+               klass->generic_container->owner.klass = klass;
+               context = &klass->generic_container->context;
        }
 
-       if (class->generic_container)
+       if (klass->generic_container)
                enable_gclass_recording ();
 
        if (cols [MONO_TYPEDEF_EXTENDS]) {
@@ -5821,80 +5820,80 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
                if (mono_metadata_token_table (parent_token) == MONO_TABLE_TYPESPEC) {
                        /*WARNING: this must satisfy mono_metadata_type_hash*/
-                       class->this_arg.byref = 1;
-                       class->this_arg.data.klass = class;
-                       class->this_arg.type = MONO_TYPE_CLASS;
-                       class->byval_arg.data.klass = class;
-                       class->byval_arg.type = MONO_TYPE_CLASS;
+                       klass->this_arg.byref = 1;
+                       klass->this_arg.data.klass = klass;
+                       klass->this_arg.type = MONO_TYPE_CLASS;
+                       klass->byval_arg.data.klass = klass;
+                       klass->byval_arg.type = MONO_TYPE_CLASS;
                }
                parent = mono_class_get_checked (image, parent_token, error);
                if (parent && context) /* Always inflate */
                        parent = mono_class_inflate_generic_class_checked (parent, context, error);
 
                if (parent == NULL) {
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        goto parent_failure;
                }
 
                for (tmp = parent; tmp; tmp = tmp->parent) {
-                       if (tmp == class) {
-                               mono_class_set_failure_and_error (class, error, "Cycle found while resolving parent");
+                       if (tmp == klass) {
+                               mono_class_set_failure_and_error (klass, error, "Cycle found while resolving parent");
                                goto parent_failure;
                        }
-                       if (class->generic_container && tmp->generic_class && tmp->generic_class->container_class == class) {
-                               mono_class_set_failure_and_error (class, error, "Parent extends generic instance of this type");
+                       if (klass->generic_container && tmp->generic_class && tmp->generic_class->container_class == klass) {
+                               mono_class_set_failure_and_error (klass, error, "Parent extends generic instance of this type");
                                goto parent_failure;
                        }
                }
        }
 
-       mono_class_setup_parent (class, parent);
+       mono_class_setup_parent (klass, parent);
 
        /* uses ->valuetype, which is initialized by mono_class_setup_parent above */
-       mono_class_setup_mono_type (class);
+       mono_class_setup_mono_type (klass);
 
-       if (class->generic_container)
-               disable_gclass_recording (fix_gclass_incomplete_instantiation, class);
+       if (klass->generic_container)
+               disable_gclass_recording (fix_gclass_incomplete_instantiation, klass);
 
        /* 
-        * This might access class->byval_arg for recursion generated by generic constraints,
+        * This might access klass->byval_arg for recursion generated by generic constraints,
         * so it has to come after setup_mono_type ().
         */
        if ((nesting_tokeen = mono_metadata_nested_in_typedef (image, type_token))) {
-               class->nested_in = mono_class_create_from_typedef (image, nesting_tokeen, error);
+               klass->nested_in = mono_class_create_from_typedef (image, nesting_tokeen, error);
                if (!mono_error_ok (error)) {
                        /*FIXME implement a mono_class_set_failure_from_mono_error */
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
-                       mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
+                       mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                        mono_loader_assert_no_error ();
                        return NULL;
                }
        }
 
-       if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
-               class->unicode = 1;
+       if ((klass->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
+               klass->unicode = 1;
 
 #ifdef HOST_WIN32
-       if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
-               class->unicode = 1;
+       if ((klass->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
+               klass->unicode = 1;
 #endif
 
-       class->cast_class = class->element_class = class;
+       klass->cast_class = klass->element_class = klass;
 
-       if (!class->enumtype) {
+       if (!klass->enumtype) {
                if (!mono_metadata_interfaces_from_typedef_full (
                            image, type_token, &interfaces, &icount, FALSE, context, error)){
 
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
-                       mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
+                       mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                        return NULL;
                }
 
-               class->interfaces = interfaces;
-               class->interface_count = icount;
-               class->interfaces_inited = 1;
+               klass->interfaces = interfaces;
+               klass->interface_count = icount;
+               klass->interfaces_inited = 1;
        }
 
        /*g_print ("Load class %s\n", name);*/
@@ -5902,8 +5901,8 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        /*
         * Compute the field and method lists
         */
-       class->field.first  = cols [MONO_TYPEDEF_FIELD_LIST] - 1;
-       class->method.first = cols [MONO_TYPEDEF_METHOD_LIST] - 1;
+       klass->field.first  = cols [MONO_TYPEDEF_FIELD_LIST] - 1;
+       klass->method.first = cols [MONO_TYPEDEF_METHOD_LIST] - 1;
 
        if (tt->rows > tidx){           
                mono_metadata_decode_row (tt, tidx, cols_next, MONO_TYPEDEF_SIZE);
@@ -5916,33 +5915,33 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        if (cols [MONO_TYPEDEF_FIELD_LIST] && 
            cols [MONO_TYPEDEF_FIELD_LIST] <= image->tables [MONO_TABLE_FIELD].rows)
-               class->field.count = field_last - class->field.first;
+               klass->field.count = field_last - klass->field.first;
        else
-               class->field.count = 0;
+               klass->field.count = 0;
 
        if (cols [MONO_TYPEDEF_METHOD_LIST] <= image->tables [MONO_TABLE_METHOD].rows)
-               class->method.count = method_last - class->method.first;
+               klass->method.count = method_last - klass->method.first;
        else
-               class->method.count = 0;
+               klass->method.count = 0;
 
        /* reserve space to store vector pointer in arrays */
        if (mono_is_corlib_image (image) && !strcmp (nspace, "System") && !strcmp (name, "Array")) {
-               class->instance_size += 2 * sizeof (gpointer);
-               g_assert (class->field.count == 0);
+               klass->instance_size += 2 * sizeof (gpointer);
+               g_assert (klass->field.count == 0);
        }
 
-       if (class->enumtype) {
-               MonoType *enum_basetype = mono_class_find_enum_basetype (class, error);
+       if (klass->enumtype) {
+               MonoType *enum_basetype = mono_class_find_enum_basetype (klass, error);
                if (!enum_basetype) {
                        /*set it to a default value as the whole runtime can't handle this to be null*/
-                       class->cast_class = class->element_class = mono_defaults.int32_class;
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
+                       klass->cast_class = klass->element_class = mono_defaults.int32_class;
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
-                       mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
+                       mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                        mono_loader_assert_no_error ();
                        return NULL;
                }
-               class->cast_class = class->element_class = mono_class_from_mono_type (enum_basetype);
+               klass->cast_class = klass->element_class = mono_class_from_mono_type (enum_basetype);
        }
 
        /*
@@ -5950,30 +5949,30 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
         * We must do this after the class has been constructed to make certain recursive scenarios
         * work.
         */
-       if (class->generic_container && !mono_metadata_load_generic_param_constraints_checked (image, type_token, class->generic_container, error)) {
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
+       if (klass->generic_container && !mono_metadata_load_generic_param_constraints_checked (image, type_token, klass->generic_container, error)) {
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
                mono_loader_unlock ();
-               mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
+               mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                mono_loader_assert_no_error ();
                return NULL;
        }
 
-       if (class->image->assembly_name && !strcmp (class->image->assembly_name, "Mono.Simd") && !strcmp (nspace, "Mono.Simd")) {
+       if (klass->image->assembly_name && !strcmp (klass->image->assembly_name, "Mono.Simd") && !strcmp (nspace, "Mono.Simd")) {
                if (!strncmp (name, "Vector", 6))
-                       class->simd_type = !strcmp (name + 6, "2d") || !strcmp (name + 6, "2ul") || !strcmp (name + 6, "2l") || !strcmp (name + 6, "4f") || !strcmp (name + 6, "4ui") || !strcmp (name + 6, "4i") || !strcmp (name + 6, "8s") || !strcmp (name + 6, "8us") || !strcmp (name + 6, "16b") || !strcmp (name + 6, "16sb");
+                       klass->simd_type = !strcmp (name + 6, "2d") || !strcmp (name + 6, "2ul") || !strcmp (name + 6, "2l") || !strcmp (name + 6, "4f") || !strcmp (name + 6, "4ui") || !strcmp (name + 6, "4i") || !strcmp (name + 6, "8s") || !strcmp (name + 6, "8us") || !strcmp (name + 6, "16b") || !strcmp (name + 6, "16sb");
        }
 
        mono_loader_unlock ();
 
-       mono_profiler_class_loaded (class, MONO_PROFILE_OK);
+       mono_profiler_class_loaded (klass, MONO_PROFILE_OK);
        mono_loader_assert_no_error ();
 
-       return class;
+       return klass;
 
 parent_failure:
-       mono_class_setup_mono_type (class);
+       mono_class_setup_mono_type (klass);
        mono_loader_unlock ();
-       mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
+       mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
        mono_loader_assert_no_error ();
        return NULL;
 }
@@ -6617,7 +6616,7 @@ MonoClass *
 mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
 {
        MonoImage *image;
-       MonoClass *class;
+       MonoClass *klass;
        MonoClass *parent = NULL;
        GSList *list, *rootlist = NULL;
        int nsize;
@@ -6641,10 +6640,10 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
                mono_mutex_lock (&image->szarray_cache_lock);
                if (!image->szarray_cache)
                        image->szarray_cache = g_hash_table_new (mono_aligned_addr_hash, NULL);
-               class = g_hash_table_lookup (image->szarray_cache, eclass);
+               klass = g_hash_table_lookup (image->szarray_cache, eclass);
                mono_mutex_unlock (&image->szarray_cache_lock);
-               if (class)
-                       return class;
+               if (klass)
+                       return klass;
 
                mono_loader_lock ();
        } else {
@@ -6655,10 +6654,10 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
 
                if ((rootlist = list = g_hash_table_lookup (image->array_cache, eclass))) {
                        for (; list; list = list->next) {
-                               class = list->data;
-                               if ((class->rank == rank) && (class->byval_arg.type == (((rank > 1) || bounded) ? MONO_TYPE_ARRAY : MONO_TYPE_SZARRAY))) {
+                               klass = list->data;
+                               if ((klass->rank == rank) && (klass->byval_arg.type == (((rank > 1) || bounded) ? MONO_TYPE_ARRAY : MONO_TYPE_SZARRAY))) {
                                        mono_loader_unlock ();
-                                       return class;
+                                       return klass;
                                }
                        }
                }
@@ -6674,10 +6673,10 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
                        mono_class_init (parent);
        }
 
-       class = mono_image_alloc0 (image, sizeof (MonoClass));
+       klass = mono_image_alloc0 (image, sizeof (MonoClass));
 
-       class->image = image;
-       class->name_space = eclass->name_space;
+       klass->image = image;
+       klass->name_space = eclass->name_space;
        nsize = strlen (eclass->name);
        name = g_malloc (nsize + 2 + rank + 1);
        memcpy (name, eclass->name, nsize);
@@ -6688,95 +6687,95 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
                name [nsize + rank] = '*';
        name [nsize + rank + bounded] = ']';
        name [nsize + rank + bounded + 1] = 0;
-       class->name = mono_image_strdup (image, name);
+       klass->name = mono_image_strdup (image, name);
        g_free (name);
 
-       mono_profiler_class_event (class, MONO_PROFILE_START_LOAD);
+       mono_profiler_class_event (klass, MONO_PROFILE_START_LOAD);
 
        classes_size += sizeof (MonoClass);
 
-       class->type_token = 0;
+       klass->type_token = 0;
        /* all arrays are marked serializable and sealed, bug #42779 */
-       class->flags = TYPE_ATTRIBUTE_CLASS | TYPE_ATTRIBUTE_SERIALIZABLE | TYPE_ATTRIBUTE_SEALED | TYPE_ATTRIBUTE_PUBLIC;
-       class->parent = parent;
-       class->instance_size = mono_class_instance_size (class->parent);
+       klass->flags = TYPE_ATTRIBUTE_CLASS | TYPE_ATTRIBUTE_SERIALIZABLE | TYPE_ATTRIBUTE_SEALED | TYPE_ATTRIBUTE_PUBLIC;
+       klass->parent = parent;
+       klass->instance_size = mono_class_instance_size (klass->parent);
 
        if (eclass->byval_arg.type == MONO_TYPE_TYPEDBYREF || eclass->byval_arg.type == MONO_TYPE_VOID) {
                /*Arrays of those two types are invalid.*/
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
        } else if (eclass->enumtype && !mono_class_enum_basetype (eclass)) {
                if (!eclass->ref_info_handle || eclass->wastypebuilder) {
                        g_warning ("Only incomplete TypeBuilder objects are allowed to be an enum without base_type");
                        g_assert (eclass->ref_info_handle && !eclass->wastypebuilder);
                }
                /* element_size -1 is ok as this is not an instantitable type*/
-               class->sizes.element_size = -1;
+               klass->sizes.element_size = -1;
        } else
-               class->sizes.element_size = mono_class_array_element_size (eclass);
+               klass->sizes.element_size = mono_class_array_element_size (eclass);
 
-       mono_class_setup_supertypes (class);
+       mono_class_setup_supertypes (klass);
 
        if (eclass->generic_class)
                mono_class_init (eclass);
        if (!eclass->size_inited)
                mono_class_setup_fields (eclass);
        if (eclass->exception_type) /*FIXME we fail the array type, but we have to let other fields be set.*/
-               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
 
-       class->has_references = MONO_TYPE_IS_REFERENCE (&eclass->byval_arg) || eclass->has_references? TRUE: FALSE;
+       klass->has_references = MONO_TYPE_IS_REFERENCE (&eclass->byval_arg) || eclass->has_references? TRUE: FALSE;
 
-       class->rank = rank;
+       klass->rank = rank;
        
        if (eclass->enumtype)
-               class->cast_class = eclass->element_class;
+               klass->cast_class = eclass->element_class;
        else
-               class->cast_class = eclass;
+               klass->cast_class = eclass;
 
-       switch (class->cast_class->byval_arg.type) {
+       switch (klass->cast_class->byval_arg.type) {
        case MONO_TYPE_I1:
-               class->cast_class = mono_defaults.byte_class;
+               klass->cast_class = mono_defaults.byte_class;
                break;
        case MONO_TYPE_U2:
-               class->cast_class = mono_defaults.int16_class;
+               klass->cast_class = mono_defaults.int16_class;
                break;
        case MONO_TYPE_U4:
 #if SIZEOF_VOID_P == 4
        case MONO_TYPE_I:
        case MONO_TYPE_U:
 #endif
-               class->cast_class = mono_defaults.int32_class;
+               klass->cast_class = mono_defaults.int32_class;
                break;
        case MONO_TYPE_U8:
 #if SIZEOF_VOID_P == 8
        case MONO_TYPE_I:
        case MONO_TYPE_U:
 #endif
-               class->cast_class = mono_defaults.int64_class;
+               klass->cast_class = mono_defaults.int64_class;
                break;
        default:
                break;
        }
 
-       class->element_class = eclass;
+       klass->element_class = eclass;
 
        if ((rank > 1) || bounded) {
                MonoArrayType *at = mono_image_alloc0 (image, sizeof (MonoArrayType));
-               class->byval_arg.type = MONO_TYPE_ARRAY;
-               class->byval_arg.data.array = at;
+               klass->byval_arg.type = MONO_TYPE_ARRAY;
+               klass->byval_arg.data.array = at;
                at->eklass = eclass;
                at->rank = rank;
                /* FIXME: complete.... */
        } else {
-               class->byval_arg.type = MONO_TYPE_SZARRAY;
-               class->byval_arg.data.klass = eclass;
+               klass->byval_arg.type = MONO_TYPE_SZARRAY;
+               klass->byval_arg.data.klass = eclass;
        }
-       class->this_arg = class->byval_arg;
-       class->this_arg.byref = 1;
+       klass->this_arg = klass->byval_arg;
+       klass->this_arg.byref = 1;
        if (corlib_type) {
-               class->inited = 1;
+               klass->inited = 1;
        }
 
-       class->generic_container = eclass->generic_container;
+       klass->generic_container = eclass->generic_container;
 
        if (rank == 1 && !bounded) {
                MonoClass *prev_class;
@@ -6785,20 +6784,20 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
                prev_class = g_hash_table_lookup (image->szarray_cache, eclass);
                if (prev_class)
                        /* Someone got in before us */
-                       class = prev_class;
+                       klass = prev_class;
                else
-                       g_hash_table_insert (image->szarray_cache, eclass, class);
+                       g_hash_table_insert (image->szarray_cache, eclass, klass);
                mono_mutex_unlock (&image->szarray_cache_lock);
        } else {
-               list = g_slist_append (rootlist, class);
+               list = g_slist_append (rootlist, klass);
                g_hash_table_insert (image->array_cache, eclass, list);
        }
 
        mono_loader_unlock ();
 
-       mono_profiler_class_loaded (class, MONO_PROFILE_OK);
+       mono_profiler_class_loaded (klass, MONO_PROFILE_OK);
 
-       return class;
+       return klass;
 }
 
 /**
@@ -6901,34 +6900,34 @@ mono_class_data_size (MonoClass *klass)
  * Takes a field index instead of a field token.
  */
 static MonoClassField *
-mono_class_get_field_idx (MonoClass *class, int idx)
+mono_class_get_field_idx (MonoClass *klass, int idx)
 {
-       mono_class_setup_fields_locking (class);
-       if (class->exception_type)
+       mono_class_setup_fields_locking (klass);
+       if (klass->exception_type)
                return NULL;
 
-       while (class) {
-               if (class->image->uncompressed_metadata) {
+       while (klass) {
+               if (klass->image->uncompressed_metadata) {
                        /* 
-                        * class->field.first points to the FieldPtr table, while idx points into the
+                        * klass->field.first points to the FieldPtr table, while idx points into the
                         * Field table, so we have to do a search.
                         */
                        /*FIXME this is broken for types with multiple fields with the same name.*/
-                       const char *name = mono_metadata_string_heap (class->image, mono_metadata_decode_row_col (&class->image->tables [MONO_TABLE_FIELD], idx, MONO_FIELD_NAME));
+                       const char *name = mono_metadata_string_heap (klass->image, mono_metadata_decode_row_col (&klass->image->tables [MONO_TABLE_FIELD], idx, MONO_FIELD_NAME));
                        int i;
 
-                       for (i = 0; i < class->field.count; ++i)
-                               if (mono_field_get_name (&class->fields [i]) == name)
-                                       return &class->fields [i];
+                       for (i = 0; i < klass->field.count; ++i)
+                               if (mono_field_get_name (&klass->fields [i]) == name)
+                                       return &klass->fields [i];
                        g_assert_not_reached ();
                } else {                        
-                       if (class->field.count) {
-                               if ((idx >= class->field.first) && (idx < class->field.first + class->field.count)){
-                                       return &class->fields [idx - class->field.first];
+                       if (klass->field.count) {
+                               if ((idx >= klass->field.first) && (idx < klass->field.first + klass->field.count)){
+                                       return &klass->fields [idx - klass->field.first];
                                }
                        }
                }
-               class = class->parent;
+               klass = klass->parent;
        }
        return NULL;
 }
@@ -6943,13 +6942,13 @@ mono_class_get_field_idx (MonoClass *class, int idx)
  * class.
  */
 MonoClassField *
-mono_class_get_field (MonoClass *class, guint32 field_token)
+mono_class_get_field (MonoClass *klass, guint32 field_token)
 {
        int idx = mono_metadata_token_index (field_token);
 
        g_assert (mono_metadata_token_code (field_token) == MONO_TOKEN_FIELD_DEF);
 
-       return mono_class_get_field_idx (class, idx - 1);
+       return mono_class_get_field_idx (klass, idx - 1);
 }
 
 /**
@@ -7331,29 +7330,29 @@ MonoClass *
 mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context)
 {
        MonoError error;
-       MonoClass *class;
-       class = mono_class_get_checked (image, type_token, &error);
+       MonoClass *klass;
+       klass = mono_class_get_checked (image, type_token, &error);
 
-       if (class && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
-               class = mono_class_inflate_generic_class_checked (class, context, &error);
+       if (klass && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
+               klass = mono_class_inflate_generic_class_checked (klass, context, &error);
 
        g_assert (mono_error_ok (&error)); /* FIXME deprecate this function and forbit the runtime from using it. */
-       return class;
+       return klass;
 }
 
 
 MonoClass *
 mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error)
 {
-       MonoClass *class;
+       MonoClass *klass;
 
        mono_error_init (error);
-       class = mono_class_get_checked (image, type_token, error);
+       klass = mono_class_get_checked (image, type_token, error);
 
-       if (class && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
-               class = mono_class_inflate_generic_class_checked (class, context, error);
+       if (klass && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
+               klass = mono_class_inflate_generic_class_checked (klass, context, error);
 
-       return class;
+       return klass;
 }
 /**
  * mono_class_get_checked:
@@ -7366,7 +7365,7 @@ mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_toke
 MonoClass *
 mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error)
 {
-       MonoClass *class = NULL;
+       MonoClass *klass = NULL;
 
        mono_error_init (error);
 
@@ -7377,19 +7376,19 @@ mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error)
                        mono_error_set_bad_image (error, image,"Bad token table for dynamic image: %x", table);
                        return NULL;
                }
-               class = mono_lookup_dynamic_token (image, type_token, NULL); /*FIXME proper error handling*/
+               klass = mono_lookup_dynamic_token (image, type_token, NULL); /*FIXME proper error handling*/
                goto done;
        }
 
        switch (type_token & 0xff000000){
        case MONO_TOKEN_TYPE_DEF:
-               class = mono_class_create_from_typedef (image, type_token, error);
+               klass = mono_class_create_from_typedef (image, type_token, error);
                break;          
        case MONO_TOKEN_TYPE_REF:
-               class = mono_class_from_typeref_checked (image, type_token, error);
+               klass = mono_class_from_typeref_checked (image, type_token, error);
                break;
        case MONO_TOKEN_TYPE_SPEC:
-               class = mono_class_create_from_typespec (image, type_token, NULL, error);
+               klass = mono_class_create_from_typespec (image, type_token, NULL, error);
                break;
        default:
                mono_error_set_bad_image (error, image, "Unknown type token %x", type_token & 0xff000000);
@@ -7397,13 +7396,13 @@ mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error)
 
 done:
        /* Generic case, should be avoided for when a better error is possible. */
-       if (!class && mono_error_ok (error)) {
+       if (!klass && mono_error_ok (error)) {
                char *name = mono_class_name_from_token (image, type_token);
                char *assembly = mono_assembly_name_from_token (image, type_token);
                mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
        }
 
-       return class;
+       return klass;
 }
 
 
@@ -7431,15 +7430,15 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
                return mono_class_get_type (mono_lookup_dynamic_token (image, type_token, context));
 
        if ((type_token & 0xff000000) != MONO_TOKEN_TYPE_SPEC) {
-               MonoClass *class = mono_class_get_checked (image, type_token, error);
+               MonoClass *klass = mono_class_get_checked (image, type_token, error);
 
-               if (!class) {
+               if (!klass) {
                        mono_loader_assert_no_error ();
                        return NULL;
                }
 
-               g_assert (class);
-               return mono_class_get_type (class);
+               g_assert (klass);
+               return mono_class_get_type (klass);
        }
 
        type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, error);
@@ -7691,7 +7690,7 @@ mono_class_from_name_case_checked (MonoImage *image, const char* name_space, con
 }
 
 static MonoClass*
-return_nested_in (MonoClass *class, char *nested)
+return_nested_in (MonoClass *klass, char *nested)
 {
        MonoClass *found;
        char *s = strchr (nested, '/');
@@ -7702,7 +7701,7 @@ return_nested_in (MonoClass *class, char *nested)
                s++;
        }
 
-       while ((found = mono_class_get_nested_types (class, &iter))) {
+       while ((found = mono_class_get_nested_types (klass, &iter))) {
                if (strcmp (found->name, nested) == 0) {
                        if (s)
                                return return_nested_in (found, s);
@@ -7717,7 +7716,7 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
 {
        MonoTableInfo *file_table = &image->tables [MONO_TABLE_FILE];
        MonoImage *file_image;
-       MonoClass *class;
+       MonoClass *klass;
        int i;
 
        /* 
@@ -7734,9 +7733,9 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
 
                file_image = mono_image_load_file_for_image (image, i + 1);
                if (file_image) {
-                       class = mono_class_from_name (file_image, name_space, name);
-                       if (class)
-                               return class;
+                       klass = mono_class_from_name (file_image, name_space, name);
+                       if (klass)
+                               return klass;
                }
        }
 
@@ -7750,7 +7749,7 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
        MonoImage *loaded_image;
        guint32 token = 0;
        int i;
-       MonoClass *class;
+       MonoClass *klass;
        char *nested;
        char buf [1024];
 
@@ -7775,14 +7774,14 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
 
        /* FIXME: get_class_from_name () can't handle types in the EXPORTEDTYPE table */
        if (get_class_from_name && image->tables [MONO_TABLE_EXPORTEDTYPE].rows == 0) {
-               gboolean res = get_class_from_name (image, name_space, name, &class);
+               gboolean res = get_class_from_name (image, name_space, name, &klass);
                if (res) {
-                       if (!class)
-                               class = search_modules (image, name_space, name);
+                       if (!klass)
+                               klass = search_modules (image, name_space, name);
                        if (nested)
-                               return class ? return_nested_in (class, nested) : NULL;
+                               return klass ? return_nested_in (klass, nested) : NULL;
                        else
-                               return class;
+                               return klass;
                }
        }
 
@@ -7801,16 +7800,16 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                for (i = 0; i < image->module_count; ++i) {
                        MonoImage *module = image->modules [i];
 
-                       class = mono_class_from_name (module, name_space, name);
-                       if (class)
-                               return class;
+                       klass = mono_class_from_name (module, name_space, name);
+                       if (klass)
+                               return klass;
                }
        }
 
        if (!token) {
-               class = search_modules (image, name_space, name);
-               if (class)
-                       return class;
+               klass = search_modules (image, name_space, name);
+               if (klass)
+                       return klass;
        }
 
        if (!token)
@@ -7830,10 +7829,10 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                        loaded_image = mono_assembly_load_module (image->assembly, impl >> MONO_IMPLEMENTATION_BITS);
                        if (!loaded_image)
                                return NULL;
-                       class = mono_class_from_name_checked_aux (loaded_image, name_space, name, error, visited_images);
+                       klass = mono_class_from_name_checked_aux (loaded_image, name_space, name, error, visited_images);
                        if (nested)
-                               return return_nested_in (class, nested);
-                       return class;
+                               return return_nested_in (klass, nested);
+                       return klass;
                } else if ((impl & MONO_IMPLEMENTATION_MASK) == MONO_IMPLEMENTATION_ASSEMBLYREF) {
                        guint32 assembly_idx;
 
@@ -7852,10 +7851,10 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
 
        token = MONO_TOKEN_TYPE_DEF | token;
 
-       class = mono_class_get_checked (image, token, error);
+       klass = mono_class_get_checked (image, token, error);
        if (nested)
-               return return_nested_in (class, nested);
-       return class;
+               return return_nested_in (klass, nested);
+       return klass;
 }
 
 MonoClass *
@@ -8629,7 +8628,7 @@ mono_ldtoken_checked (MonoImage *image, guint32 token, MonoClass **handle_class,
                return type;
        }
        case MONO_TOKEN_FIELD_DEF: {
-               MonoClass *class;
+               MonoClass *klass;
                guint32 type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
                if (!type) {
                        mono_error_set_bad_image (error, image, "Bad ldtoken %x", token);
@@ -8637,12 +8636,12 @@ mono_ldtoken_checked (MonoImage *image, guint32 token, MonoClass **handle_class,
                }
                if (handle_class)
                        *handle_class = mono_defaults.fieldhandle_class;
-               class = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_DEF | type, context, error);
-               if (!class)
+               klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_DEF | type, context, error);
+               if (!klass)
                        return NULL;
 
-               mono_class_init (class);
-               return mono_class_get_field (class, token);
+               mono_class_init (klass);
+               return mono_class_get_field (klass, token);
        }
        case MONO_TOKEN_METHOD_DEF:
        case MONO_TOKEN_METHOD_SPEC: {
@@ -9093,7 +9092,7 @@ mono_class_get_virtual_methods (MonoClass* klass, gpointer *iter)
                for (i = start_index; i < klass->method.count; ++i) {
                        guint32 flags;
 
-                       /* class->method.first points into the methodptr table */
+                       /* klass->method.first points into the methodptr table */
                        flags = mono_metadata_decode_table_row_col (klass->image, MONO_TABLE_METHOD, klass->method.first + i, MONO_METHOD_FLAGS);
 
                        if (flags & METHOD_ATTRIBUTE_VIRTUAL)
@@ -9661,7 +9660,7 @@ find_method_in_metadata (MonoClass *klass, const char *name, int param_count, in
                MonoMethod *method;
                MonoMethodSignature *sig;
 
-               /* class->method.first points into the methodptr table */
+               /* klass->method.first points into the methodptr table */
                mono_metadata_decode_table_row (klass->image, MONO_TABLE_METHOD, klass->method.first + i, cols, MONO_METHOD_SIZE);
 
                if (!strcmp (mono_metadata_string_heap (klass->image, cols [MONO_METHOD_NAME]), name)) {
@@ -9712,7 +9711,8 @@ mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int p
                if (res) {
                        MonoError error;
                        res = mono_class_inflate_generic_method_full_checked (res, klass, mono_class_get_context (klass), &error);
-                       g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
+                       if (!mono_error_ok (&error))
+                               mono_error_cleanup (&error); /*FIXME don't swallow the error */
                }
                return res;
        }
@@ -10395,11 +10395,11 @@ mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass)
  * LOCKING: Acquires the loader lock.
  */
 void
-mono_class_setup_interface_id (MonoClass *class)
+mono_class_setup_interface_id (MonoClass *klass)
 {
        mono_loader_lock ();
-       if (MONO_CLASS_IS_INTERFACE (class) && !class->interface_id)
-               class->interface_id = mono_get_unique_iid (class);
+       if (MONO_CLASS_IS_INTERFACE (klass) && !klass->interface_id)
+               klass->interface_id = mono_get_unique_iid (klass);
        mono_loader_unlock ();
 }
 
@@ -10428,7 +10428,7 @@ mono_class_alloc_ext (MonoClass *klass)
 /*
  * mono_class_setup_interfaces:
  *
- *   Initialize class->interfaces/interfaces_count.
+ *   Initialize klass->interfaces/interfaces_count.
  * LOCKING: Acquires the loader lock.
  * This function can fail the type.
  */
@@ -10496,10 +10496,10 @@ mono_class_setup_interfaces (MonoClass *klass, MonoError *error)
 static void
 mono_field_resolve_type (MonoClassField *field, MonoError *error)
 {
-       MonoClass *class = field->parent;
-       MonoImage *image = class->image;
-       MonoClass *gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL;
-       int field_idx = field - class->fields;
+       MonoClass *klass = field->parent;
+       MonoImage *image = klass->image;
+       MonoClass *gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       int field_idx = field - klass->fields;
 
        mono_error_init (error);
 
@@ -10508,38 +10508,38 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
                MonoType *gtype = mono_field_get_type_checked (gfield, error);
                if (!mono_error_ok (error)) {
                        char *err_msg = g_strdup_printf ("Could not load field %d type due to: %s", field_idx, mono_error_get_message (error));
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
                        g_free (err_msg);
                }
 
-               field->type = mono_class_inflate_generic_type_no_copy (image, gtype, mono_class_get_context (class), error);
+               field->type = mono_class_inflate_generic_type_no_copy (image, gtype, mono_class_get_context (klass), error);
                if (!mono_error_ok (error)) {
                        char *err_msg = g_strdup_printf ("Could not load field %d type due to: %s", field_idx, mono_error_get_message (error));
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
                        g_free (err_msg);
                }
        } else {
                const char *sig;
                guint32 cols [MONO_FIELD_SIZE];
                MonoGenericContainer *container = NULL;
-               int idx = class->field.first + field_idx;
+               int idx = klass->field.first + field_idx;
 
                /*FIXME, in theory we do not lazy load SRE fields*/
                g_assert (!image_is_dynamic (image));
 
-               if (class->generic_container) {
-                       container = class->generic_container;
+               if (klass->generic_container) {
+                       container = klass->generic_container;
                } else if (gtd) {
                        container = gtd->generic_container;
                        g_assert (container);
                }
 
-               /* class->field.first and idx points into the fieldptr table */
+               /* klass->field.first and idx points into the fieldptr table */
                mono_metadata_decode_table_row (image, MONO_TABLE_FIELD, idx, cols, MONO_FIELD_SIZE);
 
                if (!mono_verifier_verify_field_signature (image, cols [MONO_FIELD_SIGNATURE], NULL)) {
-                       mono_error_set_type_load_class (error, class, "Could not verify field %s signature", field->name);
-                       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_error_set_type_load_class (error, klass, "Could not verify field %s signature", field->name);
+                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        return;
                }
 
@@ -10548,26 +10548,26 @@ 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));
+                       mono_class_set_failure_from_loader_error (klass, error, g_strdup_printf ("Could not load field %s type", field->name));
        }
 }
 
 static guint32
 mono_field_resolve_flags (MonoClassField *field)
 {
-       MonoClass *class = field->parent;
-       MonoImage *image = class->image;
-       MonoClass *gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL;
-       int field_idx = field - class->fields;
+       MonoClass *klass = field->parent;
+       MonoImage *image = klass->image;
+       MonoClass *gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       int field_idx = field - klass->fields;
 
 
        if (gtd) {
                MonoClassField *gfield = &gtd->fields [field_idx];
                return mono_field_get_flags (gfield);
        } else {
-               int idx = class->field.first + field_idx;
+               int idx = klass->field.first + field_idx;
 
                /*FIXME, in theory we do not lazy load SRE fields*/
                g_assert (!image_is_dynamic (image));
@@ -10580,14 +10580,14 @@ mono_field_resolve_flags (MonoClassField *field)
  * mono_class_setup_basic_field_info:
  * @class: The class to initialize
  *
- * Initializes the class->fields array of fields.
+ * Initializes the klass->fields array of fields.
  * Aquires the loader lock.
  */
 static void
-mono_class_setup_basic_field_info_locking (MonoClass *class)
+mono_class_setup_basic_field_info_locking (MonoClass *klass)
 {
        mono_loader_lock ();
-       mono_class_setup_basic_field_info (class);
+       mono_class_setup_basic_field_info (klass);
        mono_loader_unlock ();
 }
 
index 14585755bc58a8baa3055a169bbf410798945802..dda430f3fc7390b25ef11129f7a3143fc6c703d0 100644 (file)
@@ -1689,13 +1689,13 @@ gpointer
 ves_icall_System_ComObject_GetInterfaceInternal (MonoComObject* obj, MonoReflectionType* type, MonoBoolean throw_exception)
 {
 #ifndef DISABLE_COM
-       MonoClass *class = mono_type_get_class (type->type);
-       if (!mono_class_init (class)) {
-               mono_set_pending_exception (mono_class_get_exception_for_failure (class));
+       MonoClass *klass = mono_type_get_class (type->type);
+       if (!mono_class_init (klass)) {
+               mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
                return NULL;
        }
 
-       return cominterop_get_interface (obj, class, (gboolean)throw_exception);
+       return cominterop_get_interface (obj, klass, (gboolean)throw_exception);
 #else
        g_assert_not_reached ();
 #endif
index e8acbe99d1cfc46f07fdd46247b42c996ca15d57..f55443001b41a5fb7ea4fb50028ba95a6e254245 100644 (file)
@@ -72,21 +72,21 @@ wrapper_type_to_str (guint32 wrapper_type)
 #endif
 
 static void
-append_class_name (GString *res, MonoClass *class, gboolean include_namespace)
+append_class_name (GString *res, MonoClass *klass, gboolean include_namespace)
 {
-       if (!class) {
+       if (!klass) {
                g_string_append (res, "Unknown");
                return;
        }
-       if (class->nested_in) {
-               append_class_name (res, class->nested_in, include_namespace);
+       if (klass->nested_in) {
+               append_class_name (res, klass->nested_in, include_namespace);
                g_string_append_c (res, '/');
        }
-       if (include_namespace && *(class->name_space)) {
-               g_string_append (res, class->name_space);
+       if (include_namespace && *(klass->name_space)) {
+               g_string_append (res, klass->name_space);
                g_string_append_c (res, '.');
        }
-       g_string_append (res, class->name);
+       g_string_append (res, klass->name);
 }
 
 static MonoClass*
@@ -956,23 +956,24 @@ print_field_value (const char *field_ptr, MonoClassField *field, int type_offset
 }
 
 static void
-objval_describe (MonoClass *class, const char *addr)
+objval_describe (MonoClass *klass, const char *addr)
 {
        MonoClassField *field;
        MonoClass *p;
        const char *field_ptr;
        gssize type_offset = 0;
-       if (class->valuetype)
+
+       if (klass->valuetype)
                type_offset = -sizeof (MonoObject);
 
-       for (p = class; p != NULL; p = p->parent) {
+       for (p = klass; p != NULL; p = p->parent) {
                gpointer iter = NULL;
                int printed_header = FALSE;
                while ((field = mono_class_get_fields (p, &iter))) {
                        if (field->type->attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_HAS_FIELD_RVA))
                                continue;
 
-                       if (p != class && !printed_header) {
+                       if (p != klass && !printed_header) {
                                const char *sep;
                                g_print ("In class ");
                                sep = print_name_space (p);
@@ -995,8 +996,8 @@ objval_describe (MonoClass *class, const char *addr)
 void
 mono_object_describe_fields (MonoObject *obj)
 {
-       MonoClass *class = mono_object_class (obj);
-       objval_describe (class, (char*)obj);
+       MonoClass *klass = mono_object_class (obj);
+       objval_describe (klass, (char*)obj);
 }
 
 /**
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 eaf494042187afcc16174435084b7c7cbc75b909..cb5b857ea79066295db3560e34a39e087409b681 100644 (file)
@@ -2061,19 +2061,19 @@ ICALL_EXPORT MonoArray*
 ves_icall_Type_GetInterfaces (MonoReflectionType* type)
 {
        MonoError error;
-       MonoClass *class = mono_class_from_mono_type (type->type);
+       MonoClass *klass = mono_class_from_mono_type (type->type);
        MonoClass *parent;
        FillIfaceArrayData data = { 0 };
        int len;
 
        GHashTable *iface_hash = g_hash_table_new (get_interfaces_hash, NULL);
 
-       if (class->generic_class && class->generic_class->context.class_inst->is_open) {
-               data.context = mono_class_get_context (class);
-               class = class->generic_class->container_class;
+       if (klass->generic_class && klass->generic_class->context.class_inst->is_open) {
+               data.context = mono_class_get_context (klass);
+               klass = klass->generic_class->container_class;
        }
 
-       for (parent = class; parent; parent = parent->parent) {
+       for (parent = klass; parent; parent = parent->parent) {
                mono_class_setup_interfaces (parent, &error);
                if (!mono_error_ok (&error))
                        goto fail;
@@ -2111,7 +2111,7 @@ ICALL_EXPORT void
 ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType *iface, MonoArray **targets, MonoArray **methods)
 {
        gboolean variance_used;
-       MonoClass *class = mono_class_from_mono_type (type->type);
+       MonoClass *klass = mono_class_from_mono_type (type->type);
        MonoClass *iclass = mono_class_from_mono_type (iface->type);
        MonoReflectionMethod *member;
        MonoMethod* method;
@@ -2119,12 +2119,12 @@ ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType
        int i = 0, len, ioffset;
        MonoDomain *domain;
 
-       mono_class_init_or_throw (class);
+       mono_class_init_or_throw (klass);
        mono_class_init_or_throw (iclass);
 
-       mono_class_setup_vtable (class);
+       mono_class_setup_vtable (klass);
 
-       ioffset = mono_class_interface_offset_with_variance (class, iclass, &variance_used);
+       ioffset = mono_class_interface_offset_with_variance (klass, iclass, &variance_used);
        if (ioffset == -1)
                return;
 
@@ -2136,7 +2136,7 @@ ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType
        while ((method = mono_class_get_methods (iclass, &iter))) {
                member = mono_method_get_object (domain, method, iclass);
                mono_array_setref (*methods, i, member);
-               member = mono_method_get_object (domain, class->vtable [i + ioffset], class);
+               member = mono_method_get_object (domain, klass->vtable [i + ioffset], klass);
                mono_array_setref (*targets, i, member);
                
                i ++;
@@ -2161,22 +2161,22 @@ ves_icall_Type_GetPacking (MonoReflectionType *type, guint32 *packing, guint32 *
 ICALL_EXPORT MonoReflectionType*
 ves_icall_MonoType_GetElementType (MonoReflectionType *type)
 {
-       MonoClass *class;
+       MonoClass *klass;
 
        if (!type->type->byref && type->type->type == MONO_TYPE_SZARRAY)
                return mono_type_get_object (mono_object_domain (type), &type->type->data.klass->byval_arg);
 
-       class = mono_class_from_mono_type (type->type);
-       mono_class_init_or_throw (class);
+       klass = mono_class_from_mono_type (type->type);
+       mono_class_init_or_throw (klass);
 
        // GetElementType should only return a type for:
        // Array Pointer PassedByRef
        if (type->type->byref)
-               return mono_type_get_object (mono_object_domain (type), &class->byval_arg);
-       else if (class->element_class && MONO_CLASS_IS_ARRAY (class))
-               return mono_type_get_object (mono_object_domain (type), &class->element_class->byval_arg);
-       else if (class->element_class && type->type->type == MONO_TYPE_PTR)
-               return mono_type_get_object (mono_object_domain (type), &class->element_class->byval_arg);
+               return mono_type_get_object (mono_object_domain (type), &klass->byval_arg);
+       else if (klass->element_class && MONO_CLASS_IS_ARRAY (klass))
+               return mono_type_get_object (mono_object_domain (type), &klass->element_class->byval_arg);
+       else if (klass->element_class && type->type->type == MONO_TYPE_PTR)
+               return mono_type_get_object (mono_object_domain (type), &klass->element_class->byval_arg);
        else
                return NULL;
 }
@@ -2187,8 +2187,8 @@ ves_icall_get_type_parent (MonoReflectionType *type)
        if (type->type->byref)
                return NULL;
 
-       MonoClass *class = mono_class_from_mono_type (type->type);
-       return class->parent ? mono_type_get_object (mono_object_domain (type), &class->parent->byval_arg): NULL;
+       MonoClass *klass = mono_class_from_mono_type (type->type);
+       return klass->parent ? mono_type_get_object (mono_object_domain (type), &klass->parent->byval_arg): NULL;
 }
 
 ICALL_EXPORT MonoBoolean
@@ -2221,54 +2221,54 @@ ves_icall_type_iscomobject (MonoReflectionType *type)
 ICALL_EXPORT MonoReflectionModule*
 ves_icall_MonoType_get_Module (MonoReflectionType *type)
 {
-       MonoClass *class = mono_class_from_mono_type (type->type);
-       return mono_module_get_object (mono_object_domain (type), class->image);
+       MonoClass *klass = mono_class_from_mono_type (type->type);
+       return mono_module_get_object (mono_object_domain (type), klass->image);
 }
 
 ICALL_EXPORT MonoReflectionAssembly*
 ves_icall_MonoType_get_Assembly (MonoReflectionType *type)
 {
        MonoDomain *domain = mono_domain_get (); 
-       MonoClass *class = mono_class_from_mono_type (type->type);
-       return mono_assembly_get_object (domain, class->image->assembly);
+       MonoClass *klass = mono_class_from_mono_type (type->type);
+       return mono_assembly_get_object (domain, klass->image->assembly);
 }
 
 ICALL_EXPORT MonoReflectionType*
 ves_icall_MonoType_get_DeclaringType (MonoReflectionType *type)
 {
        MonoDomain *domain = mono_domain_get ();
-       MonoClass *class;
+       MonoClass *klass;
 
        if (type->type->byref)
                return NULL;
        if (type->type->type == MONO_TYPE_VAR) {
                MonoGenericContainer *param = mono_type_get_generic_param_owner (type->type);
-               class = param ? param->owner.klass : NULL;
+               klass = param ? param->owner.klass : NULL;
        } else if (type->type->type == MONO_TYPE_MVAR) {
                MonoGenericContainer *param = mono_type_get_generic_param_owner (type->type);
-               class = param ? param->owner.method->klass : NULL;
+               klass = param ? param->owner.method->klass : NULL;
        } else {
-               class = mono_class_from_mono_type (type->type)->nested_in;
+               klass = mono_class_from_mono_type (type->type)->nested_in;
        }
 
-       return class ? mono_type_get_object (domain, &class->byval_arg) : NULL;
+       return klass ? mono_type_get_object (domain, &klass->byval_arg) : NULL;
 }
 
 ICALL_EXPORT MonoString*
 ves_icall_MonoType_get_Name (MonoReflectionType *type)
 {
        MonoDomain *domain = mono_domain_get (); 
-       MonoClass *class = mono_class_from_mono_type (type->type);
+       MonoClass *klass = mono_class_from_mono_type (type->type);
 
        if (type->type->byref) {
-               char *n = g_strdup_printf ("%s&", class->name);
+               char *n = g_strdup_printf ("%s&", klass->name);
                MonoString *res = mono_string_new (domain, n);
 
                g_free (n);
 
                return res;
        } else {
-               return mono_string_new (domain, class->name);
+               return mono_string_new (domain, klass->name);
        }
 }
 
@@ -2276,30 +2276,30 @@ ICALL_EXPORT MonoString*
 ves_icall_MonoType_get_Namespace (MonoReflectionType *type)
 {
        MonoDomain *domain = mono_domain_get (); 
-       MonoClass *class = mono_class_from_mono_type (type->type);
+       MonoClass *klass = mono_class_from_mono_type (type->type);
 
-       while (class->nested_in)
-               class = class->nested_in;
+       while (klass->nested_in)
+               klass = klass->nested_in;
 
-       if (class->name_space [0] == '\0')
+       if (klass->name_space [0] == '\0')
                return NULL;
        else
-               return mono_string_new (domain, class->name_space);
+               return mono_string_new (domain, klass->name_space);
 }
 
 ICALL_EXPORT gint32
 ves_icall_MonoType_GetArrayRank (MonoReflectionType *type)
 {
-       MonoClass *class;
+       MonoClass *klass;
 
        if (type->type->type != MONO_TYPE_ARRAY && type->type->type != MONO_TYPE_SZARRAY) {
                mono_set_pending_exception (mono_get_exception_argument ("type", "Type must be an array type"));
                return 0;
        }
 
-       class = mono_class_from_mono_type (type->type);
+       klass = mono_class_from_mono_type (type->type);
 
-       return class->rank;
+       return klass->rank;
 }
 
 static MonoArray*
@@ -2383,7 +2383,7 @@ ves_icall_Type_GetGenericTypeDefinition_impl (MonoReflectionType *type)
 ICALL_EXPORT MonoReflectionType*
 ves_icall_Type_MakeGenericType (MonoReflectionType *type, MonoArray *type_array)
 {
-       MonoClass *class;
+       MonoClass *klass;
        MonoType *geninst, **types;
        int i, count;
 
@@ -2403,10 +2403,10 @@ ves_icall_Type_MakeGenericType (MonoReflectionType *type, MonoArray *type_array)
        if (!geninst)
                return NULL;
 
-       class = mono_class_from_mono_type (geninst);
+       klass = mono_class_from_mono_type (geninst);
 
        /*we might inflate to the GTD*/
-       if (class->generic_class && !mono_verifier_class_is_valid_generic_instantiation (class)) {
+       if (klass->generic_class && !mono_verifier_class_is_valid_generic_instantiation (klass)) {
                mono_set_pending_exception (mono_get_exception_argument ("typeArguments", "Invalid generic arguments"));
                return NULL;
        }
@@ -3121,16 +3121,20 @@ ves_icall_System_Enum_get_hashcode (MonoObject *eobj)
        g_assert (basetype);
 
        switch (basetype->type) {
-               case MONO_TYPE_I1:      
-                       return *((gint8*)data);
+               case MONO_TYPE_I1:       {
+                       gint8 value = *((gint8*)data);
+                       return ((int)value ^ (int)value << 8);
+               }
                case MONO_TYPE_U1:
                        return *((guint8*)data);
                case MONO_TYPE_CHAR:
                case MONO_TYPE_U2:
                        return *((guint16*)data);
                
-               case MONO_TYPE_I2:
-                       return *((gint16*)data);
+               case MONO_TYPE_I2: {
+                       gint16 value = *((gint16*)data);
+                       return ((int)(guint16)value | (((int)value) << 16));
+               }
                case MONO_TYPE_U4:
                        return *((guint32*)data);
                case MONO_TYPE_I4:
diff --git a/mono/metadata/image-internals.h b/mono/metadata/image-internals.h
new file mode 100644 (file)
index 0000000..3bfd955
--- /dev/null
@@ -0,0 +1,31 @@
+/* 
+ * Copyright 2015 Xamarin Inc
+ */
+#ifndef __MONO_METADATA_IMAGE_INTERNALS_H__
+#define __MONO_METADATA_IMAGE_INTERNALS_H__
+
+#ifdef CHECKED_BUILD
+
+#include <mono/metadata/image.h>
+#include <mono/metadata/metadata-internals.h>
+
+typedef struct
+{
+       MonoImage *image;
+       MonoImageSet *image_set;
+} MonoMemPoolOwner;
+
+static MonoMemPoolOwner mono_mempool_no_owner = {NULL,NULL};
+
+static gboolean
+check_mempool_owner_eq (MonoMemPoolOwner a, MonoMemPoolOwner b)
+{
+       return a.image == b.image && a.image_set == b.image_set;
+}
+
+MonoMemPoolOwner
+mono_find_mempool_owner (void *ptr);
+
+#endif /* CHECKED_BUILD */
+
+#endif /* __MONO_METADATA_IMAGE_INTERNALS_H__ */
index c4e28a542ec04ebacdff485c2ef86bb7e2280178..aaa7d313271d2dbf86c0032cf80a3cf77d4caf94 100644 (file)
@@ -38,6 +38,7 @@
 #include <mono/metadata/security-core-clr.h>
 #include <mono/metadata/verify-internals.h>
 #include <mono/metadata/verify.h>
+#include <mono/metadata/image-internals.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifdef HAVE_UNISTD_H
 
 #define INVALID_ADDRESS 0xffffffff
 
+// Amount initially reserved in each image's mempool.
+// FIXME: This number is arbitrary, a more practical number should be found
+#define INITIAL_IMAGE_SIZE    512
+
 /*
- * Keeps track of the various assemblies loaded
+ * The "loaded images" hashes keep track of the various assemblies and netmodules loaded
+ * There are four, for all combinations of [look up by path or assembly name?]
+ * and [normal or reflection-only load?, as in Assembly.ReflectionOnlyLoad]
  */
-static GHashTable *loaded_images_hash;
-static GHashTable *loaded_images_refonly_hash;
+enum {
+       IMAGES_HASH_PATH = 0,
+       IMAGES_HASH_PATH_REFONLY = 1,
+       IMAGES_HASH_NAME = 2,
+       IMAGES_HASH_NAME_REFONLY = 3,
+       IMAGES_HASH_COUNT = 4
+};
+static GHashTable *loaded_images_hashes [4] = {NULL, NULL, NULL, NULL};
+
+static GHashTable *get_loaded_images_hash (gboolean refonly)
+{
+       int idx = refonly ? IMAGES_HASH_PATH_REFONLY : IMAGES_HASH_PATH;
+       return loaded_images_hashes [idx];
+}
+
+static GHashTable *get_loaded_images_by_name_hash (gboolean refonly)
+{
+       int idx = refonly ? IMAGES_HASH_NAME_REFONLY : IMAGES_HASH_NAME;
+       return loaded_images_hashes [idx];
+}
 
 static gboolean debug_assembly_unload = FALSE;
 
@@ -199,8 +224,9 @@ mono_images_init (void)
 {
        mono_mutex_init_recursive (&images_mutex);
 
-       loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
-       loaded_images_refonly_hash = g_hash_table_new (g_str_hash, g_str_equal);
+       int hash_idx;
+       for(hash_idx = 0; hash_idx < IMAGES_HASH_COUNT; hash_idx++)
+               loaded_images_hashes [hash_idx] = g_hash_table_new (g_str_hash, g_str_equal);
 
        debug_assembly_unload = g_getenv ("MONO_DEBUG_ASSEMBLY_UNLOAD") != NULL;
 
@@ -222,12 +248,15 @@ mono_images_cleanup (void)
 
        mono_mutex_destroy (&images_mutex);
 
-       g_hash_table_iter_init (&iter, loaded_images_hash);
+       // If an assembly image is still loaded at shutdown, this could indicate managed code is still running.
+       // Reflection-only images being still loaded doesn't indicate anything as harmful, so we don't check for it.
+       g_hash_table_iter_init (&iter, get_loaded_images_hash (FALSE));
        while (g_hash_table_iter_next (&iter, NULL, (void**)&image))
                mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Assembly image '%s' still loaded at shutdown.", image->name);
 
-       g_hash_table_destroy (loaded_images_hash);
-       g_hash_table_destroy (loaded_images_refonly_hash);
+       int hash_idx;
+       for(hash_idx = 0; hash_idx < IMAGES_HASH_COUNT; hash_idx++)
+               g_hash_table_destroy (loaded_images_hashes [hash_idx]);
 
        mutex_inited = FALSE;
 }
@@ -668,17 +697,17 @@ mono_image_load_module (MonoImage *image, int idx)
 static gpointer
 class_key_extract (gpointer value)
 {
-       MonoClass *class = value;
+       MonoClass *klass = value;
 
-       return GUINT_TO_POINTER (class->type_token);
+       return GUINT_TO_POINTER (klass->type_token);
 }
 
 static gpointer*
 class_next_value (gpointer value)
 {
-       MonoClass *class = value;
+       MonoClass *klass = value;
 
-       return (gpointer*)&class->next_class_cache;
+       return (gpointer*)&klass->next_class_cache;
 }
 
 void
@@ -687,7 +716,7 @@ mono_image_init (MonoImage *image)
        mono_mutex_init_recursive (&image->lock);
        mono_mutex_init_recursive (&image->szarray_cache_lock);
 
-       image->mempool = mono_mempool_new_size (512);
+       image->mempool = mono_mempool_new_size (INITIAL_IMAGE_SIZE);
        mono_internal_hash_table_init (&image->class_cache,
                                       g_direct_hash,
                                       class_key_extract,
@@ -1123,23 +1152,35 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status,
        return do_mono_image_load (image, status, care_about_cli, care_about_pecoff);
 }
 
+/**
+ * mono_image_loaded:
+ * @name: path or assembly name of the image to load
+ * @refonly: Check with respect to reflection-only loads?
+ *
+ * This routine verifies that the given image is loaded.
+ * It checks either reflection-only loads only, or normal loads only, as specified by parameter.
+ *
+ * Returns: the loaded MonoImage, or NULL on failure.
+ */
 MonoImage *
 mono_image_loaded_full (const char *name, gboolean refonly)
 {
        MonoImage *res;
-       GHashTable *loaded_images = refonly ? loaded_images_refonly_hash : loaded_images_hash;
-        
+
        mono_images_lock ();
-       res = g_hash_table_lookup (loaded_images, name);
+       res = g_hash_table_lookup (get_loaded_images_hash (refonly), name);
+       if (!res)
+               res = g_hash_table_lookup (get_loaded_images_by_name_hash (refonly), name);
        mono_images_unlock ();
+
        return res;
 }
 
 /**
  * mono_image_loaded:
- * @name: name of the image to load
+ * @name: path or assembly name of the image to load
  *
- * This routine ensures that the given image is loaded.
+ * This routine verifies that the given image is loaded. Reflection-only loads do not count.
  *
  * Returns: the loaded MonoImage, or NULL on failure.
  */
@@ -1171,7 +1212,7 @@ MonoImage *
 mono_image_loaded_by_guid_full (const char *guid, gboolean refonly)
 {
        GuidData data;
-       GHashTable *loaded_images = refonly ? loaded_images_refonly_hash : loaded_images_hash;
+       GHashTable *loaded_images = get_loaded_images_hash (refonly);
        data.res = NULL;
        data.guid = guid;
 
@@ -1191,7 +1232,7 @@ static MonoImage *
 register_image (MonoImage *image)
 {
        MonoImage *image2;
-       GHashTable *loaded_images = image->ref_only ? loaded_images_refonly_hash : loaded_images_hash;
+       GHashTable *loaded_images = get_loaded_images_hash (image->ref_only);
 
        mono_images_lock ();
        image2 = g_hash_table_lookup (loaded_images, image->name);
@@ -1203,9 +1244,11 @@ register_image (MonoImage *image)
                mono_image_close (image);
                return image2;
        }
+
+       GHashTable *loaded_images_by_name = get_loaded_images_by_name_hash (image->ref_only);
        g_hash_table_insert (loaded_images, image->name, image);
-       if (image->assembly_name && (g_hash_table_lookup (loaded_images, image->assembly_name) == NULL))
-               g_hash_table_insert (loaded_images, (char *) image->assembly_name, image);      
+       if (image->assembly_name && (g_hash_table_lookup (loaded_images_by_name, image->assembly_name) == NULL))
+               g_hash_table_insert (loaded_images_by_name, (char *) image->assembly_name, image);
        mono_images_unlock ();
 
        return image;
@@ -1298,13 +1341,14 @@ MonoImage *
 mono_image_open_full (const char *fname, MonoImageOpenStatus *status, gboolean refonly)
 {
        MonoImage *image;
-       GHashTable *loaded_images;
+       GHashTable *loaded_images = get_loaded_images_hash (refonly);
        char *absfname;
        
        g_return_val_if_fail (fname != NULL, NULL);
        
 #ifdef HOST_WIN32
-       /* Load modules using LoadLibrary. */
+       // Win32 path: If we are running with mixed-mode assemblies enabled (ie have loaded mscoree.dll),
+       // then assemblies need to be loaded with LoadLibrary:
        if (!refonly && coree_module_handle) {
                HMODULE module_handle;
                guint16 *fname_utf16;
@@ -1315,8 +1359,8 @@ mono_image_open_full (const char *fname, MonoImageOpenStatus *status, gboolean r
 
                /* There is little overhead because the OS loader lock is held by LoadLibrary. */
                mono_images_lock ();
-               image = g_hash_table_lookup (loaded_images_hash, absfname);
-               if (image) {
+               image = g_hash_table_lookup (loaded_images, absfname);
+               if (image) { // Image already loaded
                        g_assert (image->is_module_handle);
                        if (image->has_entry_point && image->ref_count == 0) {
                                /* Increment reference count on images loaded outside of the runtime. */
@@ -1333,13 +1377,14 @@ mono_image_open_full (const char *fname, MonoImageOpenStatus *status, gboolean r
                        return image;
                }
 
+               // Image not loaded, load it now
                fname_utf16 = g_utf8_to_utf16 (absfname, -1, NULL, NULL, NULL);
                module_handle = MonoLoadImage (fname_utf16);
                if (status && module_handle == NULL)
                        last_error = GetLastError ();
 
                /* mono_image_open_from_module_handle is called by _CorDllMain. */
-               image = g_hash_table_lookup (loaded_images_hash, absfname);
+               image = g_hash_table_lookup (loaded_images, absfname);
                if (image)
                        mono_image_addref (image);
                mono_images_unlock ();
@@ -1382,17 +1427,17 @@ mono_image_open_full (const char *fname, MonoImageOpenStatus *status, gboolean r
         * the same image, we discard all but the first copy.
         */
        mono_images_lock ();
-       loaded_images = refonly ? loaded_images_refonly_hash : loaded_images_hash;
        image = g_hash_table_lookup (loaded_images, absfname);
        g_free (absfname);
-       
-       if (image){
+
+       if (image) { // Image already loaded
                mono_image_addref (image);
                mono_images_unlock ();
                return image;
        }
        mono_images_unlock ();
 
+       // Image not loaded, load it now
        image = do_mono_image_open (fname, status, TRUE, TRUE, refonly, FALSE);
        if (image == NULL)
                return NULL;
@@ -1604,12 +1649,12 @@ gboolean
 mono_image_close_except_pools (MonoImage *image)
 {
        MonoImage *image2;
-       GHashTable *loaded_images;
+       GHashTable *loaded_images, *loaded_images_by_name;
        int i;
 
        g_return_val_if_fail (image != NULL, FALSE);
 
-       /* 
+       /*
         * Atomically decrement the refcount and remove ourselves from the hash tables, so
         * register_image () can't grab an image which is being closed.
         */
@@ -1620,14 +1665,15 @@ mono_image_close_except_pools (MonoImage *image)
                return FALSE;
        }
 
-       loaded_images = image->ref_only ? loaded_images_refonly_hash : loaded_images_hash;
+       loaded_images         = get_loaded_images_hash (image->ref_only);
+       loaded_images_by_name = get_loaded_images_by_name_hash (image->ref_only);
        image2 = g_hash_table_lookup (loaded_images, image->name);
        if (image == image2) {
                /* This is not true if we are called from mono_image_open () */
                g_hash_table_remove (loaded_images, image->name);
        }
-       if (image->assembly_name && (g_hash_table_lookup (loaded_images, image->assembly_name) == image))
-               g_hash_table_remove (loaded_images, (char *) image->assembly_name);     
+       if (image->assembly_name && (g_hash_table_lookup (loaded_images_by_name, image->assembly_name) == image))
+               g_hash_table_remove (loaded_images_by_name, (char *) image->assembly_name);     
 
        mono_images_unlock ();
 
@@ -2481,11 +2527,81 @@ mono_image_property_remove (MonoImage *image, gpointer subject)
 }
 
 void
-mono_image_append_class_to_reflection_info_set (MonoClass *class)
+mono_image_append_class_to_reflection_info_set (MonoClass *klass)
 {
-       MonoImage *image = class->image;
+       MonoImage *image = klass->image;
        g_assert (image_is_dynamic (image));
        mono_image_lock (image);
-       image->reflection_info_unregister_classes = g_slist_prepend_mempool (image->mempool, image->reflection_info_unregister_classes, class);
+       image->reflection_info_unregister_classes = g_slist_prepend_mempool (image->mempool, image->reflection_info_unregister_classes, klass);
        mono_image_unlock (image);
 }
+
+#if CHECKED_BUILD
+
+// These are support for the mempool reference tracking feature in checked-build, but live in image.c due to use of static variables of this file.
+
+// Given an image and a pointer, return the mempool owner if it is either this image or one of its imagesets.
+static MonoMemPoolOwner
+check_for_mempool_owner (void *ptr, MonoImage *image)
+{
+       if (mono_mempool_contains_addr (image->mempool, ptr))
+       {
+               MonoMemPoolOwner owner = {image, NULL};
+               return owner;
+       }
+
+       GSList *l;
+       for (l = image->image_sets; l; l = l->next) {
+               MonoImageSet *set = l->data;
+
+               if (mono_mempool_contains_addr (set->mempool, ptr))
+               {
+                       MonoMemPoolOwner owner = {NULL, set};
+                       return owner;
+               }
+       }
+
+       return mono_mempool_no_owner;
+}
+
+/**
+ * mono_find_mempool_owner:
+ *
+ * Find the image or imageset, if any, which a given pointer is located in the memory of.
+ */
+MonoMemPoolOwner
+mono_find_mempool_owner (void *ptr)
+{
+       mono_images_lock ();
+
+       MonoMemPoolOwner owner = mono_mempool_no_owner;
+       gboolean searching = TRUE;
+
+       // Iterate over both by-path image hashes
+       const int hash_candidates[] = {IMAGES_HASH_PATH, IMAGES_HASH_PATH_REFONLY};
+       int hash_idx;
+       for (hash_idx = 0; searching && hash_idx < G_N_ELEMENTS (hash_candidates); hash_idx++)
+       {
+               GHashTable *target = loaded_images_hashes [hash_candidates [hash_idx]];
+               GHashTableIter iter;
+               MonoImage *image;
+
+               // Iterate over images within a hash
+               g_hash_table_iter_init (&iter, target);
+               while (searching && g_hash_table_iter_next(&iter, NULL, (gpointer *)&image))
+               {
+                       mono_image_lock (image);
+                       owner = check_for_mempool_owner (ptr, image);
+                       mono_image_unlock (image);
+
+                       // Continue searching if null owner returned
+                       searching = check_mempool_owner_eq (owner, mono_mempool_no_owner);
+               }
+       }
+
+       mono_images_unlock ();
+
+       return owner;
+}
+
+#endif
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 1f925bd8ed23757ec15af306a6baf5cdeafe5907..3ff9598c04e426830db418d27e829451d249424f 100644 (file)
@@ -575,7 +575,7 @@ ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean ne
                MonoBoolean specific, MonoBoolean installed)
 {
        MonoArray *ret;
-       MonoClass *class;
+       MonoClass *klass;
        MonoCultureInfo *culture;
        MonoDomain *domain;
        const CultureInfoEntry *ci;
@@ -592,7 +592,7 @@ ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean ne
                        len++;
        }
 
-       class = mono_class_from_name (mono_get_corlib (),
+       klass = mono_class_from_name (mono_get_corlib (),
                        "System.Globalization", "CultureInfo");
 
        /* The InvariantCulture is not in culture_entries */
@@ -600,7 +600,7 @@ ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean ne
        if (neutral)
                len++;
 
-       ret = mono_array_new (domain, class, len);
+       ret = mono_array_new (domain, klass, len);
 
        if (len == 0)
                return ret;
@@ -613,7 +613,7 @@ ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean ne
                ci = &culture_entries [i];
                is_neutral = ci->territory == 0;
                if ((neutral && is_neutral) || (specific && !is_neutral)) {
-                       culture = (MonoCultureInfo *) mono_object_new (domain, class);
+                       culture = (MonoCultureInfo *) mono_object_new (domain, klass);
                        mono_runtime_object_init ((MonoObject *) culture);
                        construct_culture (culture, ci);
                        culture->use_user_override = TRUE;
index 5504e83b3fdd2d304139ad864b708146916b8d7b..a53221364ba6ab72500de8e9147bf63f55ac0092 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);
@@ -11095,7 +11105,7 @@ mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_e
 }
 
 MonoMethod *
-mono_marshal_get_generic_array_helper (MonoClass *class, MonoClass *iface, gchar *name, MonoMethod *method)
+mono_marshal_get_generic_array_helper (MonoClass *klass, MonoClass *iface, gchar *name, MonoMethod *method)
 {
        MonoMethodSignature *sig, *csig;
        MonoMethodBuilder *mb;
@@ -11103,7 +11113,7 @@ mono_marshal_get_generic_array_helper (MonoClass *class, MonoClass *iface, gchar
        WrapperInfo *info;
        int i;
 
-       mb = mono_mb_new_no_dup_name (class, name, MONO_WRAPPER_MANAGED_TO_MANAGED);
+       mb = mono_mb_new_no_dup_name (klass, name, MONO_WRAPPER_MANAGED_TO_MANAGED);
        mb->method->slot = -1;
 
        mb->method->flags = METHOD_ATTRIBUTE_PRIVATE | METHOD_ATTRIBUTE_VIRTUAL |
@@ -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 f02703a31fa2b41e83600a8099d668f944931f13..0cc8ca036c1e069ab4588e51e9206f116721344b 100644 (file)
 #include "mempool.h"
 #include "mempool-internals.h"
 
-#if USE_MALLOC_FOR_MEMPOOLS
-#define MALLOC_ALLOCATION
-#endif
-
 /*
  * MonoMemPool is for fast allocation of memory. We free
  * all memory when the pool is destroyed.
@@ -30,6 +26,8 @@
 
 #define MEM_ALIGN 8
 #define ALIGN_SIZE(s)  (((s) + MEM_ALIGN - 1) & ~(MEM_ALIGN - 1))
+
+// Size of memory at start of mempool reserved for header
 #define SIZEOF_MEM_POOL        (ALIGN_SIZE (sizeof (MonoMemPool)))
 
 #if MONO_SMALL_CONFIG
 #define MONO_MEMPOOL_MINSIZE 512
 #endif
 
+// The --with-malloc-mempools debug-build flag causes mempools to be allocated in single-element blocks, so tools like Valgrind can run better.
+#if USE_MALLOC_FOR_MEMPOOLS
+#define INDIVIDUAL_ALLOCATIONS
+#define MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE 0
+#else
+#define MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE MONO_MEMPOOL_PAGESIZE
+#endif
+
 #ifndef G_LIKELY
 #define G_LIKELY(a) (a)
 #define G_UNLIKELY(a) (a)
 #endif
 
-#ifdef MALLOC_ALLOCATION
-typedef struct _Chunk {
-       struct _Chunk *next;
-       guint32 size;
-} Chunk;
-
-struct _MonoMemPool {
-       Chunk *chunks;
-       guint32 allocated;
-};
-#else
+// A mempool is a linked list of memory blocks, each of which begins with this header structure.
+// The initial block in the linked list is special, and tracks additional information.
 struct _MonoMemPool {
+       // Next block after this one in linked list
        MonoMemPool *next;
-       gint rest;
-       guint8 *pos, *end;
+
+       // Size of this memory block only
        guint32 size;
+
+       // Used in "initial block" only: Beginning of current free space in mempool (may be in some block other than the first one)
+       guint8 *pos;
+
+       // Used in "initial block" only: End of current free space in mempool (ie, the first byte following the end of usable space)
+       guint8 *end;
+
        union {
-               double pad; /* to assure proper alignment */
+               // Unused: Imposing floating point memory rules on _MonoMemPool's final field ensures proper alignment of whole header struct
+               double pad;
+
+               // Used in "initial block" only: Number of bytes so far allocated (whether used or not) in the whole mempool
                guint32 allocated;
        } d;
 };
-#endif
 
 static long total_bytes_allocated = 0;
 
@@ -81,24 +88,33 @@ mono_mempool_new (void)
        return mono_mempool_new_size (MONO_MEMPOOL_PAGESIZE);
 }
 
+/**
+ * mono_mempool_new_size:
+ * @initial_size: the amount of memory to initially reserve for the memory pool.
+ *
+ * Returns: a new memory pool with a specific initial memory reservation.
+ */
 MonoMemPool *
 mono_mempool_new_size (int initial_size)
 {
-#ifdef MALLOC_ALLOCATION
-       return g_new0 (MonoMemPool, 1);
-#else
        MonoMemPool *pool;
+
+#ifdef INDIVIDUAL_ALLOCATIONS
+       // In individual allocation mode, create initial block with zero storage space.
+       initial_size = SIZEOF_MEM_POOL;
+#else
        if (initial_size < MONO_MEMPOOL_MINSIZE)
                initial_size = MONO_MEMPOOL_MINSIZE;
+#endif
+
        pool = g_malloc (initial_size);
 
        pool->next = NULL;
-       pool->pos = (guint8*)pool + SIZEOF_MEM_POOL;
-       pool->end = pool->pos + initial_size - SIZEOF_MEM_POOL;
+       pool->pos = (guint8*)pool + SIZEOF_MEM_POOL; // Start after header
+       pool->end = (guint8*)pool + initial_size;    // End at end of allocated space 
        pool->d.allocated = pool->size = initial_size;
        total_bytes_allocated += initial_size;
        return pool;
-#endif
 }
 
 /**
@@ -110,11 +126,6 @@ mono_mempool_new_size (int initial_size)
 void
 mono_mempool_destroy (MonoMemPool *pool)
 {
-#ifdef MALLOC_ALLOCATION
-       mono_mempool_empty (pool);
-
-       g_free (pool);
-#else
        MonoMemPool *p, *n;
 
        total_bytes_allocated -= pool->d.allocated;
@@ -125,7 +136,6 @@ mono_mempool_destroy (MonoMemPool *pool)
                g_free (p);
                p = n;
        }
-#endif
 }
 
 /**
@@ -137,9 +147,6 @@ mono_mempool_destroy (MonoMemPool *pool)
 void
 mono_mempool_invalidate (MonoMemPool *pool)
 {
-#ifdef MALLOC_ALLOCATION
-       g_assert_not_reached ();
-#else
        MonoMemPool *p, *n;
 
        p = pool;
@@ -148,49 +155,26 @@ mono_mempool_invalidate (MonoMemPool *pool)
                memset (p, 42, p->size);
                p = n;
        }
-#endif
-}
-
-void
-mono_mempool_empty (MonoMemPool *pool)
-{
-#ifdef MALLOC_ALLOCATION
-       Chunk *p, *n;
-
-       p = pool->chunks;
-       pool->chunks = NULL;
-       while (p) {
-               n = p->next;
-               g_free (p);
-               p = n;
-       }
-
-       pool->allocated = 0;
-#else
-       pool->pos = (guint8*)pool + SIZEOF_MEM_POOL;
-       pool->end = pool->pos + pool->size - SIZEOF_MEM_POOL;
-#endif
 }
 
 /**
  * mono_mempool_stats:
  * @pool: the momory pool we need stats for
  *
- * Print a few stats about the mempool
+ * Print a few stats about the mempool:
+ * - Total memory allocated (malloced) by mem pool
+ * - Number of chunks/blocks memory is allocated in
+ * - How much memory is available to dispense before a new malloc must occur?
  */
 void
 mono_mempool_stats (MonoMemPool *pool)
 {
-#ifdef MALLOC_ALLOCATION
-       g_assert_not_reached ();
-#else
        MonoMemPool *p;
        int count = 0;
-       guint32 still_free = 0;
+       guint32 still_free = pool->end - pool->pos;
 
        p = pool;
        while (p) {
-               still_free += p->end - p->pos;
                p = p->next;
                count++;
        }
@@ -200,10 +184,8 @@ mono_mempool_stats (MonoMemPool *pool)
                g_print ("Num chunks: %d\n", count);
                g_print ("Free memory: %d\n", still_free);
        }
-#endif
 }
 
-#ifndef MALLOC_ALLOCATION
 #ifdef TRACE_ALLOCATIONS
 #include <execinfo.h>
 #include "metadata/appdomain.h"
@@ -237,7 +219,18 @@ mono_backtrace (int size)
 
 #endif
 
-static int
+/**
+ * mono_mempool_alloc:
+ * @pool: the memory pool to use
+ * @size: size of the memory entity we are trying to allocate
+ *
+ * A mempool is growing; give a recommended size for the next block.
+ * Each block in a mempool should be about 150% bigger than the previous one,
+ * or bigger if it is necessary to include the new entity.
+ *
+ * Returns: the recommended size.
+ */
+static guint
 get_next_size (MonoMemPool *pool, int size)
 {
        int target = pool->next? pool->next->size: pool->size;
@@ -251,12 +244,11 @@ get_next_size (MonoMemPool *pool, int size)
                target = MONO_MEMPOOL_PAGESIZE;
        return target;
 }
-#endif
 
 /**
  * mono_mempool_alloc:
- * @pool: the momory pool to use
- * @size: size of the momory block
+ * @pool: the memory pool to use
+ * @size: size of the memory block
  *
  * Allocates a new block of memory in @pool.
  *
@@ -265,24 +257,10 @@ get_next_size (MonoMemPool *pool, int size)
 gpointer
 mono_mempool_alloc (MonoMemPool *pool, guint size)
 {
-       gpointer rval;
+       gpointer rval = pool->pos; // Return value
 
+       // Normal case: Just bump up pos pointer and we are done
        size = ALIGN_SIZE (size);
-
-#ifdef MALLOC_ALLOCATION
-       {
-               Chunk *c = g_malloc (size + sizeof (Chunk));
-
-               c->next = pool->chunks;
-               pool->chunks = c;
-               c->size = size - sizeof(Chunk);
-
-               pool->allocated += size;
-
-               rval = ((guint8*)c) + sizeof (Chunk);
-       }
-#else
-       rval = pool->pos;
        pool->pos = (guint8*)rval + size;
 
 #ifdef TRACE_ALLOCATIONS
@@ -290,28 +268,34 @@ mono_mempool_alloc (MonoMemPool *pool, guint size)
                mono_backtrace (size);
        }
 #endif
+
+       // If we have just overflowed the current block, we need to back up and try again.
        if (G_UNLIKELY (pool->pos >= pool->end)) {
-               pool->pos -= size;
-               if (size >= 4096) {
-                       MonoMemPool *np = g_malloc (SIZEOF_MEM_POOL + size);
+               pool->pos -= size;  // Back out
+
+               // For large objects, allocate the object into its own block.
+               // (In individual allocation mode, the constant will be 0 and this path will always be taken)
+               if (size >= MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE) {
+                       guint new_size = SIZEOF_MEM_POOL + size;
+                       MonoMemPool *np = g_malloc (new_size);
+
                        np->next = pool->next;
+                       np->size = new_size;
                        pool->next = np;
-                       np->pos = (guint8*)np + SIZEOF_MEM_POOL;
-                       np->size = SIZEOF_MEM_POOL + size;
-                       np->end = np->pos + np->size - SIZEOF_MEM_POOL;
-                       pool->d.allocated += SIZEOF_MEM_POOL + size;
-                       total_bytes_allocated += SIZEOF_MEM_POOL + size;
-                       return (guint8*)np + SIZEOF_MEM_POOL;
+                       pool->d.allocated += new_size;
+                       total_bytes_allocated += new_size;
+
+                       rval = (guint8*)np + SIZEOF_MEM_POOL;
                } else {
-                       int new_size = get_next_size (pool, size);
+                       // Notice: any unused memory at the end of the old head becomes simply abandoned in this case until the mempool is freed (see Bugzilla #35136)
+                       guint new_size = get_next_size (pool, size);
                        MonoMemPool *np = g_malloc (new_size);
+
                        np->next = pool->next;
+                       np->size = new_size;
                        pool->next = np;
                        pool->pos = (guint8*)np + SIZEOF_MEM_POOL;
-                       np->pos = (guint8*)np + SIZEOF_MEM_POOL;
-                       np->size = new_size;
-                       np->end = np->pos;
-                       pool->end = pool->pos + new_size - SIZEOF_MEM_POOL;
+                       pool->end = (guint8*)np + new_size;
                        pool->d.allocated += new_size;
                        total_bytes_allocated += new_size;
 
@@ -319,7 +303,6 @@ mono_mempool_alloc (MonoMemPool *pool, guint size)
                        pool->pos += size;
                }
        }
-#endif
 
        return rval;
 }
@@ -334,14 +317,12 @@ mono_mempool_alloc0 (MonoMemPool *pool, guint size)
 {
        gpointer rval;
 
-#ifdef MALLOC_ALLOCATION
-       rval = mono_mempool_alloc (pool, size);
-#else
+       // For the fast path, repeat the first few lines of mono_mempool_alloc
        size = ALIGN_SIZE (size);
-
        rval = pool->pos;
        pool->pos = (guint8*)rval + size;
 
+       // If that doesn't work fall back on mono_mempool_alloc to handle new chunk allocation
        if (G_UNLIKELY (pool->pos >= pool->end)) {
                rval = mono_mempool_alloc (pool, size);
        }
@@ -349,7 +330,6 @@ mono_mempool_alloc0 (MonoMemPool *pool, guint size)
        else if (pool == mono_get_corlib ()->mempool) {
                mono_backtrace (size);
        }
-#endif
 #endif
 
        memset (rval, 0, size);
@@ -365,28 +345,13 @@ gboolean
 mono_mempool_contains_addr (MonoMemPool *pool,
                                                        gpointer addr)
 {
-#ifdef MALLOC_ALLOCATION
-       Chunk *c;
+       MonoMemPool *p = pool;
 
-       c = pool->chunks;
-       while (c) {
-               guint8 *p = ((guint8*)c) + sizeof (Chunk);
-
-               if (addr >= (gpointer)p && addr < (gpointer)(p + c->size))
-                       return TRUE;
-
-               c = c->next;
-       }
-#else
-       MonoMemPool *p;
-
-       p = pool;
        while (p) {
-               if (addr > (gpointer)p && addr <= (gpointer)((guint8*)p + p->size))
+               if (addr >= (gpointer)p && addr < (gpointer)((guint8*)p + p->size))
                        return TRUE;
                p = p->next;
        }
-#endif
 
        return FALSE;
 }
@@ -422,11 +387,7 @@ mono_mempool_strdup (MonoMemPool *pool,
 guint32
 mono_mempool_get_allocated (MonoMemPool *pool)
 {
-#ifdef MALLOC_ALLOCATION
-       return pool->allocated;
-#else
        return pool->d.allocated;
-#endif
 }
 
 /**
index b096be6e4fd4e52bd6d50aa91e8ca7731d0d4891..d006493a5dc4cf9af082b53e22a8dce5d43c5c48 100644 (file)
@@ -19,9 +19,6 @@ mono_mempool_destroy       (MonoMemPool *pool);
 MONO_API void
 mono_mempool_invalidate    (MonoMemPool *pool);
 
-MONO_API void
-mono_mempool_empty         (MonoMemPool *pool);
-
 MONO_API void
 mono_mempool_stats         (MonoMemPool *pool);
 
index 27098c333868682a1010a36b4b4c223fcb56ff1f..710cdf0b5020e83f78a1075f428df17ffc3d8d91 100644 (file)
@@ -74,7 +74,7 @@ struct _MonoAssembly {
        /* 
         * The number of appdomains which have this assembly loaded plus the number of 
         * assemblies referencing this assembly through an entry in their image->references
-        * arrays. The later is needed because entries in the image->references array
+        * arrays. The latter is needed because entries in the image->references array
         * might point to assemblies which are only loaded in some appdomains, and without
         * the additional reference, they can be freed at any time.
         * The ref_count is initially 0.
@@ -180,6 +180,8 @@ struct _MonoImage {
         * this image between calls of mono_image_open () and mono_image_close ().
         */
        int   ref_count;
+
+       /* If the raw data was allocated from a source such as mmap, the allocator may store resource tracking information here. */
        void *raw_data_handle;
        char *raw_data;
        guint32 raw_data_len;
@@ -216,10 +218,16 @@ struct _MonoImage {
 
        /* Whenever this image is considered as platform code for the CoreCLR security model */
        guint8 core_clr_platform_code : 1;
-                           
+
+       /* The path to the file for this image. */
        char *name;
+
+       /* The assembly name reported in the file for this image (expected to be NULL for a netmodule) */
        const char *assembly_name;
+
+       /* The module name reported in the file for this image (could be NULL for a malformed file) */
        const char *module_name;
+
        char *version;
        gint16 md_version_major, md_version_minor;
        char *guid;
@@ -249,11 +257,16 @@ struct _MonoImage {
        MonoAssembly **references;
        int nreferences;
 
+       /* Code files in the assembly. */
        MonoImage **modules;
        guint32 module_count;
        gboolean *modules_loaded;
 
-       MonoImage **files; /*protected by the image lock*/
+       /*
+        * Files in the assembly. Items are either NULL or alias items in modules, so this does not impact ref_count.
+        * Protected by the image lock.
+        */
+       MonoImage **files;
 
        gpointer aot_module;
 
@@ -432,6 +445,7 @@ typedef struct {
        guint32 *values; /* rows * columns */
 } MonoDynamicTable;
 
+/* "Dynamic" assemblies and images arise from System.Reflection.Emit */
 struct _MonoDynamicAssembly {
        MonoAssembly assembly;
        char *strong_name;
@@ -710,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);
@@ -746,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,
@@ -882,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 69281fa3a516bd9cb0729e84639a5ad79d717fec..c3bb80740ea2622b37749c30bafdd07108f9babf 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);
@@ -484,6 +484,10 @@ mono_tables_names [] = {
 
 #endif
 
+// Amount initially reserved in each imageset's mempool.
+// FIXME: This number is arbitrary, a more practical number should be found
+#define INITIAL_IMAGE_SET_SIZE    1024
+
 /**
  * mono_meta_table_name:
  * @table: table index
@@ -1318,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);
 
@@ -1352,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 *
@@ -1591,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;
@@ -1673,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;
        }
 
@@ -1722,11 +1736,33 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container
        return type;
 }
 
+
 MonoType*
-mono_metadata_parse_type_full (MonoImage *m, MonoGenericContainer *container, MonoParseTypeMode mode,
+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,
                                                           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);
 }
 
 /*
@@ -1736,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
@@ -2018,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);
@@ -2048,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;
@@ -2100,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;
 }
 
@@ -2437,7 +2468,7 @@ mono_image_set_alloc (MonoImageSet *set, guint size)
 
        mono_image_set_lock (set);
        if (!set->mempool)
-               set->mempool = mono_mempool_new_size (1024);
+               set->mempool = mono_mempool_new_size (INITIAL_IMAGE_SET_SIZE);
        res = mono_mempool_alloc (set->mempool, size);
        mono_image_set_unlock (set);
 
@@ -2451,7 +2482,7 @@ mono_image_set_alloc0 (MonoImageSet *set, guint size)
 
        mono_image_set_lock (set);
        if (!set->mempool)
-               set->mempool = mono_mempool_new_size (1024);
+               set->mempool = mono_mempool_new_size (INITIAL_IMAGE_SET_SIZE);
        res = mono_mempool_alloc0 (set->mempool, size);
        mono_image_set_unlock (set);
 
@@ -2465,7 +2496,7 @@ mono_image_set_strdup (MonoImageSet *set, const char *s)
 
        mono_image_set_lock (set);
        if (!set->mempool)
-               set->mempool = mono_mempool_new_size (1024);
+               set->mempool = mono_mempool_new_size (INITIAL_IMAGE_SET_SIZE);
        res = mono_mempool_strdup (set->mempool, s);
        mono_image_set_unlock (set);
 
@@ -3075,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;
@@ -3104,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;
 
@@ -3167,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 */
@@ -3185,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);
 }
 
@@ -3226,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.
@@ -3240,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) {
@@ -3262,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
@@ -3289,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){
@@ -3317,68 +3390,69 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer
        case MONO_TYPE_VALUETYPE:
        case MONO_TYPE_CLASS: {
                guint32 token;
-               MonoClass *class;
-               MonoError error;
+               MonoClass *klass;
                token = mono_metadata_parse_typedef_or_ref (m, ptr, &ptr);
-               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*/
+               klass = mono_class_get_checked (m, token, error);
+               type->data.klass = klass;
+               if (!klass)
                        return FALSE;
-               }
-               if (!compare_type_literals (class->byval_arg.type, type->type))
+
+               if (!compare_type_literals (m, klass->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;
 }
 
 /*
@@ -3687,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;
                }
@@ -4795,7 +4869,7 @@ mono_metadata_type_hash (MonoType *t1)
        case MONO_TYPE_VALUETYPE:
        case MONO_TYPE_CLASS:
        case MONO_TYPE_SZARRAY: {
-               MonoClass *class = t1->data.klass;
+               MonoClass *klass = t1->data.klass;
                /*
                 * Dynamic classes must not be hashed on their type since it can change
                 * during runtime. For example, if we hash a reference type that is
@@ -4804,9 +4878,9 @@ mono_metadata_type_hash (MonoType *t1)
                 * This is specially problematic with generic instances since they are
                 * inserted in a bunch of hash tables before been finished.
                 */
-               if (image_is_dynamic (class->image))
-                       return (t1->byref << 6) | mono_metadata_str_hash (class->name);
-               return ((hash << 5) - hash) ^ mono_metadata_str_hash (class->name);
+               if (image_is_dynamic (klass->image))
+                       return (t1->byref << 6) | mono_metadata_str_hash (klass->name);
+               return ((hash << 5) - hash) ^ mono_metadata_str_hash (klass->name);
        }
        case MONO_TYPE_PTR:
                return ((hash << 5) - hash) ^ mono_metadata_type_hash (t1->data.type);
@@ -5521,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 1d0b0217a5146e77ca4e66cf5cc5058d76fb60a7..b1880ba69d8c8a26aa3d6cf948956a89ed48cf21 100644 (file)
@@ -518,7 +518,7 @@ BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reser
 #endif
 
 guint
-mono_gc_get_vtable_bits (MonoClass *class)
+mono_gc_get_vtable_bits (MonoClass *klass)
 {
        return 0;
 }
index c3f24008d657afe73f286b1f76629d11d3b005dd..6a11417dc4d7bd31e6fdecba20ce7f3d87685ca7 100644 (file)
@@ -680,7 +680,7 @@ mono_runtime_free_method (MonoDomain *domain, MonoMethod *method)
 #define BITMAP_EL_SIZE (sizeof (gsize) * 8)
 
 static gsize*
-compute_class_bitmap (MonoClass *class, gsize *bitmap, int size, int offset, int *max_set, gboolean static_fields)
+compute_class_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset, int *max_set, gboolean static_fields)
 {
        MONO_REQ_GC_NEUTRAL_MODE;
 
@@ -690,9 +690,9 @@ compute_class_bitmap (MonoClass *class, gsize *bitmap, int size, int offset, int
        int max_size;
 
        if (static_fields)
-               max_size = mono_class_data_size (class) / sizeof (gpointer);
+               max_size = mono_class_data_size (klass) / sizeof (gpointer);
        else
-               max_size = class->instance_size / sizeof (gpointer);
+               max_size = klass->instance_size / sizeof (gpointer);
        if (max_size > size) {
                g_assert (offset <= 0);
                bitmap = g_malloc0 ((max_size + BITMAP_EL_SIZE - 1) / BITMAP_EL_SIZE * sizeof (gsize));
@@ -701,14 +701,14 @@ compute_class_bitmap (MonoClass *class, gsize *bitmap, int size, int offset, int
 
 #ifdef HAVE_SGEN_GC
        /*An Ephemeron cannot be marked by sgen*/
-       if (!static_fields && class->image == mono_defaults.corlib && !strcmp ("Ephemeron", class->name)) {
+       if (!static_fields && klass->image == mono_defaults.corlib && !strcmp ("Ephemeron", klass->name)) {
                *max_set = 0;
                memset (bitmap, 0, size / 8);
                return bitmap;
        }
 #endif
 
-       for (p = class; p != NULL; p = p->parent) {
+       for (p = klass; p != NULL; p = p->parent) {
                gpointer iter = NULL;
                while ((field = mono_class_get_fields (p, &iter))) {
                        MonoType *type;
@@ -744,7 +744,7 @@ compute_class_bitmap (MonoClass *class, gsize *bitmap, int size, int offset, int
 #ifdef HAVE_SGEN_GC
                                break;
 #else
-                               if (class->image != mono_defaults.corlib)
+                               if (klass->image != mono_defaults.corlib)
                                        break;
 #endif
                        case MONO_TYPE_STRING:
@@ -806,11 +806,11 @@ compute_class_bitmap (MonoClass *class, gsize *bitmap, int size, int offset, int
  * Mono internal function to compute a bitmap of reference fields in a class.
  */
 gsize*
-mono_class_compute_bitmap (MonoClass *class, gsize *bitmap, int size, int offset, int *max_set, gboolean static_fields)
+mono_class_compute_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset, int *max_set, gboolean static_fields)
 {
        MONO_REQ_GC_NEUTRAL_MODE;
 
-       return compute_class_bitmap (class, bitmap, size, offset, max_set, static_fields);
+       return compute_class_bitmap (klass, bitmap, size, offset, max_set, static_fields);
 }
 
 #if 0
@@ -819,7 +819,7 @@ mono_class_compute_bitmap (MonoClass *class, gsize *bitmap, int size, int offset
  * and ignores static fields
  */
 static gsize*
-compute_class_non_ref_bitmap (MonoClass *class, gsize *bitmap, int size, int offset)
+compute_class_non_ref_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset)
 {
        MonoClassField *field;
        MonoClass *p;
@@ -963,7 +963,7 @@ mono_string_alloc (int length)
 }
 
 void
-mono_class_compute_gc_descriptor (MonoClass *class)
+mono_class_compute_gc_descriptor (MonoClass *klass)
 {
        MONO_REQ_GC_NEUTRAL_MODE;
 
@@ -982,29 +982,29 @@ mono_class_compute_gc_descriptor (MonoClass *class)
                mono_loader_unlock ();
        }
 
-       if (!class->inited)
-               mono_class_init (class);
+       if (!klass->inited)
+               mono_class_init (klass);
 
-       if (class->gc_descr_inited)
+       if (klass->gc_descr_inited)
                return;
 
-       class->gc_descr_inited = TRUE;
-       class->gc_descr = MONO_GC_DESCRIPTOR_NULL;
+       klass->gc_descr_inited = TRUE;
+       klass->gc_descr = MONO_GC_DESCRIPTOR_NULL;
 
        bitmap = default_bitmap;
-       if (class == mono_defaults.string_class) {
-               class->gc_descr = mono_gc_make_descr_for_string (bitmap, 2);
-       } else if (class->rank) {
-               mono_class_compute_gc_descriptor (class->element_class);
-               if (MONO_TYPE_IS_REFERENCE (&class->element_class->byval_arg)) {
+       if (klass == mono_defaults.string_class) {
+               klass->gc_descr = mono_gc_make_descr_for_string (bitmap, 2);
+       } else if (klass->rank) {
+               mono_class_compute_gc_descriptor (klass->element_class);
+               if (MONO_TYPE_IS_REFERENCE (&klass->element_class->byval_arg)) {
                        gsize abm = 1;
-                       class->gc_descr = mono_gc_make_descr_for_array (class->byval_arg.type == MONO_TYPE_SZARRAY, &abm, 1, sizeof (gpointer));
+                       klass->gc_descr = mono_gc_make_descr_for_array (klass->byval_arg.type == MONO_TYPE_SZARRAY, &abm, 1, sizeof (gpointer));
                        /*printf ("new array descriptor: 0x%x for %s.%s\n", class->gc_descr,
                                class->name_space, class->name);*/
                } else {
                        /* remove the object header */
-                       bitmap = compute_class_bitmap (class->element_class, default_bitmap, sizeof (default_bitmap) * 8, - (int)(sizeof (MonoObject) / sizeof (gpointer)), &max_set, FALSE);
-                       class->gc_descr = mono_gc_make_descr_for_array (class->byval_arg.type == MONO_TYPE_SZARRAY, bitmap, mono_array_element_size (class) / sizeof (gpointer), mono_array_element_size (class));
+                       bitmap = compute_class_bitmap (klass->element_class, default_bitmap, sizeof (default_bitmap) * 8, - (int)(sizeof (MonoObject) / sizeof (gpointer)), &max_set, FALSE);
+                       klass->gc_descr = mono_gc_make_descr_for_array (klass->byval_arg.type == MONO_TYPE_SZARRAY, bitmap, mono_array_element_size (klass) / sizeof (gpointer), mono_array_element_size (klass));
                        /*printf ("new vt array descriptor: 0x%x for %s.%s\n", class->gc_descr,
                                class->name_space, class->name);*/
                        if (bitmap != default_bitmap)
@@ -1014,8 +1014,8 @@ mono_class_compute_gc_descriptor (MonoClass *class)
                /*static int count = 0;
                if (count++ > 58)
                        return;*/
-               bitmap = compute_class_bitmap (class, default_bitmap, sizeof (default_bitmap) * 8, 0, &max_set, FALSE);
-               class->gc_descr = mono_gc_make_descr_for_object (bitmap, max_set + 1, class->instance_size);
+               bitmap = compute_class_bitmap (klass, default_bitmap, sizeof (default_bitmap) * 8, 0, &max_set, FALSE);
+               klass->gc_descr = mono_gc_make_descr_for_object (bitmap, max_set + 1, klass->instance_size);
                /*
                if (class->gc_descr == MONO_GC_DESCRIPTOR_NULL)
                        g_print ("disabling typed alloc (%d) for %s.%s\n", max_set, class->name_space, class->name);
@@ -1822,7 +1822,7 @@ mono_method_add_generic_virtual_invocation (MonoDomain *domain, MonoVTable *vtab
        mono_domain_unlock (domain);
 }
 
-static MonoVTable *mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean raise_on_error);
+static MonoVTable *mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, gboolean raise_on_error);
 
 /**
  * mono_class_vtable:
@@ -1834,9 +1834,9 @@ static MonoVTable *mono_class_create_runtime_vtable (MonoDomain *domain, MonoCla
  * On failure, NULL is returned, and class->exception_type is set.
  */
 MonoVTable *
-mono_class_vtable (MonoDomain *domain, MonoClass *class)
+mono_class_vtable (MonoDomain *domain, MonoClass *klass)
 {
-       return mono_class_vtable_full (domain, class, FALSE);
+       return mono_class_vtable_full (domain, klass, FALSE);
 }
 
 /**
@@ -1849,25 +1849,25 @@ mono_class_vtable (MonoDomain *domain, MonoClass *class)
  * they contain the domain specific static class data.
  */
 MonoVTable *
-mono_class_vtable_full (MonoDomain *domain, MonoClass *class, gboolean raise_on_error)
+mono_class_vtable_full (MonoDomain *domain, MonoClass *klass, gboolean raise_on_error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
        MonoClassRuntimeInfo *runtime_info;
 
-       g_assert (class);
+       g_assert (klass);
 
-       if (class->exception_type) {
+       if (klass->exception_type) {
                if (raise_on_error)
-                       mono_raise_exception (mono_class_get_exception_for_failure (class));
+                       mono_raise_exception (mono_class_get_exception_for_failure (klass));
                return NULL;
        }
 
        /* this check can be inlined in jitted code, too */
-       runtime_info = class->runtime_info;
+       runtime_info = klass->runtime_info;
        if (runtime_info && runtime_info->max_domain >= domain->domain_id && runtime_info->domain_vtables [domain->domain_id])
                return runtime_info->domain_vtables [domain->domain_id];
-       return mono_class_create_runtime_vtable (domain, class, raise_on_error);
+       return mono_class_create_runtime_vtable (domain, klass, raise_on_error);
 }
 
 /**
@@ -1879,15 +1879,15 @@ mono_class_vtable_full (MonoDomain *domain, MonoClass *class, gboolean raise_on_
  * it was already created.
  */
 MonoVTable *
-mono_class_try_get_vtable (MonoDomain *domain, MonoClass *class)
+mono_class_try_get_vtable (MonoDomain *domain, MonoClass *klass)
 {
        MONO_REQ_GC_NEUTRAL_MODE;
 
        MonoClassRuntimeInfo *runtime_info;
 
-       g_assert (class);
+       g_assert (klass);
 
-       runtime_info = class->runtime_info;
+       runtime_info = klass->runtime_info;
        if (runtime_info && runtime_info->max_domain >= domain->domain_id && runtime_info->domain_vtables [domain->domain_id])
                return runtime_info->domain_vtables [domain->domain_id];
        return NULL;
@@ -1917,7 +1917,7 @@ alloc_vtable (MonoDomain *domain, size_t vtable_size, size_t imt_table_bytes)
 }
 
 static MonoVTable *
-mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean raise_on_error)
+mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, gboolean raise_on_error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
@@ -1934,25 +1934,25 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
 
        mono_loader_lock (); /*FIXME mono_class_init acquires it*/
        mono_domain_lock (domain);
-       runtime_info = class->runtime_info;
+       runtime_info = klass->runtime_info;
        if (runtime_info && runtime_info->max_domain >= domain->domain_id && runtime_info->domain_vtables [domain->domain_id]) {
                mono_domain_unlock (domain);
                mono_loader_unlock ();
                return runtime_info->domain_vtables [domain->domain_id];
        }
-       if (!class->inited || class->exception_type) {
-               if (!mono_class_init (class) || class->exception_type) {
+       if (!klass->inited || klass->exception_type) {
+               if (!mono_class_init (klass) || klass->exception_type) {
                        mono_domain_unlock (domain);
                        mono_loader_unlock ();
                        if (raise_on_error)
-                               mono_raise_exception (mono_class_get_exception_for_failure (class));
+                               mono_raise_exception (mono_class_get_exception_for_failure (klass));
                        return NULL;
                }
        }
 
        /* Array types require that their element type be valid*/
-       if (class->byval_arg.type == MONO_TYPE_ARRAY || class->byval_arg.type == MONO_TYPE_SZARRAY) {
-               MonoClass *element_class = class->element_class;
+       if (klass->byval_arg.type == MONO_TYPE_ARRAY || klass->byval_arg.type == MONO_TYPE_SZARRAY) {
+               MonoClass *element_class = klass->element_class;
                if (!element_class->inited)
                        mono_class_init (element_class);
 
@@ -1962,44 +1962,44 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                
                if (element_class->exception_type != MONO_EXCEPTION_NONE) {
                        /*Can happen if element_class only got bad after mono_class_setup_vtable*/
-                       if (class->exception_type == MONO_EXCEPTION_NONE)
-                               mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       if (klass->exception_type == MONO_EXCEPTION_NONE)
+                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
                        mono_domain_unlock (domain);
                        mono_loader_unlock ();
                        if (raise_on_error)
-                               mono_raise_exception (mono_class_get_exception_for_failure (class));
+                               mono_raise_exception (mono_class_get_exception_for_failure (klass));
                        return NULL;
                }
        }
 
        /* 
-        * For some classes, mono_class_init () already computed class->vtable_size, and 
+        * For some classes, mono_class_init () already computed klass->vtable_size, and 
         * that is all that is needed because of the vtable trampolines.
         */
-       if (!class->vtable_size)
-               mono_class_setup_vtable (class);
+       if (!klass->vtable_size)
+               mono_class_setup_vtable (klass);
 
-       if (class->generic_class && !class->vtable)
-               mono_class_check_vtable_constraints (class, NULL);
+       if (klass->generic_class && !klass->vtable)
+               mono_class_check_vtable_constraints (klass, NULL);
 
        /* Initialize klass->has_finalize */
-       mono_class_has_finalizer (class);
+       mono_class_has_finalizer (klass);
 
-       if (class->exception_type) {
+       if (klass->exception_type) {
                mono_domain_unlock (domain);
                mono_loader_unlock ();
                if (raise_on_error)
-                       mono_raise_exception (mono_class_get_exception_for_failure (class));
+                       mono_raise_exception (mono_class_get_exception_for_failure (klass));
                return NULL;
        }
 
-       vtable_slots = class->vtable_size;
+       vtable_slots = klass->vtable_size;
        /* we add an additional vtable slot to store the pointer to static field data only when needed */
-       class_size = mono_class_data_size (class);
+       class_size = mono_class_data_size (klass);
        if (class_size)
                vtable_slots++;
 
-       if (class->interface_offsets_count) {
+       if (klass->interface_offsets_count) {
                imt_table_bytes = sizeof (gpointer) * (MONO_IMT_SIZE);
                mono_stats.imt_number_of_tables++;
                mono_stats.imt_tables_size += imt_table_bytes;
@@ -2016,11 +2016,11 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
        vt = (MonoVTable*) ((char*)interface_offsets + imt_table_bytes);
        g_assert (!((gsize)vt & 7));
 
-       vt->klass = class;
-       vt->rank = class->rank;
+       vt->klass = klass;
+       vt->rank = klass->rank;
        vt->domain = domain;
 
-       mono_class_compute_gc_descriptor (class);
+       mono_class_compute_gc_descriptor (klass);
                /*
                 * We can't use typed allocation in the non-root domains, since the
                 * collector needs the GC descriptor stored in the vtable even after
@@ -2038,43 +2038,43 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                vt->gc_descr = MONO_GC_DESCRIPTOR_NULL;
        else
 #endif
-               vt->gc_descr = class->gc_descr;
+               vt->gc_descr = klass->gc_descr;
 
-       gc_bits = mono_gc_get_vtable_bits (class);
+       gc_bits = mono_gc_get_vtable_bits (klass);
        g_assert (!(gc_bits & ~((1 << MONO_VTABLE_AVAILABLE_GC_BITS) - 1)));
 
        vt->gc_bits = gc_bits;
 
        if (class_size) {
                /* we store the static field pointer at the end of the vtable: vt->vtable [class->vtable_size] */
-               if (class->has_static_refs) {
+               if (klass->has_static_refs) {
                        MonoGCDescriptor statics_gc_descr;
                        int max_set = 0;
                        gsize default_bitmap [4] = {0};
                        gsize *bitmap;
 
-                       bitmap = compute_class_bitmap (class, default_bitmap, sizeof (default_bitmap) * 8, 0, &max_set, TRUE);
-                       /*g_print ("bitmap 0x%x for %s.%s (size: %d)\n", bitmap [0], class->name_space, class->name, class_size);*/
+                       bitmap = compute_class_bitmap (klass, default_bitmap, sizeof (default_bitmap) * 8, 0, &max_set, TRUE);
+                       /*g_print ("bitmap 0x%x for %s.%s (size: %d)\n", bitmap [0], klass->name_space, klass->name, class_size);*/
                        statics_gc_descr = mono_gc_make_descr_from_bitmap (bitmap, max_set + 1);
-                       vt->vtable [class->vtable_size] = mono_gc_alloc_fixed (class_size, statics_gc_descr, MONO_ROOT_SOURCE_STATIC, "managed static variables");
-                       mono_domain_add_class_static_data (domain, class, vt->vtable [class->vtable_size], NULL);
+                       vt->vtable [klass->vtable_size] = mono_gc_alloc_fixed (class_size, statics_gc_descr, MONO_ROOT_SOURCE_STATIC, "managed static variables");
+                       mono_domain_add_class_static_data (domain, klass, vt->vtable [klass->vtable_size], NULL);
                        if (bitmap != default_bitmap)
                                g_free (bitmap);
                } else {
-                       vt->vtable [class->vtable_size] = mono_domain_alloc0 (domain, class_size);
+                       vt->vtable [klass->vtable_size] = mono_domain_alloc0 (domain, class_size);
                }
                vt->has_static_fields = TRUE;
                mono_stats.class_static_data_size += class_size;
        }
 
        iter = NULL;
-       while ((field = mono_class_get_fields (class, &iter))) {
+       while ((field = mono_class_get_fields (klass, &iter))) {
                if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC))
                        continue;
                if (mono_field_is_deleted (field))
                        continue;
                if (!(field->type->attrs & FIELD_ATTRIBUTE_LITERAL)) {
-                       gint32 special_static = class->no_special_static_fields ? SPECIAL_STATIC_NONE : field_is_special_static (class, field);
+                       gint32 special_static = klass->no_special_static_fields ? SPECIAL_STATIC_NONE : field_is_special_static (klass, field);
                        if (special_static != SPECIAL_STATIC_NONE) {
                                guint32 size, offset;
                                gint32 align;
@@ -2131,25 +2131,25 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                }               
        }
 
-       vt->max_interface_id = class->max_interface_id;
-       vt->interface_bitmap = class->interface_bitmap;
+       vt->max_interface_id = klass->max_interface_id;
+       vt->interface_bitmap = klass->interface_bitmap;
        
        //printf ("Initializing VT for class %s (interface_offsets_count = %d)\n",
-       //              class->name, class->interface_offsets_count);
+       //              class->name, klass->interface_offsets_count);
 
        /* Initialize vtable */
        if (callbacks.get_vtable_trampoline) {
                // This also covers the AOT case
-               for (i = 0; i < class->vtable_size; ++i) {
+               for (i = 0; i < klass->vtable_size; ++i) {
                        vt->vtable [i] = callbacks.get_vtable_trampoline (i);
                }
        } else {
-               mono_class_setup_vtable (class);
+               mono_class_setup_vtable (klass);
 
-               for (i = 0; i < class->vtable_size; ++i) {
+               for (i = 0; i < klass->vtable_size; ++i) {
                        MonoMethod *cm;
 
-                       if ((cm = class->vtable [i]))
+                       if ((cm = klass->vtable [i]))
                                vt->vtable [i] = arch_create_jit_trampoline (cm);
                }
        }
@@ -2165,9 +2165,9 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
         * re-acquire them and check if another thread has created the vtable in the meantime.
         */
        /* Special case System.MonoType to avoid infinite recursion */
-       if (class != mono_defaults.monotype_class) {
+       if (klass != mono_defaults.monotype_class) {
                /*FIXME check for OOM*/
-               vt->type = mono_type_get_object (domain, &class->byval_arg);
+               vt->type = mono_type_get_object (domain, &klass->byval_arg);
                if (mono_object_get_class (vt->type) != mono_defaults.monotype_class)
                        /* This is unregistered in
                           unregister_vtable_reflection_type() in
@@ -2175,22 +2175,22 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                        MONO_GC_REGISTER_ROOT_IF_MOVING(vt->type, MONO_ROOT_SOURCE_REFLECTION, "vtable reflection type");
        }
 
-       mono_vtable_set_is_remote (vt, mono_class_is_contextbound (class));
+       mono_vtable_set_is_remote (vt, mono_class_is_contextbound (klass));
 
        /*  class_vtable_array keeps an array of created vtables
         */
        g_ptr_array_add (domain->class_vtable_array, vt);
-       /* class->runtime_info is protected by the loader lock, both when
+       /* klass->runtime_info is protected by the loader lock, both when
         * it it enlarged and when it is stored info.
         */
 
        /*
-        * Store the vtable in class->runtime_info.
-        * class->runtime_info is accessed without locking, so this do this last after the vtable has been constructed.
+        * Store the vtable in klass->runtime_info.
+        * klass->runtime_info is accessed without locking, so this do this last after the vtable has been constructed.
         */
        mono_memory_barrier ();
 
-       old_info = class->runtime_info;
+       old_info = klass->runtime_info;
        if (old_info && old_info->max_domain >= domain->domain_id) {
                /* someone already created a large enough runtime info */
                old_info->domain_vtables [domain->domain_id] = vt;
@@ -2207,7 +2207,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                /* this is a bounded memory retention issue: may want to 
                 * handle it differently when we'll have a rcu-like system.
                 */
-               runtime_info = mono_image_alloc0 (class->image, MONO_SIZEOF_CLASS_RUNTIME_INFO + new_size * sizeof (gpointer));
+               runtime_info = mono_image_alloc0 (klass->image, MONO_SIZEOF_CLASS_RUNTIME_INFO + new_size * sizeof (gpointer));
                runtime_info->max_domain = new_size - 1;
                /* copy the stuff from the older info */
                if (old_info) {
@@ -2216,12 +2216,12 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                runtime_info->domain_vtables [domain->domain_id] = vt;
                /* keep this last*/
                mono_memory_barrier ();
-               class->runtime_info = runtime_info;
+               klass->runtime_info = runtime_info;
        }
 
-       if (class == mono_defaults.monotype_class) {
+       if (klass == mono_defaults.monotype_class) {
                /*FIXME check for OOM*/
-               vt->type = mono_type_get_object (domain, &class->byval_arg);
+               vt->type = mono_type_get_object (domain, &klass->byval_arg);
                if (mono_object_get_class (vt->type) != mono_defaults.monotype_class)
                        /* This is unregistered in
                           unregister_vtable_reflection_type() in
@@ -2234,8 +2234,8 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
 
        /* make sure the parent is initialized */
        /*FIXME shouldn't this fail the current type?*/
-       if (class->parent)
-               mono_class_vtable_full (domain, class->parent, raise_on_error);
+       if (klass->parent)
+               mono_class_vtable_full (domain, klass->parent, raise_on_error);
 
        return vt;
 }
@@ -2261,7 +2261,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        int i, j, vtsize, max_interface_id, extra_interface_vtsize = 0;
        MonoClass *k;
        GSList *extra_interfaces = NULL;
-       MonoClass *class = remote_class->proxy_class;
+       MonoClass *klass = remote_class->proxy_class;
        gpointer *interface_offsets;
        uint8_t *bitmap;
        int bsize;
@@ -2271,7 +2271,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        int bcsize;
 #endif
 
-       vt = mono_class_vtable (domain, class);
+       vt = mono_class_vtable (domain, klass);
        g_assert (vt); /*FIXME property handle failure*/
        max_interface_id = vt->max_interface_id;
        
@@ -2282,7 +2282,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
                int method_count;
 
                /*FIXME test for interfaces with variant generic arguments*/
-               if (MONO_CLASS_IMPLEMENTS_INTERFACE (class, iclass->interface_id))
+               if (MONO_CLASS_IMPLEMENTS_INTERFACE (klass, iclass->interface_id))
                        continue;       /* interface implemented by the class */
                if (g_slist_find (extra_interfaces, iclass))
                        continue;
@@ -2297,7 +2297,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
                        for (i = 0; i < ifaces->len; ++i) {
                                MonoClass *ic = g_ptr_array_index (ifaces, i);
                                /*FIXME test for interfaces with variant generic arguments*/
-                               if (MONO_CLASS_IMPLEMENTS_INTERFACE (class, ic->interface_id))
+                               if (MONO_CLASS_IMPLEMENTS_INTERFACE (klass, ic->interface_id))
                                        continue;       /* interface implemented by the class */
                                if (g_slist_find (extra_interfaces, ic))
                                        continue;
@@ -2315,7 +2315,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        mono_stats.imt_number_of_tables++;
        mono_stats.imt_tables_size += imt_table_bytes;
 
-       vtsize = imt_table_bytes + MONO_SIZEOF_VTABLE + class->vtable_size * sizeof (gpointer);
+       vtsize = imt_table_bytes + MONO_SIZEOF_VTABLE + klass->vtable_size * sizeof (gpointer);
 
        mono_stats.class_vtable_size += vtsize + extra_interface_vtsize;
 
@@ -2323,26 +2323,26 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        pvt = (MonoVTable*) ((char*)interface_offsets + imt_table_bytes);
        g_assert (!((gsize)pvt & 7));
 
-       memcpy (pvt, vt, MONO_SIZEOF_VTABLE + class->vtable_size * sizeof (gpointer));
+       memcpy (pvt, vt, MONO_SIZEOF_VTABLE + klass->vtable_size * sizeof (gpointer));
 
        pvt->klass = mono_defaults.transparent_proxy_class;
        /* we need to keep the GC descriptor for a transparent proxy or we confuse the precise GC */
        pvt->gc_descr = mono_defaults.transparent_proxy_class->gc_descr;
 
        /* initialize vtable */
-       mono_class_setup_vtable (class);
-       for (i = 0; i < class->vtable_size; ++i) {
+       mono_class_setup_vtable (klass);
+       for (i = 0; i < klass->vtable_size; ++i) {
                MonoMethod *cm;
                    
-               if ((cm = class->vtable [i]))
+               if ((cm = klass->vtable [i]))
                        pvt->vtable [i] = arch_create_remoting_trampoline (domain, cm, target_type);
                else
                        pvt->vtable [i] = NULL;
        }
 
-       if (class->flags & TYPE_ATTRIBUTE_ABSTRACT) {
+       if (klass->flags & TYPE_ATTRIBUTE_ABSTRACT) {
                /* create trampolines for abstract methods */
-               for (k = class; k; k = k->parent) {
+               for (k = klass; k; k = k->parent) {
                        MonoMethod* m;
                        gpointer iter = NULL;
                        while ((m = mono_class_get_methods (k, &iter)))
@@ -2359,13 +2359,13 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        bitmap = mono_domain_alloc0 (domain, bsize);
 #endif
 
-       for (i = 0; i < class->interface_offsets_count; ++i) {
-               int interface_id = class->interfaces_packed [i]->interface_id;
+       for (i = 0; i < klass->interface_offsets_count; ++i) {
+               int interface_id = klass->interfaces_packed [i]->interface_id;
                bitmap [interface_id >> 3] |= (1 << (interface_id & 7));
        }
 
        if (extra_interfaces) {
-               int slot = class->vtable_size;
+               int slot = klass->vtable_size;
                MonoClass* interf;
                gpointer iter;
                MonoMethod* cm;
@@ -2387,7 +2387,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        }
 
        /* Now that the vtable is full, we can actually fill up the IMT */
-       build_imt (class, pvt, domain, interface_offsets, extra_interfaces);
+       build_imt (klass, pvt, domain, interface_offsets, extra_interfaces);
        if (extra_interfaces) {
                g_slist_free (extra_interfaces);
        }
@@ -3041,12 +3041,12 @@ handle_enum:
                        t = mono_class_enum_basetype (type->data.klass)->type;
                        goto handle_enum;
                } else {
-                       MonoClass *class = mono_class_from_mono_type (type);
-                       int size = mono_class_value_size (class, NULL);
+                       MonoClass *klass = mono_class_from_mono_type (type);
+                       int size = mono_class_value_size (klass, NULL);
                        if (value == NULL)
                                mono_gc_bzero_atomic (dest, size);
                        else
-                               mono_gc_wbarrier_value_copy (dest, value, 1, class);
+                               mono_gc_wbarrier_value_copy (dest, value, 1, klass);
                }
                return;
        case MONO_TYPE_GENERICINST:
@@ -4639,12 +4639,12 @@ mono_object_new_from_token  (MonoDomain *domain, MonoImage *image, guint32 token
        MONO_REQ_GC_UNSAFE_MODE;
 
        MonoError error;
-       MonoClass *class;
+       MonoClass *klass;
 
-       class = mono_class_get_checked (image, token, &error);
+       klass = mono_class_get_checked (image, token, &error);
        g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
-       return mono_object_new (domain, class);
+       return mono_object_new (domain, klass);
 }
 
 
@@ -4805,13 +4805,13 @@ mono_array_clone (MonoArray *array)
 #endif
 
 gboolean
-mono_array_calc_byte_len (MonoClass *class, uintptr_t len, uintptr_t *res)
+mono_array_calc_byte_len (MonoClass *klass, uintptr_t len, uintptr_t *res)
 {
        MONO_REQ_GC_NEUTRAL_MODE;
 
        uintptr_t byte_len;
 
-       byte_len = mono_array_element_size (class);
+       byte_len = mono_array_element_size (klass);
        if (CHECK_MUL_OVERFLOW_UN (byte_len, len))
                return FALSE;
        byte_len *= len;
@@ -5151,7 +5151,7 @@ mono_string_new_wrapper (const char *text)
  * Returns: A newly created object which contains @value.
  */
 MonoObject *
-mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
+mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer value)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
@@ -5159,21 +5159,21 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
        int size;
        MonoVTable *vtable;
 
-       g_assert (class->valuetype);
-       if (mono_class_is_nullable (class))
-               return mono_nullable_box (value, class);
+       g_assert (klass->valuetype);
+       if (mono_class_is_nullable (klass))
+               return mono_nullable_box (value, klass);
 
-       vtable = mono_class_vtable (domain, class);
+       vtable = mono_class_vtable (domain, klass);
        if (!vtable)
                return NULL;
-       size = mono_class_instance_size (class);
+       size = mono_class_instance_size (klass);
        res = mono_object_new_alloc_specific (vtable);
 
        size = size - sizeof (MonoObject);
 
 #ifdef HAVE_SGEN_GC
-       g_assert (size == mono_class_value_size (class, NULL));
-       mono_gc_wbarrier_value_copy ((char *)res + sizeof (MonoObject), value, 1, class);
+       g_assert (size == mono_class_value_size (klass, NULL));
+       mono_gc_wbarrier_value_copy ((char *)res + sizeof (MonoObject), value, 1, klass);
 #else
 #if NO_UNALIGNED_ACCESS
        mono_gc_memmove_atomic ((char *)res + sizeof (MonoObject), value, size);
@@ -5196,7 +5196,7 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
        }
 #endif
 #endif
-       if (class->has_finalize)
+       if (klass->has_finalize)
                mono_object_register_finalizer (res);
        return res;
 }
@@ -6492,7 +6492,7 @@ mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *
 
        for (i = 0; i < count; i++) {
                gpointer vpos;
-               MonoClass *class;
+               MonoClass *klass;
                MonoObject *arg;
 
                if (sig->params [i]->byref)
@@ -6500,10 +6500,10 @@ mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *
                else 
                        vpos = params [i];
 
-               class = mono_class_from_mono_type (sig->params [i]);
+               klass = mono_class_from_mono_type (sig->params [i]);
 
-               if (class->valuetype)
-                       arg = mono_value_box (domain, class, vpos);
+               if (klass->valuetype)
+                       arg = mono_value_box (domain, klass, vpos);
                else 
                        arg = *((MonoObject **)vpos);
                      
@@ -6555,10 +6555,10 @@ mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoAr
                                mono_gc_wbarrier_generic_store (*((MonoObject ***)params [i]), (MonoObject *)arg);
                        } else {
                                if (arg) {
-                                       MonoClass *class = ((MonoObject*)arg)->vtable->klass;
-                                       size = mono_class_value_size (class, NULL);
-                                       if (class->has_references)
-                                               mono_gc_wbarrier_value_copy (*((gpointer *)params [i]), arg + sizeof (MonoObject), 1, class);
+                                       MonoClass *klass = ((MonoObject*)arg)->vtable->klass;
+                                       size = mono_class_value_size (klass, NULL);
+                                       if (klass->has_references)
+                                               mono_gc_wbarrier_value_copy (*((gpointer *)params [i]), arg + sizeof (MonoObject), 1, klass);
                                        else
                                                mono_gc_memmove_atomic (*((gpointer *)params [i]), arg + sizeof (MonoObject), size);
                                } else {
index 2615373e1223cdeb1f892e92aaae3507ad4ea57a..e2e3fdff79fe388496a7fd12b060b1e037f1787a 100644 (file)
@@ -478,22 +478,22 @@ verify_image_file (const char *fname)
        for (i = 1; i <= table->rows; ++i) {
                MonoError error;
                guint32 token = i | MONO_TOKEN_TYPE_DEF;
-               MonoClass *class = mono_class_get_checked (image, token, &error);
-               if (!class) {
+               MonoClass *klass = mono_class_get_checked (image, token, &error);
+               if (!klass) {
                        printf ("Could not load class with token %x due to %s\n", token, mono_error_get_message (&error));
                        mono_error_cleanup (&error);
                        continue;
                }
-               mono_class_init (class);
-               if (class->exception_type != MONO_EXCEPTION_NONE || mono_loader_get_last_error ()) {
-                       printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, class->name_space, class->name);
+               mono_class_init (klass);
+               if (klass->exception_type != MONO_EXCEPTION_NONE || mono_loader_get_last_error ()) {
+                       printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
                        mono_loader_clear_error ();
                        ++count;
                }
 
-               mono_class_setup_vtable (class);
-               if (class->exception_type != MONO_EXCEPTION_NONE || mono_loader_get_last_error ()) {
-                       printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, class->name_space, class->name);
+               mono_class_setup_vtable (klass);
+               if (klass->exception_type != MONO_EXCEPTION_NONE || mono_loader_get_last_error ()) {
+                       printf ("Error verifying class(0x%08x) %s.%s a type load error happened\n", token, klass->name_space, klass->name);
                        mono_loader_clear_error ();
                        ++count;
                }
index 22b011ee59e12a25aa0b4c7f96b921bcfcb8c99f..0c1fbe397c928589c94143fc0e9fa459353749cf 100644 (file)
@@ -171,21 +171,21 @@ static void get_default_param_value_blobs (MonoMethod *method, char **blobs, gui
 static MonoReflectionType *mono_reflection_type_get_underlying_system_type (MonoReflectionType* t);
 static MonoType* mono_reflection_get_type_with_rootimage (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve);
 static MonoReflectionType* mono_reflection_type_resolve_user_types (MonoReflectionType *type);
-static gboolean is_sre_array (MonoClass *class);
-static gboolean is_sre_byref (MonoClass *class);
-static gboolean is_sre_pointer (MonoClass *class);
-static gboolean is_sre_type_builder (MonoClass *class);
-static gboolean is_sre_method_builder (MonoClass *class);
-static gboolean is_sre_ctor_builder (MonoClass *class);
-static gboolean is_sre_field_builder (MonoClass *class);
-static gboolean is_sr_mono_method (MonoClass *class);
-static gboolean is_sr_mono_cmethod (MonoClass *class);
-static gboolean is_sr_mono_generic_method (MonoClass *class);
-static gboolean is_sr_mono_generic_cmethod (MonoClass *class);
-static gboolean is_sr_mono_field (MonoClass *class);
-static gboolean is_sr_mono_property (MonoClass *class);
-static gboolean is_sre_method_on_tb_inst (MonoClass *class);
-static gboolean is_sre_ctor_on_tb_inst (MonoClass *class);
+static gboolean is_sre_array (MonoClass *klass);
+static gboolean is_sre_byref (MonoClass *klass);
+static gboolean is_sre_pointer (MonoClass *klass);
+static gboolean is_sre_type_builder (MonoClass *klass);
+static gboolean is_sre_method_builder (MonoClass *klass);
+static gboolean is_sre_ctor_builder (MonoClass *klass);
+static gboolean is_sre_field_builder (MonoClass *klass);
+static gboolean is_sr_mono_method (MonoClass *klass);
+static gboolean is_sr_mono_cmethod (MonoClass *klass);
+static gboolean is_sr_mono_generic_method (MonoClass *klass);
+static gboolean is_sr_mono_generic_cmethod (MonoClass *klass);
+static gboolean is_sr_mono_field (MonoClass *klass);
+static gboolean is_sr_mono_property (MonoClass *klass);
+static gboolean is_sre_method_on_tb_inst (MonoClass *klass);
+static gboolean is_sre_ctor_on_tb_inst (MonoClass *klass);
 
 static guint32 mono_image_get_methodspec_token (MonoDynamicImage *assembly, MonoMethod *method);
 static guint32 mono_image_get_inflated_method_token (MonoDynamicImage *assembly, MonoMethod *m);
@@ -1852,10 +1852,10 @@ fieldref_encode_signature (MonoDynamicImage *assembly, MonoImage *field_image, M
                for (i = 0; i < type->num_mods; ++i) {
                        if (field_image) {
                                MonoError error;
-                               MonoClass *class = mono_class_get_checked (field_image, type->modifiers [i].token, &error);
+                               MonoClass *klass = mono_class_get_checked (field_image, type->modifiers [i].token, &error);
                                g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
-                               token = mono_image_typedef_or_ref (assembly, &class->byval_arg);
+                               token = mono_image_typedef_or_ref (assembly, &klass->byval_arg);
                        } else {
                                token = type->modifiers [i].token;
                        }
@@ -1884,12 +1884,12 @@ field_encode_signature (MonoDynamicImage *assembly, MonoReflectionFieldBuilder *
        guint32 idx;
        guint32 typespec = 0;
        MonoType *type;
-       MonoClass *class;
+       MonoClass *klass;
 
        init_type_builder_generics (fb->type);
 
        type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type);
-       class = mono_class_from_mono_type (type);
+       klass = mono_class_from_mono_type (type);
 
        sigbuffer_init (&buf, 32);
        
@@ -1897,12 +1897,12 @@ field_encode_signature (MonoDynamicImage *assembly, MonoReflectionFieldBuilder *
        encode_custom_modifiers (assembly, fb->modreq, fb->modopt, &buf);
        /* encode custom attributes before the type */
 
-       if (class->generic_container)
+       if (klass->generic_container)
                typespec = create_typespec (assembly, type);
 
        if (typespec) {
                MonoGenericClass *gclass;
-               gclass = mono_metadata_lookup_generic_class (class, class->generic_container->context.class_inst, TRUE);
+               gclass = mono_metadata_lookup_generic_class (klass, klass->generic_container->context.class_inst, TRUE);
                encode_generic_class (assembly, gclass, &buf);
        } else {
                encode_type (assembly, type, &buf);
@@ -2895,7 +2895,7 @@ is_field_on_inst (MonoClassField *field)
 static MonoType*
 get_field_on_inst_generic_type (MonoClassField *field)
 {
-       MonoClass *class, *gtd;
+       MonoClass *klass, *gtd;
        MonoDynamicGenericClass *dgclass;
        int field_index;
 
@@ -2908,11 +2908,11 @@ get_field_on_inst_generic_type (MonoClassField *field)
                return dgclass->field_generic_types [field_index];              
        }
 
-       class = field->parent;
-       gtd = class->generic_class->container_class;
+       klass = field->parent;
+       gtd = klass->generic_class->container_class;
 
-       if (field >= class->fields && field - class->fields < class->field.count) {
-               field_index = field - class->fields;
+       if (field >= klass->fields && field - klass->fields < klass->field.count) {
+               field_index = field - klass->fields;
                return gtd->fields [field_index].type;
        }
 
@@ -6437,11 +6437,11 @@ mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly)
        
        CHECK_OBJECT (MonoReflectionAssembly *, assembly, NULL);
        if (!assembly_type) {
-               MonoClass *class = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoAssembly");
-               if (class == NULL)
-                       class = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Assembly");
-               g_assert (class);
-               assembly_type = class;
+               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoAssembly");
+               if (klass == NULL)
+                       klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Assembly");
+               g_assert (klass);
+               assembly_type = klass;
        }
        res = (MonoReflectionAssembly *)mono_object_new (domain, assembly_type);
        res->assembly = assembly;
@@ -6460,11 +6460,11 @@ mono_module_get_object   (MonoDomain *domain, MonoImage *image)
        
        CHECK_OBJECT (MonoReflectionModule *, image, NULL);
        if (!module_type) {
-               MonoClass *class = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoModule");
-               if (class == NULL)
-                       class = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Module");
-               g_assert (class);
-               module_type = class;
+               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoModule");
+               if (klass == NULL)
+                       klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Module");
+               g_assert (klass);
+               module_type = klass;
        }
        res = (MonoReflectionModule *)mono_object_new (domain, module_type);
 
@@ -6507,11 +6507,11 @@ mono_module_file_get_object (MonoDomain *domain, MonoImage *image, int table_ind
        const char *val;
        
        if (!module_type) {
-               MonoClass *class = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoModule");
-               if (class == NULL)
-                       class = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Module");
-               g_assert (class);
-               module_type = class;
+               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoModule");
+               if (klass == NULL)
+                       klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Module");
+               g_assert (klass);
+               module_type = klass;
        }
        res = (MonoReflectionModule *)mono_object_new (domain, module_type);
 
@@ -9485,9 +9485,9 @@ mono_reflection_type_get_underlying_system_type (MonoReflectionType* t)
 
 
 static gboolean
-is_corlib_type (MonoClass *class)
+is_corlib_type (MonoClass *klass)
 {
-       return class->image == mono_defaults.corlib;
+       return klass->image == mono_defaults.corlib;
 }
 
 #define check_corlib_type_cached(_class, _namespace, _name) do { \
@@ -9504,69 +9504,69 @@ is_corlib_type (MonoClass *class)
 
 #ifndef DISABLE_REFLECTION_EMIT
 static gboolean
-is_sre_array (MonoClass *class)
+is_sre_array (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "ArrayType");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "ArrayType");
 }
 
 static gboolean
-is_sre_byref (MonoClass *class)
+is_sre_byref (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "ByRefType");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "ByRefType");
 }
 
 static gboolean
-is_sre_pointer (MonoClass *class)
+is_sre_pointer (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "PointerType");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "PointerType");
 }
 
 static gboolean
-is_sre_generic_instance (MonoClass *class)
+is_sre_generic_instance (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoGenericClass");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoGenericClass");
 }
 
 static gboolean
-is_sre_type_builder (MonoClass *class)
+is_sre_type_builder (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "TypeBuilder");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "TypeBuilder");
 }
 
 static gboolean
-is_sre_method_builder (MonoClass *class)
+is_sre_method_builder (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "MethodBuilder");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "MethodBuilder");
 }
 
 static gboolean
-is_sre_ctor_builder (MonoClass *class)
+is_sre_ctor_builder (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "ConstructorBuilder");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "ConstructorBuilder");
 }
 
 static gboolean
-is_sre_field_builder (MonoClass *class)
+is_sre_field_builder (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "FieldBuilder");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "FieldBuilder");
 }
 
 static gboolean
-is_sre_method_on_tb_inst (MonoClass *class)
+is_sre_method_on_tb_inst (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "MethodOnTypeBuilderInst");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "MethodOnTypeBuilderInst");
 }
 
 static gboolean
-is_sre_ctor_on_tb_inst (MonoClass *class)
+is_sre_ctor_on_tb_inst (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection.Emit", "ConstructorOnTypeBuilderInst");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "ConstructorOnTypeBuilderInst");
 }
 
 MonoType*
 mono_reflection_type_get_handle (MonoReflectionType* ref)
 {
-       MonoClass *class;
+       MonoClass *klass;
        if (!ref)
                return NULL;
        if (ref->type)
@@ -9580,9 +9580,9 @@ mono_reflection_type_get_handle (MonoReflectionType* ref)
                        return ref->type;
        }
 
-       class = mono_object_class (ref);
+       klass = mono_object_class (ref);
 
-       if (is_sre_array (class)) {
+       if (is_sre_array (klass)) {
                MonoType *res;
                MonoReflectionArrayType *sre_array = (MonoReflectionArrayType*)ref;
                MonoType *base = mono_reflection_type_get_handle (sre_array->element_type);
@@ -9593,7 +9593,7 @@ mono_reflection_type_get_handle (MonoReflectionType* ref)
                        res = &mono_bounded_array_class_get (mono_class_from_mono_type (base), sre_array->rank, TRUE)->byval_arg;
                sre_array->type.type = res;
                return res;
-       } else if (is_sre_byref (class)) {
+       } else if (is_sre_byref (klass)) {
                MonoType *res;
                MonoReflectionDerivedType *sre_byref = (MonoReflectionDerivedType*)ref;
                MonoType *base = mono_reflection_type_get_handle (sre_byref->element_type);
@@ -9601,7 +9601,7 @@ mono_reflection_type_get_handle (MonoReflectionType* ref)
                res = &mono_class_from_mono_type (base)->this_arg;
                sre_byref->type.type = res;
                return res;
-       } else if (is_sre_pointer (class)) {
+       } else if (is_sre_pointer (klass)) {
                MonoType *res;
                MonoReflectionDerivedType *sre_pointer = (MonoReflectionDerivedType*)ref;
                MonoType *base = mono_reflection_type_get_handle (sre_pointer->element_type);
@@ -9609,7 +9609,7 @@ mono_reflection_type_get_handle (MonoReflectionType* ref)
                res = &mono_ptr_class_get (base)->byval_arg;
                sre_pointer->type.type = res;
                return res;
-       } else if (is_sre_generic_instance (class)) {
+       } else if (is_sre_generic_instance (klass)) {
                MonoType *res, **types;
                MonoReflectionGenericClass *gclass = (MonoReflectionGenericClass*)ref;
                int i, count;
@@ -9649,18 +9649,18 @@ mono_reflection_register_with_runtime (MonoReflectionType *type)
 {
        MonoType *res = mono_reflection_type_get_handle (type);
        MonoDomain *domain = mono_object_domain ((MonoObject*)type);
-       MonoClass *class;
+       MonoClass *klass;
 
        if (!res)
                mono_raise_exception (mono_get_exception_argument (NULL, "Invalid generic instantiation, one or more arguments are not proper user types"));
 
-       class = mono_class_from_mono_type (res);
+       klass = mono_class_from_mono_type (res);
 
        mono_loader_lock (); /*same locking as mono_type_get_object*/
        mono_domain_lock (domain);
 
-       if (!image_is_dynamic (class->image)) {
-               mono_class_setup_supertypes (class);
+       if (!image_is_dynamic (klass->image)) {
+               mono_class_setup_supertypes (klass);
        } else {
                if (!domain->type_hash)
                        domain->type_hash = mono_g_hash_table_new_type ((GHashFunc)mono_metadata_type_hash, 
@@ -9769,13 +9769,13 @@ mono_reflection_register_with_runtime (MonoReflectionType *type)
 }
 
 static gboolean
-is_sre_type_builder (MonoClass *class)
+is_sre_type_builder (MonoClass *klass)
 {
        return FALSE;
 }
 
 static gboolean
-is_sre_generic_instance (MonoClass *class)
+is_sre_generic_instance (MonoClass *klass)
 {
        return FALSE;
 }
@@ -9789,52 +9789,52 @@ init_type_builder_generics (MonoObject *type)
 
 
 static gboolean
-is_sr_mono_field (MonoClass *class)
+is_sr_mono_field (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoField");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoField");
 }
 
 static gboolean
-is_sr_mono_property (MonoClass *class)
+is_sr_mono_property (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoProperty");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoProperty");
 }
 
 static gboolean
-is_sr_mono_method (MonoClass *class)
+is_sr_mono_method (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoMethod");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoMethod");
 }
 
 static gboolean
-is_sr_mono_cmethod (MonoClass *class)
+is_sr_mono_cmethod (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoCMethod");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoCMethod");
 }
 
 static gboolean
-is_sr_mono_generic_method (MonoClass *class)
+is_sr_mono_generic_method (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoGenericMethod");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoGenericMethod");
 }
 
 static gboolean
-is_sr_mono_generic_cmethod (MonoClass *class)
+is_sr_mono_generic_cmethod (MonoClass *klass)
 {
-       check_corlib_type_cached (class, "System.Reflection", "MonoGenericCMethod");
+       check_corlib_type_cached (klass, "System.Reflection", "MonoGenericCMethod");
 }
 
 gboolean
-mono_class_is_reflection_method_or_constructor (MonoClass *class)
+mono_class_is_reflection_method_or_constructor (MonoClass *klass)
 {
-       return is_sr_mono_method (class) || is_sr_mono_cmethod (class) || is_sr_mono_generic_method (class) || is_sr_mono_generic_cmethod (class);
+       return is_sr_mono_method (klass) || is_sr_mono_cmethod (klass) || is_sr_mono_generic_method (klass) || is_sr_mono_generic_cmethod (klass);
 }
 
 static gboolean
 is_usertype (MonoReflectionType *ref)
 {
-       MonoClass *class = mono_object_class (ref);
-       return class->image != mono_defaults.corlib || strcmp ("TypeDelegator", class->name) == 0;
+       MonoClass *klass = mono_object_class (ref);
+       return klass->image != mono_defaults.corlib || strcmp ("TypeDelegator", klass->name) == 0;
 }
 
 static MonoReflectionType*
@@ -11345,16 +11345,16 @@ ensure_runtime_vtable (MonoClass *klass)
 static MonoMethod*
 mono_reflection_method_get_handle (MonoObject *method)
 {
-       MonoClass *class = mono_object_class (method);
-       if (is_sr_mono_method (class) || is_sr_mono_generic_method (class)) {
+       MonoClass *klass = mono_object_class (method);
+       if (is_sr_mono_method (klass) || is_sr_mono_generic_method (klass)) {
                MonoReflectionMethod *sr_method = (MonoReflectionMethod*)method;
                return sr_method->method;
        }
-       if (is_sre_method_builder (class)) {
+       if (is_sre_method_builder (klass)) {
                MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder*)method;
                return mb->mhandle;
        }
-       if (is_sre_method_on_tb_inst (class)) {
+       if (is_sre_method_on_tb_inst (klass)) {
                MonoReflectionMethodOnTypeBuilderInst *m = (MonoReflectionMethodOnTypeBuilderInst*)method;
                MonoMethod *result;
                /*FIXME move this to a proper method and unify with resolve_object*/
@@ -11377,7 +11377,7 @@ mono_reflection_method_get_handle (MonoObject *method)
                return result;
        }
 
-       g_error ("Can't handle methods of type %s:%s", class->name_space, class->name);
+       g_error ("Can't handle methods of type %s:%s", klass->name_space, klass->name);
        return NULL;
 }
 
@@ -12284,11 +12284,11 @@ resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, Mon
                ensure_complete_type (field->parent);
                if (context) {
                        MonoType *inflated = mono_class_inflate_generic_type (&field->parent->byval_arg, context);
-                       MonoClass *class = mono_class_from_mono_type (inflated);
+                       MonoClass *klass = mono_class_from_mono_type (inflated);
                        MonoClassField *inflated_field;
                        gpointer iter = NULL;
                        mono_metadata_free_type (inflated);
-                       while ((inflated_field = mono_class_get_fields (class, &iter))) {
+                       while ((inflated_field = mono_class_get_fields (klass, &iter))) {
                                if (!strcmp (field->name, inflated_field->name))
                                        break;
                        }
index dcc60ecc5504a93656884ca5c78eb8ad47709457..387047daccb1d4cd0edc5962988c92480e7d403f 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 ();
@@ -354,14 +354,14 @@ mono_remoting_wrapper (MonoMethod *method, gpointer *params)
                gpointer* mparams = (gpointer*) alloca(count*sizeof(gpointer));
 
                for (i=0; i<count; i++) {
-                       MonoClass *class = mono_class_from_mono_type (sig->params [i]);
-                       if (class->valuetype) {
+                       MonoClass *klass = mono_class_from_mono_type (sig->params [i]);
+                       if (klass->valuetype) {
                                if (sig->params [i]->byref) {
                                        mparams[i] = *((gpointer *)params [i]);
                                } else {
                                        /* runtime_invoke expects a boxed instance */
                                        if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i])))
-                                               mparams[i] = mono_nullable_box (params [i], class);
+                                               mparams[i] = mono_nullable_box (params [i], klass);
                                        else
                                                mparams[i] = params [i];
                                }
@@ -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;
@@ -1322,7 +1334,7 @@ mono_marshal_get_ldfld_remote_wrapper (MonoClass *klass)
  *
  * This method generates a function which can be use to load a field with type
  * @type from an object. The generated function has the following signature:
- * <@type> ldfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset)
+ * <@type> ldfld_wrapper (MonoObject *this, MonoClass *klass, MonoClassField *field, int offset)
  */
 MonoMethod *
 mono_marshal_get_ldfld_wrapper (MonoType *type)
@@ -1479,7 +1491,7 @@ mono_marshal_get_ldfld_wrapper (MonoType *type)
  *
  * This method generates a function which can be used to load a field address
  * from an object. The generated function has the following signature:
- * gpointer ldflda_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset);
+ * gpointer ldflda_wrapper (MonoObject *this, MonoClass *klass, MonoClassField *field, int offset);
  */
 MonoMethod *
 mono_marshal_get_ldflda_wrapper (MonoType *type)
@@ -1683,7 +1695,7 @@ mono_marshal_get_stfld_remote_wrapper (MonoClass *klass)
  *
  * This method generates a function which can be use to store a field with type
  * @type. The generated function has the following signature:
- * void stfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset, <@type> val)
+ * void stfld_wrapper (MonoObject *this, MonoClass *klass, MonoClassField *field, int offset, <@type> val)
  */
 MonoMethod *
 mono_marshal_get_stfld_wrapper (MonoType *type)
index 43e06db574b9ab524bfb06748b7db29413d6f448..07f5da24dbcb91568711a7d5e558ce2cda624d30 100644 (file)
@@ -125,27 +125,27 @@ mono_security_core_clr_is_platform_image (MonoImage *image)
 static MonoClass*
 security_critical_attribute (void)
 {
-       static MonoClass *class = NULL;
+       static MonoClass *klass = NULL;
 
-       if (!class) {
-               class = mono_class_from_name (mono_defaults.corlib, "System.Security", 
+       if (!klass) {
+               klass = mono_class_from_name (mono_defaults.corlib, "System.Security", 
                        "SecurityCriticalAttribute");
        }
-       g_assert (class);
-       return class;
+       g_assert (klass);
+       return klass;
 }
 
 static MonoClass*
 security_safe_critical_attribute (void)
 {
-       static MonoClass *class = NULL;
+       static MonoClass *klass = NULL;
 
-       if (!class) {
-               class = mono_class_from_name (mono_defaults.corlib, "System.Security", 
+       if (!klass) {
+               klass = mono_class_from_name (mono_defaults.corlib, "System.Security", 
                        "SecuritySafeCriticalAttribute");
        }
-       g_assert (class);
-       return class;
+       g_assert (klass);
+       return klass;
 }
 
 /* sometime we get a NULL (not found) caller (e.g. get_reflection_caller) */
@@ -164,17 +164,17 @@ get_method_full_name (MonoMethod * method)
  *     debugging purposes.
  */
 static void
-set_type_load_exception_type (const char *format, MonoClass *class)
+set_type_load_exception_type (const char *format, MonoClass *klass)
 {
-       char *type_name = mono_type_get_full_name (class);
-       char *parent_name = mono_type_get_full_name (class->parent);
+       char *type_name = mono_type_get_full_name (klass);
+       char *parent_name = mono_type_get_full_name (klass->parent);
        char *message = g_strdup_printf (format, type_name, parent_name);
 
        g_free (parent_name);
        g_free (type_name);
        
        mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
-       mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, message);
+       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, message);
        // note: do not free string given to mono_class_set_failure
 }
 
@@ -255,30 +255,30 @@ get_default_ctor (MonoClass *klass)
  *     Reference: fxcop CA2132 rule
  */
 void
-mono_security_core_clr_check_inheritance (MonoClass *class)
+mono_security_core_clr_check_inheritance (MonoClass *klass)
 {
        MonoSecurityCoreCLRLevel class_level, parent_level;
-       MonoClass *parent = class->parent;
+       MonoClass *parent = klass->parent;
 
        if (!parent)
                return;
 
-       class_level = mono_security_core_clr_class_level (class);
+       class_level = mono_security_core_clr_class_level (klass);
        parent_level = mono_security_core_clr_class_level (parent);
 
        if (class_level < parent_level) {
                set_type_load_exception_type (
                        "Inheritance failure for type %s. Parent class %s is more restricted.",
-                       class);
+                       klass);
        } else {
                MonoMethod *parent_ctor = get_default_ctor (parent);
                if (parent_ctor && ((parent_ctor->flags & METHOD_ATTRIBUTE_PUBLIC) != 0)) {
-                       class_level = mono_security_core_clr_method_level (get_default_ctor (class), FALSE);
+                       class_level = mono_security_core_clr_method_level (get_default_ctor (klass), FALSE);
                        parent_level = mono_security_core_clr_method_level (parent_ctor, FALSE);
                        if (class_level < parent_level) {
                                set_type_load_exception_type (
                                        "Inheritance failure for type %s. Default constructor security mismatch with %s.",
-                                       class);
+                                       klass);
                        }
                }
        }
@@ -299,7 +299,7 @@ mono_security_core_clr_check_inheritance (MonoClass *class)
  *     Reference: http://msdn.microsoft.com/en-us/magazine/cc765416.aspx#id0190030
  */
 void
-mono_security_core_clr_check_override (MonoClass *class, MonoMethod *override, MonoMethod *base)
+mono_security_core_clr_check_override (MonoClass *klass, MonoMethod *override, MonoMethod *base)
 {
        MonoSecurityCoreCLRLevel base_level = mono_security_core_clr_method_level (base, FALSE);
        MonoSecurityCoreCLRLevel override_level = mono_security_core_clr_method_level (override, FALSE);
@@ -930,17 +930,17 @@ mono_security_core_clr_level_from_cinfo (MonoCustomAttrInfo *cinfo, MonoImage *i
  *     - a check for the class and outer class(es) ...
  */
 static MonoSecurityCoreCLRLevel
-mono_security_core_clr_class_level_no_platform_check (MonoClass *class)
+mono_security_core_clr_class_level_no_platform_check (MonoClass *klass)
 {
        MonoSecurityCoreCLRLevel level = MONO_SECURITY_CORE_CLR_TRANSPARENT;
-       MonoCustomAttrInfo *cinfo = mono_custom_attrs_from_class (class);
+       MonoCustomAttrInfo *cinfo = mono_custom_attrs_from_class (klass);
        if (cinfo) {
-               level = mono_security_core_clr_level_from_cinfo (cinfo, class->image);
+               level = mono_security_core_clr_level_from_cinfo (cinfo, klass->image);
                mono_custom_attrs_free (cinfo);
        }
 
-       if (level == MONO_SECURITY_CORE_CLR_TRANSPARENT && class->nested_in)
-               level = mono_security_core_clr_class_level_no_platform_check (class->nested_in);
+       if (level == MONO_SECURITY_CORE_CLR_TRANSPARENT && klass->nested_in)
+               level = mono_security_core_clr_class_level_no_platform_check (klass->nested_in);
 
        return level;
 }
@@ -951,13 +951,13 @@ mono_security_core_clr_class_level_no_platform_check (MonoClass *class)
  *     Return the MonoSecurityCoreCLRLevel for the specified class.
  */
 MonoSecurityCoreCLRLevel
-mono_security_core_clr_class_level (MonoClass *class)
+mono_security_core_clr_class_level (MonoClass *klass)
 {
        /* non-platform code is always Transparent - whatever the attributes says */
-       if (!mono_security_core_clr_test && !mono_security_core_clr_is_platform_image (class->image))
+       if (!mono_security_core_clr_test && !mono_security_core_clr_is_platform_image (klass->image))
                return MONO_SECURITY_CORE_CLR_TRANSPARENT;
 
-       return mono_security_core_clr_class_level_no_platform_check (class);
+       return mono_security_core_clr_class_level_no_platform_check (klass);
 }
 
 /*
@@ -1043,12 +1043,12 @@ mono_security_enable_core_clr ()
 #else
 
 void
-mono_security_core_clr_check_inheritance (MonoClass *class)
+mono_security_core_clr_check_inheritance (MonoClass *klass)
 {
 }
 
 void
-mono_security_core_clr_check_override (MonoClass *class, MonoMethod *override, MonoMethod *base)
+mono_security_core_clr_check_override (MonoClass *klass, MonoMethod *override, MonoMethod *base)
 {
 }
 
@@ -1099,7 +1099,7 @@ mono_security_core_clr_is_call_allowed (MonoMethod *caller, MonoMethod *callee)
 }
 
 MonoSecurityCoreCLRLevel
-mono_security_core_clr_class_level (MonoClass *class)
+mono_security_core_clr_class_level (MonoClass *klass)
 {
        return MONO_SECURITY_CORE_CLR_TRANSPARENT;
 }
index 60eb578939451a20e97b8b13faa5e02a119768fa..301300b77329b5bedbbd2f01fb0cebf1720ae96b 100644 (file)
@@ -52,7 +52,7 @@ typedef struct {
        void (*processing_stw_step) (void);
        void (*processing_build_callback_data) (int generation);
        void (*processing_after_callback) (int generation);
-       MonoGCBridgeObjectKind (*class_kind) (MonoClass *class);
+       MonoGCBridgeObjectKind (*class_kind) (MonoClass *klass);
        void (*register_finalized_object) (GCObject *object);
        void (*describe_pointer) (GCObject *object);
        void (*enable_accounting) (void);
index 9eb5b3693034dfd541355e92dd2d375925199145..c85d60d9affa04e94f2b687e6d49b461e33cab67 100644 (file)
@@ -407,9 +407,9 @@ sgen_bridge_processing_finish (int generation)
 }
 
 MonoGCBridgeObjectKind
-sgen_bridge_class_kind (MonoClass *class)
+sgen_bridge_class_kind (MonoClass *klass)
 {
-       return bridge_processor.class_kind (class);
+       return bridge_processor.class_kind (klass);
 }
 
 void
@@ -442,9 +442,9 @@ set_dump_prefix (const char *prefix)
 static const char *bridge_class;
 
 static MonoGCBridgeObjectKind
-bridge_test_bridge_class_kind (MonoClass *class)
+bridge_test_bridge_class_kind (MonoClass *klass)
 {
-       if (!strcmp (bridge_class, class->name))
+       if (!strcmp (bridge_class, klass->name))
                return GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS;
        return GC_BRIDGE_TRANSPARENT_CLASS;
 }
index e986ae0c2ed5ba451d3c3b34204e27ae687405fa..28105cb047553cec6cf26a1aaa2786fa75e87c41 100644 (file)
@@ -244,14 +244,14 @@ extern gboolean sgen_mono_xdomain_checks;
 static gboolean G_GNUC_UNUSED
 sgen_client_object_has_critical_finalizer (GCObject *obj)
 {
-       MonoClass *class;
+       MonoClass *klass;
 
        if (!mono_defaults.critical_finalizer_object)
                return FALSE;
 
-       class = SGEN_LOAD_VTABLE (obj)->klass;
+       klass = SGEN_LOAD_VTABLE (obj)->klass;
 
-       return mono_class_has_parent_fast (class, mono_defaults.critical_finalizer_object);
+       return mono_class_has_parent_fast (klass, mono_defaults.critical_finalizer_object);
 }
 
 const char* sgen_client_vtable_get_namespace (GCVTable vtable);
index bd94f85cc4a0a3e002b6c489ff156146de2fca1d..02262b3f3609755c08f811ef9502fc0f28a70bd7 100644 (file)
@@ -220,12 +220,14 @@ emit_nursery_check (MonoMethodBuilder *mb, int *nursery_check_return_labels, gbo
         */
        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
        mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_START);
-       mono_mb_emit_icon (mb, DEFAULT_NURSERY_BITS);
+       mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+       mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_BITS);
        mono_mb_emit_byte (mb, CEE_SHR_UN);
        mono_mb_emit_stloc (mb, shifted_nursery_start);
 
        mono_mb_emit_ldarg (mb, 0);
-       mono_mb_emit_icon (mb, DEFAULT_NURSERY_BITS);
+       mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+       mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_BITS);
        mono_mb_emit_byte (mb, CEE_SHR_UN);
        mono_mb_emit_ldloc (mb, shifted_nursery_start);
        nursery_check_return_labels [0] = mono_mb_emit_branch (mb, CEE_BEQ);
@@ -234,7 +236,8 @@ emit_nursery_check (MonoMethodBuilder *mb, int *nursery_check_return_labels, gbo
                // if (!ptr_in_nursery (*ptr)) return;
                mono_mb_emit_ldarg (mb, 0);
                mono_mb_emit_byte (mb, CEE_LDIND_I);
-               mono_mb_emit_icon (mb, DEFAULT_NURSERY_BITS);
+               mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+               mono_mb_emit_byte (mb, CEE_MONO_LDPTR_NURSERY_BITS);
                mono_mb_emit_byte (mb, CEE_SHR_UN);
                mono_mb_emit_ldloc (mb, shifted_nursery_start);
                nursery_check_return_labels [1] = mono_mb_emit_branch (mb, CEE_BNE_UN);
@@ -249,6 +252,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 +331,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;
@@ -423,12 +431,12 @@ sgen_client_zero_array_fill_header (void *p, size_t size)
 static MonoGCFinalizerCallbacks fin_callbacks;
 
 guint
-mono_gc_get_vtable_bits (MonoClass *class)
+mono_gc_get_vtable_bits (MonoClass *klass)
 {
        guint res = 0;
        /* FIXME move this to the bridge code */
        if (sgen_need_bridge_processing ()) {
-               switch (sgen_bridge_class_kind (class)) {
+               switch (sgen_bridge_class_kind (klass)) {
                case GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS:
                case GC_BRIDGE_OPAQUE_BRIDGE_CLASS:
                        res = SGEN_GC_BIT_BRIDGE_OBJECT;
@@ -441,7 +449,7 @@ mono_gc_get_vtable_bits (MonoClass *class)
                }
        }
        if (fin_callbacks.is_class_finalization_aware) {
-               if (fin_callbacks.is_class_finalization_aware (class))
+               if (fin_callbacks.is_class_finalization_aware (klass))
                        res |= SGEN_GC_BIT_FINALIZER_AWARE;
        }
        return res;
@@ -1052,7 +1060,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 +1384,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 +2919,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 c894b065bedb7fd513273d40edaf15945774d439..9958f07dbba1b0fa50d522b2aa70efe2a257e79a 100644 (file)
@@ -465,28 +465,28 @@ enable_accounting (void)
 }
 
 static MonoGCBridgeObjectKind
-class_kind (MonoClass *class)
+class_kind (MonoClass *klass)
 {
-       MonoGCBridgeObjectKind res = bridge_callbacks.bridge_class_kind (class);
+       MonoGCBridgeObjectKind res = bridge_callbacks.bridge_class_kind (klass);
 
        /* If it's a bridge, nothing we can do about it. */
        if (res == GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS || res == GC_BRIDGE_OPAQUE_BRIDGE_CLASS)
                return res;
 
        /* Non bridge classes with no pointers will never point to a bridge, so we can savely ignore them. */
-       if (!class->has_references) {
-               SGEN_LOG (6, "class %s is opaque\n", class->name);
+       if (!klass->has_references) {
+               SGEN_LOG (6, "class %s is opaque\n", klass->name);
                return GC_BRIDGE_OPAQUE_CLASS;
        }
 
        /* Some arrays can be ignored */
-       if (class->rank == 1) {
-               MonoClass *elem_class = class->element_class;
+       if (klass->rank == 1) {
+               MonoClass *elem_class = klass->element_class;
 
                /* FIXME the bridge check can be quite expensive, cache it at the class level. */
                /* An array of a sealed type that is not a bridge will never get to a bridge */
                if ((elem_class->flags & TYPE_ATTRIBUTE_SEALED) && !elem_class->has_references && !bridge_callbacks.bridge_class_kind (elem_class)) {
-                       SGEN_LOG (6, "class %s is opaque\n", class->name);
+                       SGEN_LOG (6, "class %s is opaque\n", klass->name);
                        return GC_BRIDGE_OPAQUE_CLASS;
                }
        }
index 581bb67d3a2adc38837c72c001293dfc75a3a321..98b0d7eeb9770a9b2582db45801f75397478f73f 100644 (file)
@@ -400,9 +400,9 @@ enable_accounting (void)
 }
 
 static MonoGCBridgeObjectKind
-class_kind (MonoClass *class)
+class_kind (MonoClass *klass)
 {
-       return bridge_callbacks.bridge_class_kind (class);
+       return bridge_callbacks.bridge_class_kind (klass);
 }
 
 static HashEntry*
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 9537c0710bee73f26bb018c8df30d9f349825e4d..910fa9bf1fc582de56b904463ba62d72d95be964 100644 (file)
@@ -179,28 +179,28 @@ enable_accounting (void)
 }
 
 static MonoGCBridgeObjectKind
-class_kind (MonoClass *class)
+class_kind (MonoClass *klass)
 {
-       MonoGCBridgeObjectKind res = bridge_callbacks.bridge_class_kind (class);
+       MonoGCBridgeObjectKind res = bridge_callbacks.bridge_class_kind (klass);
 
        /* If it's a bridge, nothing we can do about it. */
        if (res == GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS || res == GC_BRIDGE_OPAQUE_BRIDGE_CLASS)
                return res;
 
        /* Non bridge classes with no pointers will never point to a bridge, so we can savely ignore them. */
-       if (!class->has_references) {
-               SGEN_LOG (6, "class %s is opaque\n", class->name);
+       if (!klass->has_references) {
+               SGEN_LOG (6, "class %s is opaque\n", klass->name);
                return GC_BRIDGE_OPAQUE_CLASS;
        }
 
        /* Some arrays can be ignored */
-       if (class->rank == 1) {
-               MonoClass *elem_class = class->element_class;
+       if (klass->rank == 1) {
+               MonoClass *elem_class = klass->element_class;
 
                /* FIXME the bridge check can be quite expensive, cache it at the class level. */
                /* An array of a sealed type that is not a bridge will never get to a bridge */
                if ((elem_class->flags & TYPE_ATTRIBUTE_SEALED) && !elem_class->has_references && !bridge_callbacks.bridge_class_kind (elem_class)) {
-                       SGEN_LOG (6, "class %s is opaque\n", class->name);
+                       SGEN_LOG (6, "class %s is opaque\n", klass->name);
                        return GC_BRIDGE_OPAQUE_CLASS;
                }
        }
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 43a938d0fc4a0e09757c04938cbbb2ba5b269639..5a4a9a02c0dedc4814c76282467001b67a328345 100644 (file)
@@ -1006,8 +1006,8 @@ verifier_load_type (VerifyContext *ctx, int token, const char *opcode) {
        MonoType* type;
        
        if (ctx->method->wrapper_type != MONO_WRAPPER_NONE) {
-               MonoClass *class = mono_method_get_wrapper_data (ctx->method, (guint32)token);
-               type = class ? &class->byval_arg : NULL;
+               MonoClass *klass = mono_method_get_wrapper_data (ctx->method, (guint32)token);
+               type = klass ? &klass->byval_arg : NULL;
        } else {
                MonoError error;
                if (!IS_TYPE_DEF_OR_REF_OR_SPEC (token) || !token_bounds_check (ctx->image, token)) {
@@ -1655,7 +1655,7 @@ static MonoType*
 get_boxable_mono_type (VerifyContext* ctx, int token, const char *opcode)
 {
        MonoType *type;
-       MonoClass *class;
+       MonoClass *klass;
 
        if (!(type = verifier_load_type (ctx, token, opcode)))
                return NULL;
@@ -1673,10 +1673,10 @@ get_boxable_mono_type (VerifyContext* ctx, int token, const char *opcode)
        if (type->type == MONO_TYPE_TYPEDBYREF)
                CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Invalid use of typedbyref for %s at 0x%04x", opcode, ctx->ip_offset));
 
-       if (!(class = mono_class_from_mono_type (type)))
+       if (!(klass = mono_class_from_mono_type (type)))
                ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Could not retrieve type token for %s at 0x%04x", opcode, ctx->ip_offset));
 
-       if (class->generic_container && type->type != MONO_TYPE_GENERICINST)
+       if (klass->generic_container && type->type != MONO_TYPE_GENERICINST)
                CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use the generic type definition in a boxable type position for %s at 0x%04x", opcode, ctx->ip_offset));      
 
        check_unverifiable_type (ctx, type);
@@ -6096,21 +6096,21 @@ get_field_end (MonoClassField *field)
 }
 
 static gboolean
-verify_class_for_overlapping_reference_fields (MonoClass *class)
+verify_class_for_overlapping_reference_fields (MonoClass *klass)
 {
        int i = 0, j;
        gpointer iter = NULL;
        MonoClassField *field;
-       gboolean is_fulltrust = mono_verifier_is_class_full_trust (class);
+       gboolean is_fulltrust = mono_verifier_is_class_full_trust (klass);
        /*We can't skip types with !has_references since this is calculated after we have run.*/
-       if (!((class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT))
+       if (!((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT))
                return TRUE;
 
 
        /*We must check for stuff overlapping reference fields.
          The outer loop uses mono_class_get_fields to ensure that MonoClass:fields get inited.
        */
-       while ((field = mono_class_get_fields (class, &iter))) {
+       while ((field = mono_class_get_fields (klass, &iter))) {
                int fieldEnd = get_field_end (field);
                gboolean is_valuetype = !MONO_TYPE_IS_REFERENCE (field->type);
                ++i;
@@ -6118,8 +6118,8 @@ verify_class_for_overlapping_reference_fields (MonoClass *class)
                if (mono_field_is_deleted (field) || (field->type->attrs & FIELD_ATTRIBUTE_STATIC))
                        continue;
 
-               for (j = i; j < class->field.count; ++j) {
-                       MonoClassField *other = &class->fields [j];
+               for (j = i; j < klass->field.count; ++j) {
+                       MonoClassField *other = &klass->fields [j];
                        int otherEnd = get_field_end (other);
                        if (mono_field_is_deleted (other) || (is_valuetype && !MONO_TYPE_IS_REFERENCE (other->type)) || (other->type->attrs & FIELD_ATTRIBUTE_STATIC))
                                continue;
@@ -6151,16 +6151,16 @@ field_equals (gconstpointer _a, gconstpointer _b)
 
 
 static gboolean
-verify_class_fields (MonoClass *class)
+verify_class_fields (MonoClass *klass)
 {
        gpointer iter = NULL;
        MonoClassField *field;
-       MonoGenericContext *context = mono_class_get_context (class);
+       MonoGenericContext *context = mono_class_get_context (klass);
        GHashTable *unique_fields = g_hash_table_new_full (&field_hash, &field_equals, NULL, NULL);
-       if (class->generic_container)
-               context = &class->generic_container->context;
+       if (klass->generic_container)
+               context = &klass->generic_container->context;
 
-       while ((field = mono_class_get_fields (class, &iter)) != NULL) {
+       while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
                if (!mono_type_is_valid_type_in_context (field->type, context)) {
                        g_hash_table_destroy (unique_fields);
                        return FALSE;
@@ -6176,11 +6176,11 @@ verify_class_fields (MonoClass *class)
 }
 
 static gboolean
-verify_interfaces (MonoClass *class)
+verify_interfaces (MonoClass *klass)
 {
        int i;
-       for (i = 0; i < class->interface_count; ++i) {
-               MonoClass *iface = class->interfaces [i];
+       for (i = 0; i < klass->interface_count; ++i) {
+               MonoClass *iface = klass->interfaces [i];
                if (!(iface->flags & TYPE_ATTRIBUTE_INTERFACE))
                        return FALSE;
        }
@@ -6188,22 +6188,22 @@ verify_interfaces (MonoClass *class)
 }
 
 static gboolean
-verify_valuetype_layout_with_target (MonoClass *class, MonoClass *target_class)
+verify_valuetype_layout_with_target (MonoClass *klass, MonoClass *target_class)
 {
        int type;
        gpointer iter = NULL;
        MonoClassField *field;
        MonoClass *field_class;
 
-       if (!class->valuetype)
+       if (!klass->valuetype)
                return TRUE;
 
-       type = class->byval_arg.type;
+       type = klass->byval_arg.type;
        /*primitive type fields are not properly decoded*/
        if ((type >= MONO_TYPE_BOOLEAN && type <= MONO_TYPE_R8) || (type >= MONO_TYPE_I && type <= MONO_TYPE_U))
                return TRUE;
 
-       while ((field = mono_class_get_fields (class, &iter)) != NULL) {
+       while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
                if (!field->type)
                        return FALSE;
 
@@ -6212,7 +6212,7 @@ verify_valuetype_layout_with_target (MonoClass *class, MonoClass *target_class)
 
                field_class = mono_class_get_generic_type_definition (mono_class_from_mono_type (field->type));
 
-               if (field_class == target_class || class == field_class || !verify_valuetype_layout_with_target (field_class, target_class))
+               if (field_class == target_class || klass == field_class || !verify_valuetype_layout_with_target (field_class, target_class))
                        return FALSE;
        }
 
@@ -6220,10 +6220,10 @@ verify_valuetype_layout_with_target (MonoClass *class, MonoClass *target_class)
 }
 
 static gboolean
-verify_valuetype_layout (MonoClass *class)
+verify_valuetype_layout (MonoClass *klass)
 {
        gboolean res;
-       res = verify_valuetype_layout_with_target (class, class);
+       res = verify_valuetype_layout_with_target (klass, klass);
        return res;
 }
 
@@ -6257,10 +6257,10 @@ recursive_mark_constraint_args (MonoBitSet *used_args, MonoGenericContainer *gc,
 }
 
 static gboolean
-verify_generic_parameters (MonoClass *class)
+verify_generic_parameters (MonoClass *klass)
 {
        int i;
-       MonoGenericContainer *gc = class->generic_container;
+       MonoGenericContainer *gc = klass->generic_container;
        MonoBitSet *used_args = mono_bitset_new (gc->type_argc, 0);
 
        for (i = 0; i < gc->type_argc; ++i) {
@@ -6277,7 +6277,7 @@ verify_generic_parameters (MonoClass *class)
                        MonoClass *ctr = *constraints;
                        MonoType *constraint_type = &ctr->byval_arg;
 
-                       if (!mono_class_can_access_class (class, ctr))
+                       if (!mono_class_can_access_class (klass, ctr))
                                goto fail;
 
                        if (!mono_type_is_valid_type_in_context (constraint_type, &gc->context))
@@ -6307,48 +6307,48 @@ fail:
  * 
  */
 gboolean
-mono_verifier_verify_class (MonoClass *class)
+mono_verifier_verify_class (MonoClass *klass)
 {
        /*Neither <Module>, object or ifaces have parent.*/
-       if (!class->parent &&
-               class != mono_defaults.object_class && 
-               !MONO_CLASS_IS_INTERFACE (class) &&
-               (!image_is_dynamic (class->image) && class->type_token != 0x2000001)) /*<Module> is the first type in the assembly*/
+       if (!klass->parent &&
+               klass != mono_defaults.object_class && 
+               !MONO_CLASS_IS_INTERFACE (klass) &&
+               (!image_is_dynamic (klass->image) && klass->type_token != 0x2000001)) /*<Module> is the first type in the assembly*/
                return FALSE;
-       if (class->parent) {
-               if (MONO_CLASS_IS_INTERFACE (class->parent))
+       if (klass->parent) {
+               if (MONO_CLASS_IS_INTERFACE (klass->parent))
                        return FALSE;
-               if (!class->generic_class && class->parent->generic_container)
+               if (!klass->generic_class && klass->parent->generic_container)
                        return FALSE;
-               if (class->parent->generic_class && !class->generic_class) {
-                       MonoGenericContext *context = mono_class_get_context (class);
-                       if (class->generic_container)
-                               context = &class->generic_container->context;
-                       if (!mono_type_is_valid_type_in_context (&class->parent->byval_arg, context))
+               if (klass->parent->generic_class && !klass->generic_class) {
+                       MonoGenericContext *context = mono_class_get_context (klass);
+                       if (klass->generic_container)
+                               context = &klass->generic_container->context;
+                       if (!mono_type_is_valid_type_in_context (&klass->parent->byval_arg, context))
                                return FALSE;
                }
        }
-       if (class->generic_container && (class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT)
+       if (klass->generic_container && (klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT)
                return FALSE;
-       if (class->generic_container && !verify_generic_parameters (class))
+       if (klass->generic_container && !verify_generic_parameters (klass))
                return FALSE;
-       if (!verify_class_for_overlapping_reference_fields (class))
+       if (!verify_class_for_overlapping_reference_fields (klass))
                return FALSE;
-       if (class->generic_class && !mono_class_is_valid_generic_instantiation (NULL, class))
+       if (klass->generic_class && !mono_class_is_valid_generic_instantiation (NULL, klass))
                return FALSE;
-       if (class->generic_class == NULL && !verify_class_fields (class))
+       if (klass->generic_class == NULL && !verify_class_fields (klass))
                return FALSE;
-       if (class->valuetype && !verify_valuetype_layout (class))
+       if (klass->valuetype && !verify_valuetype_layout (klass))
                return FALSE;
-       if (!verify_interfaces (class))
+       if (!verify_interfaces (klass))
                return FALSE;
        return TRUE;
 }
 
 gboolean
-mono_verifier_class_is_valid_generic_instantiation (MonoClass *class)
+mono_verifier_class_is_valid_generic_instantiation (MonoClass *klass)
 {
-       return mono_class_is_valid_generic_instantiation (NULL, class);
+       return mono_class_is_valid_generic_instantiation (NULL, klass);
 }
 
 gboolean
@@ -6362,7 +6362,7 @@ mono_verifier_is_method_valid_generic_instantiation (MonoMethod *method)
 #else
 
 gboolean
-mono_verifier_verify_class (MonoClass *class)
+mono_verifier_verify_class (MonoClass *klass)
 {
        /* The verifier was disabled at compile time */
        return TRUE;
@@ -6425,7 +6425,7 @@ mono_free_verify_list (GSList *list)
 }
 
 gboolean
-mono_verifier_class_is_valid_generic_instantiation (MonoClass *class)
+mono_verifier_class_is_valid_generic_instantiation (MonoClass *klass)
 {
        return TRUE;
 }
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..220d89d4e5f87788399821b42083998540e2b8b5 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);
@@ -5185,6 +5172,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
        case MONO_PATCH_INFO_JIT_TLS_ID:
        case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
        case MONO_PATCH_INFO_GC_NURSERY_START:
+       case MONO_PATCH_INFO_GC_NURSERY_BITS:
                break;
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
                encode_value (patch_info->data.index, p, &p);
@@ -5457,6 +5445,7 @@ emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg)
 
                if (patch_info->type == MONO_PATCH_INFO_GC_CARD_TABLE_ADDR ||
                        patch_info->type == MONO_PATCH_INFO_GC_NURSERY_START ||
+                       patch_info->type == MONO_PATCH_INFO_GC_NURSERY_BITS ||
                        patch_info->type == MONO_PATCH_INFO_AOT_MODULE) {
                        /* Stored in a GOT slot initialized at module load time */
                        patch_info->type = MONO_PATCH_INFO_NONE;
@@ -7060,6 +7049,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                case MONO_PATCH_INFO_NONE:
                case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
                case MONO_PATCH_INFO_GC_NURSERY_START:
+               case MONO_PATCH_INFO_GC_NURSERY_BITS:
                        break;
                case MONO_PATCH_INFO_IMAGE:
                        /* The assembly is stored in GOT slot 0 */
@@ -7317,6 +7307,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)
 {
@@ -9514,6 +9524,11 @@ add_preinit_got_slots (MonoAotCompile *acfg)
        get_got_offset (acfg, FALSE, ji);
        get_got_offset (acfg, TRUE, ji);
 
+       ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo));
+       ji->type = MONO_PATCH_INFO_GC_NURSERY_BITS;
+       get_got_offset (acfg, FALSE, ji);
+       get_got_offset (acfg, TRUE, ji);
+
        for (i = 0; i < sizeof (preinited_jit_icalls) / sizeof (char*); ++i) {
                ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile));
                ji->type = MONO_PATCH_INFO_INTERNAL_METHOD;
@@ -9631,6 +9646,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 f00e74d4bb113718f662b8ad7ef2f5035b63f5f4..63f6e1f713f84648ae33628e5db5fd12e6b0c5ca 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>
 
@@ -529,8 +529,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
                                MonoGenericParam *par = (MonoGenericParam*)mono_image_alloc0 (module->assembly->image, sizeof (MonoGenericParamFull));
                                par->num = num;
                                par->gshared_constraint = gshared_constraint;
-                               // FIXME:
-                               par->image = mono_defaults.corlib;
+                               par->image = module->assembly->image;
                                t->data.generic_param = par;
                                if (par_name)
                                        ((MonoGenericParamFull*)par)->info.name = par_name;
@@ -829,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);
@@ -894,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);
 
@@ -904,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);
 
@@ -988,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);
@@ -1074,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);
@@ -1135,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) {
@@ -1652,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;
 
@@ -1721,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;
 }
@@ -1789,13 +1800,16 @@ init_amodule_got (MonoAotModule *amodule)
                        amodule->shared_got [i] = NULL;
                } else if (ji->type == MONO_PATCH_INFO_GC_NURSERY_START && !mono_gc_is_moving ()) {
                        amodule->shared_got [i] = NULL;
+               } else if (ji->type == MONO_PATCH_INFO_GC_NURSERY_BITS && !mono_gc_is_moving ()) {
+                       amodule->shared_got [i] = NULL;
                } else if (ji->type == MONO_PATCH_INFO_IMAGE) {
                        amodule->shared_got [i] = amodule->assembly->image;
                } else if (ji->type == MONO_PATCH_INFO_MSCORLIB_GOT_ADDR) {
                        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;
                        }
@@ -3413,6 +3427,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin
        case MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG:
        case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
        case MONO_PATCH_INFO_GC_NURSERY_START:
+       case MONO_PATCH_INFO_GC_NURSERY_BITS:
        case MONO_PATCH_INFO_JIT_TLS_ID:
                break;
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
@@ -4420,7 +4435,7 @@ mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code
 
        ji.type = decode_value (p, &p);
 
-       mp = mono_mempool_new_size (512);
+       mp = mono_mempool_new ();
        res = decode_patch (module, mp, &ji, p, &p);
 
        if (!res) {
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..f2dc914e374aaf959ca6cbb97336efe5bb72ab6c 100644 (file)
@@ -47,11 +47,13 @@ typedef enum {
        MONO_AOT_MODE_NONE,
        /* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
        MONO_AOT_MODE_NORMAL,
-       /* Enables hyrbid AOT mode, JIT can still be used for wrappers */
+       /* Enables hybrid AOT mode, JIT can still be used for wrappers */
        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 9c01d20f38fe91f56748cf7029e95e9a2437818c..c54c08f6a9ed22c6bffc3b8ba44f6ba2c3bf7df7 100644 (file)
@@ -7515,6 +7515,22 @@ emit_optimized_ldloca_ir (MonoCompile *cfg, unsigned char *ip, unsigned char *en
        return NULL;
 }
 
+static void
+emit_runtime_constant (MonoCompile *cfg, MonoInst **ins, MonoJumpInfoType patch_type)
+{
+       if (cfg->compile_aot) {
+               EMIT_NEW_AOTCONST (cfg, *ins, patch_type, NULL);
+       } else {
+               MonoJumpInfo ji;
+               gpointer target;
+
+               ji.type = patch_type;
+               target = mono_resolve_patch_target (NULL, NULL, NULL, &ji, FALSE);
+
+               EMIT_NEW_PCONST (cfg, *ins, target);
+       }
+}
+
 static gboolean
 is_exception_class (MonoClass *klass)
 {
@@ -9585,7 +9601,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * based on whenever there is an rgctx or not.
                         */
                        if (cfg->llvm_only && virtual && cmethod && (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
-                               MonoInst *args [16], *icall_args [16];
+                               MonoInst *args_buf [16], *icall_args [16];
+                               MonoInst **args;
                                MonoBasicBlock *rgctx_bb, *end_bb;
                                MonoInst *call1, *call2, *call_target;
                                MonoMethodSignature *rgctx_sig;
@@ -9627,7 +9644,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                /* Rgctx case */
                                MONO_START_BB (cfg, rgctx_bb);
                                /* Make a call with an rgctx */
-                               g_assert (fsig->param_count + 2 < 16);
+                               if (fsig->param_count + 2 < 16)
+                                       args = args_buf;
+                               else
+                                       args = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * (fsig->param_count + 2));
                                args [0] = sp [0];
                                for (i = 0; i < fsig->param_count; ++i)
                                        args [i + 1] = sp [i + 1];
@@ -12137,43 +12157,26 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                                break;
                        }
-                       case CEE_MONO_LDPTR_CARD_TABLE: {
-                               int shift_bits;
-                               gpointer card_mask;
-                               CHECK_STACK_OVF (1);
-
-                               if (cfg->compile_aot)
-                                       EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_GC_CARD_TABLE_ADDR, NULL);
-                               else
-                                       EMIT_NEW_PCONST (cfg, ins, mono_gc_get_card_table (&shift_bits, &card_mask));
-
-                               *sp++ = ins;
-                               ip += 2;
-                               inline_costs += 10 * num_calls++;
-                               break;
-                       }
-                       case CEE_MONO_LDPTR_NURSERY_START: {
-                               int shift_bits;
-                               size_t size;
-                               CHECK_STACK_OVF (1);
-
-                               if (cfg->compile_aot)
-                                       EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_GC_NURSERY_START, NULL);
-                               else
-                                       EMIT_NEW_PCONST (cfg, ins, mono_gc_get_nursery (&shift_bits, &size));
-
-                               *sp++ = ins;
-                               ip += 2;
-                               inline_costs += 10 * num_calls++;
-                               break;
-                       }
+                       case CEE_MONO_LDPTR_CARD_TABLE:
+                       case CEE_MONO_LDPTR_NURSERY_START:
+                       case CEE_MONO_LDPTR_NURSERY_BITS:
                        case CEE_MONO_LDPTR_INT_REQ_FLAG: {
                                CHECK_STACK_OVF (1);
 
-                               if (cfg->compile_aot)
-                                       EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG, NULL);
-                               else
-                                       EMIT_NEW_PCONST (cfg, ins, mono_thread_interruption_request_flag ());
+                               switch (ip [1]) {
+                                       case CEE_MONO_LDPTR_CARD_TABLE:
+                                               emit_runtime_constant (cfg, &ins, MONO_PATCH_INFO_GC_CARD_TABLE_ADDR);
+                                               break;
+                                       case CEE_MONO_LDPTR_NURSERY_START:
+                                               emit_runtime_constant (cfg, &ins, MONO_PATCH_INFO_GC_NURSERY_START);
+                                               break;
+                                       case CEE_MONO_LDPTR_NURSERY_BITS:
+                                               emit_runtime_constant (cfg, &ins, MONO_PATCH_INFO_GC_NURSERY_BITS);
+                                               break;
+                                       case CEE_MONO_LDPTR_INT_REQ_FLAG:
+                                               emit_runtime_constant (cfg, &ins, MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG);
+                                               break;
+                               }
 
                                *sp++ = ins;
                                ip += 2;
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 c37664d134057f9b794566d067891ef712019691..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>
@@ -126,14 +130,10 @@ mono_exceptions_init (void)
        cbs.mono_walk_stack_with_ctx = mono_runtime_walk_stack_with_ctx;
        cbs.mono_walk_stack_with_state = mono_walk_stack_with_state;
 
-#if defined(ENABLE_LLVM) && !defined(MONO_LLVM_LOADED)
        if (mono_llvm_only)
                cbs.mono_raise_exception = mono_llvm_raise_exception;
        else
                cbs.mono_raise_exception = mono_get_throw_exception ();
-#else
-               cbs.mono_raise_exception = mono_get_throw_exception ();
-#endif
        cbs.mono_raise_exception_with_ctx = mono_raise_exception_with_ctx;
        cbs.mono_exception_walk_trace = mono_exception_walk_trace;
        cbs.mono_install_handler_block_guard = mono_install_handler_block_guard;
@@ -2717,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
@@ -2737,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)
 {
@@ -2752,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;
@@ -2768,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 ();
@@ -2899,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 33d473cfc6e9e093ff76b78f840ebf9bf4889c08..1d79ce0d5115ca241d05e82a4c2fbcad4709fec1 100644 (file)
@@ -747,11 +747,6 @@ mono_llvm_dispose_ee (MonoEERef *eeref)
 
 #else
 
-void
-mono_llvm_cpp_throw_exception (void)
-{
-}
-
 void
 mono_llvm_set_unhandled_exception_handler (void)
 {
index a2e4abc6f9c44ec5277940d676e1bd9191ac8eef..78bccd07ff9422a5adcc1ddc75af0343f5a84a8c 100644 (file)
@@ -111,9 +111,6 @@ mono_llvm_set_unhandled_exception_handler (void);
 void
 default_mono_llvm_unhandled_exception (void);
 
-void
-mono_llvm_cpp_throw_exception (void);
-
 G_END_DECLS
 
 #endif /* __MONO_MINI_LLVM_CPP_H__ */  
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..d073a2c1db6d4b4157b664eea19cccf1330e77c6 100644 (file)
@@ -1235,6 +1235,7 @@ mono_patch_info_hash (gconstpointer data)
        case MONO_PATCH_INFO_MSCORLIB_GOT_ADDR:
        case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
        case MONO_PATCH_INFO_GC_NURSERY_START:
+       case MONO_PATCH_INFO_GC_NURSERY_BITS:
        case MONO_PATCH_INFO_JIT_TLS_ID:
        case MONO_PATCH_INFO_GOT_OFFSET:
        case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
@@ -1429,10 +1430,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: {
@@ -1663,6 +1663,15 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                target = mono_gc_get_nursery (&shift_bits, &size);
                break;
        }
+       case MONO_PATCH_INFO_GC_NURSERY_BITS: {
+               int shift_bits;
+               size_t size;
+
+               mono_gc_get_nursery (&shift_bits, &size);
+
+               target = (gpointer)(mgreg_t)shift_bits;
+               break;
+       }
        case MONO_PATCH_INFO_CASTCLASS_CACHE: {
                target = mono_domain_alloc0 (domain, sizeof (gpointer));
                break;
@@ -3289,9 +3298,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 8b77c438721b0280a37688ba279136d663308bd3..ca4ea9fd7d3641675a7f3ef6dd8591bbec0591f6 100644 (file)
@@ -58,3 +58,4 @@ PATCH_INFO(GC_SAFE_POINT_FLAG, "gc_safe_point_flag")
 PATCH_INFO(NONE, "none")
 PATCH_INFO(AOT_MODULE, "aot_module")
 PATCH_INFO(AOT_JIT_INFO, "aot_jit_info")
+PATCH_INFO(GC_NURSERY_BITS, "gc_nursery_bits")
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 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 cd402bab447f2c484e58e5a0b5992ee088694152..03cf5a7e9bff706fd86a6d46db1c4b2b69d692e1 100644 (file)
@@ -864,11 +864,11 @@ runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQS
 
 runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
        @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
-       $(RUNTIME) ./test-runner.exe -j a --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
+       $(RUNTIME) ./test-runner.exe -j a --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
 
 runtest-managed-serial: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
        @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
-       $(RUNTIME) ./test-runner.exe -j 1 --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
+       $(RUNTIME) ./test-runner.exe -j 1 --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
 
 testjit:
        @if test x$(M) != x0; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
@@ -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 0b30affa84354f09ec2faeb394d542cc2d9a4551..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;
@@ -54,9 +57,8 @@ public class TestRunner
                int concurrency = 1;
                int timeout = 2 * 60; // in seconds
                int expectedExitCode = 0;
-               string testsuiteName = "runtime";
-
-               DateTime test_start_time = DateTime.UtcNow;
+               string testsuiteName = null;
+               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;
@@ -130,6 +139,11 @@ public class TestRunner
                        }
                }
 
+               if (String.IsNullOrEmpty (testsuiteName)) {
+                       Console.WriteLine ("Missing the required --testsuite-name command line option.");
+                       return 1;
+               }
+
                var disabled = new Dictionary <string, string> ();
 
                if (disabled_tests != null) {
@@ -137,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> ();
@@ -149,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) {
@@ -161,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) {
@@ -176,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;
@@ -226,6 +254,8 @@ public class TestRunner
                                                }
                                        };
 
+                                       var start = DateTime.UtcNow;
+
                                        p.Start ();
 
                                        p.BeginOutputReadLine ();
@@ -236,30 +266,31 @@ 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 ());
                                        }
                                }
                        });
@@ -272,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-->
@@ -399,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);
@@ -439,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 7dd659918745bfc7419451f9cc3ab93d117fba25..1a07001dc04273ffbe7da00887feeb999954e20b 100644 (file)
 #include <mono/utils/checked-build.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-tls.h>
+#include <mono/metadata/mempool.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/image-internals.h>
+#include <mono/metadata/class-internals.h>
 #include <glib.h>
 
 #define MAX_NATIVE_BT 6
@@ -225,4 +229,269 @@ assert_gc_neutral_mode (void)
        }
 }
 
+// check_metadata_store et al: The goal of these functions is to verify that if there is a pointer from one mempool into
+// another, that the pointed-to memory is protected by the reference count mechanism for MonoImages.
+//
+// Note: The code below catches only some kinds of failures. Failures outside its scope notably incode:
+// * Code below absolutely assumes that no mempool is ever held as "mempool" member by more than one Image or ImageSet at once
+// * Code below assumes reference counts never underflow (ie: if we have a pointer to something, it won't be deallocated while we're looking at it)
+// Locking strategy is a little slapdash overall.
+
+#define check_mempool_assert_message(...) \
+       g_assertion_message("Mempool reference violation: " __VA_ARGS__)
+
+// Say image X "references" image Y if X either contains Y in its modules field, or X’s "references" field contains an
+// assembly whose image is Y.
+// Say image X transitively references image Y if there is any chain of images-referencing-images which leads from X to Y.
+// Once the mempools for two pointers have been looked up, there are four possibilities:
+
+// Case 1. Image FROM points to Image TO: Legal if FROM transitively references TO
+
+// We'll do a simple BFS graph search on images. For each image we visit:
+static void
+check_image_search (GHashTable *visited, GPtrArray *next, MonoImage *candidate, MonoImage *goal, gboolean *success)
+{
+       // Image hasn't even been loaded-- ignore it
+       if (!candidate)
+               return;
+
+       // Image has already been visited-- ignore it
+       if (g_hash_table_lookup_extended (visited, candidate, NULL, NULL))
+               return;
+
+       // Image is the target-- mark success
+       if (candidate == goal)
+       {
+               *success = TRUE;
+               return;
+       }
+
+       // Unvisited image, queue it to have its children visited
+       g_hash_table_insert (visited, candidate, NULL);
+       g_ptr_array_add (next, candidate);
+       return;
+}
+
+static gboolean
+check_image_may_reference_image(MonoImage *from, MonoImage *to)
+{
+       if (to == from) // Shortcut
+               return TRUE;
+
+       // Corlib is never unloaded, and all images implicitly reference it.
+       // Some images avoid explicitly referencing it as an optimization, so special-case it here.
+       if (to == mono_defaults.corlib)
+               return TRUE;
+
+       gboolean success = FALSE;
+
+       // Images to inspect on this pass, images to inspect on the next pass
+       GPtrArray *current = g_ptr_array_sized_new (1), *next = g_ptr_array_new ();
+
+       // Because in practice the image graph contains cycles, we must track which images we've visited
+       GHashTable *visited = g_hash_table_new (NULL, NULL);
+
+       #define CHECK_IMAGE_VISIT(i) check_image_search (visited, next, (i), to, &success)
+
+       CHECK_IMAGE_VISIT (from); // Initially "next" contains only from node
+
+       // For each pass exhaust the "to check" queue while filling up the "check next" queue
+       while (!success && next->len > 0) // Halt on success or when out of nodes to process
+       {
+               // Swap "current" and "next" and clear next
+               GPtrArray *temp = current;
+               current = next;
+               next = temp;
+               g_ptr_array_set_size (next, 0);
+
+               int current_idx;
+               for(current_idx = 0; current_idx < current->len; current_idx++)
+               {
+                       MonoImage *checking = g_ptr_array_index (current, current_idx); // CAST?
+
+                       mono_image_lock (checking);
+
+                       // For each queued image visit all directly referenced images
+                       int inner_idx;
+
+                       for (inner_idx = 0; !success && inner_idx < checking->module_count; inner_idx++)
+                       {
+                               CHECK_IMAGE_VISIT (checking->modules[inner_idx]);
+                       }
+
+                       for (inner_idx = 0; !success && inner_idx < checking->nreferences; inner_idx++)
+                       {
+                               // References are lazy-loaded and thus allowed to be NULL.
+                               // If they are NULL, we don't care about them for this search, because they haven't impacted ref_count yet.
+                               if (checking->references[inner_idx])
+                               {
+                                       CHECK_IMAGE_VISIT (checking->references[inner_idx]->image);
+                               }
+                       }
+
+                       mono_image_unlock (checking);
+               }
+       }
+
+       g_ptr_array_free (current, TRUE); g_ptr_array_free (next, TRUE); g_hash_table_destroy (visited);
+
+       return success;
+}
+
+// Case 2. ImageSet FROM points to Image TO: One of FROM's "images" either is, or transitively references, TO.
+static gboolean
+check_image_set_may_reference_image (MonoImageSet *from, MonoImage *to)
+{
+       // See above-- All images implicitly reference corlib
+       if (to == mono_defaults.corlib)
+               return TRUE;
+
+       int idx;
+       gboolean success = FALSE;
+       mono_image_set_lock (from);
+       for (idx = 0; !success && idx < from->nimages; idx++)
+       {
+               if (!check_image_may_reference_image (from->images[idx], to))
+                       success = TRUE;
+       }
+       mono_image_set_unlock (from);
+
+       return success; // No satisfying image found in from->images
+}
+
+// Case 3. ImageSet FROM points to ImageSet TO: The images in TO are a strict subset of FROM (no transitive relationship is important here)
+static gboolean
+check_image_set_may_reference_image_set (MonoImageSet *from, MonoImageSet *to)
+{
+       if (to == from)
+               return TRUE;
+
+       gboolean valid = TRUE; // Until proven otherwise
+
+       mono_image_set_lock (from); mono_image_set_lock (to);
+
+       int to_idx, from_idx;
+       for (to_idx = 0; valid && to_idx < to->nimages; to_idx++)
+       {
+               gboolean seen = FALSE;
+
+               // For each item in to->images, scan over from->images looking for it.
+               for (from_idx = 0; !seen && from_idx < from->nimages; from_idx++)
+               {
+                       if (to->images[to_idx] == from->images[from_idx])
+                               seen = TRUE;
+               }
+
+               // If the to->images item is not found in from->images, the subset check has failed
+               if (!seen)
+                       valid = FALSE;
+       }
+
+       mono_image_set_unlock (from); mono_image_set_unlock (to);
+
+       return valid; // All items in "to" were found in "from"
+}
+
+// Case 4. Image FROM points to ImageSet TO: FROM transitively references *ALL* of the “images” listed in TO
+static gboolean
+check_image_may_reference_image_set (MonoImage *from, MonoImageSet *to)
+{
+       if (to->nimages == 0) // Malformed image_set
+               return FALSE;
+
+       gboolean valid = TRUE;
+
+       mono_image_set_lock (to);
+       int idx;
+       for (idx = 0; valid && idx < to->nimages; idx++)
+       {
+               if (!check_image_may_reference_image (from, to->images[idx]))
+                       valid = FALSE;
+       }
+       mono_image_set_unlock (to);
+
+       return valid; // All images in to->images checked out
+}
+
+// Small helper-- get a descriptive string for a MonoMemPoolOwner
+static const char *
+check_mempool_owner_name (MonoMemPoolOwner owner)
+{
+       if (owner.image)
+               return owner.image->name;
+       if (owner.image_set) // TODO: Construct a string containing all included images
+               return "(Imageset)";
+       return "(Non-image memory)";
+}
+
+static void
+check_mempool_may_reference_mempool (void *from_ptr, void *to_ptr, gboolean require_local)
+{
+       // Null pointers are OK
+       if (!to_ptr)
+               return;
+
+       MonoMemPoolOwner from = mono_find_mempool_owner (from_ptr), to = mono_find_mempool_owner (to_ptr);
+
+       if (require_local)
+       {
+               if (!check_mempool_owner_eq (from,to))
+                       check_mempool_assert_message ("Pointer in image %s should have been internal, but instead pointed to image %s", check_mempool_owner_name(from), check_mempool_owner_name(to));
+       }
+
+       // Writing into unknown mempool
+       else if (check_mempool_owner_eq (from, mono_mempool_no_owner))
+       {
+               check_mempool_assert_message ("Non-image memory attempting to write pointer to image %s", check_mempool_owner_name(to));
+       }
+
+       // Reading from unknown mempool
+       else if (check_mempool_owner_eq (to, mono_mempool_no_owner))
+       {
+               check_mempool_assert_message ("Attempting to write pointer from image %s to non-image memory", check_mempool_owner_name(from));
+       }
+
+       // Split out the four cases described above:
+       else if (from.image && to.image)
+       {
+               if (!check_image_may_reference_image (from.image, to.image))
+                       check_mempool_assert_message ("Image %s tried to point to image %s, but does not retain a reference", check_mempool_owner_name(from), check_mempool_owner_name(to));
+       }
+
+       else if (from.image && to.image_set)
+       {
+               if (!check_image_may_reference_image_set (from.image, to.image_set))
+                       check_mempool_assert_message ("Image %s tried to point to image set, but does not retain a reference", check_mempool_owner_name(from));
+       }
+
+       else if (from.image_set && to.image_set)
+       {
+               if (!check_image_set_may_reference_image_set (from.image_set, to.image_set))
+                       check_mempool_assert_message ("Image set tried to point to image set, but does not retain a reference");
+       }
+
+       else if (from.image_set && to.image)
+       {
+               if (!check_image_set_may_reference_image (from.image_set, to.image))
+                       check_mempool_assert_message ("Image set tried to point to image %s, but does not retain a reference", check_mempool_owner_name(to));
+       }
+
+       else
+       {
+               check_mempool_assert_message ("Internal logic error: Unreachable code");
+       }
+}
+
+void
+check_metadata_store (void *from, void *to)
+{
+    check_mempool_may_reference_mempool (from, to, FALSE);
+}
+
+void
+check_metadata_store_local (void *from, void *to)
+{
+    check_mempool_may_reference_mempool (from, to, TRUE);
+}
+
 #endif /* CHECKED_BUILD */
index d2ba9ec1b1b9d716a8f7ef147ac35cac1e79534b..17524bdd1b8362c64a2704ba60aba5204b3750c9 100644 (file)
 #define __CHECKED_BUILD_H__
 
 #include <config.h>
+#include <mono/utils/atomic.h>
+
+// This is for metadata writes which we have chosen not to check at the current time.
+// Because in principle this should never happen, we still use a macro so that the exemptions will be easier to find, and remove, later.
+// The current reason why this is needed is for pointers to constant strings, which the checker cannot verify yet.
+#define CHECKED_METADATA_WRITE_PTR_EXEMPT(ptr, val) do { (ptr) = (val); } while (0)
 
 #ifdef CHECKED_BUILD
 
@@ -70,6 +76,18 @@ Functions that can be called from both coop or preept modes.
        assert_gc_neutral_mode ();      \
 } while (0);
 
+// Use when writing a pointer from one image or imageset to another.
+#define CHECKED_METADATA_WRITE_PTR(ptr, val) do {    \
+    check_metadata_store (&(ptr), (val));    \
+    (ptr) = (val);    \
+} while (0);
+
+// Use when writing a pointer from an image or imageset to itself.
+#define CHECKED_METADATA_WRITE_PTR_LOCAL(ptr, val) do {    \
+    check_metadata_store_local (&(ptr), (val));    \
+    (ptr) = (val);    \
+} while (0);
+
 /*
 This can be called by embedders
 */
@@ -93,6 +111,9 @@ void assert_gc_neutral_mode (void);
 void checked_build_init (void);
 void checked_build_thread_transition(const char *transition, void *info, int from_state, int suspend_count, int next_state, int suspend_count_delta);
 
+void check_metadata_store(void *from, void *to);
+void check_metadata_store_local(void *from, void *to);
+
 #else
 
 #define MONO_REQ_GC_SAFE_MODE
@@ -104,6 +125,9 @@ void checked_build_thread_transition(const char *transition, void *info, int fro
 #define CHECKED_MONO_INIT()
 #define CHECKED_BUILD_THREAD_TRANSITION(transition, info, from_state, suspend_count, next_state, suspend_count_delta)
 
+#define CHECKED_METADATA_WRITE_PTR(ptr, val) do { (ptr) = (val); } while (0)
+#define CHECKED_METADATA_WRITE_PTR_LOCAL(ptr, val) do { (ptr) = (val); } while (0)
+
 #endif /* CHECKED_BUILD */
 
 #endif
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