Merge pull request #2201 from rolfbjarne/linker-better-xml-processing-errors
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Tue, 17 Nov 2015 13:47:18 +0000 (08:47 -0500)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Tue, 17 Nov 2015 13:47:18 +0000 (08:47 -0500)
[linker] Provide better error message when an error occurs while processing xml descriptions

212 files changed:
.gitignore
README.md
acceptance-tests/Makefile.am
acceptance-tests/SUBMODULES.json
external/referencesource
man/mono.1
mcs/Makefile
mcs/build/profiles/monotouch.make
mcs/build/profiles/monotouch_runtime.make
mcs/build/profiles/monotouch_tv_runtime.make [new file with mode: 0644]
mcs/build/profiles/monotouch_watch_runtime.make [new file with mode: 0644]
mcs/class/Facades/Makefile
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.Cairo/Mono.Cairo/Context.cs
mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs
mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs
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/System.Core/monotouch_tv_runtime_System.Core.dll.sources [new file with mode: 0644]
mcs/class/System.Core/monotouch_watch_runtime_System.Core.dll.sources [new file with mode: 0644]
mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs
mcs/class/System.Drawing/Test/System.Drawing/ColorTranslator.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ActionBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BatchBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BatchedJoinBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BatchedJoinBlock`3Test.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BroadcastBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ChooseTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/CompletionTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/DataflowBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ExecutionBlocksTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/JoinBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/JoinBlock`3Test.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OutputAvailableTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/PropagateCompletionTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ReceivingTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/TransformBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/TransformManyBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/WriteOnceBlockTest.cs
mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs [deleted file]
mcs/class/System.Web/System.Web.dll.sources
mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
mcs/class/System.XML/monotouch_tv_runtime_System.Xml.dll.sources [new file with mode: 0644]
mcs/class/System.XML/monotouch_watch_runtime_System.Xml.dll.sources [new file with mode: 0644]
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/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
mcs/class/System/ReferenceSources/SslStream.cs
mcs/class/System/System.Net.Security/SslStream.cs
mcs/class/System/System.Net/EndPointListener.cs
mcs/class/System/System.Net/HttpConnection.cs
mcs/class/System/System.Net/HttpListener.cs
mcs/class/System/Test/System.Net/HttpListener2Test.cs
mcs/class/System/monotouch_tv_runtime_System.dll.sources [new file with mode: 0644]
mcs/class/System/monotouch_watch_runtime_System.dll.sources [new file with mode: 0644]
mcs/class/corlib/System.IO/MonoIO.cs
mcs/class/corlib/System/Array.cs
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System.Reflection/MonoGenericClassTest.cs
mcs/class/corlib/Test/System.Threading/ThreadTest.cs
mcs/class/corlib/Test/System/ArrayTest.cs
mcs/class/corlib/Test/System/DateTimeOffsetTestCoreFx.cs
mcs/class/corlib/Test/System/EnumTest.cs
mcs/class/corlib/Test/System/TimeZoneInfoTest.cs
mcs/class/corlib/Test/System/TypeTest.cs
mcs/class/corlib/monotouch_tv_runtime_corlib.dll.sources [new file with mode: 0644]
mcs/class/corlib/monotouch_watch_runtime_corlib.dll.sources [new file with mode: 0644]
mcs/errors/cs0841-6.cs [new file with mode: 0644]
mcs/mcs/anonymous.cs
mcs/mcs/generic.cs
mcs/mcs/namespace.cs
mcs/mcs/statement.cs
mcs/tests/gtest-635.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/Descriptors/mscorlib.xml
mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs
mcs/tools/macpack/LOADER
mono/cil/opcode.def
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/attach.c
mono/metadata/boehm-gc.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/cominterop.c
mono/metadata/console-null.c
mono/metadata/console-unix.c
mono/metadata/console-win32.c
mono/metadata/debug-helpers.c
mono/metadata/domain.c
mono/metadata/file-io.c
mono/metadata/file-io.h
mono/metadata/gc-internal.h [deleted file]
mono/metadata/gc-internals.h [new file with mode: 0644]
mono/metadata/gc.c
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/image.c
mono/metadata/jit-info.c
mono/metadata/loader.c
mono/metadata/locales.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/metadata.c
mono/metadata/monitor.c
mono/metadata/mono-config.c
mono/metadata/mono-debug.c
mono/metadata/mono-hash.c
mono/metadata/mono-ptr-array.h
mono/metadata/null-gc.c
mono/metadata/number-ms.c
mono/metadata/object.c
mono/metadata/pedump.c
mono/metadata/profiler.c
mono/metadata/reflection-internals.h
mono/metadata/reflection.c
mono/metadata/remoting.c
mono/metadata/security-core-clr.c
mono/metadata/sgen-bridge-internal.h [deleted file]
mono/metadata/sgen-bridge-internals.h [new file with mode: 0644]
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-os-coop.c
mono/metadata/sgen-os-mach.c
mono/metadata/sgen-os-posix.c
mono/metadata/sgen-os-win32.c
mono/metadata/sgen-stw.c
mono/metadata/sgen-tarjan-bridge.c
mono/metadata/string-icalls.c
mono/metadata/threadpool-ms-io.c
mono/metadata/threadpool-ms.c
mono/metadata/threads.c
mono/metadata/verify.c
mono/mini/Makefile.am.in
mono/mini/TestDriver.cs
mono/mini/aot-compiler.c
mono/mini/aot-compiler.h [new file with mode: 0644]
mono/mini/aot-runtime.c
mono/mini/arch-stubs.c
mono/mini/debugger-agent.c
mono/mini/decompose.c
mono/mini/driver.c
mono/mini/exceptions-amd64.c
mono/mini/exceptions-ia64.c
mono/mini/exceptions-sparc.c
mono/mini/exceptions-x86.c
mono/mini/iltests.il [new file with mode: 0644]
mono/mini/iltests.il.in [deleted file]
mono/mini/jit-icalls.c
mono/mini/jit.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-arm.h
mono/mini/mini-darwin.c
mono/mini/mini-exceptions.c
mono/mini/mini-gc.c
mono/mini/mini-llvm.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini-windows.c
mono/mini/mini-x86.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/patch-info.h
mono/mini/tasklets.c
mono/mini/tramp-amd64.c
mono/mini/tramp-s390x.c
mono/mini/tramp-x86.c
mono/sgen/sgen-conf.h
mono/sgen/sgen-gc.c
mono/sgen/sgen-memory-governor.c
mono/sgen/sgen-workers.c
mono/sgen/sgen-workers.h
mono/tests/enum.cs
mono/tests/sgen-domain-unload-2.cs
mono/tests/sgen-new-threads-dont-join-stw.cs
mono/tests/test-driver
mono/tests/test-runner.cs
mono/utils/Makefile.am
mono/utils/mono-logger-internal.h [deleted file]
mono/utils/mono-logger-internals.h [new file with mode: 0644]
mono/utils/mono-logger.c
mono/utils/mono-mmap-internal.h [deleted file]
mono/utils/mono-mmap-internals.h [new file with mode: 0644]
mono/utils/mono-mmap.c
mono/utils/mono-sigcontext.h
mono/utils/mono-threads-posix.c
msvc/libmonoruntime.vcxproj
msvc/libmonoutils.vcxproj
runtime/Makefile.am
samples/embed/testi.c [deleted file]

index 1cb061f77894615a877ca23c16bcce6acb8e816d..3258779bae5618a8cfb4e68ad84b7959c1b2d9e7 100644 (file)
@@ -125,4 +125,5 @@ mono.h
 mono-*.tar.*
 tmpinst-dir.stamp
 msvc/scripts/inputs/
+extensions-config.h
 
index 27c6036d1a8c5c96fc07a62f1aeb2e027e2f2ae5..96559ab5c34307f3b10e964dfd4ce67b465ae4cc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -80,8 +80,7 @@ Testing and Installation
 You can run the mono and mcs test suites with the command: `make check`.
 
 Expect to find a few test suite failures. As a sanity check, you
-can compare the failures you got with [https://wrench.mono-project.com/Wrench/](https://wrench.mono-project.com/Wrench/)
-and [http://jenkins.mono-project.com/](http://jenkins.mono-project.com/).
+can compare the failures you got with [https://jenkins.mono-project.com/](https://jenkins.mono-project.com/).
 
 You can now install mono with: `make install`
 
index 367d4954dc8a38231550e3d7a383503f5614b184..68b9ff90e7dc4c8e38686a067a75eb9365f9504b 100644 (file)
@@ -19,54 +19,42 @@ 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_COREMANGLIB_TESTSI_CS) $(CORECLR_TESTSI_IL)
+       $(MAKE) -j4 $(CORECLR_TESTSI_CS)
+       $(MAKE) -j4 $(CORECLR_COREMANGLIB_TESTSI_CS)
+       $(MAKE) -j4 $(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
@@ -89,7 +77,7 @@ coreclr-runtest-coremanglib: coreclr-validate test-runner.exe $(CORECLR_COREMANG
 check-coreclr: coreclr-compile-tests coreclr-runtest-basic coreclr-runtest-coremanglib
 
 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
+       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
 
 # 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
@@ -307,6 +295,7 @@ 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/gettypetypeof/gettypetypeofmatrix.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     \
@@ -3808,7 +3797,12 @@ 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/ReversePInvoke/Marshalling/MarshalBoolArray.cs
+       $(CORECLR_PATH)/tests/src/Interop/ReversePInvoke/Marshalling/MarshalBoolArray.cs        \
+       $(CORECLR_PATH)/tests/src/Interop/NativeCallable/NativeCallableTest.cs  \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructABI/StructABI.OSX.cs       \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructABI/StructABI.Windows.cs   \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructABI/StructABI.Unix.cs      \
+       $(CORECLR_PATH)/tests/src/JIT/Directed/StructABI/StructABI.cs
 
 # relies on a define:
 CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/Exceptions/Finalization/Finalizer.cs
@@ -3860,6 +3854,9 @@ CORECLR_DISABLED_TEST_CS_SRC +=   \
        $(CORECLR_PATH)/tests/src/CoreMangLib/cti/system/resources/resourcemanager/customculture.cs     \
        $(CORECLR_PATH)/tests/src/CoreMangLib/system/resources/resourcemanager/customculture.cs
 
+# Mono doesn't support ICastable
+CORECLR_DISABLED_TEST_CS_SRC += $(CORECLR_PATH)/tests/src/Interop/ICastable/Castable.cs
+
 # throws IndexOutOfRange exception even on .NET
 CORECLR_DISABLED_TEST_CS_SRC +=        \
        $(CORECLR_PATH)/tests/src/baseservices/threading/interlocked/compareexchange/compareexchangetclass.cs   \
@@ -5203,4 +5200,9 @@ test-runner.exe: $(top_srcdir)/mono/tests/test-runner.cs
 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
+CLEANFILES = *.dll *.exe *.mdb $(CORECLR_STRESSTESTSI_CS) GCStressTests.exe coreclr-testlibrary.dll
+
+clean-local:
+       -rm -f $(CORECLR_TESTSI_CS)
+       -rm -f $(CORECLR_COREMANGLIB_TESTSI_CS)
+       -rm -f $(CORECLR_TESTSI_IL)
\ No newline at end of file
index cc2d888411881be7bc208c254a3a0a7330248d7e..8624aa789e2e55c3e83dce7f674ff77ab59a7091 100644 (file)
@@ -2,7 +2,7 @@
   {
     "name": "roslyn", 
     "url": "git://github.com/dotnet/roslyn.git", 
-    "rev": "2e68ae5e6ec51762296c681aadf57a6f33f2f34f", 
+    "rev": "322bd5b2bbf07df6a67de35cbcb2365484412f70", 
     "remote-branch": "origin/master", 
     "branch": "master", 
     "directory": "roslyn"
@@ -10,7 +10,7 @@
   {
     "name": "coreclr", 
     "url": "git://github.com/mono/coreclr.git", 
-    "rev": "65b122151adb6b5ef7c27d8e0c268ef479fbe8b4", 
+    "rev": "ffe6263398591cfbd8100070ac8a191ff2080fbb", 
     "remote-branch": "origin/mono", 
     "branch": "mono", 
     "directory": "coreclr"
@@ -18,7 +18,7 @@
   {
     "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 d69f20d81d23e8e924e9339552336a2d0252864a..8c73c45821dfbaf20fb303db1a73f8de96c0a515 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d69f20d81d23e8e924e9339552336a2d0252864a
+Subproject commit 8c73c45821dfbaf20fb303db1a73f8de96c0a515
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 35ae9f963f528d93e7a519e3423db8e2f474e19e..f6127157641bbf50f43ca438ecb8044ff927b3fa 100644 (file)
@@ -11,6 +11,8 @@ monotouch_SUBDIRS := build class
 monotouch_watch_SUBDIRS := build class
 monotouch_tv_SUBDIRS := build class
 monotouch_runtime_SUBDIRS := build class
+monotouch_watch_runtime_SUBDIRS := build class
+monotouch_tv_runtime_SUBDIRS := build class
 xammac_SUBDIRS := build class
 mobile_SUBDIRS := build class
 mobile_static_SUBDIRS := build class
@@ -65,6 +67,8 @@ $(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:
 $(_boot_:%=profile-do--monotouch_watch--%):   profile-do--monotouch_watch--%:   profile-do--build--%
 $(_boot_:%=profile-do--monotouch_tv--%):      profile-do--monotouch_tv--%:      profile-do--build--%
 $(_boot_:%=profile-do--monotouch_runtime--%):  profile-do--monotouch_runtime--%:  profile-do--build--%
+$(_boot_:%=profile-do--monotouch_watch_runtime--%):  profile-do--monotouch_watch_runtime--%:  profile-do--build--%
+$(_boot_:%=profile-do--monotouch_tv_runtime--%):     profile-do--monotouch_tv_runtime--%:     profile-do--build--%
 $(_boot_:%=profile-do--xammac--%):            profile-do--xammac--%:            profile-do--build--%
 $(_boot_:%=profile-do--xammac_net_4_5--%):    profile-do--xammac_net_4_5--%:           profile-do--build--%
 $(_boot_:%=profile-do--mobile--%):            profile-do--mobile--%:         profile-do--build--%
index bdeba2bac4e5701b52e7f365c5fcea413a2a0164..39d5443914fe7284745307a13b0c1e65b1c15c1e 100644 (file)
@@ -1,42 +1,4 @@
-#! -*- makefile -*-
+include $(topdir)/build/profiles/monotouch_runtime.make
 
-BOOTSTRAP_PROFILE = build
-
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-
-# Use system resgen as we don't want local System.Windows.Forms dependency
-RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
-
-profile-check:
-       @:
-
-DEFAULT_REFERENCES = -r:mscorlib.dll
-
-PROFILE_MCS_FLAGS = \
-       -d:NET_1_1 \
-       -d:NET_2_0 \
-       -d:NET_2_1 \
-       -d:NET_3_5 \
-       -d:NET_4_0 \
-       -d:NET_4_5 \
-       -d:MOBILE,MOBILE_LEGACY \
-       -d:MONO \
-       -d:DISABLE_CAS_USE \
-       -d:MONOTOUCH \
-       -d:DISABLE_REMOTING \
-       -d:DISABLE_COM \
-       -d:FULL_AOT_RUNTIME \
-       -nowarn:1699 \
-       -nostdlib \
-       -lib:$(topdir)/class/lib/$(PROFILE) \
-       $(DEFAULT_REFERENCES) \
-       $(PLATFORM_DEBUG_FLAGS)
-
-FRAMEWORK_VERSION = 2.1
-NO_TEST = yes
-
-# the tuner takes care of the install
-NO_INSTALL = yes
-MOBILE_STATIC = yes
-MOBILE_PROFILE = yes
+PROFILE_MCS_FLAGS += \
+       -d:FULL_AOT_RUNTIME
index 8f42ec8acbe599b29d7311ddcdfab8c0202d7b6a..de74d7d92bff19bc79b78c3d21e7cf6815abd678 100644 (file)
@@ -14,7 +14,24 @@ profile-check:
        @:
 
 DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE  -d:MOBILE,MOBILE_LEGACY -d:MONOTOUCH -D:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+PROFILE_MCS_FLAGS = \
+       -d:NET_1_1 \
+       -d:NET_2_0 \
+       -d:NET_2_1 \
+       -d:NET_3_5 \
+       -d:NET_4_0 \
+       -d:NET_4_5 \
+       -d:MOBILE,MOBILE_LEGACY \
+       -d:MONO \
+       -d:DISABLE_CAS_USE \
+       -d:MONOTOUCH \
+       -d:DISABLE_REMOTING \
+       -d:DISABLE_COM \
+       -nowarn:1699 \
+       -nostdlib \
+       -lib:$(topdir)/class/lib/$(PROFILE) \
+       $(DEFAULT_REFERENCES) \
+       $(PLATFORM_DEBUG_FLAGS)
 
 FRAMEWORK_VERSION = 2.1
 
diff --git a/mcs/build/profiles/monotouch_tv_runtime.make b/mcs/build/profiles/monotouch_tv_runtime.make
new file mode 100644 (file)
index 0000000..c6c98dc
--- /dev/null
@@ -0,0 +1,4 @@
+include $(topdir)/build/profiles/monotouch_runtime.make
+
+PROFILE_MCS_FLAGS += \
+       -d:MONOTOUCH_TV
diff --git a/mcs/build/profiles/monotouch_watch_runtime.make b/mcs/build/profiles/monotouch_watch_runtime.make
new file mode 100644 (file)
index 0000000..0a63182
--- /dev/null
@@ -0,0 +1,4 @@
+include $(topdir)/build/profiles/monotouch_runtime.make
+
+PROFILE_MCS_FLAGS += \
+       -d:MONOTOUCH_WATCH
index e5a5892a916d764ddc582b344ffaf23af91e14c9..2f8847d707a580082df4139a81a1acf16835f4b2 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.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
 
@@ -68,6 +29,7 @@ include $(MCS_BUILD_DIR)/rules.make
 dist-local: dist-default
 
 DIST_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
+DISTFILES=subdirs.make
 
 doc-update-local:
        @echo "not doing docs"
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 309f3826aabeae5d3680fcdbd03dce6e75a6aa3b..64790f2005f35d3b1e2fcc2b9500325668655ba9 100644 (file)
@@ -85,6 +85,9 @@ monotouch_runtime_dirs := \
        System.XML \
        Mono.CSharp
 
+monotouch_watch_runtime_dirs := $(monotouch_runtime_dirs)
+monotouch_tv_runtime_dirs := $(monotouch_runtime_dirs)
+
 xammac_4_5_dirs := \
        corlib  \
        System  \
@@ -283,6 +286,8 @@ monotouch_SUBDIRS := $(monotouch_dirs)
 monotouch_watch_SUBDIRS := $(monotouch_watch_dirs)
 monotouch_tv_SUBDIRS    := $(monotouch_tv_dirs)
 monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
+monotouch_watch_runtime_SUBDIRS := $(monotouch_watch_runtime_dirs)
+monotouch_tv_runtime_SUBDIRS := $(monotouch_tv_runtime_dirs)
 mobile_static_SUBDIRS := $(mobile_static_dirs)
 mobile_SUBDIRS := $(mobile_dynamic_dirs)
 xammac_SUBDIRS := $(xammac_dirs)
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 57cb86cd8b0e855c9f6ee28749240cd5e39766c0..7ca0dee45dd5f5ee5ebb41c273fc1c3373d62297 100644 (file)
@@ -230,7 +230,7 @@ namespace Cairo {
                        NativeMethods.cairo_set_dash (handle, dashes, dashes.Length, offset);
                }
 
-               [Obsolete("Use GetSource/GetSource")]
+               [Obsolete("Use GetSource/SetSource")]
                public Pattern Pattern {
                        set {
                                SetSource (value);
@@ -241,7 +241,7 @@ namespace Cairo {
                }
 
                //This is obsolete because it wasn't obvious it needed to be disposed
-               [Obsolete("Use GetSource/GetSource")]
+               [Obsolete("Use GetSource/SetSource")]
                public Pattern Source {
                        set {
                                SetSource (value);
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 bde613bbb90c513a3b9e3a76f230ccc677adbc6e..5754f4fd87d8b876f18b5a6efe9948de8a20d8c3 100644 (file)
@@ -56,7 +56,7 @@ namespace Mono.Security.Providers.OldTls
                        Stream innerStream, bool leaveInnerStreamOpen,
                        MonoTlsSettings settings = null)
                {
-                       var impl = new LegacySslStream (innerStream, leaveInnerStreamOpen, settings);
+                       var impl = new LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
                        return new MonoSslStreamImpl (impl);
                }
 
index e2c9a05c158c038ee9cc581613c19f2134627198..7fab7f7f35d4127d4febd09c9445cafe8c3d39ef 100644 (file)
@@ -86,13 +86,21 @@ namespace Mono.Security.Interface
                        get;
                }
 
-               X509Certificate SelectClientCertificate (
+               /*
+                * Returns `true` if a client certificate has been selected (which could be `null`).
+                */
+               bool SelectClientCertificate (
                        string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate,
-                       string[] acceptableIssuers);
+                       string[] acceptableIssuers, out X509Certificate clientCertificate);
 
-               ValidationResult ValidateChain (string targetHost, X509CertificateCollection certificates);
+               /*
+                * If @serverMode is true, then we're a server and want to validate a certificate that we received from a client.
+                */
+               ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509CertificateCollection certificates);
 
-               ValidationResult ValidateClientCertificate (X509CertificateCollection certificates);
+               bool InvokeSystemValidator (
+                       string targetHost, bool serverMode, X509CertificateCollection certificates,
+                       ref MonoSslPolicyErrors errors, ref int status11);
        }
 
        public static class CertificateValidationHelper
@@ -128,14 +136,25 @@ namespace Mono.Security.Interface
                        get { return supportsTrustAnchors; }
                }
 
-               internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
+               static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
-                       return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (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 GetDefaultValidator (provider, settings);
+               }
+
+               /*
+                * Use this overloaded version in user code.
+                */
                public static ICertificateValidator GetValidator (MonoTlsSettings settings)
                {
-                       return GetDefaultValidator (settings);
+                       return GetDefaultValidator (null, settings);
                }
        }
 #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..7305c51784d6f7dc3e77c9335138d4c3c0cd6d52 100644 (file)
@@ -105,6 +105,33 @@ namespace Mono.Security.Interface
 
 #endregion
 
+#region Certificate Validation
+
+               /*
+                * Allows a TLS provider to provide a custom system certificiate validator.
+                */
+               public virtual bool HasCustomSystemCertificateValidator {
+                       get { return false; }
+               }
+
+               /*
+                * If @serverMode is true, then we're a server and want to validate a certificate
+                * that we received from a client.
+                * 
+                * Returns `true` if certificate validation has been performed and `false` to invoke the
+                * default system validator.
+                */
+               public virtual bool InvokeSystemCertificateValidator (
+                       ICertificateValidator validator, string targetHost, bool serverMode,
+                       X509CertificateCollection certificates, out bool success,
+                       ref MonoSslPolicyErrors errors, ref int status11)
+               {
+                       success = false;
+                       return false;
+               }
+
+#endregion
+
 #region Manged SSPI
 
                /*
index 1c7035addf4cd739bf233fd93aa36ba5197b9232..41ff61e243e675c8b4e8bdd8187d04c6e9265c63 100644 (file)
@@ -93,7 +93,7 @@ namespace Mono.Security.Interface
                        return NoReflectionHelper.CreateHttpsRequest (requestUri, provider, settings);
                }
 
-               public static HttpListener CreateHttpListener (X509Certificate2 certificate, MonoTlsProvider provider = null, MonoTlsSettings settings = null)
+               public static HttpListener CreateHttpListener (X509Certificate certificate, MonoTlsProvider provider = null, MonoTlsSettings settings = null)
                {
                        return (HttpListener)NoReflectionHelper.CreateHttpListener (certificate, provider, settings);
                }
index 5c7dba7b07785cdd244d13e536bf9ffc22f44b87..077ed335e785ae4f941b514c6e681af996cc3b9a 100644 (file)
@@ -89,6 +89,10 @@ namespace Mono.Security.Interface
                bool callbackNeedsChain = true;
                ICertificateValidator certificateValidator;
 
+               public MonoTlsSettings ()
+               {
+               }
+
                #region Private APIs
 
                /*
@@ -101,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!")]
@@ -112,22 +115,26 @@ namespace Mono.Security.Interface
                                return this;
                        }
 
-                       var copy = new MonoTlsSettings ();
-                       copy.RemoteCertificateValidationCallback = RemoteCertificateValidationCallback;
-                       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.EnabledProtocols = EnabledProtocols;
-                       copy.TrustAnchors = TrustAnchors;
-                       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
        }
 }
diff --git a/mcs/class/System.Core/monotouch_tv_runtime_System.Core.dll.sources b/mcs/class/System.Core/monotouch_tv_runtime_System.Core.dll.sources
new file mode 100644 (file)
index 0000000..b050f33
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_System.Core.dll.sources
diff --git a/mcs/class/System.Core/monotouch_watch_runtime_System.Core.dll.sources b/mcs/class/System.Core/monotouch_watch_runtime_System.Core.dll.sources
new file mode 100644 (file)
index 0000000..b050f33
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_System.Core.dll.sources
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 9e91ad564762bec33432867fbf633902e7d2df39..0502b761beb70dd8c651545859bf2ce233c549a9 100644 (file)
@@ -46,7 +46,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        for (int i = 0; i < array.Length; ++i)
                                Assert.IsTrue (block.Post (i), "Not accepted");
 
-                       Assert.IsTrue (evt.Wait (500));
+                       Assert.IsTrue (evt.Wait (1000));
                        
                        Assert.IsTrue (array.All (b => b), "Some false");
                }
@@ -82,7 +82,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        block.Complete ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
index 9812f1b6295f179ef335b699e8063aee707baf1c..a6f4ab1090b53ecde9484f4c2dc4c80d16975acc 100644 (file)
@@ -340,7 +340,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        scheduler.ExecuteAll ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -355,9 +355,9 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        block.Complete ();
 
                        CollectionAssert.AreEqual (new[] { 1 },
-                               block.Receive (TimeSpan.FromMilliseconds (200)));
+                               block.Receive (TimeSpan.FromMilliseconds (2000)));
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -371,9 +371,9 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        block.Complete ();
 
                        CollectionAssert.AreEqual (new[] { 1, 2 },
-                               block.Receive (TimeSpan.FromMilliseconds (200)));
+                               block.Receive (TimeSpan.FromMilliseconds (2000)));
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -386,9 +386,9 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        block.Complete ();
 
                        CollectionAssert.AreEqual (new[] { 1 },
-                               block.Receive (TimeSpan.FromMilliseconds (200)));
+                               block.Receive (TimeSpan.FromMilliseconds (2000)));
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -410,7 +410,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        int[] batch;
                        Assert.IsFalse (block.TryReceive (out batch));
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -446,7 +446,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (block.TryReceive (out batch));
                        CollectionAssert.AreEquivalent (new[] { 11, 21 }, batch);
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
        }
 }
\ No newline at end of file
index 5547b2f14ab174c1faa38293200ea324916f11aa..50983f5d9cac16884eb8b3853a06d22412938db0 100644 (file)
@@ -52,7 +52,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (block.Target2.Post (2));
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsNotNull (result);
                        CollectionAssert.AreEqual (new[] { 1 }, result.Item1);
@@ -68,7 +68,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsNull (result);
 
                        Assert.IsTrue (block.Target1.Post (4));
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsNotNull (result);
                        CollectionAssert.AreEqual (new[] { 3, 4 }, result.Item1);
@@ -84,7 +84,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsNull (result);
 
                        Assert.IsTrue (block.Target2.Post (6));
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsNotNull (result);
                        CollectionAssert.IsEmpty (result.Item1);
@@ -114,7 +114,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        CollectionAssert.AreEqual (new[] { 1 }, batch.Item1);
                        CollectionAssert.IsEmpty (batch.Item2);
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -143,7 +143,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        scheduler.ExecuteAll ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
        }
 }
\ No newline at end of file
index f1d622f799e439ffbd32184b50b01443f0d4561a..bdf27532e0b24667ff5134021af9c095a9d4b890 100644 (file)
@@ -54,7 +54,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (block.Target3.Post ("foo"));
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsNotNull (result);
                        CollectionAssert.AreEqual (new[] { 1 }, result.Item1);
@@ -86,7 +86,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        CollectionAssert.IsEmpty (batch.Item2);
                        CollectionAssert.IsEmpty (batch.Item3);
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -125,7 +125,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        scheduler.ExecuteAll ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
        }
 }
\ No newline at end of file
index bd8ccb579e0fdf8a3f422a412adf296bd44be296..bec9f30a1884947be265b146bcbe9a14ad3d76e3 100644 (file)
@@ -77,13 +77,13 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.AreEqual (DataflowMessageStatus.Postponed,
                                target.OfferMessage (header, 43, source, false));
 
-                       Assert.AreEqual (42, block.Receive (TimeSpan.FromMilliseconds (100)));
+                       Assert.AreEqual (42, block.Receive (TimeSpan.FromMilliseconds (1000)));
 
                        Assert.IsFalse (block.Completion.Wait (100));
 
                        Assert.IsTrue (source.WasConsumed (header));
 
-                       Assert.AreEqual (43, block.Receive (TimeSpan.FromMilliseconds (100)));
+                       Assert.AreEqual (43, block.Receive (TimeSpan.FromMilliseconds (1000)));
 
                        Assert.AreEqual (DataflowMessageStatus.Accepted,
                                target.OfferMessage (new DataflowMessageHeader (3), 44, source, false));
index 1802b389e427a3c6ea695cc6f6323bd373a3e82b..b08e6bd174a00baad2a3b9899be216ace4e825e5 100644 (file)
@@ -58,7 +58,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (broadcast.Post (42));
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsTrue (act1);
                        Assert.IsTrue (act2);
@@ -81,7 +81,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        broadcast.LinkTo (action);
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsTrue (act);
                }
@@ -99,7 +99,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (broadcast.Post (2));
 
                        Assert.AreEqual (1, target.Receive (TimeSpan.FromMilliseconds (0)));
-                       Assert.AreEqual (2, target.Receive (TimeSpan.FromMilliseconds (100)));
+                       Assert.AreEqual (2, target.Receive (TimeSpan.FromMilliseconds (1000)));
                }
 
                [Test]
@@ -200,7 +200,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (broadcast.Post (2));
 
                        AssertEx.Throws<TimeoutException> (
-                               () => target.Receive (TimeSpan.FromMilliseconds (100)));
+                               () => target.Receive (TimeSpan.FromMilliseconds (1000)));
 
                        scheduler.ExecuteAll ();
 
@@ -269,7 +269,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (broadcast.Post (source));
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsNotNull (act1);
                        Assert.IsNotNull (act2);
index e22e94113a850dfc3661ca6d25c9eeb4a026cdf4..0844be2368018ba8372f98a1d606e9b9d9abfdd7 100644 (file)
@@ -46,7 +46,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        source1.Post (42);
 
-                       Assert.IsTrue (completion.Wait (500));
+                       Assert.IsTrue (completion.Wait (1000));
                        Assert.AreEqual (0, completion.Result);
                        Assert.IsTrue (action1);
                        Assert.IsFalse (action2);
@@ -67,7 +67,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        source1.Post (42);
                        source1.Post (43);
 
-                       Assert.IsTrue (completion.Wait (500));
+                       Assert.IsTrue (completion.Wait (1000));
                        Assert.AreEqual (0, completion.Result);
                        Assert.AreEqual (1, action1);
                        Assert.AreEqual (0, action2);
@@ -104,7 +104,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Task.WaitAll (t1, t2);
 
-                       Assert.IsTrue (completion.Wait (500));
+                       Assert.IsTrue (completion.Wait (1000));
                        Assert.AreEqual (1, action1 + action2);
 
                        int item;
@@ -166,7 +166,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        source1.Post (10);
 
-                       Assert.IsTrue (completion.Wait (500));
+                       Assert.IsTrue (completion.Wait (1000));
                        Assert.AreEqual (0, completion.Result);
                        Assert.AreEqual (42, action1);
                        Assert.AreEqual (0, action2);
@@ -185,7 +185,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        source1.Post (42);
 
-                       var ae = AssertEx.Throws<AggregateException> (() => completion.Wait (500));
+                       var ae = AssertEx.Throws<AggregateException> (() => completion.Wait (1000));
                        Assert.AreEqual (1, ae.InnerExceptions.Count);
                        Assert.AreSame (exception, ae.InnerException);
                }
@@ -207,7 +207,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        source3.Post (new object ());
 
-                       Assert.IsTrue (completion.Wait (500));
+                       Assert.IsTrue (completion.Wait (1000));
                        Assert.AreEqual (2, completion.Result);
                        Assert.IsFalse (action1);
                        Assert.IsFalse (action2);
index 952726d3f835309e6424d291e4ff5dee941f0c36..7c25746cb691dca078f80e9a8ff17c174eb2587b 100644 (file)
@@ -50,7 +50,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.AreEqual (42, block.Receive ());
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                        Assert.IsTrue (block.Completion.IsCompleted);
                        Assert.AreEqual (TaskStatus.RanToCompletion, block.Completion.Status);
                }
@@ -62,7 +62,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (block.Post (42));
                        ((IDataflowBlock)block).Fault (new Exception ());
 
-                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
                        Assert.IsTrue (block.Completion.IsCompleted);
                        Assert.AreEqual (TaskStatus.Faulted, block.Completion.Status);
                        Assert.IsFalse (block.Post (43));
@@ -78,7 +78,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        tokenSource.Cancel ();
 
                        var ae = AssertEx.Throws<AggregateException> (
-                               () => block.Completion.Wait (100));
+                               () => block.Completion.Wait (1000));
                        Assert.AreEqual (1, ae.InnerExceptions.Count);
                        Assert.AreEqual (typeof(TaskCanceledException), ae.InnerException.GetType ());
 
@@ -208,7 +208,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        ((IDataflowBlock)block).Fault (new Exception ("fault"));
 
                        var exception =
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                        Assert.AreEqual (1, exception.InnerExceptions.Count);
                        Assert.AreEqual ("action", exception.InnerException.Message);
@@ -259,7 +259,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        tokenSource.Cancel ();
 
                        var exception =
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                        Assert.AreEqual (1, exception.InnerExceptions.Count);
                        Assert.AreEqual ("action", exception.InnerException.Message);
@@ -289,7 +289,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        evt.Set ();
 
                        var exception =
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                        Assert.AreEqual (1, exception.InnerExceptions.Count);
                        Assert.AreEqual ("action", exception.InnerException.Message);
@@ -309,7 +309,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        ((IDataflowBlock)block).Fault (new Exception ("fault"));
 
                        var exception =
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                        Assert.AreEqual (1, exception.InnerExceptions.Count);
                        Assert.AreEqual (typeof(TaskCanceledException),
@@ -341,7 +341,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Thread.Sleep (100);
 
                        var exception =
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                        Assert.AreEqual (1, exception.InnerExceptions.Count);
                        Assert.AreEqual (typeof(TaskCanceledException),
@@ -373,7 +373,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Thread.Sleep (100);
 
                        var exception =
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                        Assert.AreEqual (1, exception.InnerExceptions.Count);
                        Assert.AreEqual ("fault", exception.InnerException.Message);
index 4ebff304fc930f2f944d672d2b2d28c578b86043..f897f06e23ec0462959abcb771decc277aa2ed6f 100644 (file)
@@ -60,7 +60,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        var block = new BufferBlock<int> ();
                        block.Complete ();
                        AssertEx.Throws<InvalidOperationException> (
-                               () => block.Receive (TimeSpan.FromMilliseconds (100)));
+                               () => block.Receive (TimeSpan.FromMilliseconds (1000)));
                }
 
                [Test]
@@ -68,7 +68,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                {
                        var block = new BufferBlock<int> ();
                        AssertEx.Throws<TimeoutException> (
-                               () => block.Receive (TimeSpan.FromMilliseconds (100)));
+                               () => block.Receive (TimeSpan.FromMilliseconds (1000)));
                }
 
                [Test]
@@ -169,7 +169,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.AreEqual (1, target.Receive ());
 
-                       Assert.IsTrue (task.Wait (100));
+                       Assert.IsTrue (task.Wait (1000));
                        Assert.IsTrue (task.Result);
                }
 
@@ -187,7 +187,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        target.Complete ();
 
-                       Assert.IsTrue (task.Wait (100));
+                       Assert.IsTrue (task.Wait (1000));
                        Assert.IsFalse (task.Result);
                }
 
index d523a8faa35e41d77bfd90de5835ee86cbfc36f8..94ff41fe9f4c82ee248ffe4a613853f05d5a7d00 100644 (file)
@@ -77,7 +77,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                                block.Post (1);
 
                                var ae =
-                                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
                                Assert.AreEqual (1, ae.InnerExceptions.Count);
                                Assert.AreSame (exception, ae.InnerException);
                        }
@@ -118,7 +118,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                                shouldRun = 0;
                                evt.Set ();
 
-                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
 
                                Thread.Sleep (100);
 
@@ -188,7 +188,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                                scheduler.ExecuteAll ();
 
                                var ae =
-                                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100)).
+                                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000)).
                                                Flatten ();
 
                                Assert.AreEqual (1, ae.InnerExceptions.Count);
index 24b87e215f4e1cd8f7709bc582aaef5e6c5d397f..d431db41528b53fe9b5846c936a901b8cd4cb732 100644 (file)
@@ -79,7 +79,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Task.Factory.StartNew (() => block.Target1.Post (42));
                        Task.Factory.StartNew (() => block.Target2.Post (24));
 
-                       Assert.IsTrue (evt.Wait (500));
+                       Assert.IsTrue (evt.Wait (1000));
                        Assert.IsNotNull (tuple);
                        Assert.AreEqual (42, tuple.Item1);
                        Assert.AreEqual (24, tuple.Item2);
@@ -113,7 +113,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Tuple<int, int> tuple;
                        Assert.IsFalse (block.TryReceive (out tuple));
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -140,7 +140,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        scheduler.ExecuteAll ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -175,7 +175,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (block.TryReceive (out tuple));
                        Assert.AreEqual (Tuple.Create (11, 21), tuple);
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
        }
 }
\ No newline at end of file
index 8137b4a10f7fce4d23b685817f0b45285eb7592d..1b6c5871f7e82f0053a8219c08203fa609d63381 100644 (file)
@@ -50,12 +50,12 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        block.Target1.Post (42);
 
-                       evt.Wait (500);
+                       evt.Wait (1000);
                        Assert.IsNull (tuple);
 
                        block.Target2.Post (24);
 
-                       evt.Wait (500);
+                       evt.Wait (1000);
                        Assert.IsNull (tuple);
 
                        block.Target3.Post (44);
@@ -79,7 +79,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Tuple<int, int, int> tuple;
                        Assert.IsFalse (block.TryReceive (out tuple));
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -108,7 +108,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        scheduler.ExecuteAll ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
@@ -148,7 +148,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (block.TryReceive (out tuple));
                        Assert.AreEqual (Tuple.Create (11, 21, 31), tuple);
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
        }
 }
\ No newline at end of file
index 27fce238a62d72cf31cf28808e2908cc2e03d5e7..6d87932058401cac0c2528c0ed6da421068ea900 100644 (file)
@@ -59,7 +59,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        foreach (var block in blocks) {
                                var ae =
-                                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (100));
+                                       AssertEx.Throws<AggregateException> (() => block.Completion.Wait (1000));
                                Assert.AreEqual (1, ae.InnerExceptions.Count);
                                Assert.IsInstanceOfType (typeof(TaskCanceledException), ae.InnerExceptions [0]);
                                Assert.IsTrue (block.Completion.IsCanceled);
@@ -103,7 +103,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                                        source.LinkTo (new BufferBlock<int> ());
                                }
-                               Assert.IsTrue (block.Completion.Wait (500));
+                               Assert.IsTrue (block.Completion.Wait (1000));
 
                                CollectionAssert.AreEquivalent (
                                        Enumerable.Range (0, 100), queue.Select (t => t.Item1));
@@ -243,7 +243,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsNotNull (action);
 
-                       Assert.IsTrue (action.Completion.Wait (100));
+                       Assert.IsTrue (action.Completion.Wait (1000));
                        Assert.IsTrue (task.Wait (0));
                }
 
@@ -405,7 +405,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        evt.Set ();
 
-                       Assert.IsTrue (Task.WaitAll (new Task[] { task1, task2 }, 100));
+                       Assert.IsTrue (Task.WaitAll (new Task[] { task1, task2 }, 1000));
 
                        CollectionAssert.AreEquivalent (
                                new[]
index 3ec700ad0b47057778df23e721017cb820b82be6..3a5f5334185e6341f4c0cec240ba196da08e390f 100644 (file)
@@ -56,7 +56,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue(source.Post(1));
 
-                       Assert.IsTrue(task.Wait(100));
+                       Assert.IsTrue(task.Wait(1000));
                        Assert.IsTrue(task.Result);
                }
 
@@ -68,7 +68,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        var task = source.OutputAvailableAsync();
 
-                       Assert.IsTrue(task.Wait(100));
+                       Assert.IsTrue(task.Wait(1000));
                        Assert.IsFalse(task.Result);
                }
 
@@ -83,7 +83,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        source.Complete();
 
-                       Assert.IsTrue(task.Wait(100));
+                       Assert.IsTrue(task.Wait(1000));
                        Assert.IsFalse(task.Result);
                }
 
@@ -95,7 +95,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        var task = source.OutputAvailableAsync();
 
-                       Assert.IsTrue(task.Wait(100));
+                       Assert.IsTrue(task.Wait(1000));
                        Assert.IsFalse(task.Result);
                }
 
@@ -110,7 +110,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        ((IDataflowBlock)source).Fault(new Exception());
 
-                       Assert.IsTrue(task.Wait(100));
+                       Assert.IsTrue(task.Wait(1000));
                        Assert.IsFalse(task.Result);
                }
 
@@ -139,7 +139,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue(source.Post(1));
 
-                       Assert.IsTrue(task.Wait(100));
+                       Assert.IsTrue(task.Wait(1000));
                        Assert.IsTrue(task.Result);
                }
 
@@ -153,7 +153,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        tokenSource.Cancel();
 
-                       AssertEx.Throws<AggregateException>(() => task.Wait(100));
+                       AssertEx.Throws<AggregateException>(() => task.Wait(1000));
                        Assert.IsTrue(task.IsCanceled);
                }
        }
index a91148fc1898781e0e82dcdcd94a6e862975265d..adae5e38f3dce0a09b6f24d6794f46382c7730c3 100644 (file)
@@ -39,7 +39,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsFalse (target.Completion.Wait (100));
                        source.Complete ();
-                       Assert.IsTrue (target.Completion.Wait (100));
+                       Assert.IsTrue (target.Completion.Wait (1000));
                }
 
                [Test]
@@ -55,10 +55,10 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        source.Fault (exception);
 
                        var ae =
-                               AssertEx.Throws<AggregateException> (() => source.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => source.Completion.Wait (1000));
                        Assert.AreEqual (exception, ae.Flatten ().InnerException);
 
-                       ae = AssertEx.Throws<AggregateException> (() => target.Completion.Wait (100));
+                       ae = AssertEx.Throws<AggregateException> (() => target.Completion.Wait (1000));
                        Assert.AreEqual (exception, ae.Flatten ().InnerException);
                }
 
@@ -76,11 +76,11 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        tokenSource.Cancel ();
 
                        var ae =
-                               AssertEx.Throws<AggregateException> (() => source.Completion.Wait (100));
+                               AssertEx.Throws<AggregateException> (() => source.Completion.Wait (1000));
                        Assert.IsInstanceOfType (
                                typeof(TaskCanceledException), ae.Flatten ().InnerException);
 
-                       Assert.IsTrue (target.Completion.Wait (100));
+                       Assert.IsTrue (target.Completion.Wait (1000));
                }
 
                [Test]
@@ -109,7 +109,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsFalse (target.Completion.Wait (100));
 
                        Assert.AreEqual (42, target.Receive ());
-                       Assert.IsTrue (target.Completion.Wait (100));
+                       Assert.IsTrue (target.Completion.Wait (1000));
                }
 
                [Test]
index 9f004f45cf69f1c7e21f7fd40260f5d18bdff2e7..62fe18cfae5cef3d757f02d9738c52110d7c7532 100644 (file)
@@ -113,7 +113,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        scheduler.ExecuteAll ();
                        Assert.AreEqual (default(int), target.DirectlyAccepted);
 
-                       Assert.AreEqual (42, source.Receive (TimeSpan.FromMilliseconds (100)));
+                       Assert.AreEqual (42, source.Receive (TimeSpan.FromMilliseconds (1000)));
                        scheduler.ExecuteAll ();
                        Assert.AreEqual (43, target.DirectlyAccepted);
                }
@@ -347,7 +347,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                                new BufferBlock<int> (new DataflowBlockOptions { TaskScheduler = scheduler });
 
                        AssertEx.Throws<TimeoutException> (
-                               () => block.Receive (TimeSpan.FromMilliseconds (100)));
+                               () => block.Receive (TimeSpan.FromMilliseconds (1000)));
 
                        block.Post (1);
 
index 2685803a4c82d263e4067f5fadef482c769758b3..3901a55afcd66efc16d509179183619a08f15916 100644 (file)
@@ -91,7 +91,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        block.Complete ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
index 9d6ece4f8fcf12fa3d986eb5233e029068aab79c..5be73fcaa1c01d5801e90633980e7043ae9238df 100644 (file)
@@ -88,7 +88,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (transformMany.Post (1), "#1");
 
                        transformMany.Complete ();
-                       Assert.IsTrue (transformMany.Completion.Wait (100), "#2");
+                       Assert.IsTrue (transformMany.Completion.Wait (1000), "#2");
                        Assert.IsFalse (received, "#3");
                }
 
@@ -108,7 +108,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        block.Complete ();
 
-                       Assert.IsTrue (block.Completion.Wait (100));
+                       Assert.IsTrue (block.Completion.Wait (1000));
                }
 
                [Test]
index 320df00fb9b56e06a8e6b6554b593d4c12af82e3..4c6584e3e9d4975e7d97424751609fe9b3cdde52 100644 (file)
@@ -58,7 +58,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (block.Post (42), "#1");
                        Assert.IsFalse (block.Post (43), "#2");
 
-                       Assert.IsTrue (evt.Wait (100), "#3");
+                       Assert.IsTrue (evt.Wait (1000), "#3");
 
                        Assert.IsTrue (act1, "#4");
                        Assert.IsTrue (act2, "#5");
@@ -81,7 +81,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        block.LinkTo (action);
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsTrue (act);
                }
@@ -98,8 +98,8 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (block.Post (2));
 
-                       Assert.AreEqual (1, target.Receive (TimeSpan.FromMilliseconds (100)));
-                       Assert.AreEqual (2, target.Receive (TimeSpan.FromMilliseconds (100)));
+                       Assert.AreEqual (1, target.Receive (TimeSpan.FromMilliseconds (1000)));
+                       Assert.AreEqual (2, target.Receive (TimeSpan.FromMilliseconds (1000)));
                }
 
                [Test]
@@ -114,7 +114,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (block.Post (1));
 
                        AssertEx.Throws<TimeoutException> (
-                               () => target.Receive (TimeSpan.FromMilliseconds (100)));
+                               () => target.Receive (TimeSpan.FromMilliseconds (1000)));
 
                        scheduler.ExecuteAll ();
 
@@ -147,7 +147,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (block.Post (source));
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsNotNull (act1);
                        Assert.IsNotNull (act2);
@@ -180,7 +180,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsTrue (broadcast.Post (42));
 
-                       Assert.IsTrue (evt.Wait (100));
+                       Assert.IsTrue (evt.Wait (1000));
 
                        Assert.IsTrue (act1);
                        Assert.IsTrue (act2);
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 7a568b4c09ec7656cdfd3416b7ce566eaf1d649a..e1937a1fc52e0281283b0f77689a36a3c7a62125 100644 (file)
@@ -202,6 +202,9 @@ namespace System.Windows.Forms {
                }
 
                internal void Initialize () {
+                       if (Marshal.SizeOf<IntPtr> () == 8){
+                               Console.Error.WriteLine ("WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all");
+                       }
                        // Initialize the event handlers        
                        Carbon.EventHandler.Driver = this;
                        ApplicationHandler = new Carbon.ApplicationHandler (this);
diff --git a/mcs/class/System.XML/monotouch_tv_runtime_System.Xml.dll.sources b/mcs/class/System.XML/monotouch_tv_runtime_System.Xml.dll.sources
new file mode 100644 (file)
index 0000000..b663093
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.Xml.dll.sources
diff --git a/mcs/class/System.XML/monotouch_watch_runtime_System.Xml.dll.sources b/mcs/class/System.XML/monotouch_watch_runtime_System.Xml.dll.sources
new file mode 100644 (file)
index 0000000..b663093
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.Xml.dll.sources
index d6de8253d321cd8cc2de05f6f85a54159bb79e4f..b7f6d3be94edc9abc408925020d856559743a45f 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;
@@ -113,13 +114,13 @@ namespace Mono.Net.Security
 #endif
                }
 
-               internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
+               internal static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
                        if (settings == null)
-                               return new ChainValidationHelper (null, false, null, null);
-                       if (settings.CertificateValidator == null)
-                               settings.CertificateValidator = new ChainValidationHelper (settings, false, null, null);
-                       return settings.CertificateValidator;
+                               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
@@ -127,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;
                }
@@ -145,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;
@@ -153,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;
@@ -211,6 +214,10 @@ namespace Mono.Net.Security
                        return clientCertificate;
                }
 
+               public MonoTlsProvider Provider {
+                       get { return provider; }
+               }
+
                public MonoTlsSettings Settings {
                        get { return settings; }
                }
@@ -219,7 +226,19 @@ namespace Mono.Net.Security
                        get { return certSelectionCallback != null; }
                }
 
-               public X509Certificate SelectClientCertificate (
+               public bool SelectClientCertificate (
+                       string targetHost, XX509CertificateCollection localCertificates, X509Certificate remoteCertificate,
+                       string[] acceptableIssuers, out X509Certificate clientCertificate)
+               {
+                       if (certSelectionCallback == null) {
+                               clientCertificate = null;
+                               return false;
+                       }
+                       clientCertificate = certSelectionCallback (targetHost, localCertificates, remoteCertificate, acceptableIssuers);
+                       return true;
+               }
+
+               internal X509Certificate SelectClientCertificate (
                        string targetHost, XX509CertificateCollection localCertificates, X509Certificate remoteCertificate,
                        string[] acceptableIssuers)
                {
@@ -233,27 +252,17 @@ namespace Mono.Net.Security
                        var certs = new XX509CertificateCollection ();
                        certs.Add (new X509Certificate2 (certificate.GetRawCertData ()));
 
-                       var result = ValidateChain (null, certs, (SslPolicyErrors)errors);
+                       var result = ValidateChain (string.Empty, true, certs, (SslPolicyErrors)errors);
                        if (result == null)
                                return false;
 
                        return result.Trusted && !result.UserDenied;
                }
 
-               internal static SystemCertificateValidator GetSystemCertificateValidator ()
-               {
-                       return new SystemCertificateValidator ();
-               }
-
-               public ValidationResult ValidateClientCertificate (XX509CertificateCollection certs)
-               {
-                       return ValidateChain (string.Empty, certs, 0);
-               }
-
-               public ValidationResult ValidateChain (string host, XX509CertificateCollection certs)
+               public ValidationResult ValidateCertificate (string host, bool serverMode, XX509CertificateCollection certs)
                {
                        try {
-                               var result = ValidateChain (host, certs, 0);
+                               var result = ValidateChain (host, serverMode, certs, 0);
                                if (tlsStream != null)
                                        tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
                                return result;
@@ -264,16 +273,13 @@ namespace Mono.Net.Security
                        }
                }
 
-               ValidationResult ValidateChain (string host, XX509CertificateCollection 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;
                        bool result = false;
 
                        var hasCallback = certValidationCallback != null || callbackWrapper != null;
-                       var anchors = settings != null ? settings.TrustAnchors : null;
-
-                       var systemValidator = GetSystemCertificateValidator ();
 
                        X509Certificate leaf;
                        if (certs == null || certs.Count == 0)
@@ -296,31 +302,22 @@ 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 !MOBILE
-                       if (needsChain)
-                               chain = systemValidator.ComputeX509Chain (certs, ref errors, ref status11);
-#endif
-
-                       systemValidator.CheckUsage (certs, host, ref errors, ref status11);
+                       bool providerValidated = false;
+                       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;
+                               providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, out result, ref xerrors, ref status11);
+                               errors = (SslPolicyErrors)xerrors;
+                       }
 
-                       if (!skipSystemValidators)
-                               result = systemValidator.EvaluateSystem (certs, anchors, host, chain, ref errors, ref status11);
+                       if (!providerValidated)
+                               result = SystemCertificateValidator.Evaluate (settings, host, certs, ref chain, ref errors, ref status11);
 
                        if (policy != null && (!(policy is DefaultCertificatePolicy) || certValidationCallback == null)) {
                                ServicePoint sp = null;
@@ -345,6 +342,18 @@ namespace Mono.Net.Security
                        }
                        return new ValidationResult (result, user_denied, status11, (MonoSslPolicyErrors)errors);
                }
+
+               public bool InvokeSystemValidator (string targetHost, bool serverMode, XX509CertificateCollection certificates, ref MonoSslPolicyErrors xerrors, ref int status11)
+               {
+                       if (SystemCertificateValidator.NeedsChain (settings))
+                               throw new NotSupportedException ("Cannot use ICertificateValidator.InvokeSystemValidator() when the X509Chain is required.");
+
+                       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
index 4677b35708d035f6e1054f9087efa981c41e28dc..4a7b792ea7056a083f87eec7e32992244b1b4903 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)
-                       : this (innerStream, leaveInnerStreamOpen, null)
-               {
-               }
-
-               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 = ChainValidationHelper.GetDefaultValidator (settings);
+                       this.certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
                }
                #endregion // Constructors
 
@@ -332,7 +324,9 @@ namespace Mono.Net.Security
                        string [] acceptableIssuers = new string [serverRequestedCerts != null ? serverRequestedCerts.Count : 0];
                        for (int i = 0; i < acceptableIssuers.Length; i++)
                                acceptableIssuers [i] = serverRequestedCerts [i].GetIssuerName ();
-                       return certificateValidator.SelectClientCertificate (targetHost, clientCerts, serverCert, acceptableIssuers);
+                       X509Certificate clientCertificate;
+                       certificateValidator.SelectClientCertificate (targetHost, clientCerts, serverCert, acceptableIssuers, out clientCertificate);
+                       return clientCertificate;
                }
 
                public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
@@ -376,7 +370,7 @@ namespace Mono.Net.Security
                                        for (int i = 0; i < mcerts.Count; i++)
                                                certs.Add (new X509Certificate2 (mcerts [i].RawData));
                                }
-                               return ((ChainValidationHelper)certificateValidator).ValidateChain (targetHost, certs);
+                               return ((ChainValidationHelper)certificateValidator).ValidateCertificate (targetHost, false, certs);
                        };
                        s.ClientCertSelectionDelegate = OnCertificateSelection;
 
index ee19a3ec14448db0951c938c86c24d4d707d0a81..8fd50fd1a3e6378edefcb01fe93453e1e638f4f5 100644 (file)
@@ -84,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 a401de63006887cebc99b27ee79c0b652a157244..1f066e1fcfea1aae2a650886882a0a03c821f104 100644 (file)
@@ -258,7 +258,7 @@ namespace Mono.Net.Security
                        }
                }
 
-               internal static HttpListener CreateHttpListener (X509Certificate2 certificate, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
+               internal static HttpListener CreateHttpListener (X509Certificate certificate, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
                {
                        lock (locker) {
                                var internalProvider = provider != null ? new Private.MonoTlsProviderWrapper (provider) : null;
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 2b01fd32a6d9268b1bc0c25039fb52841cda60ae..baf83f33e9fb1ceb6560654722d793a53d57b88a 100644 (file)
@@ -46,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
@@ -104,7 +104,7 @@ namespace Mono.Net.Security
                internal static object CreateHttpListener (object certificate, object provider, object settings)
                {
                        #if SECURITY_DEP
-                       return MonoTlsProviderFactory.CreateHttpListener ((X509Certificate2)certificate, (MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+                       return MonoTlsProviderFactory.CreateHttpListener ((X509Certificate)certificate, (MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
                        #else
                        throw new NotSupportedException ();
                        #endif
index 028536fe4179e7c9a945a6632a5fa960fc129ee6..39cfa73e66d8e6162bbfdb5af2392a68dd4217ad 100644 (file)
@@ -39,7 +39,7 @@ using System.Diagnostics;
 
 namespace Mono.Net.Security
 {
-       internal class SystemCertificateValidator
+       internal static class SystemCertificateValidator
        {
                static bool is_macosx;
                static bool is_mobile;
@@ -72,7 +72,7 @@ namespace Mono.Net.Security
 #endif
                }
 
-               public virtual X509Chain ComputeX509Chain (XX509CertificateCollection certs, ref SslPolicyErrors errors, ref int status11)
+               static X509Chain ComputeX509Chain (XX509CertificateCollection certs, ref SslPolicyErrors errors, ref int status11)
                {
 #if MOBILE
                        return null;
@@ -106,7 +106,7 @@ namespace Mono.Net.Security
 #endif
                }
 
-               public virtual void CheckUsage (XX509CertificateCollection certs, string host, ref SslPolicyErrors errors, ref int status11)
+               static void CheckUsage (XX509CertificateCollection certs, string host, ref SslPolicyErrors errors, ref int status11)
                {
 #if !MONOTOUCH
                        var leaf = (X509Certificate2)certs[0];
@@ -125,7 +125,7 @@ namespace Mono.Net.Security
 #endif
                }
 
-               public virtual bool EvaluateSystem (XX509CertificateCollection certs, XX509CertificateCollection anchors, string host, X509Chain chain, ref SslPolicyErrors errors, ref int status11)
+               static bool EvaluateSystem (XX509CertificateCollection certs, XX509CertificateCollection anchors, string host, X509Chain chain, ref SslPolicyErrors errors, ref int status11)
                {
                        var leaf = certs [0];
                        var result = false;
@@ -169,6 +169,38 @@ namespace Mono.Net.Security
                        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)
                {
index a09d3b458baee82d8adb8f3d06321a642580d514..fea8922f809b307515e5c67cbb829d8bc84d1f6d 100644 (file)
@@ -28,7 +28,7 @@ namespace System.Net.Security
                        if (encryptionPolicy != EncryptionPolicy.RequireEncryption && encryptionPolicy != EncryptionPolicy.AllowNoEncryption && encryptionPolicy != EncryptionPolicy.NoEncryption)
                                throw new ArgumentException (SR.GetString (SR.net_invalid_enum, "EncryptionPolicy"), "encryptionPolicy");
 
-                       var validationHelper = MNS.ChainValidationHelper.CloneWithCallbackWrapper (ref settings, myUserCertValidationCallbackWrapper);
+                       var validationHelper = MNS.ChainValidationHelper.CloneWithCallbackWrapper (provider, ref settings, myUserCertValidationCallbackWrapper);
 
                        LocalCertSelectionCallback selectionCallback = null;
                        if (validationHelper.HasCertificateSelectionCallback)
index f6b328970ed73a60bc1dbbf9096534b8bf0fe4f7..67266618aaee535695f55b1b66d48d954d725a80 100644 (file)
@@ -96,7 +96,7 @@ namespace System.Net.Security
 
                static MonoTlsProvider GetProvider ()
                {
-                       return new MNS.Private.MonoDefaultTlsProvider ();
+                       return MonoTlsProviderFactory.GetDefaultProvider ();
                }
 
                public SslStream (Stream innerStream)
index d5a1d484dee6b671f97228667b5cfd062e7c9c12..8080354f806b23f753ff4af389f9cb4efe211f3a 100644 (file)
@@ -53,7 +53,7 @@ namespace System.Net {
                Hashtable prefixes;  // Dictionary <ListenerPrefix, HttpListener>
                ArrayList unhandled; // List<ListenerPrefix> unhandled; host = '*'
                ArrayList all;       // List<ListenerPrefix> all;  host = '+'
-               X509Certificate2 cert;
+               X509Certificate cert;
                bool secure;
                Dictionary<HttpConnection, HttpConnection> unregistered;
 
@@ -107,7 +107,7 @@ namespace System.Net {
                        if (accepted == null)
                                return;
 
-                       if (epl.secure && (epl.cert == null || !epl.cert.HasPrivateKey)) {
+                       if (epl.secure && epl.cert == null) {
                                accepted.Close ();
                                return;
                        }
index eb8104281fbee3b9c3806b4132f734466ab80a93..7adfdf8d95660c51e673d3304118705a55d19d0a 100644 (file)
@@ -74,7 +74,7 @@ namespace System.Net {
                int reuses;
                bool context_bound;
                bool secure;
-               X509Certificate2 cert;
+               X509Certificate cert;
                int s_timeout = 90000; // 90k ms for first request, 15k ms from then on
                Timer timer;
                IPEndPoint local_ep;
@@ -83,7 +83,7 @@ namespace System.Net {
                X509Certificate2 client_cert;
                IMonoSslStream ssl_stream;
 
-               public HttpConnection (Socket sock, EndPointListener epl, bool secure, X509Certificate2 cert)
+               public HttpConnection (Socket sock, EndPointListener epl, bool secure, X509Certificate cert)
                {
                        this.sock = sock;
                        this.epl = epl;
@@ -312,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;
@@ -344,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 4bba9e31f9c79d38da44d98cc2e0e8fa27e8d92c..15580d3b70514fb650dff0c92f64886a4379a72a 100644 (file)
@@ -62,7 +62,7 @@ namespace System.Net {
 
                IMonoTlsProvider tlsProvider;
                MSI.MonoTlsSettings tlsSettings;
-               X509Certificate2 certificate;
+               X509Certificate certificate;
 
                Hashtable registry;   // Dictionary<HttpListenerContext,HttpListenerContext> 
                ArrayList ctx_queue;  // List<HttpListenerContext> ctx_queue;
@@ -79,7 +79,7 @@ namespace System.Net {
                        auth_schemes = AuthenticationSchemes.Anonymous;
                }
 
-               internal HttpListener (X509Certificate2 certificate, IMonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
+               internal HttpListener (X509Certificate certificate, IMonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
                        : this ()
                {
                        this.certificate = certificate;
@@ -87,7 +87,7 @@ namespace System.Net {
                        this.tlsSettings = tlsSettings;
                }
 
-               internal X509Certificate2 LoadCertificateAndKey (IPAddress addr, int port)
+               internal X509Certificate LoadCertificateAndKey (IPAddress addr, int port)
                {
                        lock (registry) {
                                if (certificate != null)
@@ -104,8 +104,9 @@ namespace System.Net {
                                        string pvk_file = Path.Combine (path, String.Format ("{0}.pvk", port));
                                        if (!File.Exists (pvk_file))
                                                return null;
-                                       certificate = new X509Certificate2 (cert_file);
-                                       certificate.PrivateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
+                                       var cert = new X509Certificate2 (cert_file);
+                                       cert.PrivateKey = PrivateKey.CreateFromFile (pvk_file).RSA;
+                                       certificate = cert;
                                        return certificate;
                                } catch {
                                        // ignore errors
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 ();
+               }
        }
 }
diff --git a/mcs/class/System/monotouch_tv_runtime_System.dll.sources b/mcs/class/System/monotouch_tv_runtime_System.dll.sources
new file mode 100644 (file)
index 0000000..7c0bd59
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_System.dll.sources
diff --git a/mcs/class/System/monotouch_watch_runtime_System.dll.sources b/mcs/class/System/monotouch_watch_runtime_System.dll.sources
new file mode 100644 (file)
index 0000000..7c0bd59
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_System.dll.sources
index a15c475bbaa88aab7ec9854f900dd4bf16215afa..994358c86bec2aff6ec7373da50dcd0ee17d515a 100644 (file)
@@ -51,6 +51,8 @@ namespace System.IO
                public static readonly IntPtr
                        InvalidHandle = (IntPtr)(-1L);
 
+               static bool dump_handles = Environment.GetEnvironmentVariable ("MONO_DUMP_HANDLES_ON_ERROR_TOO_MANY_OPEN_FILES") != null;
+
                // error methods
                public static Exception GetException (MonoIOError error)
                {
@@ -89,6 +91,8 @@ namespace System.IO
                                return new FileNotFoundException (message, path);
 
                        case MonoIOError.ERROR_TOO_MANY_OPEN_FILES:
+                               if (dump_handles)
+                                       DumpHandles ();
                                return new IOException ("Too many open files", unchecked((int)0x80070000) | (int)error);
                                
                        case MonoIOError.ERROR_PATH_NOT_FOUND:
@@ -599,6 +603,9 @@ namespace System.IO
                        [MethodImplAttribute (MethodImplOptions.InternalCall)]
                        get;
                }
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern static void DumpHandles ();
        }
 }
 
index 024f3ff18f10a3ec19c4a4a211bb88adbd196964..8f6e0aa098e40b238d2738503705207086c3eb80 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);
                }
 
@@ -3189,6 +3189,19 @@ namespace System
                //
                // Moved value from instance into target of different type with no checks (JIT intristics)
                //
+               // Restrictions:
+               //
+               // S and R must either:
+               //       both be blitable valuetypes
+               //       both be reference types (IOW, an unsafe cast)
+               // S and R cannot be float or double
+               // S and R must either:
+               //       both be a struct
+               //       both be a scalar
+               // S and R must either:
+               //       be of same size
+               //       both be a scalar of size <= 4
+               //
                internal static R UnsafeMov<S,R> (S instance) {
                        return (R)(object) instance;
                }
index bc27da33976e6ff062adc0905a4fe81ec8e7a008..311bb9eb4554e88e5d7f7e001e558e0099233201 100644 (file)
@@ -1378,7 +1378,8 @@ namespace System
                                else {
                                        abbrevs.Add (abbrev_index, sb.ToString ());
                                        //Adding all the substrings too, as it seems to be used, at least for Africa/Windhoek
-                                       for (int j = 1; j < sb.Length; j++)
+                                       //j == sb.Length empty substring also needs to be added #31432
+                                       for (int j = 1; j <= sb.Length; j++)
                                                abbrevs.Add (abbrev_index + j, sb.ToString (j, sb.Length - j));
                                        abbrev_index = i + 1;
                                        sb = new StringBuilder ();
index 74624d1ba14c39cf6e4d52fb62f5a556bd7a54c6..9db8bda20fd9b41f96a36a25f56c016ca0814408 100644 (file)
@@ -201,6 +201,89 @@ namespace MonoTests.System.Reflection.Emit
                        Assert.AreSame (expected, t.BaseType, "#1");
                        
                }
+
+               [Test]
+               public void GenericClassFromStaleTypeBuilderDoesNotClassInit ()
+               {
+                       // interface JJJ<T> {
+                       //   abstract void W (x : T)
+                       // }
+                       MethodInfo winfo = null;
+                       TypeBuilder ib = null;
+                       Type ic = null;
+                       Type icreated = null;
+                       {
+                               ib = module.DefineType ("Foo.JJJ`1",
+                                                        TypeAttributes.Public
+                                                        | TypeAttributes.Interface
+                                                        | TypeAttributes.Abstract);
+                               String[] gens = { "T" };
+                               GenericTypeParameterBuilder[] gbs = ib.DefineGenericParameters (gens);
+                               var gb = gbs[0];
+                               winfo = ib.DefineMethod ("W",
+                                                        MethodAttributes.Public |
+                                                        MethodAttributes.Abstract |
+                                                        MethodAttributes.Virtual,
+                                                        CallingConventions.HasThis,
+                                                        typeof(void),
+                                        new Type[] { gb });
+                               icreated = ib.CreateType();
+
+                       }
+
+                       // class SSS : JJJ<char> {
+                       //   bool wasCalled;
+                       //   void JJJ.W (x : T) { wasCalled = true; return; }
+                       // }
+                       TypeBuilder tb = null;
+                       MethodBuilder mb = null;
+                       {
+                               tb = module.DefineType ("Foo.SSS",
+                                                       TypeAttributes.Public,
+                                                       null,
+                                                       new Type[]{ icreated.MakeGenericType(typeof(char)) });
+                               var wasCalledField = tb.DefineField ("wasCalled",
+                                                                    typeof(bool),
+                                                                    FieldAttributes.Public);
+                               mb = tb.DefineMethod ("W_impl",
+                                                     MethodAttributes.Public | MethodAttributes.Virtual,
+                                                     CallingConventions.HasThis,
+                                                     typeof (void),
+                                                     new Type[] { typeof (char) });
+                               {
+                                       var il = mb.GetILGenerator ();
+                                       il.Emit (OpCodes.Ldarg_0); // this
+                                       il.Emit (OpCodes.Ldc_I4_1);
+                                       il.Emit (OpCodes.Stfld, wasCalledField); // this.wasCalled = true
+                                       il.Emit (OpCodes.Ret);
+                               }
+                       }
+
+                       ic = ib.MakeGenericType(typeof (char)); // this is a MonoGenericMethod
+                       var mintf = TypeBuilder.GetMethod(ic, winfo);
+                       // the next line causes mono_class_init() to
+                       // be called on JJJ<char> when we try to setup
+                       // the vtable for SSS
+                       tb.DefineMethodOverride(mb, mintf);
+
+                       var result = tb.CreateType();
+
+                       // o = new SSS()
+                       object o = Activator.CreateInstance(result);
+                       Assert.IsNotNull(o, "#1");
+
+                       // ((JJJ<char>)o).W('a');
+                       var m = icreated.MakeGenericType(typeof(char)).GetMethod("W", BindingFlags.Public | BindingFlags.Instance);
+                       Assert.IsNotNull(m, "#2");
+                       m.Invoke(o, new object[] {'a'});
+
+                       var f = result.GetField("wasCalled", BindingFlags.Public | BindingFlags.Instance);
+                       Assert.IsNotNull(f, "#3");
+                       var wasCalledVal = f.GetValue(o);
+                       Assert.IsNotNull(wasCalledVal, "#4");
+                       Assert.AreEqual (wasCalledVal.GetType(), typeof(Boolean), "#5");
+                       Assert.AreEqual (wasCalledVal, true, "#6");
+               }
        }
 }
 
index 8be40d46b9a604c42c2b0d1527bc2186ec9b3ea1..39b303f4736cdae36d3286191c01224ad14d99b7 100644 (file)
@@ -861,6 +861,32 @@ namespace MonoTests.System.Threading
                        Assert.AreSame (Thread.GetNamedDataSlot ("te#st"), Thread.GetNamedDataSlot ("te#st"), "#2");
                }
 
+               class DomainClass : MarshalByRefObject {
+                       Thread m_thread;
+                       bool success;
+
+                       public bool Run () {
+                               m_thread = new Thread(ThreadProc);
+                               m_thread.Start(Thread.CurrentThread);
+                               m_thread.Join();
+                               return success;
+                       }
+
+                       public void ThreadProc (object arg) {
+                               success = m_thread == Thread.CurrentThread;
+                       }
+               }
+
+               [Test]
+               public void CurrentThread_Domains ()
+               {
+                       AppDomain ad = AppDomain.CreateDomain ("foo");
+                       ad.Load (typeof (DomainClass).Assembly.GetName ());
+                       var o = (DomainClass)ad.CreateInstanceAndUnwrap (typeof (DomainClass).Assembly.FullName, typeof (DomainClass).FullName);
+                       Assert.IsTrue (o.Run ());
+                       AppDomain.Unload (ad);
+               }
+
                void CheckIsRunning (string s, Thread t)
                {
                        int c = counter;
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 e056e537594269fe96592b54a4c18ce10aa4d074..fb7b3d7b1de839aa5ee2ea61bbd1e54e55308e90 100644 (file)
@@ -73,14 +73,14 @@ public static class DateTimeOffsetUnixTimeConversionTests
     {
         long expectedMilliseconds = test.UnixTimeMilliseconds;
         long actualMilliseconds = test.DateTimeOffset.ToUnixTimeMilliseconds();
-        Assert.Equals(expectedMilliseconds, actualMilliseconds);
+        Assert.AreEqual(expectedMilliseconds, actualMilliseconds);
     }
 
     private static void TestToUnixTimeSeconds(TestTime test)
     {
         long expectedSeconds = test.UnixTimeSeconds;
         long actualSeconds = test.DateTimeOffset.ToUnixTimeSeconds();
-        Assert.Equals(expectedSeconds, actualSeconds);
+        Assert.AreEqual(expectedSeconds, actualSeconds);
     }
 
     [Test]
@@ -98,7 +98,7 @@ public static class DateTimeOffsetUnixTimeConversionTests
         // Only assert that expected == actual up to millisecond precision for conversion from milliseconds
         long expectedTicks = (test.DateTimeOffset.UtcTicks / TimeSpan.TicksPerMillisecond) * TimeSpan.TicksPerMillisecond;
         long actualTicks = DateTimeOffset.FromUnixTimeMilliseconds(test.UnixTimeMilliseconds).UtcTicks;
-        Assert.Equals(expectedTicks, actualTicks);
+        Assert.AreEqual(expectedTicks, actualTicks);
     }
 
     private static void TestFromUnixTimeSeconds(TestTime test)
@@ -106,7 +106,7 @@ public static class DateTimeOffsetUnixTimeConversionTests
         // Only assert that expected == actual up to second precision for conversion from seconds
         long expectedTicks = (test.DateTimeOffset.UtcTicks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond;
         long actualTicks = DateTimeOffset.FromUnixTimeSeconds(test.UnixTimeSeconds).UtcTicks;
-        Assert.Equals(expectedTicks, actualTicks);
+        Assert.AreEqual(expectedTicks, actualTicks);
     }
 
 
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 770ab17dffc7e0907e6c4ebd770fb4bf1f0b87bd..01c639e0f419a25e4955fa3f14b420675201a6a8 100644 (file)
@@ -1162,5 +1162,30 @@ namespace MonoTests.System
                                }
                        }
                }
+
+               [TestFixture]
+               public class ParseTZBuffer
+               {
+                       MethodInfo parseTZBuffer;
+
+                       [SetUp]
+                       public void Setup()
+                       {
+                               var flags = BindingFlags.Static | BindingFlags.NonPublic;
+                               parseTZBuffer = typeof (TimeZoneInfo).GetMethod ("ParseTZBuffer", flags);
+                       }
+
+                       [Test]
+                       public void Bug31432 ()
+                       {
+                               // Europe/Moscow from failing device
+                               var base64Data = "VFppZjIAAAAAAAAAAAAAAAAAAAAAAAAPAAAADwAAAAAAAABNAAAADwAAACKbXx7HnT7yeZ4q7vme9zlpn4RX+aDYbOmhABYJoTymQKQQbcCkPTKwpRVosKU9A8CnHkVQtaQZYBUnp9AWGNxAFwjbUBf6D8AY6g7QGdtDQBrMk9AbvKDwHKyR8B2cgvAejHPwH3xk8CBsVfAhXEbwIkw38CM8KPAkLBnwJRwK8CYL+/AnBSdwJ/UYcCjlF4ApeL+AKdTQQCrEszArtNxwLKTNcC2UvnAuhK9wL3SgcDBkkXAxXbzwMnKX8DM9nvA0UnnwNR2A8DYyW/A2/WLwOBt4cDjdRPA5+1pwOr0m8DvbPHA8pkNwPbsecD6GJXA/mwBwQGYHcEGEHPBCRelwQ2P+8EQly3BFQ+DwRgWtcEcjwvBH7snwSQOk8EnOq/BK44bwS66N8EzMo3BNjm/wVEwdYAIBAgMBAwUEBQYFBwgHCQcJBwkHCQoLCgsKCwoLCgsKCwoMDQoJBwsKCwoLCgsKCwoLCgsKCwoLCgsKCwoLCgsKCwoLCgsKCwoLCg4KAAAjOQAAAAAxhwEEAAAjdwAAAAA/lwEIAAAqMAADAAA4QAENAABGUAEPAAAqMAARAAAcIAAVAAA4QAEZAAAqMAARAAA4QAEZAAAqMAEdAAAcIAAVAAA4QAARTU1UAE1TVABNRFNUAFMATQBNU0sARUVUAE1TRABFRVNUAAAAAAAAAAAAAAABAQEBAQAAAAAAAAAAAAAAAAAAAFRaaWYyAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAATgAAABAAAAAm/////1a2wMf/////m18ex/////+dPvJ5/////54q7vn/////nvc5af////+fhFf5/////6DYbOn/////oQAWCf////+hPKZA/////6QQbcD/////pD0ysP////+lFWiw/////6U9A8D/////px5FUP////+1pBlgAAAAABUnp9AAAAAAFhjcQAAAAAAXCNtQAAAAABf6D8AAAAAAGOoO0AAAAAAZ20NAAAAAABrMk9AAAAAAG7yg8AAAAAAcrJHwAAAAAB2cgvAAAAAAHoxz8AAAAAAffGTwAAAAACBsVfAAAAAAIVxG8AAAAAAiTDfwAAAAACM8KPAAAAAAJCwZ8AAAAAAlHArwAAAAACYL+/AAAAAAJwUncAAAAAAn9RhwAAAAACjlF4AAAAAAKXi/gAAAAAAp1NBAAAAAACrEszAAAAAAK7TccAAAAAAspM1wAAAAAC2UvnAAAAAALoSvcAAAAAAvdKBwAAAAADBkkXAAAAAAMV288AAAAAAycpfwAAAAADM9nvAAAAAANFJ58AAAAAA1HYDwAAAAADYyW/AAAAAANv1i8AAAAAA4G3hwAAAAADjdRPAAAAAAOftacAAAAAA6vSbwAAAAADvbPHAAAAAAPKZDcAAAAAA9ux5wAAAAAD6GJXAAAAAAP5sAcAAAAABAZgdwAAAAAEGEHPAAAAAAQkXpcAAAAABDY/7wAAAAAEQly3AAAAAARUPg8AAAAABGBa1wAAAAAEcjwvAAAAAAR+7J8AAAAABJA6TwAAAAAEnOq/AAAAAASuOG8AAAAABLro3wAAAAAEzMo3AAAAAATY5v8AAAAABUTB1gAQMCAwQCBAYFBgcGCAkICggKCAoICgsMCwwLDAsMCwwLDAsNDgsKCAwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCw8LAAAjOQAAAAAjOQAEAAAxhwEIAAAjdwAEAAA/lwEMAAAqMAADAAA4QAERAABGUAETAAAqMAAVAAAcIAAZAAA4QAEdAAAqMAAVAAA4QAEdAAAqMAEhAAAcIAAZAAA4QAAVTE1UAE1NVABNU1QATURTVABTAE0ATVNLAEVFVABNU0QARUVTVAAAAAAAAAAAAAAAAAEBAQEBAAAAAAAAAAAAAAAAAAAAAApNU0stMwo=";
+
+                               var data = Convert.FromBase64String (base64Data);
+
+                               var tz = parseTZBuffer.Invoke (null, new object[] { "Test", data, data.Length});
+                               Assert.IsTrue (tz != null);
+                       }
+               }
        }
 }
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/class/corlib/monotouch_tv_runtime_corlib.dll.sources b/mcs/class/corlib/monotouch_tv_runtime_corlib.dll.sources
new file mode 100644 (file)
index 0000000..9e173da
--- /dev/null
@@ -0,0 +1 @@
+#include corlib.dll.sources
\ No newline at end of file
diff --git a/mcs/class/corlib/monotouch_watch_runtime_corlib.dll.sources b/mcs/class/corlib/monotouch_watch_runtime_corlib.dll.sources
new file mode 100644 (file)
index 0000000..9e173da
--- /dev/null
@@ -0,0 +1 @@
+#include corlib.dll.sources
\ No newline at end of file
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 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 ba58d1f1380ebbb95642eab2d2d03541b839967e..e5c8bb4316c6b5af4ce075f1b939559bf7efd40f 100644 (file)
@@ -3881,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);
                }
@@ -4396,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)
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
index b56a09422e550b974ee2f5f34930c23ebb56c00e..6218e73ddf27abba174bf3c61885a763272ab9ab 100644 (file)
       </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">
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 0fae1a02c00e199a0a7ce7fc313fa3cd73f34963..6e07617be3ed6e8fcc86a9bfb68cb99571db7292 100644 (file)
                <type fullname="System.Threading.ExecutionContext" />
                <type fullname="System.Threading.Interlocked">
                        <method name="CompareExchange" />
+                       <method name="Exchange" />
                </type>
                <type fullname="System.Threading.Monitor">
                        <method name="Enter" />
index bd55c8527c6d154f2b16908a6a7d4c3144eb83d9..74c219a82b61bd5811c3b708350b6a85a7c19a92 100644 (file)
@@ -336,6 +336,9 @@ namespace Mono.Linker.Steps {
                                        return;
 
                                MarkType (et);
+                               if (argument.Value == null)
+                                       return;
+
                                foreach (var cac in (CustomAttributeArgument[]) argument.Value)
                                        MarkWithResolvedScope ((TypeReference) cac.Value);
                        } else if (at.Namespace == "System" && at.Name == "Type") {
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 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 145ea11f951e1e33eca71409dc8997c90fb6628b..fde85f255d772e42c81b1dc581cac227f9255cd6 100644 (file)
@@ -129,7 +129,7 @@ common_sources = \
        file-io.h               \
        filewatcher.c           \
        filewatcher.h           \
-       gc-internal.h           \
+       gc-internals.h          \
        icall.c                 \
        icall-def.h             \
        image.c                 \
@@ -238,7 +238,7 @@ sgen_sources = \
        sgen-os-coop.c          \
        sgen-bridge.c           \
        sgen-bridge.h           \
-       sgen-bridge-internal.h  \
+       sgen-bridge-internals.h \
        sgen-old-bridge.c               \
        sgen-new-bridge.c               \
        sgen-tarjan-bridge.c            \
index 9bbbc1ebc588b3141f9a64560af4e8c6b08f30eb..0e57d84fb44b27e15872550dbadec7855c493395 100644 (file)
@@ -32,7 +32,7 @@
 #endif
 #endif
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/object.h>
 #include <mono/metadata/domain-internals.h>
 #include "mono/metadata/metadata-internals.h"
@@ -42,7 +42,7 @@
 #include <mono/metadata/threadpool-ms.h>
 #include <mono/metadata/socket-io.h>
 #include <mono/metadata/tabledefs.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/monitor.h>
@@ -56,7 +56,7 @@
 #include <mono/metadata/tokentype.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/utils/mono-uri.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-path.h>
 #include <mono/utils/mono-stdlib.h>
 #include <mono/utils/mono-io-portability.h>
@@ -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 c44dffda11e2777e042f822e00e0d02ce301b18d..3ea11123186a9720f1c2fa894364939cbaa3c721 100644 (file)
@@ -30,7 +30,7 @@
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/mono-config-dirs.h>
 #include <mono/utils/mono-digest.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-path.h>
 #include <mono/metadata/reflection.h>
 #include <mono/metadata/coree.h>
index 71e87e1c577f09e113fdc7ca9dba54647a044b44..cea84bc86ef762b4b43568ea6df44b89e9badf11 100644 (file)
@@ -37,7 +37,7 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/threads-types.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/utils/mono-threads.h>
 #include "attach.h"
 
index 540c2b94cf647416e3ff835678b41e4d44454795..666f6381ebc0d6473e3435217e21f002fb57f1f4 100644 (file)
@@ -11,7 +11,7 @@
 #include <string.h>
 
 #define GC_I_HIDE_POINTERS
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/class-internals.h>
@@ -23,7 +23,7 @@
 #include <mono/metadata/runtime.h>
 #include <mono/metadata/sgen-toggleref.h>
 #include <mono/utils/atomic.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-threads.h>
@@ -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 1657d990f17d05de2822515d3966b514a29b9535..a7f7454749877cfd50665064a3f17904e6ebdc30 100644 (file)
@@ -1,8 +1,8 @@
 /* 
  * Copyright 2012 Xamarin Inc
  */
-#ifndef __MONO_METADATA_CLASS_INTERBALS_H__
-#define __MONO_METADATA_CLASS_INTERBALS_H__
+#ifndef __MONO_METADATA_CLASS_INTERNALS_H__
+#define __MONO_METADATA_CLASS_INTERNALS_H__
 
 #include <mono/metadata/class.h>
 #include <mono/metadata/object.h>
@@ -1140,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) \
@@ -1416,4 +1416,4 @@ mono_field_from_token_checked (MonoImage *image, uint32_t token, MonoClass **ret
 gpointer
 mono_ldtoken_checked (MonoImage *image, guint32 token, MonoClass **handle_class, MonoGenericContext *context, MonoError *error);
 
-#endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */
+#endif /* __MONO_METADATA_CLASS_INTERNALS_H__ */
index 63ff5967f7c27ffe0e4263f4c91fde7ab6899a83..5b81f05e28bb397cf2ccf1d37a0327f8c1adaa3e 100644 (file)
 #include <mono/metadata/security-manager.h>
 #include <mono/metadata/security-core-clr.h>
 #include <mono/metadata/attrdefs.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/verify-internals.h>
 #include <mono/metadata/mono-debug.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-string.h>
 #include <mono/utils/mono-error-internals.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/bsearch.h>
@@ -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,7 +1336,7 @@ 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;
                }
 
@@ -1345,12 +1345,12 @@ mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
                        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 && !image_is_dynamic(klass->image)) {
+                               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;
                }
 
@@ -10550,24 +10550,24 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
                g_assert (*sig == 0x06);
                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..7ac6667914d94aee80c89eea89b3b8679e76e7c2 100644 (file)
 #include "mono/metadata/monitor.h"
 #include "mono/metadata/metadata-internals.h"
 #include "mono/metadata/domain-internals.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mono/metadata/threads-types.h"
 #include "mono/metadata/string-icalls.h"
 #include "mono/metadata/attrdefs.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mono/utils/mono-counters.h"
 #include "mono/utils/strenc.h"
 #include "mono/utils/atomic.h"
@@ -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 46554d214abaadce47008ef1d68aa61f794bf319..7c778bfacd14e66a927884e720d07a7d9bcd315f 100644 (file)
@@ -11,7 +11,7 @@
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/domain-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 #include <mono/metadata/console-io.h>
 #include <mono/metadata/exception.h>
index 7708a482d7d2cc17b484f49c7235c599a8bb96fa..9629857be704a59656a345ab33761c1a7f95c676 100644 (file)
@@ -31,7 +31,7 @@
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/domain-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/metadata.h>
 #include <mono/metadata/threadpool-ms.h>
 #include <mono/utils/mono-signal-handler.h>
index 7de83602c9b252cdfce50d16369e75de67e2f1a0..ff703808c3d9587a3cb6e7ed4a19b919e4cd1139 100644 (file)
@@ -24,7 +24,7 @@
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/domain-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/metadata.h>
 
 #include <mono/metadata/console-io.h>
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 a7509bda4f4f2f265e43e8109e97b4c89c669f01..85d89d579fc62b6afb8f8b831c1aaec79ceedab0 100644 (file)
 #include <string.h>
 #include <sys/stat.h>
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-compiler.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-membar.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/hazard-pointer.h>
@@ -33,7 +33,7 @@
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/metadata-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/mono-debug-debugger.h>
 #include <mono/metadata/mono-config.h>
index b193e0a54945d373379c6dc1c990ea4855eaf8b6..c4364a11437fa501fb27911e64084e090b3c3a8f 100644 (file)
@@ -1252,3 +1252,12 @@ mono_filesize_from_fd (int fd)
 }
 
 #endif
+
+void _wapi_handle_dump (void);
+
+void ves_icall_System_IO_MonoIO_DumpHandles (void)
+{
+#ifndef HOST_WIN32
+       _wapi_handle_dump ();
+#endif
+}
index 271bc58af7785a76521b9307e35a89ed24ecf10b..2974bd49949ecdd27de60df557c33ee102df61e4 100644 (file)
@@ -253,6 +253,9 @@ mono_filesize_from_path (MonoString *path);
 extern gint64
 mono_filesize_from_fd (int fd);
 
+void
+ves_icall_System_IO_MonoIO_DumpHandles (void);
+
 G_END_DECLS
 
 #endif /* _MONO_METADATA_FILEIO_H_ */
diff --git a/mono/metadata/gc-internal.h b/mono/metadata/gc-internal.h
deleted file mode 100644 (file)
index 11c94b4..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * metadata/gc-internal.h: Internal GC interface
- *
- * Author: Paolo Molaro <lupus@ximian.com>
- *
- * (C) 2002 Ximian, Inc.
- * Copyright 2012 Xamarin Inc (http://www.xamarin.com)
- */
-
-#ifndef __MONO_METADATA_GC_INTERNAL_H__
-#define __MONO_METADATA_GC_INTERNAL_H__
-
-#include <glib.h>
-#include <mono/utils/gc_wrapper.h>
-#include <mono/metadata/object-internals.h>
-#include <mono/metadata/threads-types.h>
-#include <mono/sgen/gc-internal-agnostic.h>
-#include <mono/utils/gc_wrapper.h>
-
-#define mono_domain_finalizers_lock(domain) mono_mutex_lock (&(domain)->finalizable_objects_hash_lock);
-#define mono_domain_finalizers_unlock(domain) mono_mutex_unlock (&(domain)->finalizable_objects_hash_lock);
-
-/* Register a memory area as a conservatively scanned GC root */
-#define MONO_GC_REGISTER_ROOT_PINNING(x,src,msg) mono_gc_register_root ((char*)&(x), sizeof(x), MONO_GC_DESCRIPTOR_NULL, (src), (msg))
-
-#define MONO_GC_UNREGISTER_ROOT(x) mono_gc_deregister_root ((char*)&(x))
-
-/*
- * Register a memory location as a root pointing to memory allocated using
- * mono_gc_alloc_fixed (). This includes MonoGHashTable.
- */
-/* The result of alloc_fixed () is not GC tracked memory */
-#define MONO_GC_REGISTER_ROOT_FIXED(x,src,msg) do { \
-       if (!mono_gc_is_moving ())                              \
-               MONO_GC_REGISTER_ROOT_PINNING ((x),(src),(msg)); \
-       } while (0)
-
-/*
- * Return a GC descriptor for an array containing N pointers to memory allocated
- * by mono_gc_alloc_fixed ().
- */
-/* For SGEN, the result of alloc_fixed () is not GC tracked memory */
-#define MONO_GC_ROOT_DESCR_FOR_FIXED(n) (mono_gc_is_moving () ? mono_gc_make_root_descr_all_refs (0) : MONO_GC_DESCRIPTOR_NULL)
-
-/* Register a memory location holding a single object reference as a GC root */
-#define MONO_GC_REGISTER_ROOT_SINGLE(x,src,msg) do { \
-       g_assert (sizeof (x) == sizeof (MonoObject*)); \
-       mono_gc_register_root ((char*)&(x), sizeof(MonoObject*), mono_gc_make_root_descr_all_refs (1), (src), (msg)); \
-       } while (0)
-
-/*
- * This is used for fields which point to objects which are kept alive by other references
- * when using Boehm.
- */
-#define MONO_GC_REGISTER_ROOT_IF_MOVING(x,src,msg) do { \
-       if (mono_gc_is_moving ()) \
-               MONO_GC_REGISTER_ROOT_SINGLE(x,src,msg);                \
-} while (0)
-
-#define MONO_GC_UNREGISTER_ROOT_IF_MOVING(x) do { \
-       if (mono_gc_is_moving ()) \
-               MONO_GC_UNREGISTER_ROOT (x);                    \
-} while (0)
-
-/* useful until we keep track of gc-references in corlib etc. */
-#define IS_GC_REFERENCE(class,t) (mono_gc_is_moving () ? FALSE : ((t)->type == MONO_TYPE_U && (class)->image == mono_defaults.corlib))
-
-void   mono_object_register_finalizer               (MonoObject  *obj);
-void   ves_icall_System_GC_InternalCollect          (int          generation);
-gint64 ves_icall_System_GC_GetTotalMemory           (MonoBoolean  forceCollection);
-void   ves_icall_System_GC_KeepAlive                (MonoObject  *obj);
-void   ves_icall_System_GC_ReRegisterForFinalize    (MonoObject  *obj);
-void   ves_icall_System_GC_SuppressFinalize         (MonoObject  *obj);
-void   ves_icall_System_GC_WaitForPendingFinalizers (void);
-
-MonoObject *ves_icall_System_GCHandle_GetTarget (guint32 handle);
-guint32     ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint32 type);
-void        ves_icall_System_GCHandle_FreeHandle (guint32 handle);
-gpointer    ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle);
-void        ves_icall_System_GC_register_ephemeron_array (MonoObject *array);
-MonoObject  *ves_icall_System_GC_get_ephemeron_tombstone (void);
-
-MonoBoolean ves_icall_Mono_Runtime_SetGCAllowSynchronousMajor (MonoBoolean flag);
-
-extern void mono_gc_init (void);
-extern void mono_gc_base_init (void);
-extern void mono_gc_cleanup (void);
-extern void mono_gc_base_cleanup (void);
-
-/*
- * Return whenever the current thread is registered with the GC (i.e. started
- * by the GC pthread wrappers on unix.
- */
-extern gboolean mono_gc_is_gc_thread (void);
-
-extern gboolean mono_gc_is_finalizer_internal_thread (MonoInternalThread *thread);
-
-extern void mono_gc_set_stack_end (void *stack_end);
-
-/* only valid after the RECLAIM_START GC event and before RECLAIM_END
- * Not exported in public headers, but can be linked to (unsupported).
- */
-gboolean mono_object_is_alive (MonoObject* obj);
-gboolean mono_gc_is_finalizer_thread (MonoThread *thread);
-gpointer mono_gc_out_of_memory (size_t size);
-void     mono_gc_enable_events (void);
-void     mono_gc_enable_alloc_events (void);
-
-void mono_gchandle_set_target (guint32 gchandle, MonoObject *obj);
-
-/*Ephemeron functionality. Sgen only*/
-gboolean    mono_gc_ephemeron_array_add (MonoObject *obj);
-
-/* To disable synchronous, evacuating collections - concurrent SGen only */
-gboolean    mono_gc_set_allow_synchronous_major (gboolean flag);
-
-MonoBoolean
-mono_gc_GCHandle_CheckCurrentDomain (guint32 gchandle);
-
-/* User defined marking function */
-/* It should work like this:
- * foreach (ref in GC references in the are structure pointed to by ADDR)
- *    mark_func (ref)
- */
-typedef void (*MonoGCMarkFunc)     (MonoObject **addr, void *gc_data);
-typedef void (*MonoGCRootMarkFunc) (void *addr, MonoGCMarkFunc mark_func, void *gc_data);
-
-/* Create a descriptor with a user defined marking function */
-MonoGCDescriptor mono_gc_make_root_descr_user (MonoGCRootMarkFunc marker);
-
-/* Return whenever user defined marking functions are supported */
-gboolean mono_gc_user_markers_supported (void);
-
-/* desc is the result from mono_gc_make_descr*. A NULL value means
- * all the words might contain GC pointers.
- * The memory is non-moving and it will be explicitly deallocated.
- * size bytes will be available from the returned address (ie, descr
- * must not be stored in the returned memory)
- * NOTE: Under Boehm, this returns memory allocated using GC_malloc, so the result should
- * be stored into a location registered using MONO_GC_REGISTER_ROOT_FIXED ().
- */
-void* mono_gc_alloc_fixed            (size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg);
-void  mono_gc_free_fixed             (void* addr);
-
-/* make sure the gchandle was allocated for an object in domain */
-gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain);
-void     mono_gchandle_free_domain  (MonoDomain *domain);
-
-typedef void (*FinalizerThreadCallback) (gpointer user_data);
-
-/* if there are finalizers to run, run them. Returns the number of finalizers run */
-gboolean mono_gc_pending_finalizers (void);
-void     mono_gc_finalize_notify    (void);
-
-void* mono_gc_alloc_pinned_obj (MonoVTable *vtable, size_t size);
-void* mono_gc_alloc_obj (MonoVTable *vtable, size_t size);
-void* mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length);
-void* mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uintptr_t bounds_size);
-void* mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len);
-MonoGCDescriptor mono_gc_make_descr_for_string (gsize *bitmap, int numbits);
-
-void  mono_gc_register_for_finalization (MonoObject *obj, void *user_data);
-void  mono_gc_add_memory_pressure (gint64 value);
-MONO_API int   mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg);
-void  mono_gc_deregister_root (char* addr);
-int   mono_gc_finalizers_for_domain (MonoDomain *domain, MonoObject **out_array, int out_size);
-void  mono_gc_run_finalize (void *obj, void *data);
-void  mono_gc_clear_domain (MonoDomain * domain);
-void* mono_gc_alloc_mature (MonoVTable *vtable);
-
-/* 
- * Register a root which can only be written using a write barrier.
- * Writes to the root must be done using a write barrier (MONO_ROOT_SETREF).
- * If the root uses an user defined mark routine, the writes are not required to be
- * to the area between START and START+SIZE.
- * The write barrier allows the GC to avoid scanning this root at each collection, so it
- * is more efficient.
- * FIXME: Add an API for clearing remset entries if a root with a user defined
- * mark routine is deleted.
- */
-int mono_gc_register_root_wbarrier (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg);
-
-void mono_gc_wbarrier_set_root (gpointer ptr, MonoObject *value);
-
-/* Set a field of a root registered using mono_gc_register_root_wbarrier () */
-#define MONO_ROOT_SETREF(s,fieldname,value) do {       \
-       mono_gc_wbarrier_set_root (&((s)->fieldname), (MonoObject*)value); \
-} while (0)
-
-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);
-MonoMethod *mono_gc_get_managed_allocator_by_type (int atype, gboolean slowpath);
-
-guint32 mono_gc_get_managed_allocator_types (void);
-
-/* Return a short string identifying the GC, indented to be saved in AOT images */
-const char *mono_gc_get_gc_name (void);
-
-/* Fast write barriers */
-MonoMethod* mono_gc_get_specific_write_barrier (gboolean is_concurrent);
-MonoMethod* mono_gc_get_write_barrier (void);
-
-/* Fast valuetype copy */
-void mono_gc_wbarrier_value_copy_bitmap (gpointer dest, gpointer src, int size, unsigned bitmap);
-
-/* helper for the managed alloc support */
-MonoString *mono_string_alloc (int length);
-
-/* 
- * Functions supplied by the runtime and called by the GC. Currently only used
- * by SGEN.
- */
-typedef struct {
-       /* 
-        * Function called during thread startup/attach to allocate thread-local data 
-        * needed by the other functions.
-        */
-       gpointer (*thread_attach_func) (void);
-       /* 
-        * Function called during thread deatch to free the data allocated by
-        * thread_attach_func.
-        */
-       void (*thread_detach_func) (gpointer user_data);
-       /* 
-        * Function called from every thread when suspending for GC. It can save
-        * data needed for marking from thread stacks. user_data is the data returned 
-        * by attach_func. This might called with GC locks held and the word stopped,
-        * so it shouldn't do any synchronization etc.
-        */
-       void (*thread_suspend_func) (gpointer user_data, void *sigcontext, MonoContext *ctx);
-       /* 
-        * Function called to mark from thread stacks. user_data is the data returned 
-        * by attach_func. This is called twice, with the word stopped:
-        * - in the first pass, it should mark areas of the stack using
-        *   conservative marking by calling mono_gc_conservatively_scan_area ().
-        * - in the second pass, it should mark the remaining areas of the stack
-        *   using precise marking by calling mono_gc_scan_object ().
-        */
-       void (*thread_mark_func) (gpointer user_data, guint8 *stack_start, guint8 *stack_end, gboolean precise, void *gc_data);
-       /*
-        * Function called for debugging to get the current managed method for
-        * tracking the provenances of objects.
-        */
-       gpointer (*get_provenance_func) (void);
-} MonoGCCallbacks;
-
-/* Set the callback functions callable by the GC */
-void mono_gc_set_gc_callbacks (MonoGCCallbacks *callbacks);
-MonoGCCallbacks *mono_gc_get_gc_callbacks (void);
-
-/* Functions callable from the thread mark func */
-
-/* Scan the memory area between START and END conservatively */
-void mono_gc_conservatively_scan_area (void *start, void *end);
-
-/* Scan OBJ, returning its new address */
-void *mono_gc_scan_object (void *obj, void *gc_data);
-
-/* Return the suspend signal number used by the GC to suspend threads,
-   or -1 if not applicable. */
-int mono_gc_get_suspend_signal (void);
-
-/* Return the suspend signal number used by the GC to suspend threads,
-   or -1 if not applicable. */
-int mono_gc_get_restart_signal (void);
-
-/*
- * Return a human readable description of the GC in malloc-ed memory.
- */
-char* mono_gc_get_description (void);
-
-/*
- * Configure the GC to desktop mode
- */
-void mono_gc_set_desktop_mode (void);
-
-/*
- * Return whenever this GC can move objects
- */
-gboolean mono_gc_is_moving (void);
-
-typedef void* (*MonoGCLockedCallbackFunc) (void *data);
-
-void* mono_gc_invoke_with_gc_lock (MonoGCLockedCallbackFunc func, void *data);
-
-int mono_gc_get_los_limit (void);
-
-guint8* mono_gc_get_card_table (int *shift_bits, gpointer *card_mask);
-gboolean mono_gc_card_table_nursery_check (void);
-
-void* mono_gc_get_nursery (int *shift_bits, size_t *size);
-
-void mono_gc_set_current_thread_appdomain (MonoDomain *domain);
-
-void mono_gc_set_skip_thread (gboolean skip);
-
-#ifndef HOST_WIN32
-int mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
-#endif
-
-/*
- * Return whenever GC is disabled
- */
-gboolean mono_gc_is_disabled (void);
-
-/*
- * Return whenever this is the null GC
- */
-gboolean mono_gc_is_null (void);
-
-void mono_gc_set_string_length (MonoString *str, gint32 new_length);
-
-#if defined(__MACH__)
-void mono_gc_register_mach_exception_thread (pthread_t thread);
-pthread_t mono_gc_get_mach_exception_thread (void);
-#endif
-
-gboolean mono_gc_precise_stack_mark_enabled (void);
-
-typedef struct _RefQueueEntry RefQueueEntry;
-
-struct _RefQueueEntry {
-       void *dis_link;
-       guint32 gchandle;
-       MonoDomain *domain;
-       void *user_data;
-       RefQueueEntry *next;
-};
-
-struct _MonoReferenceQueue {
-       RefQueueEntry *queue;
-       mono_reference_queue_callback callback;
-       MonoReferenceQueue *next;
-       gboolean should_be_deleted;
-};
-
-enum {
-       MONO_GC_FINALIZER_EXTENSION_VERSION = 1,
-};
-
-typedef struct {
-       int version;
-       gboolean (*is_class_finalization_aware) (MonoClass *klass);
-       void (*object_queued_for_finalization) (MonoObject *object);
-} MonoGCFinalizerCallbacks;
-
-MONO_API void mono_gc_register_finalizer_callbacks (MonoGCFinalizerCallbacks *callbacks);
-
-
-#ifdef HOST_WIN32
-BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reserved);
-#endif
-
-guint mono_gc_get_vtable_bits (MonoClass *klass);
-
-void mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer altstack, gint32 altstack_size);
-
-/* If set, print debugging messages around finalizers. */
-extern gboolean log_finalizers;
-
-/* If set, do not run finalizers. */
-extern gboolean do_not_finalize;
-
-#endif /* __MONO_METADATA_GC_INTERNAL_H__ */
-
diff --git a/mono/metadata/gc-internals.h b/mono/metadata/gc-internals.h
new file mode 100644 (file)
index 0000000..465c92b
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * metadata/gc-internals.h: Internal GC interface
+ *
+ * Author: Paolo Molaro <lupus@ximian.com>
+ *
+ * (C) 2002 Ximian, Inc.
+ * Copyright 2012 Xamarin Inc (http://www.xamarin.com)
+ */
+
+#ifndef __MONO_METADATA_GC_INTERNAL_H__
+#define __MONO_METADATA_GC_INTERNAL_H__
+
+#include <glib.h>
+#include <mono/utils/gc_wrapper.h>
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/threads-types.h>
+#include <mono/sgen/gc-internal-agnostic.h>
+#include <mono/utils/gc_wrapper.h>
+
+#define mono_domain_finalizers_lock(domain) mono_mutex_lock (&(domain)->finalizable_objects_hash_lock);
+#define mono_domain_finalizers_unlock(domain) mono_mutex_unlock (&(domain)->finalizable_objects_hash_lock);
+
+/* Register a memory area as a conservatively scanned GC root */
+#define MONO_GC_REGISTER_ROOT_PINNING(x,src,msg) mono_gc_register_root ((char*)&(x), sizeof(x), MONO_GC_DESCRIPTOR_NULL, (src), (msg))
+
+#define MONO_GC_UNREGISTER_ROOT(x) mono_gc_deregister_root ((char*)&(x))
+
+/*
+ * Register a memory location as a root pointing to memory allocated using
+ * mono_gc_alloc_fixed (). This includes MonoGHashTable.
+ */
+/* The result of alloc_fixed () is not GC tracked memory */
+#define MONO_GC_REGISTER_ROOT_FIXED(x,src,msg) do { \
+       if (!mono_gc_is_moving ())                              \
+               MONO_GC_REGISTER_ROOT_PINNING ((x),(src),(msg)); \
+       } while (0)
+
+/*
+ * Return a GC descriptor for an array containing N pointers to memory allocated
+ * by mono_gc_alloc_fixed ().
+ */
+/* For SGEN, the result of alloc_fixed () is not GC tracked memory */
+#define MONO_GC_ROOT_DESCR_FOR_FIXED(n) (mono_gc_is_moving () ? mono_gc_make_root_descr_all_refs (0) : MONO_GC_DESCRIPTOR_NULL)
+
+/* Register a memory location holding a single object reference as a GC root */
+#define MONO_GC_REGISTER_ROOT_SINGLE(x,src,msg) do { \
+       g_assert (sizeof (x) == sizeof (MonoObject*)); \
+       mono_gc_register_root ((char*)&(x), sizeof(MonoObject*), mono_gc_make_root_descr_all_refs (1), (src), (msg)); \
+       } while (0)
+
+/*
+ * This is used for fields which point to objects which are kept alive by other references
+ * when using Boehm.
+ */
+#define MONO_GC_REGISTER_ROOT_IF_MOVING(x,src,msg) do { \
+       if (mono_gc_is_moving ()) \
+               MONO_GC_REGISTER_ROOT_SINGLE(x,src,msg);                \
+} while (0)
+
+#define MONO_GC_UNREGISTER_ROOT_IF_MOVING(x) do { \
+       if (mono_gc_is_moving ()) \
+               MONO_GC_UNREGISTER_ROOT (x);                    \
+} while (0)
+
+/* useful until we keep track of gc-references in corlib etc. */
+#define IS_GC_REFERENCE(class,t) (mono_gc_is_moving () ? FALSE : ((t)->type == MONO_TYPE_U && (class)->image == mono_defaults.corlib))
+
+void   mono_object_register_finalizer               (MonoObject  *obj);
+void   ves_icall_System_GC_InternalCollect          (int          generation);
+gint64 ves_icall_System_GC_GetTotalMemory           (MonoBoolean  forceCollection);
+void   ves_icall_System_GC_KeepAlive                (MonoObject  *obj);
+void   ves_icall_System_GC_ReRegisterForFinalize    (MonoObject  *obj);
+void   ves_icall_System_GC_SuppressFinalize         (MonoObject  *obj);
+void   ves_icall_System_GC_WaitForPendingFinalizers (void);
+
+MonoObject *ves_icall_System_GCHandle_GetTarget (guint32 handle);
+guint32     ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint32 type);
+void        ves_icall_System_GCHandle_FreeHandle (guint32 handle);
+gpointer    ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle);
+void        ves_icall_System_GC_register_ephemeron_array (MonoObject *array);
+MonoObject  *ves_icall_System_GC_get_ephemeron_tombstone (void);
+
+MonoBoolean ves_icall_Mono_Runtime_SetGCAllowSynchronousMajor (MonoBoolean flag);
+
+extern void mono_gc_init (void);
+extern void mono_gc_base_init (void);
+extern void mono_gc_cleanup (void);
+extern void mono_gc_base_cleanup (void);
+
+/*
+ * Return whenever the current thread is registered with the GC (i.e. started
+ * by the GC pthread wrappers on unix.
+ */
+extern gboolean mono_gc_is_gc_thread (void);
+
+extern gboolean mono_gc_is_finalizer_internal_thread (MonoInternalThread *thread);
+
+extern void mono_gc_set_stack_end (void *stack_end);
+
+/* only valid after the RECLAIM_START GC event and before RECLAIM_END
+ * Not exported in public headers, but can be linked to (unsupported).
+ */
+gboolean mono_object_is_alive (MonoObject* obj);
+gboolean mono_gc_is_finalizer_thread (MonoThread *thread);
+gpointer mono_gc_out_of_memory (size_t size);
+void     mono_gc_enable_events (void);
+void     mono_gc_enable_alloc_events (void);
+
+void mono_gchandle_set_target (guint32 gchandle, MonoObject *obj);
+
+/*Ephemeron functionality. Sgen only*/
+gboolean    mono_gc_ephemeron_array_add (MonoObject *obj);
+
+/* To disable synchronous, evacuating collections - concurrent SGen only */
+gboolean    mono_gc_set_allow_synchronous_major (gboolean flag);
+
+MonoBoolean
+mono_gc_GCHandle_CheckCurrentDomain (guint32 gchandle);
+
+/* User defined marking function */
+/* It should work like this:
+ * foreach (ref in GC references in the are structure pointed to by ADDR)
+ *    mark_func (ref)
+ */
+typedef void (*MonoGCMarkFunc)     (MonoObject **addr, void *gc_data);
+typedef void (*MonoGCRootMarkFunc) (void *addr, MonoGCMarkFunc mark_func, void *gc_data);
+
+/* Create a descriptor with a user defined marking function */
+MonoGCDescriptor mono_gc_make_root_descr_user (MonoGCRootMarkFunc marker);
+
+/* Return whenever user defined marking functions are supported */
+gboolean mono_gc_user_markers_supported (void);
+
+/* desc is the result from mono_gc_make_descr*. A NULL value means
+ * all the words might contain GC pointers.
+ * The memory is non-moving and it will be explicitly deallocated.
+ * size bytes will be available from the returned address (ie, descr
+ * must not be stored in the returned memory)
+ * NOTE: Under Boehm, this returns memory allocated using GC_malloc, so the result should
+ * be stored into a location registered using MONO_GC_REGISTER_ROOT_FIXED ().
+ */
+void* mono_gc_alloc_fixed            (size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg);
+void  mono_gc_free_fixed             (void* addr);
+
+/* make sure the gchandle was allocated for an object in domain */
+gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain);
+void     mono_gchandle_free_domain  (MonoDomain *domain);
+
+typedef void (*FinalizerThreadCallback) (gpointer user_data);
+
+/* if there are finalizers to run, run them. Returns the number of finalizers run */
+gboolean mono_gc_pending_finalizers (void);
+void     mono_gc_finalize_notify    (void);
+
+void* mono_gc_alloc_pinned_obj (MonoVTable *vtable, size_t size);
+void* mono_gc_alloc_obj (MonoVTable *vtable, size_t size);
+void* mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length);
+void* mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uintptr_t bounds_size);
+void* mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len);
+MonoGCDescriptor mono_gc_make_descr_for_string (gsize *bitmap, int numbits);
+
+void  mono_gc_register_for_finalization (MonoObject *obj, void *user_data);
+void  mono_gc_add_memory_pressure (gint64 value);
+MONO_API int   mono_gc_register_root (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg);
+void  mono_gc_deregister_root (char* addr);
+int   mono_gc_finalizers_for_domain (MonoDomain *domain, MonoObject **out_array, int out_size);
+void  mono_gc_run_finalize (void *obj, void *data);
+void  mono_gc_clear_domain (MonoDomain * domain);
+void* mono_gc_alloc_mature (MonoVTable *vtable);
+
+/* 
+ * Register a root which can only be written using a write barrier.
+ * Writes to the root must be done using a write barrier (MONO_ROOT_SETREF).
+ * If the root uses an user defined mark routine, the writes are not required to be
+ * to the area between START and START+SIZE.
+ * The write barrier allows the GC to avoid scanning this root at each collection, so it
+ * is more efficient.
+ * FIXME: Add an API for clearing remset entries if a root with a user defined
+ * mark routine is deleted.
+ */
+int mono_gc_register_root_wbarrier (char *start, size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg);
+
+void mono_gc_wbarrier_set_root (gpointer ptr, MonoObject *value);
+
+/* Set a field of a root registered using mono_gc_register_root_wbarrier () */
+#define MONO_ROOT_SETREF(s,fieldname,value) do {       \
+       mono_gc_wbarrier_set_root (&((s)->fieldname), (MonoObject*)value); \
+} while (0)
+
+void  mono_gc_finalize_threadpool_threads (void);
+
+/* fast allocation support */
+
+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);
+MonoMethod *mono_gc_get_managed_allocator_by_type (int atype, gboolean slowpath);
+
+guint32 mono_gc_get_managed_allocator_types (void);
+
+/* Return a short string identifying the GC, indented to be saved in AOT images */
+const char *mono_gc_get_gc_name (void);
+
+/* Fast write barriers */
+MonoMethod* mono_gc_get_specific_write_barrier (gboolean is_concurrent);
+MonoMethod* mono_gc_get_write_barrier (void);
+
+/* Fast valuetype copy */
+void mono_gc_wbarrier_value_copy_bitmap (gpointer dest, gpointer src, int size, unsigned bitmap);
+
+/* helper for the managed alloc support */
+MonoString *mono_string_alloc (int length);
+
+/* 
+ * Functions supplied by the runtime and called by the GC. Currently only used
+ * by SGEN.
+ */
+typedef struct {
+       /* 
+        * Function called during thread startup/attach to allocate thread-local data 
+        * needed by the other functions.
+        */
+       gpointer (*thread_attach_func) (void);
+       /* 
+        * Function called during thread deatch to free the data allocated by
+        * thread_attach_func.
+        */
+       void (*thread_detach_func) (gpointer user_data);
+       /* 
+        * Function called from every thread when suspending for GC. It can save
+        * data needed for marking from thread stacks. user_data is the data returned 
+        * by attach_func. This might called with GC locks held and the word stopped,
+        * so it shouldn't do any synchronization etc.
+        */
+       void (*thread_suspend_func) (gpointer user_data, void *sigcontext, MonoContext *ctx);
+       /* 
+        * Function called to mark from thread stacks. user_data is the data returned 
+        * by attach_func. This is called twice, with the word stopped:
+        * - in the first pass, it should mark areas of the stack using
+        *   conservative marking by calling mono_gc_conservatively_scan_area ().
+        * - in the second pass, it should mark the remaining areas of the stack
+        *   using precise marking by calling mono_gc_scan_object ().
+        */
+       void (*thread_mark_func) (gpointer user_data, guint8 *stack_start, guint8 *stack_end, gboolean precise, void *gc_data);
+       /*
+        * Function called for debugging to get the current managed method for
+        * tracking the provenances of objects.
+        */
+       gpointer (*get_provenance_func) (void);
+} MonoGCCallbacks;
+
+/* Set the callback functions callable by the GC */
+void mono_gc_set_gc_callbacks (MonoGCCallbacks *callbacks);
+MonoGCCallbacks *mono_gc_get_gc_callbacks (void);
+
+/* Functions callable from the thread mark func */
+
+/* Scan the memory area between START and END conservatively */
+void mono_gc_conservatively_scan_area (void *start, void *end);
+
+/* Scan OBJ, returning its new address */
+void *mono_gc_scan_object (void *obj, void *gc_data);
+
+/* Return the suspend signal number used by the GC to suspend threads,
+   or -1 if not applicable. */
+int mono_gc_get_suspend_signal (void);
+
+/* Return the suspend signal number used by the GC to suspend threads,
+   or -1 if not applicable. */
+int mono_gc_get_restart_signal (void);
+
+/*
+ * Return a human readable description of the GC in malloc-ed memory.
+ */
+char* mono_gc_get_description (void);
+
+/*
+ * Configure the GC to desktop mode
+ */
+void mono_gc_set_desktop_mode (void);
+
+/*
+ * Return whenever this GC can move objects
+ */
+gboolean mono_gc_is_moving (void);
+
+typedef void* (*MonoGCLockedCallbackFunc) (void *data);
+
+void* mono_gc_invoke_with_gc_lock (MonoGCLockedCallbackFunc func, void *data);
+
+int mono_gc_get_los_limit (void);
+
+guint8* mono_gc_get_card_table (int *shift_bits, gpointer *card_mask);
+gboolean mono_gc_card_table_nursery_check (void);
+
+void* mono_gc_get_nursery (int *shift_bits, size_t *size);
+
+void mono_gc_set_current_thread_appdomain (MonoDomain *domain);
+
+void mono_gc_set_skip_thread (gboolean skip);
+
+#ifndef HOST_WIN32
+int mono_gc_pthread_create (pthread_t *new_thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
+#endif
+
+/*
+ * Return whenever GC is disabled
+ */
+gboolean mono_gc_is_disabled (void);
+
+/*
+ * Return whenever this is the null GC
+ */
+gboolean mono_gc_is_null (void);
+
+void mono_gc_set_string_length (MonoString *str, gint32 new_length);
+
+#if defined(__MACH__)
+void mono_gc_register_mach_exception_thread (pthread_t thread);
+pthread_t mono_gc_get_mach_exception_thread (void);
+#endif
+
+gboolean mono_gc_precise_stack_mark_enabled (void);
+
+typedef struct _RefQueueEntry RefQueueEntry;
+
+struct _RefQueueEntry {
+       void *dis_link;
+       guint32 gchandle;
+       MonoDomain *domain;
+       void *user_data;
+       RefQueueEntry *next;
+};
+
+struct _MonoReferenceQueue {
+       RefQueueEntry *queue;
+       mono_reference_queue_callback callback;
+       MonoReferenceQueue *next;
+       gboolean should_be_deleted;
+};
+
+enum {
+       MONO_GC_FINALIZER_EXTENSION_VERSION = 1,
+};
+
+typedef struct {
+       int version;
+       gboolean (*is_class_finalization_aware) (MonoClass *klass);
+       void (*object_queued_for_finalization) (MonoObject *object);
+} MonoGCFinalizerCallbacks;
+
+MONO_API void mono_gc_register_finalizer_callbacks (MonoGCFinalizerCallbacks *callbacks);
+
+
+#ifdef HOST_WIN32
+BOOL APIENTRY mono_gc_dllmain (HMODULE module_handle, DWORD reason, LPVOID reserved);
+#endif
+
+guint mono_gc_get_vtable_bits (MonoClass *klass);
+
+void mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer altstack, gint32 altstack_size);
+
+/* If set, print debugging messages around finalizers. */
+extern gboolean log_finalizers;
+
+/* If set, do not run finalizers. */
+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 ff0f0d139a99452bfd036d56f0060a301562c1f3..18f3b655cad9097d0046b02d9daeb35a315884cf 100644 (file)
@@ -12,7 +12,7 @@
 #include <glib.h>
 #include <string.h>
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/tabledefs.h>
@@ -26,8 +26,8 @@
 #include <mono/metadata/threadpool-ms.h>
 #include <mono/sgen/sgen-conf.h>
 #include <mono/sgen/sgen-gc.h>
-#include <mono/utils/mono-logger-internal.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/utils/mono-logger-internals.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/marshal.h> /* for mono_delegate_free_ftnptr () */
 #include <mono/metadata/attach.h>
 #include <mono/metadata/console-io.h>
@@ -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
@@ -124,6 +122,23 @@ mono_gc_run_finalize (void *obj, void *data)
 
        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 2d2e405c368e88d2b241965c73f15731246c7384..489b5ded65b19fcf2edf5080854849470530a86d 100644 (file)
@@ -325,6 +325,7 @@ ICALL(MONOIO_3, "CreateDirectory(string,System.IO.MonoIOError&)", ves_icall_Syst
 ICALL(MONOIO_4, "CreatePipe", ves_icall_System_IO_MonoIO_CreatePipe)
 ICALL(MONOIO_5, "DeleteFile(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_DeleteFile)
 #endif /* !PLATFORM_RO_FS */
+ICALL(MONOIO_38, "DumpHandles", ves_icall_System_IO_MonoIO_DumpHandles)
 ICALL(MONOIO_34, "DuplicateHandle", ves_icall_System_IO_MonoIO_DuplicateHandle)
 ICALL(MONOIO_37, "FindClose", ves_icall_System_IO_MonoIO_FindClose)
 ICALL(MONOIO_35, "FindFirst", ves_icall_System_IO_MonoIO_FindFirst)
index eaf494042187afcc16174435084b7c7cbc75b909..1b36b74bc697c68e14b008387c7a54125f16164e 100644 (file)
@@ -55,7 +55,7 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/reflection-internals.h>
 #include <mono/metadata/marshal.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/rand.h>
 #include <mono/metadata/sysmath.h>
@@ -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:
index 3013a3e6fe64581702a87cbfba2b37b72316362a..d88757ab4fdb729f27cf39ccb3e398144f426e54 100644 (file)
@@ -27,7 +27,7 @@
 #include "marshal.h"
 #include "coree.h"
 #include <mono/io-layer/io-layer.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-path.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-io-portability.h>
@@ -697,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
@@ -2527,12 +2527,12 @@ 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);
 }
 
@@ -2578,10 +2578,9 @@ mono_find_mempool_owner (void *ptr)
        gboolean searching = TRUE;
 
        // Iterate over both by-path image hashes
-       const int hash_count = 2;
-       const int hash_candidates[hash_count] = {IMAGES_HASH_PATH, IMAGES_HASH_PATH_REFONLY};
+       const int hash_candidates[] = {IMAGES_HASH_PATH, IMAGES_HASH_PATH_REFONLY};
        int hash_idx;
-       for (hash_idx = 0; searching && hash_idx < IMAGES_HASH_COUNT; 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;
@@ -2605,4 +2604,4 @@ mono_find_mempool_owner (void *ptr)
        return owner;
 }
 
-#endif
\ No newline at end of file
+#endif
index be78f82c43c73bd26763c78fbe3c0a4725357fc9..06375a4977384fa0470080717388e77d08baed90 100644 (file)
 #include <string.h>
 #include <sys/stat.h>
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-compiler.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-membar.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/hazard-pointer.h>
@@ -33,7 +33,7 @@
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/metadata-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/mono-debug-debugger.h>
 #include <mono/metadata/mono-config.h>
@@ -335,10 +335,10 @@ jit_info_table_check (MonoJitInfoTable *table)
                g_assert (chunk->num_elements <= MONO_JIT_INFO_TABLE_CHUNK_SIZE);
 
                for (j = 0; j < chunk->num_elements; ++j) {
-                       MonoJitInfo *this = chunk->data [j];
+                       MonoJitInfo *this_ji = chunk->data [j];
                        MonoJitInfo *next;
 
-                       g_assert ((gint8*)this->code_start + this->code_size <= chunk->last_code_end);
+                       g_assert ((gint8*)this_ji->code_start + this_ji->code_size <= chunk->last_code_end);
 
                        if (j < chunk->num_elements - 1)
                                next = chunk->data [j + 1];
@@ -357,7 +357,7 @@ jit_info_table_check (MonoJitInfoTable *table)
                        } else
                                return;
 
-                       g_assert ((gint8*)this->code_start + this->code_size <= (gint8*)next->code_start + next->code_size);
+                       g_assert ((gint8*)this_ji->code_start + this_ji->code_size <= (gint8*)next->code_start + next->code_size);
                }
        }
 }
index c9b2131e70e97e32bc3228c6c103f1fe4d94b150..b99d6a00b1168fc4ccd5be41af8686ab7c62bb64 100644 (file)
@@ -39,7 +39,7 @@
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/lock-tracer.h>
 #include <mono/metadata/verify-internals.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-dl.h>
 #include <mono/utils/mono-membar.h>
 #include <mono/utils/mono-counters.h>
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 fa1807cd77bb9f06da8f5b4254b632a1c374cc1f..4a2de28586961787758d9773ba6223c42b0c4b9e 100644 (file)
 #include "mono/metadata/class-internals.h"
 #include "mono/metadata/metadata-internals.h"
 #include "mono/metadata/domain-internals.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mono/metadata/threads-types.h"
 #include "mono/metadata/string-icalls.h"
 #include "mono/metadata/attrdefs.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mono/metadata/cominterop.h"
 #include "mono/metadata/remoting.h"
 #include "mono/metadata/reflection-internals.h"
@@ -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*
@@ -3862,7 +3856,7 @@ emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMe
 
 /*
  * generates IL code for the runtime invoke function 
- * MonoObject *runtime_invoke (MonoObject *this, void **params, MonoObject **exc, void* method)
+ * MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method)
  *
  * we also catch exceptions if exc != null
  * If VIRTUAL is TRUE, then METHOD is invoked virtually on THIS. This is useful since
@@ -8794,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;
@@ -8834,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 */
@@ -8854,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;
@@ -8957,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);
 
@@ -8980,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);
 
@@ -9000,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); */
@@ -9983,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);
@@ -11103,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;
@@ -11111,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 |
@@ -11220,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;
 
index 49e555798c42c6e6fe23e6de201637a368048575..29350e4d8461acd65ac7c286a2d00063d12c8fde 100644 (file)
@@ -146,6 +146,10 @@ typedef struct {
        MonoMethod *method;
 } ManagedToNativeWrapperInfo;
 
+typedef struct {
+       MonoMethod *method;
+} SynchronizedWrapperInfo;
+
 typedef struct {
        MonoMethod *method;
 } SynchronizedInnerWrapperInfo;
@@ -166,6 +170,22 @@ typedef struct {
        MonoClass *klass;
 } ProxyWrapperInfo;
 
+typedef struct {
+} 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 +206,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 +218,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 +325,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 a3b9257b848818d282574b1d8c525062f0e1fc87..c3bb80740ea2622b37749c30bafdd07108f9babf 100644 (file)
@@ -3390,14 +3390,14 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer
        case MONO_TYPE_VALUETYPE:
        case MONO_TYPE_CLASS: {
                guint32 token;
-               MonoClass *class;
+               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)
+               klass = mono_class_get_checked (m, token, error);
+               type->data.klass = klass;
+               if (!klass)
                        return FALSE;
 
-               if (!compare_type_literals (m, class->byval_arg.type, type->type, error))
+               if (!compare_type_literals (m, klass->byval_arg.type, type->type, error))
                        return FALSE;
 
                break;
@@ -4869,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
@@ -4878,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);
index 151c1d382c91033269361ce8ff1fcdbb2da617f2..f86c4233baf90375a94ee5c248a54c3df585d88a 100644 (file)
@@ -20,7 +20,7 @@
 #include <mono/io-layer/io-layer.h>
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/class-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/method-builder.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/tabledefs.h>
index 440bc5f5da19018d0e031ece20fd6603e1733f8b..e29fe9d0fccf942479547318a64628afd60af3c4 100644 (file)
@@ -17,7 +17,7 @@
 #include "mono/metadata/mono-config.h"
 #include "mono/metadata/metadata-internals.h"
 #include "mono/metadata/object-internals.h"
-#include "mono/utils/mono-logger-internal.h"
+#include "mono/utils/mono-logger-internals.h"
 
 #if defined(TARGET_PS3)
 #define CONFIG_OS "CellOS"
index 42c980214eb53a73ef54cd57c7e3af979dd362d0..04b5d647be15838b4ffb9a7024ad297c0af6592f 100644 (file)
@@ -18,7 +18,7 @@
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/mono-debug-debugger.h>
 #include <mono/metadata/mono-endian.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/debug-mono-ppdb.h>
 #include <string.h>
index d1685bc3ddaa9c62be6f4d353d74db30fdeda055..bbfa757212bd7706345bf9b4de0851d14af76cc8 100644 (file)
@@ -30,7 +30,7 @@
 #include <math.h>
 #include <glib.h>
 #include "mono-hash.h"
-#include "metadata/gc-internal.h"
+#include "metadata/gc-internals.h"
 #include <mono/utils/checked-build.h>
 
 #ifdef HAVE_BOEHM_GC
index e8be3a526b0d2681025fbe45e4c9e1a94201b935..8ecac9866101498875a7edbd1ee03fd176f72a6d 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <glib.h>
 
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 
 /* This is an implementation of a growable pointer array that avoids doing memory allocations for small sizes.
  * It works by allocating an initial small array on stack and only going to gc tracked memory if needed.
index 1d0b0217a5146e77ca4e66cf5cc5058d76fb60a7..773410ad7b6fcfb9c073ebc42025e51dd1e22400 100644 (file)
@@ -9,7 +9,7 @@
 #include "config.h"
 #include <glib.h>
 #include <mono/metadata/mono-gc.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/runtime.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-threads.h>
@@ -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 629d48af4d4403f2c6efea4a04fd784197574fef..b296ca2e37d7f86340bebed513b1dbb548a3552a 100644 (file)
@@ -195,8 +195,6 @@ number_to_double (MonoNumber *number, gdouble *value)
        guint16 *src;
        gint exp, remaining, total, count, scale, absscale, index;
 
-       g_assert (number->digits);
-
        total = 0;
        src = number->digits;
        while (*src++) total ++;
index c3f24008d657afe73f286b1f76629d11d3b005dd..938289bd8f85b8ce23dffe6e0cc52375aa52e0c7 100644 (file)
@@ -21,7 +21,7 @@
 #include <mono/metadata/tokentype.h>
 #include <mono/metadata/loader.h>
 #include <mono/metadata/object.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/domain-internals.h>
 #include "mono/metadata/metadata-internals.h"
@@ -36,7 +36,7 @@
 #include "mono/metadata/profiler-private.h"
 #include "mono/metadata/security-manager.h"
 #include "mono/metadata/mono-debug-debugger.h"
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/verify-internals.h>
 #include <mono/utils/strenc.h>
 #include <mono/utils/mono-counters.h>
@@ -64,20 +64,20 @@ mono_string_to_utf8_internal (MonoMemPool *mp, MonoImage *image, MonoString *s,
 static mono_mutex_t ldstr_section;
 
 void
-mono_runtime_object_init (MonoObject *this)
+mono_runtime_object_init (MonoObject *this_obj)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
        MonoMethod *method = NULL;
-       MonoClass *klass = this->vtable->klass;
+       MonoClass *klass = this_obj->vtable->klass;
 
        method = mono_class_get_method_from_name (klass, ".ctor", 0);
        if (!method)
                g_error ("Could not lookup zero argument constructor for class %s", mono_type_get_full_name (klass));
 
        if (method->klass->valuetype)
-               this = mono_object_unbox (this);
-       mono_runtime_invoke (method, this, NULL, NULL);
+               this_obj = mono_object_unbox (this_obj);
+       mono_runtime_invoke (method, this_obj, NULL, NULL);
 }
 
 /* The pseudo algorithm for type initialization from the spec
@@ -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 a9d0e68f6dee9c9a678c548c321b55d3304898ca..435e4671a2bbd129403bdccd99daeb9af5525ccd 100644 (file)
@@ -19,7 +19,7 @@
 #include "mono/metadata/metadata-internals.h"
 #include "mono/metadata/class-internals.h"
 #include "mono/metadata/domain-internals.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mono/metadata/mono-config-dirs.h"
 #include "mono/io-layer/io-layer.h"
 #include "mono/utils/mono-dl.h"
index 7244722d8e0ec2c8f57528f1927b09564541ce09..dc8141bbdbfbc468815ac40c82d779d04c2467c7 100644 (file)
@@ -1,8 +1,8 @@
 /* 
  * Copyright 2014 Xamarin Inc
  */
-#ifndef __MONO_METADATA_REFLECTION_INTERBALS_H__
-#define __MONO_METADATA_REFLECTION_INTERBALS_H__
+#ifndef __MONO_METADATA_REFLECTION_INTERNALS_H__
+#define __MONO_METADATA_REFLECTION_INTERNALS_H__
 
 #include <mono/metadata/reflection.h>
 #include <mono/utils/mono-compiler.h>
@@ -14,4 +14,4 @@ mono_custom_attrs_get_attr_checked (MonoCustomAttrInfo *ainfo, MonoClass *attr_k
 char*
 mono_identifier_unescape_type_name_chars (char* identifier);
 
-#endif
+#endif /* __MONO_METADATA_REFLECTION_INTERNALS_H__ */
index 22b011ee59e12a25aa0b4c7f96b921bcfcb8c99f..3d34adb29f1e17c9ab403fde6200c5a422f820d2 100644 (file)
@@ -17,7 +17,7 @@
 #include "mono/metadata/metadata-internals.h"
 #include <mono/metadata/profiler-private.h>
 #include "mono/metadata/class-internals.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mono/metadata/tokentype.h"
 #include "mono/metadata/domain-internals.h"
 #include "mono/metadata/opcodes.h"
@@ -35,7 +35,7 @@
 #include "image.h"
 #include "cil-coff.h"
 #include "mono-endian.h"
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mempool-internals.h>
 #include <mono/metadata/security-core-clr.h>
 #include <mono/metadata/debug-helpers.h>
@@ -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..22ab5cc7a6ecdcb5777d1e8e2e54ed3af10b78f5 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_obj, 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_obj, 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_obj, MonoClass *klass, MonoClassField *field, int offset, <@type> val)
  */
 MonoMethod *
 mono_marshal_get_stfld_wrapper (MonoType *type)
index 43e06db574b9ab524bfb06748b7db29413d6f448..6ec8cbe1ea8b8f90b88af1a1bebc0d65115a2ef6 100644 (file)
@@ -16,7 +16,7 @@
 #include <mono/metadata/object.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/debug-helpers.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 
 #include "security-core-clr.h"
 
@@ -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;
 }
diff --git a/mono/metadata/sgen-bridge-internal.h b/mono/metadata/sgen-bridge-internal.h
deleted file mode 100644 (file)
index 60eb578..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * sgen-bridge-internal.h: The cross-GC bridge.
- *
- * Copyright (C) 2015 Xamarin Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License 2.0 as published by the Free Software Foundation;
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License 2.0 along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __MONO_SGENBRIDGEINTERNAL_H__
-#define __MONO_SGENBRIDGEINTERNAL_H__
-
-#include "config.h"
-
-#ifdef HAVE_SGEN_GC
-
-#include "mono/utils/mono-compiler.h"
-
-#include "mono/sgen/sgen-gc.h"
-#include "mono/metadata/sgen-bridge.h"
-
-extern volatile gboolean bridge_processing_in_progress;
-extern MonoGCBridgeCallbacks bridge_callbacks;
-
-gboolean sgen_need_bridge_processing (void);
-void sgen_bridge_reset_data (void);
-void sgen_bridge_processing_stw_step (void);
-void sgen_bridge_processing_finish (int generation);
-gboolean sgen_is_bridge_object (GCObject *obj);
-MonoGCBridgeObjectKind sgen_bridge_class_kind (MonoClass *klass);
-void sgen_bridge_register_finalized_object (GCObject *object);
-void sgen_bridge_describe_pointer (GCObject *object);
-
-gboolean sgen_is_bridge_object (GCObject *obj);
-void sgen_mark_bridge_object (GCObject *obj);
-
-gboolean sgen_bridge_handle_gc_debug (const char *opt);
-void sgen_bridge_print_gc_debug_usage (void);
-
-typedef struct {
-       void (*reset_data) (void);
-       void (*processing_stw_step) (void);
-       void (*processing_build_callback_data) (int generation);
-       void (*processing_after_callback) (int generation);
-       MonoGCBridgeObjectKind (*class_kind) (MonoClass *class);
-       void (*register_finalized_object) (GCObject *object);
-       void (*describe_pointer) (GCObject *object);
-       void (*enable_accounting) (void);
-       void (*set_dump_prefix) (const char *prefix);
-
-       /*
-        * These are set by processing_build_callback_data().
-        */
-       int num_sccs;
-       MonoGCBridgeSCC **api_sccs;
-
-       int num_xrefs;
-       MonoGCBridgeXRef *api_xrefs;
-} SgenBridgeProcessor;
-
-void sgen_old_bridge_init (SgenBridgeProcessor *collector);
-void sgen_new_bridge_init (SgenBridgeProcessor *collector);
-void sgen_tarjan_bridge_init (SgenBridgeProcessor *collector);
-void sgen_set_bridge_implementation (const char *name);
-void sgen_bridge_set_dump_prefix (const char *prefix);
-
-#endif
-
-#endif
diff --git a/mono/metadata/sgen-bridge-internals.h b/mono/metadata/sgen-bridge-internals.h
new file mode 100644 (file)
index 0000000..ac7dfb9
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * sgen-bridge-internals.h: The cross-GC bridge.
+ *
+ * Copyright (C) 2015 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __MONO_SGENBRIDGEINTERNAL_H__
+#define __MONO_SGENBRIDGEINTERNAL_H__
+
+#include "config.h"
+
+#ifdef HAVE_SGEN_GC
+
+#include "mono/utils/mono-compiler.h"
+
+#include "mono/sgen/sgen-gc.h"
+#include "mono/metadata/sgen-bridge.h"
+
+extern volatile gboolean bridge_processing_in_progress;
+extern MonoGCBridgeCallbacks bridge_callbacks;
+
+gboolean sgen_need_bridge_processing (void);
+void sgen_bridge_reset_data (void);
+void sgen_bridge_processing_stw_step (void);
+void sgen_bridge_processing_finish (int generation);
+gboolean sgen_is_bridge_object (GCObject *obj);
+MonoGCBridgeObjectKind sgen_bridge_class_kind (MonoClass *klass);
+void sgen_bridge_register_finalized_object (GCObject *object);
+void sgen_bridge_describe_pointer (GCObject *object);
+
+gboolean sgen_is_bridge_object (GCObject *obj);
+void sgen_mark_bridge_object (GCObject *obj);
+
+gboolean sgen_bridge_handle_gc_debug (const char *opt);
+void sgen_bridge_print_gc_debug_usage (void);
+
+typedef struct {
+       void (*reset_data) (void);
+       void (*processing_stw_step) (void);
+       void (*processing_build_callback_data) (int generation);
+       void (*processing_after_callback) (int generation);
+       MonoGCBridgeObjectKind (*class_kind) (MonoClass *klass);
+       void (*register_finalized_object) (GCObject *object);
+       void (*describe_pointer) (GCObject *object);
+       void (*enable_accounting) (void);
+       void (*set_dump_prefix) (const char *prefix);
+
+       /*
+        * These are set by processing_build_callback_data().
+        */
+       int num_sccs;
+       MonoGCBridgeSCC **api_sccs;
+
+       int num_xrefs;
+       MonoGCBridgeXRef *api_xrefs;
+} SgenBridgeProcessor;
+
+void sgen_old_bridge_init (SgenBridgeProcessor *collector);
+void sgen_new_bridge_init (SgenBridgeProcessor *collector);
+void sgen_tarjan_bridge_init (SgenBridgeProcessor *collector);
+void sgen_set_bridge_implementation (const char *name);
+void sgen_bridge_set_dump_prefix (const char *prefix);
+
+#endif
+
+#endif
index 9eb5b3693034dfd541355e92dd2d375925199145..67e6a05bf30af7889765dfbd9699b322dcbe02eb 100644 (file)
 #include <stdlib.h>
 
 #include "sgen/sgen-gc.h"
-#include "sgen-bridge-internal.h"
+#include "sgen-bridge-internals.h"
 #include "sgen/sgen-hash-table.h"
 #include "sgen/sgen-qsort.h"
-#include "utils/mono-logger-internal.h"
+#include "utils/mono-logger-internals.h"
 
 MonoGCBridgeCallbacks bridge_callbacks;
 static SgenBridgeProcessor bridge_processor;
@@ -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..ab0cedf6ad6d6fa1a27749b87a43bd9788bb3da2 100644 (file)
@@ -88,10 +88,10 @@ struct _SgenClientThreadInfo {
 #include "metadata/profiler-private.h"
 #include "utils/dtrace.h"
 #include "utils/mono-counters.h"
-#include "utils/mono-logger-internal.h"
+#include "utils/mono-logger-internals.h"
 #include "utils/mono-time.h"
 #include "utils/mono-semaphore.h"
-#include "metadata/sgen-bridge-internal.h"
+#include "metadata/sgen-bridge-internals.h"
 
 extern void mono_sgen_register_moved_object (void *obj, void *destination);
 extern void mono_sgen_gc_event_moves (void);
@@ -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..2783e1af8fa6dd6967a4bc8312a2b4f2974ced7e 100644 (file)
 #include "metadata/abi-details.h"
 #include "metadata/mono-gc.h"
 #include "metadata/runtime.h"
-#include "metadata/sgen-bridge-internal.h"
-#include "metadata/gc-internal.h"
+#include "metadata/sgen-bridge-internals.h"
+#include "metadata/gc-internals.h"
 #include "utils/mono-memory-model.h"
-#include "utils/mono-logger-internal.h"
+#include "utils/mono-logger-internals.h"
 
 #ifdef HEAVY_STATISTICS
 static guint64 stat_wbarrier_set_arrayref = 0;
@@ -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,8 @@ 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);
+       mono_marshal_set_wrapper_info (res, info);
        mono_mb_free (mb);
 
        LOCK_GC;
@@ -423,12 +429,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 +447,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 +1058,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 +1382,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 +2917,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..65981ccc665f6708c3786cb94674375572d5367a 100644 (file)
 #include <errno.h>
 
 #include "sgen/sgen-gc.h"
-#include "sgen-bridge-internal.h"
+#include "sgen-bridge-internals.h"
 #include "sgen/sgen-hash-table.h"
 #include "sgen/sgen-qsort.h"
 #include "sgen/sgen-client.h"
 #include "tabledefs.h"
-#include "utils/mono-logger-internal.h"
+#include "utils/mono-logger-internals.h"
 
 //#define NEW_XREFS
 #ifdef NEW_XREFS
@@ -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..63b39f4946ab644eb84cc1b6ea2cae9cfb4f0485 100644 (file)
 #include <stdlib.h>
 
 #include "sgen/sgen-gc.h"
-#include "sgen-bridge-internal.h"
+#include "sgen-bridge-internals.h"
 #include "sgen/sgen-hash-table.h"
 #include "sgen/sgen-qsort.h"
 #include "sgen/sgen-client.h"
-#include "utils/mono-logger-internal.h"
+#include "utils/mono-logger-internals.h"
 
 typedef struct {
        int size;
@@ -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 165c0d4a4533f7f57bce63a182b2fa6f2fd1c145..fb6fc13bc451cb9dd60a04445ac6e0a37a75f377 100644 (file)
@@ -28,7 +28,7 @@
 #include "sgen/sgen-archdep.h"
 #include "sgen/sgen-protocol.h"
 #include "metadata/object-internals.h"
-#include "metadata/gc-internal.h"
+#include "metadata/gc-internals.h"
 
 
 #if defined(USE_COOP_GC)
index 46d30d81c4d664f3386c040356e0e60f2023ae4d..b6d90399bfade433128cd03b218dffe793b19992 100644 (file)
@@ -33,7 +33,7 @@
 #include "sgen/sgen-protocol.h"
 #include "sgen/sgen-thread-pool.h"
 #include "metadata/object-internals.h"
-#include "metadata/gc-internal.h"
+#include "metadata/gc-internals.h"
 
 #if defined(__MACH__)
 #include "utils/mach-support.h"
index a45d6be1d9c44c13c527d31cfa2f4eded804f868..dbf2eddb1c707311e2d3b846efe4402158b02691 100644 (file)
@@ -31,7 +31,7 @@
 #include <errno.h>
 #include <glib.h>
 #include "sgen/sgen-gc.h"
-#include "metadata/gc-internal.h"
+#include "metadata/gc-internals.h"
 #include "sgen/sgen-archdep.h"
 #include "metadata/object-internals.h"
 #include "utils/mono-signal-handler.h"
index 3145a5e35353e235923ce95f58075a0f1b7526f5..8a2ae113da920483d3624c5995234a5fcfe8acca 100644 (file)
@@ -5,7 +5,7 @@
 #include "io-layer/io-layer.h"
 
 #include "sgen/sgen-gc.h"
-#include "metadata/gc-internal.h"
+#include "metadata/gc-internals.h"
 
 gboolean
 sgen_resume_thread (SgenThreadInfo *info)
index 8ef67fc7f43de429ece707aacc09571f7453ed08..1d23bc6373246f80d1ce5a0e4fb18764e587dad5 100644 (file)
@@ -33,8 +33,8 @@
 #include "sgen/sgen-thread-pool.h"
 #include "metadata/profiler-private.h"
 #include "sgen/sgen-client.h"
-#include "metadata/sgen-bridge-internal.h"
-#include "metadata/gc-internal.h"
+#include "metadata/sgen-bridge-internals.h"
+#include "metadata/gc-internals.h"
 
 #define TV_DECLARE SGEN_TV_DECLARE
 #define TV_GETTIME SGEN_TV_GETTIME
index 9537c0710bee73f26bb018c8df30d9f349825e4d..10cf234c4268382f35a2c94a62a99c4100346aea 100644 (file)
 #include <stdlib.h>
 
 #include "sgen/sgen-gc.h"
-#include "sgen-bridge-internal.h"
+#include "sgen-bridge-internals.h"
 #include "sgen/sgen-hash-table.h"
 #include "sgen/sgen-qsort.h"
 #include "tabledefs.h"
-#include "utils/mono-logger-internal.h"
+#include "utils/mono-logger-internals.h"
 
 typedef struct {
        int size;
@@ -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 98fbf3070459d0b244e4bc79a4603a06d25d2800..773613c669283ddb99ca1bcc946a5754d544096f 100644 (file)
@@ -23,7 +23,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/profiler.h>
 #include <mono/metadata/profiler-private.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 /* This function is redirected to String.CreateString ()
    by mono_marshal_get_native_wrapper () */
index f3d54ae9720c2c1c5b9b18061e71fc486cb76e98..6ac26ed033c111604bba586cfa527ea766b8e8dd 100644 (file)
 #include <fcntl.h>
 #endif
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-mlist.h>
 #include <mono/metadata/threadpool-ms.h>
 #include <mono/metadata/threadpool-ms-io.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-lazy-init.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 
 typedef struct {
        gboolean (*init) (gint wakeup_pipe_fd);
index b9d9f941c0cb13b2d380bd5418c286df5b3dcdc3..fd6fe24d461212d60f5ef72d90a8c46e2f39f436 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/exception.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/object.h>
 #include <mono/metadata/object-internals.h>
 #include <mono/metadata/threadpool-ms.h>
@@ -37,7 +37,7 @@
 #include <mono/utils/mono-complex.h>
 #include <mono/utils/mono-lazy-init.h>
 #include <mono/utils/mono-logger.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-proclib.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-time.h>
index 346ac19b92211a2ce78ac8f280f6f99e9660ac71..188ed111c677a4544d5d95b1f71d566e88457990 100644 (file)
@@ -24,7 +24,7 @@
 #include <mono/metadata/exception.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/monitor.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/runtime.h>
 #include <mono/io-layer/io-layer.h>
@@ -41,7 +41,7 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-memory-model.h>
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 #ifdef HAVE_SIGNAL_H
 #include <signal.h>
@@ -675,6 +675,8 @@ static guint32 WINAPI start_wrapper_internal(void *data)
         */
        mono_thread_new_init (tid, &tid, start_func);
        internal->stack_ptr = &tid;
+       if (domain != mono_get_root_domain ())
+               set_current_thread_for_domain (domain, internal, start_info->obj);
 
        LIBGC_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT",%d) Setting thread stack to %p", __func__, mono_native_thread_id_get (), getpid (), thread->stack_ptr));
 
@@ -1304,7 +1306,7 @@ ves_icall_System_Threading_Thread_SetName_internal (MonoInternalThread *this_obj
 }
 
 int
-ves_icall_System_Threading_Thread_GetPriority (MonoThread *this)
+ves_icall_System_Threading_Thread_GetPriority (MonoThread *this_obj)
 {
        return ThreadPriority_Lowest;
 }
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 960894d8a35577ab7063fdbd3d1a48abf82bdf51..ead2a71747b3b44e054395440f750eb39a58e57e 100755 (executable)
@@ -407,6 +407,7 @@ common_sources = \
        driver.c                \
        debug-mini.c            \
        linear-scan.c           \
+       aot-compiler.h          \
        aot-compiler.c          \
        aot-runtime.c           \
        graph.c                 \
@@ -448,7 +449,7 @@ test_sources =                      \
        basic.cs                \
        exceptions.cs           \
        devirtualization.cs     \
-       iltests.il.in           \
+       iltests.il              \
        test.cs                 \
        generics.cs             \
        generics-variant-types.il\
@@ -588,10 +589,6 @@ generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
 %.exe: %.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
 
-iltests.il: iltests.il.in Makefile.am
-       echo '// DO NOT EDIT: This file has been generated from iltests.il.in' > iltests.il
-       cpp -Darch=$(arch_define) < $(srcdir)/iltests.il.in | sed 's/^#.*//' >> iltests.il
-
 %.exe: %.il
        $(ILASM) -output=$@ $<
 
index 64372e06c24db1d9043a75eadb017f15150238b6..c3bf999d2729ae30c014fee5a8e32a4f4449ce2f 100644 (file)
@@ -133,3 +133,65 @@ public class TestDriver {
        }
 }
 
+/// Provide tests with the ability to find out how much time they have to run before being timed out.
+public class TestTimeout {
+       const string ENV_TIMEOUT = "TEST_DRIVER_TIMEOUT_SEC";
+       private readonly TimeSpan availableTime;
+       private TimeSpan slack;
+       private DateTime startTime;
+
+       /// <summary>
+       ///   How much time the test runner provided for us or TimeSpan.Zero if there is no bound.
+       /// </summary>
+       public TimeSpan AvailableTime { get { return availableTime; } }
+
+       public DateTime StartTime { get { return startTime; } }
+
+       /// <summary> Extra time to add when deciding if there
+       ///   is still time to run.  Bigger slack means less
+       ///   time left.
+       /// </summary>
+       public TimeSpan Slack {
+               get { return slack; }
+               set { slack = value; }
+       }
+
+       public TestTimeout () {
+               availableTime = initializeAvailableTime ();
+               slack = defaultSlack ();
+       }
+
+       /// <summary>
+       ///    Consider the test started.
+       /// </summary>
+       public void Start ()
+       {
+               startTime = DateTime.UtcNow;
+       }
+
+       public bool HaveTimeLeft ()
+       {
+               if (availableTime == TimeSpan.Zero)
+                       return true;
+               var t = DateTime.UtcNow;
+               var finishTime = startTime + availableTime - slack;
+               return (t < finishTime);
+       }
+
+       private TimeSpan defaultSlack ()
+       {
+               return TimeSpan.FromSeconds (5);
+       }
+
+       private TimeSpan initializeAvailableTime ()
+       {
+               var e = System.Environment.GetEnvironmentVariable(ENV_TIMEOUT);
+               double d;
+               if (Double.TryParse(e, out d)) {
+                       return TimeSpan.FromSeconds(d);
+               } else {
+                       return TimeSpan.Zero;
+               }
+       }
+
+}
index 3eb775044a8182822cc9b7cce42d338133eff13f..8e96bed61a6b55bbbe21bb2d61a4cf731f3c243c 100644 (file)
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/marshal.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mempool-internals.h>
 #include <mono/metadata/mono-endian.h>
 #include <mono/metadata/threads-types.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/json.h>
 
-#include "mini.h"
+#include "aot-compiler.h"
 #include "seq-points.h"
 #include "image-writer.h"
 #include "dwarfwriter.h"
@@ -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,16 @@ 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);
                        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 +2829,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 +2841,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 +2864,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 +2878,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 +2911,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 +5171,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 +5444,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 +7048,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 */
@@ -9534,6 +9523,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;
diff --git a/mono/mini/aot-compiler.h b/mono/mini/aot-compiler.h
new file mode 100644 (file)
index 0000000..5cea3a2
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef __MONO_AOT_COMPILER_H__
+#define __MONO_AOT_COMPILER_H__
+
+#include "mini.h"
+
+int mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options);
+void* mono_aot_readonly_field_override (MonoClassField *field);
+gboolean mono_aot_is_shared_got_offset (int offset) MONO_LLVM_INTERNAL;
+
+guint32  mono_aot_get_got_offset            (MonoJumpInfo *ji) MONO_LLVM_INTERNAL;
+char*    mono_aot_get_method_name           (MonoCompile *cfg) MONO_LLVM_INTERNAL;
+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;
+
+#endif
+
+
+
+
index 3bcbb7c49d9034a6d07bf75a7f11e9afa5bc0984..b77ab2b0f2be21d8d5b575810cfd38807b854752 100644 (file)
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/marshal.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/mono-endian.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
@@ -60,6 +60,7 @@
 #include "seq-points.h"
 #include "version.h"
 #include "debugger-agent.h"
+#include "aot-compiler.h"
 
 #ifndef DISABLE_AOT
 
@@ -828,6 +829,7 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
        }
 
        if (image_index == MONO_AOT_METHODREF_WRAPPER) {
+               WrapperInfo *info;
                guint32 wrapper_type;
 
                wrapper_type = decode_value (p, &p);
@@ -893,9 +895,10 @@ 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: {
                        ref->method = mono_gc_get_write_barrier ();
                        break;
+               }
                case MONO_WRAPPER_STELEMREF: {
                        int subtype = decode_value (p, &p);
 
@@ -903,7 +906,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                ref->method = mono_marshal_get_stelemref ();
                        } else if (subtype == WRAPPER_SUBTYPE_VIRTUAL_STELEMREF) {
                                int kind;
-                               WrapperInfo *info;
                                
                                kind = decode_value (p, &p);
 
@@ -987,7 +989,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
 
                                ref->method = mono_marshal_get_array_address (rank, elem_size);
                        } else if (subtype == WRAPPER_SUBTYPE_STRING_CTOR) {
-                               WrapperInfo *info;
                                MonoMethod *m;
 
                                m = decode_resolve_method_ref (module, p, &p);
@@ -1073,7 +1074,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                ref->method = mono_marshal_get_runtime_invoke (m, TRUE, pass_rgctx);
                        } else {
                                MonoMethodSignature *sig;
-                               WrapperInfo *info;
 
                                sig = decode_signature_with_target (module, NULL, p, &p);
                                info = mono_marshal_get_wrapper_info (target);
@@ -1134,8 +1134,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) {
@@ -1795,6 +1793,8 @@ 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) {
@@ -2144,18 +2144,6 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data)
                mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: loaded AOT Module for %s.\n", assembly->image->name);
 }
 
-/*
- * mono_aot_register_globals:
- *
- *   This is called by the ctor function in AOT images compiled with the
- * 'no-dlsym' option.
- */
-void
-mono_aot_register_globals (gpointer *globals)
-{
-       g_assert_not_reached ();
-}
-
 /*
  * mono_aot_register_module:
  *
@@ -3420,6 +3408,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:
index 3d40a0097fac62e31f3b58497eee1f386d3a4d09..a75bab23586eab4d4d92fadbde33c865897c48b0 100644 (file)
@@ -61,7 +61,7 @@ mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins)
 gboolean
 mono_arch_opcode_needs_emulation (MonoCompile *cfg, int opcode)
 {
-       return FALSE;
+       return TRUE;
 }
 #endif
 
index db2dc5defcfb927f74c874c9584a600c9fab007a..eef2438346a647340bd3a238de55a2830ddc42d7 100644 (file)
@@ -54,7 +54,7 @@
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/mono-debug-debugger.h>
 #include <mono/metadata/debug-mono-symfile.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/threadpool-ms.h>
index 42782e45b46b0b5808e312d2a3eae74f30f55238..d3fc7f2e92305f7f6cabeb442b61774466a2fe58 100644 (file)
@@ -12,7 +12,7 @@
 #include "ir-emit.h"
 #include "jit-icalls.h"
 
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/abi-details.h>
 
 #ifndef DISABLE_JIT
@@ -447,7 +447,9 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins)
        case OP_IREM:
        case OP_IDIV_UN:
        case OP_IREM_UN:
-               if (cfg->backend->emulate_div && !mono_arch_opcode_needs_emulation (cfg, ins->opcode)) {
+               if (cfg->backend->emulate_div && mono_arch_opcode_needs_emulation (cfg, ins->opcode))
+                       emulate = TRUE;
+               if (!emulate) {
                        if (cfg->backend->need_div_check) {
                                int reg1 = alloc_ireg (cfg);
                                int reg2 = alloc_ireg (cfg);
@@ -467,8 +469,6 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins)
                        }
                        MONO_EMIT_NEW_BIALU (cfg, ins->opcode, ins->dreg, ins->sreg1, ins->sreg2);
                        NULLIFY_INS (ins);
-               } else {
-                       emulate = TRUE;
                }
                break;
 
index e5ede5813749bfa93799af2203a5fd2e90bfd3fb..ff482db7b5182da706ee7d2dd81e009bc22e5a44 100644 (file)
@@ -45,7 +45,7 @@
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/security-manager.h>
 #include <mono/metadata/security-core-clr.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/coree.h>
 #include <mono/metadata/attach.h>
 #include "mono/utils/mono-counters.h"
@@ -53,6 +53,8 @@
 
 #include "mini.h"
 #include "jit.h"
+#include "aot-compiler.h"
+
 #include <string.h>
 #include <ctype.h>
 #include <locale.h>
@@ -2226,14 +2228,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 4f7e336e6d2ee53f4ef524810ac7d667809d8723..ca3b19bfb0a2495050561f1bb5c8c073be3f943e 100644 (file)
@@ -28,7 +28,7 @@
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-debug.h>
 #include <mono/utils/mono-mmap.h>
 
index b9299cbe4fd3181883a5bf90efa29e896e4f6328..9d13bfbf2c59a3f485e4a2d963cda406fb4caf04 100644 (file)
@@ -29,7 +29,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-debug.h>
 
 #include "mini.h"
index b3b5633597644d39ff345274d0fc4f2749b21d66..d9b3d9d99c658bfc396ef0e01aa21af3633d7a03 100644 (file)
@@ -21,7 +21,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/tokentype.h>
 
 #include "mini.h"
index 3db25ca7f810f8ab363fe926b3a75c355c3e10da..87a67abd930f3d4ee33149018d6a2ed89ca38fb1 100644 (file)
@@ -23,7 +23,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-debug.h>
 #include <mono/utils/mono-mmap.h>
 
diff --git a/mono/mini/iltests.il b/mono/mini/iltests.il
new file mode 100644 (file)
index 0000000..35f1f8d
--- /dev/null
@@ -0,0 +1,2801 @@
+.assembly iltests {
+  .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
+               01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
+               63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
+}
+.assembly extern TestDriver {}
+.assembly extern mscorlib {}
+
+.class public auto ansi sealed beforefieldinit Tests {
+
+       .method static public int32 Main(string[] args) il managed {
+               .entrypoint
+               
+               ldtoken Tests
+               call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+               ldarg.0
+               call       int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type, string[])
+               ret
+       }
+
+       // make sure the register allocator works when the return value of
+       // 'div' is discarded
+       .method static public int32 test_0_div_regalloc () il managed {
+               .locals init (
+                       int32 i
+               )
+
+               ldloc 0
+               ldc.i4.s 0xa
+               div
+               pop
+               ldc.i4.0
+               ret
+       }
+       
+       
+       .method static public int32 test_1_ceq_to_i4 () il managed {
+               .locals init (
+                       int32   foo
+               )
+               ldc.i4 500
+               stloc foo
+               ldloc foo
+               ldc.i4 500
+               ceq
+               stloc foo
+               ldloc foo
+               ret
+       }
+       
+       .method static public int32 test_3_shl_regvars () il managed {
+               .locals init (
+                       int32   a,
+                       int32   b,
+                       int32   r1,
+                       int32   r2,
+                       int32   r3
+               )
+                       
+               ldc.i4.2
+               stloc      a
+               ldc.i4.1
+               stloc      b
+       
+               ldloc      a
+               ldloc      b
+               shl 
+               stloc      r1
+               
+               ldloc      a
+               ldloc      b
+               shl 
+               stloc      r2
+               
+               ldloc      a
+               ldloc      b
+               shl 
+               stloc      r3
+               
+               ldloc      r1
+               ldc.i4.4
+               ceq
+               
+               ldloc      r2
+               ldc.i4.4
+               ceq
+               
+               ldloc      r3
+               ldc.i4.4
+               ceq
+               
+               add
+               add
+               
+               ret
+       }
+       
+       .method static public int32 test_1_fceq_to_i4 () il managed {
+       
+               .locals init (
+                       float64 foo,
+                       int32   val
+               )
+
+               ldc.r8      2
+               stloc       foo
+               
+               ldloc       foo
+               ldc.r8      2
+               ceq
+               stloc       val
+               
+               ldloc       val
+               ret
+       }
+
+       //
+       // This should be manually checked. Basically under -O=linears,
+       // you should not see tons of register spilling.
+       //
+       .method static public int32 test_1_bytedreg_free () il managed {
+               .locals init (
+                       int32   foo
+               )
+               ldc.i4 500
+               stloc foo
+               ldloc foo
+               ldc.i4 500
+               ceq
+               stloc foo
+               
+               ldloc foo
+               ldc.i4 1
+               ceq
+               stloc foo
+
+               ldloc foo
+               ldc.i4 1
+               ceq
+               stloc foo
+
+               ldloc foo
+               ldc.i4 1
+               ceq
+               stloc foo
+               
+               ldloc foo
+               ldc.i4 1
+               ceq
+               stloc foo
+               
+               ldloc foo
+               ret
+       }
+       
+       //
+       // This should be manually checked. Basically under -O=linears,
+       // you should not see tons of register spilling.
+       //
+       .method static public int32 test_0_bytesreg1_free () il managed {
+               .locals init (
+                       unsigned int8      dest,
+                       int32              src,
+                       unsigned int8&     pdest
+               )
+
+               ldloca     dest
+               stloc      pdest
+               
+               ldloc      pdest
+               ldloc      src
+               stind.i1
+               
+               ldloc      pdest
+               ldloc      src
+               stind.i1
+               
+               ldloc      pdest
+               ldloc      src
+               stind.i1
+               
+               ldloc      pdest
+               ldloc      src
+               stind.i1
+               
+               ldloc      pdest
+               ldloc      src
+               stind.i1
+               
+               ldloc      pdest
+               ldloc      src
+               stind.i1
+               
+               ldloc      pdest
+               ldind.i1
+               ret
+       }
+       
+       .method static public int32 test_1_shift_regvar () il managed {
+       
+               .locals init (
+                       int32   v7FFFFFFF,
+                       int32   v1
+               )
+               
+               ldc.i4  0x7FFFFFFF
+               stloc   v7FFFFFFF
+       
+               ldc.i4.1
+               stloc v1
+               
+               ldloc   v7FFFFFFF
+               ldloc   v1
+               shl
+               ldc.i4  0xFFFFFFFE
+               ceq
+               ret
+       }
+       
+       // this only happens with the managed pointer, not an unmanaged one.
+       .method static public int32 test_0_foo () il managed {
+       
+               .locals init (
+                       int32&  buf
+               )
+               
+               ldc.i4.5
+               localloc
+               
+               stloc buf
+               ldloc buf
+               
+               ldind.i4
+               
+               ret
+       }
+
+       .method static public int32 test_0_localloc () cil managed {
+               .locals init (native int, native int, native int, native int, int32)
+
+               ldc.i4 6
+               localloc
+               conv.i
+               stloc.0
+
+               ldc.i4 6
+               localloc
+               conv.i
+               stloc.1
+
+               ldc.i4 6
+               localloc
+               conv.i
+               stloc.2
+
+               // Variable length
+               ldc.i4 128
+               stloc.s 4
+               ldloc.s 4
+               localloc
+               conv.i
+               stloc.3
+
+               // Check zero initialized
+               ldloc.0
+               ldind.i4
+               ldc.i4.0
+               beq OK1
+               ldc.i4.1
+               br FAIL
+
+OK1:
+               ldloc.3
+               ldind.i4
+               ldc.i4.0
+               beq OK2
+               ldc.i4.2
+               br FAIL
+
+OK2:
+               ldloc.3
+               ldc.i4.s 124
+               add
+               ldind.i4
+               ldc.i4.0
+               beq OK3
+               ldc.i4.3
+               br FAIL
+
+OK3:
+               ldloc.1
+               ldc.i4 999999
+               stind.i4
+               ldloc.1
+               ldind.i4
+               ldc.i4 999999
+               beq OK4
+               ldc.i4.4
+               br FAIL
+
+OK4:
+               ldloc.0
+               ldc.i4 999999
+               stind.i4
+               ldloc.0
+               ldind.i4
+               ldc.i4 999999
+               beq OK5
+               ldc.i4.5
+               br FAIL
+
+OK5:
+               // Try allocations bigger than one page
+               ldc.i4 8196
+               localloc
+               conv.i
+               stloc.3
+               ldloc.3
+               ldc.i4 8192
+               add
+               ldc.i4 99
+               stind.i4
+               ldloc.3
+               ldc.i4 8192
+               add
+               ldind.i4
+               ldc.i4 99
+               beq PASS
+               ldc.i4.6
+               br FAIL
+
+FAIL:
+               ret
+
+PASS:  ldc.i4.0
+               ret
+       }
+
+    .method private static void do_localloc () cil managed {
+        .maxstack 3
+        .locals init (
+                unsigned int8*  V_0)
+        IL_0000:  ldc.i4.1
+        IL_0001:  ldc.i4 131072
+        IL_0006:  mul
+        IL_0007:  localloc
+        IL_0009:  stloc.0
+        IL_000a:  ret
+    }
+
+       // Check that localloc cannot be inlined
+       .method static public int32 test_0_localloc_inline () cil managed {
+               .maxstack 16
+               .locals init (
+                       int32 i
+               )
+
+               ldc.i4.0
+        stloc.0
+        br COND
+
+START:  call void class Tests::do_localloc()
+        ldloc.0
+        ldc.i4.1
+        add
+        stloc.0
+COND:   ldloc.0
+        ldc.i4 1000
+        blt START
+
+               ldc.i4.0
+               ret
+       }       
+       
+       .method static public int32 test_3_copy_used_bug () il managed {
+
+               .locals init (
+                       int32 size,
+                       int32 res
+               )
+
+               ldc.i4 0
+               stloc res
+
+               ldc.i4 1
+               stloc size
+
+               ldloc size
+               ldloc size
+               ldloc size
+               add
+               stloc size
+               ldloc size
+               add
+               stloc res
+
+               ldloc res
+               ret
+       }
+
+       // demonstrate that the copy_used_var is not a fix for the above bug
+       .method static public int32 test_3_copy_used_indir_bug () il managed {
+
+               .locals init (
+                       int32 size,
+                       int32 res
+               )
+
+               ldc.i4 0
+               stloc res
+
+               ldc.i4 1
+               stloc size
+
+               ldloc size
+               ldloca size
+               ldloc size
+               ldloc size
+               add
+               stind.i4
+               ldloc size
+               add
+               stloc res
+
+               ldloc res
+               ret
+       }
+
+       .method static public void do_nothing (int32 a) il managed {
+               ret
+       }
+       
+       // demonstrate the block_split failure: needs -O=inline
+       // mini -O=inline --compile Tests:test_0_split_block_bug iltests.exe
+       .method static public int32 test_0_split_block_bug () il managed {
+
+               .locals init (
+                       int32 i1
+               )
+
+               ldc.i4 1
+               stloc i1
+ test_label:
+               ldloc i1
+               call void class Tests::do_nothing (int32)
+               ldc.i4 0
+               brtrue test_label
+               
+               ldc.i4 0
+               ret
+       }
+
+       .method public void inline_do_nothing () il managed {
+               ret
+       }
+       .method static public int32 test_1_checkthis_inlining () il managed {
+               ldnull
+               call instance void class Tests::inline_do_nothing ()
+               ldc.i4 1
+               ret
+       }
+
+       .class nested private auto ansi sealed beforefieldinit TailCallStruct 
+               extends [mscorlib]System.ValueType {
+               .field public int32 a
+               .field public int32 b
+       }
+
+       .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
+               ldarga 0
+               ldarga 0
+               ldfld int32 Tests/TailCallStruct::a
+               ldc.i4.1
+               add
+               stfld int32 Tests/TailCallStruct::a
+               ldarga 0
+               ldarga 0
+               ldfld int32 Tests/TailCallStruct::a
+               ldc.i4.2
+               add
+               stfld int32 Tests/TailCallStruct::a
+               ldarg.0
+               ret
+       }
+
+       .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
+               ldarg.0
+               tail.
+               call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
+               ret
+       }
+
+       .class nested private auto ansi sealed beforefieldinit TailCallStructBig
+               extends [mscorlib]System.ValueType {
+               .field public int32 a
+               .field public int32 b
+               .field public int32 c
+               .field public int32 d
+               .field public int32 e
+       }
+
+       .method static valuetype Tests/TailCallStructBig tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig arg) {
+               ldarga 0
+               ldarga 0
+               ldfld int32 Tests/TailCallStructBig::a
+               ldc.i4.1
+               add
+               stfld int32 Tests/TailCallStructBig::a
+               ldarg.0
+               ret
+       }
+
+       .method static valuetype Tests/TailCallStructBig tail_vret_by_addr (valuetype Tests/TailCallStructBig arg) {
+               ldarg.0
+               tail.
+               call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig)
+               ret
+       }
+
+       .method static public int32 test_3_tail_call_vret_by_addr () il managed {
+               .maxstack 16
+               .locals init (
+                       valuetype Tests/TailCallStructBig arg2
+               )
+
+               ldloca 0
+               ldc.i4.2
+               stfld int32 Tests/TailCallStructBig::a
+               ldloc.0
+               call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr (valuetype Tests/TailCallStructBig)
+               stloc.0
+
+               ldloca 0
+               ldfld int32 Tests/TailCallStructBig::a
+               ret
+       }
+
+       .method static public int32 test_9_tail_call_vret_by_val () il managed {
+               .maxstack 16
+               .locals init (
+                       valuetype Tests/TailCallStruct arg
+               )
+               ldloca 0
+               ldc.i4.2
+               stfld int32 Tests/TailCallStruct::a
+               ldloca 0
+               ldc.i4.4
+               stfld int32 Tests/TailCallStruct::b
+               ldloc.0
+               call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
+               stloc.0
+
+               ldloca 0
+               ldfld int32 Tests/TailCallStruct::a
+               ldloca 0
+               ldfld int32 Tests/TailCallStruct::b
+               add
+               ret
+       }
+
+       .method static public int32 tail3 (int32 i, int32 j) il managed {
+               ldarg.0
+               ldarg.1
+               add
+               ret
+       }
+
+       .method static public int32 tail4 (int32 i, int32 j) il managed {
+               .maxstack 16
+               .locals init (
+                       int32 k)
+
+               // Test arg0 allocated to a register
+               ldarg.0
+               ldarg.0
+               ldarg.0
+               ldarg.0
+               add
+               add
+               add
+               starg 0
+
+               // Test switched up argument variables as the actual arguments
+               ldarg.1
+               ldarg.0
+               tail.
+               call int32 Tests::tail3 (int32, int32)
+               ret
+       }
+
+       .method static public int32 test_24_tail_calls2 () il managed {
+               // Some platforms might not be able to AOT tail calls
+               .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
+
+               .maxstack 16
+               .locals init (
+                       int32 i,
+                       int32 j)
+
+               ldc.i4.4
+               stloc.0
+               ldc.i4.8
+               stloc.1
+
+               ldloc.0 
+               ldloc.1
+               call int32 Tests::tail4 (int32, int32)
+               ret
+       }
+
+       .method public static int32 test_5_jmp () cil managed {
+               // Some platforms might not be able to AOT tail calls
+               .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
+
+               ldc.i4.1
+               ldc.i4.2
+               call int32 Tests::jmp2 (int32, int32)
+               ret
+       }
+
+       .method public static int32 jmp2 (int32, int32) cil managed {
+               ldarg.0
+               ldc.i4.1
+               add
+               starg.s 0
+               ldarg.1
+               ldc.i4.1
+               add
+               starg.s 1
+               jmp int32 Tests::jmp3 (int32, int32)
+               ldc.i4.0
+               ret
+       }               
+
+       .method public static int32 jmp3 (int32 i, int32 j) cil managed {
+               ldarg.0
+               ldarg.1
+               add
+               ret
+       }
+
+       .method static public int32 test_11_switch_with_nonempty_stack () il managed {
+               .maxstack 16
+
+               ldc.i4.5
+               ldc.i4.6
+               ldc.i4.1
+               switch (L0, L1)
+       L0: 
+               add
+               ret
+       L1:
+               add
+               ret
+       }
+    .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
+               .maxstack 16
+
+        .try {
+          leave IL_0
+        }
+        finally  {
+          ldc.i4.0
+          endfinally
+        }
+        IL_0:  ldc.i4.5
+               ret
+    }
+
+       .method public static int32 test_0_conv_ovf_i8_neg () il managed {
+               .maxstack 16
+
+               ldc.i4.m1
+               conv.ovf.i8
+               conv.i4
+               ldc.i4.m1
+               beq L_OK
+               ldc.i4.1
+               ret
+       L_OK:
+               ldc.i4.0
+               ret
+       }               
+
+       .method public static int32 test_1234_conv_u4 () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.u4
+               conv.i4
+               ret
+       }
+
+       .method public static int32 test_0_conv_ovf_i_un () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.ovf.i.un
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4 0x7fffffff
+               conv.ovf.i.un
+               conv.i4
+               ldc.i4 0x7fffffff
+               beq L2
+               ldc.i4.2
+               ret
+       L2:
+               sizeof [mscorlib]System.IntPtr
+               ldc.i4 8
+               beq L5
+               .try {
+                       ldc.i4 0x80000000
+                       conv.ovf.i.un
+                       leave L4
+               } catch [mscorlib]System.OverflowException {
+                       pop
+                       leave L5
+               }
+       L4: 
+               ldc.i4.3
+               ret
+       L5:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_conv_ovf_u_un () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.ovf.u.un
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_conv_ovf_i () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.ovf.i
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_conv_ovf_u () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.ovf.u
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.ovf.i8.un
+               conv.i4
+               ret
+       }
+
+       .method public static int32 test_0_lconv_ovf_i () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.i8
+               conv.ovf.i
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_lconv_ovf_u () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.i8
+               conv.ovf.u
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_lconv_ovf_i_un () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.i8
+               conv.ovf.i.un
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_lconv_ovf_u_un () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.i8
+               conv.ovf.u.un
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_lconv_to_ovf_i8 () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.i8
+               conv.ovf.i8
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
+               .maxstack 16
+
+               ldc.i4 1234
+               conv.i8
+               conv.ovf.u8.un
+               conv.i4
+               ldc.i4 1234
+               beq L1
+               ldc.i4.1
+               ret
+       L1:
+               ldc.i4.0
+               ret
+       }
+
+       .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
+               .maxstack 16
+               .locals init (int32 res)
+
+               ldc.i4 0x7fffffff
+               conv.u8
+               conv.ovf.i4.un
+               pop
+
+               ldc.i4.2
+               stloc res
+
+        .try {
+                       ldc.i8 0x80000000
+                       conv.ovf.i4.un
+                       pop
+                       ldc.i4.0
+                       stloc res
+                       leave RET
+               } catch [mscorlib]System.OverflowException {
+                       pop
+                       leave IL_0
+               }
+
+       IL_0:
+
+        .try {
+                       ldc.i8 0xffffffff80000000
+                       conv.ovf.i4.un
+                       pop
+                       ldc.i4.1
+                       stloc res
+                       leave RET
+               } catch [mscorlib]System.OverflowException {
+                       pop
+                       leave RET
+               }
+
+       RET:
+               ldloc res
+               ret
+       }
+
+    .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
+               .maxstack 16
+               .locals init (int32 res)
+
+               ldc.i4 0x7fffffff
+               conv.u8
+               conv.ovf.i.un
+               conv.i4
+               pop
+
+               ldc.i4.1
+               ret
+       }
+
+       .method public static int32 test_32_lconv_to_u8 () cil managed
+       {
+               .maxstack 16
+
+               ldc.i4 32
+               conv.i8
+               conv.u8
+               conv.i4
+               ret
+       }                               
+
+       .method public static int32 test_32_lconv_to_i8 () cil managed
+       {
+               .maxstack 16
+
+               ldc.i4 32
+               conv.i8
+               conv.i8
+               conv.i4
+               ret
+       }                               
+
+       .method public static int32 test_15_lconv_to_u () cil managed
+       {
+       ldc.i8 0x10000000f
+               conv.u
+               conv.i4
+               ret
+       }
+
+       .method public static int32 test_1234_fconv_u () cil managed {
+               .maxstack 16
+
+               ldc.r8 1234.0
+               conv.u
+               conv.i4
+               ret
+       }
+
+       .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
+       {
+               .maxstack 16
+       
+               ldc.i4.1
+               brfalse OBJECT
+       
+               ldtoken [mscorlib]System.String
+               br AFTER
+       OBJECT:
+               ldtoken [mscorlib]System.Object
+       AFTER:
+               call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
+               callvirt instance string class [mscorlib]System.Type::get_FullName ()
+               ldstr "System.String"
+               callvirt instance bool class [mscorlib]System.Object::Equals(object)
+               ldc.i4.0
+               ceq
+               ret 
+       }
+               
+       .method public static int32 test_0_bug59580  ()
+       {
+               ldc.r4          float32(0x7FC00000)
+               ldc.r4          float32(0x7FC00000)
+               bge.un          pass
+               br              fail
+       pass:
+               ldc.i4.0
+               ret
+       fail:
+               ldc.i4.1
+               ret
+       }
+       
+       .method public static int32 test_1_bug60056  () {
+               .locals init (int32 m5)
+                       
+               ldc.i4.m1
+               stloc.0
+               
+               ldc.i4.1
+               conv.u8
+               
+               ldloc.0
+               conv.i8
+               mul
+               
+               ldc.i4.m1
+               conv.i8
+               ceq
+               ret
+       }
+       
+       .method public static int32 test_1_conv_u8_cfold  () {
+               ldc.i4.m1
+               conv.u8
+               
+               ldc.i8 0x00000000ffffffff
+               
+               ceq
+               ret
+       }
+       
+       .method public static int32 test_1_array_type_mismatch_ldelema  () {
+               .locals init (int32 r)
+               
+                       ldc.i4.1
+                       newarr string
+                       ldc.i4.0 
+                       ldelema string
+                       pop
+               
+               .try {
+                       ldc.i4.1
+                       newarr string
+                       ldc.i4.0 
+                       ldelema object
+                       pop
+                       
+                       leave end
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       pop
+                       ldc.i4.1
+                       stloc.0
+                       leave end
+               }
+       end:
+               ldloc.0
+               ret
+       }
+
+       .method public static int32 test_1_conv_ovf_i8_with_i4 () {
+                       ldc.i4.m1 
+                       conv.ovf.i8
+                       conv.ovf.i4
+                       neg
+                       ret
+       }
+
+       // bug #72148
+    .method public static int32 test_0_initlocals_float_ptr () {
+       .maxstack 3
+       .locals init (
+               float32[]       V_0,
+               float32& pinned V_1,
+               unsigned int32  V_2)
+                       ldc.i4.s 0x0f
+                       newarr [mscorlib]System.Single
+                       stloc.0 
+                       ldloc.0 
+                       ldc.i4.0 
+                       ldc.r4 1.13
+                       stelem.r4 
+                       ldloc.0 
+                       ldc.i4.0 
+                       ldelema [mscorlib]System.Single
+                       stloc.1 
+                       ldloc.1 
+                       conv.i 
+                       ldind.u4 
+                       stloc.2 
+                       ldc.i4.0
+                       ret
+       }
+
+       .method public static int32 test_7_conv_ovf_u8_un () {
+       .maxstack  2
+        .locals    init (unsigned int64)
+
+        ldc.i4.7
+        conv.ovf.u8.un
+        stloc.0
+               ldloc.0
+               conv.i4
+        ret
+       }
+
+       .method public static int32 test_7_conv_ovf_u4_un () {
+       .maxstack  2
+        .locals    init (unsigned int32)
+
+        ldc.i4.7
+        conv.ovf.u4.un
+        stloc.0
+               ldloc.0
+               conv.i4
+        ret
+       }
+
+       .method public static int32 test_1_bug_74591 () {
+               .maxstack 16
+               .locals init (int32)
+
+               ldc.i4.m1
+               stloc.0
+               ldloc.0
+               conv.ovf.i8
+               ldc.i4.m1
+               conv.ovf.i8
+               mul.ovf
+               conv.i4
+               ret
+       }
+
+       .class nested public auto ansi Integer
+               extends [mscorlib]System.Object {
+
+               .field public bool n
+
+           .method public hidebysig  specialname  rtspecialname 
+           instance default void .ctor (unsigned int64 i, bool n)  cil managed 
+           {
+                       .maxstack 8
+                       ldarg.0
+                       call instance void class [mscorlib]System.Object::.ctor()
+                       ldarg.0
+                       ldarg.2
+                       stfld bool Tests/Integer::n
+                       ret
+               }
+       }
+
+       .method public static int32 test_1_bug_74726 () {
+               .maxstack 16
+
+               ldc.i4.2
+               conv.ovf.u8
+               ldc.i4.1
+               conv.ovf.u8
+               mul.ovf.un
+               ldc.i4.1
+               newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
+               ldfld bool Tests/Integer::n
+               ldc.i4.1
+               ceq
+               ret
+       }
+
+       .class nested private auto ansi sealed xxx
+       extends [mscorlib]System.ValueType
+   {
+     .field  public   object a
+
+     .method public hidebysig  specialname  rtspecialname 
+            instance default void .ctor ()  cil managed 
+     {
+                .maxstack 8
+                ret 
+     }
+   } // end of class xxx
+
+       .method public static int32 test_0_newobj_vtype () {
+               .maxstack 6
+               .locals init (
+                       valuetype Tests/xxx V_0
+               )
+
+               newobj instance void valuetype Tests/xxx::.ctor ()
+               stloc.0
+               ldloca.s 0
+               ldfld object Tests/xxx::a
+               brfalse OK
+               ldc.i4.s 1
+               ret
+       OK:
+               ldc.i4.s 0
+               ret
+       }
+
+       .method public static int32 test_0_newobj_vtype_primitive () {
+               .maxstack 6
+               .locals init (
+                       native int V_0
+               )
+
+               ldc.i4.s 10
+               newobj instance void native int::'.ctor'(int32)
+               stloc.0
+               ldloc.0
+               ldc.i4.s 10
+               beq OK
+               ldc.i4.s 1
+               ret
+       OK:
+               ldc.i4.s 0
+               ret
+       }
+
+       .method public static int32 test_1_filters () {
+               .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 08 21 42 49 54 43 4F 44 45 00 00 )          // ...!BITCODE..
+               .maxstack 16
+               .locals init (
+                       int32 res
+               )
+
+               .try { // 0
+                       .try {
+                               ldstr "OnErrorSub test Exception"
+                               newobj instance void class [mscorlib]System.Exception::.ctor(string)
+                               throw 
+                               leave.s IL_0033
+                       }
+                       filter {
+                               pop
+                               ldc.i4.0
+                               endfilter
+                       } {
+                               pop
+                               // Should not be called
+                               ldc.i4.2
+                               stloc res
+                               leave.s IL_0033
+                       }
+               }
+               filter {
+                       pop
+                       ldc.i4.1
+                       endfilter 
+               } {
+                 pop
+                 ldc.i4.1
+                 stloc res       
+                 leave.s IL_0033
+
+               }
+               IL_0033:
+               ldloc res
+               ret
+       }
+
+       .class nested private auto ansi sealed beforefieldinit TheStruct
+               extends [mscorlib]System.ValueType {
+               .field public int32 a
+               .field public int32 b
+       }
+
+       .method public static int32 test_5_cpobj () {
+               .maxstack 8
+               .locals init (  
+                               valuetype Tests/TheStruct v_0, 
+                               valuetype Tests/TheStruct v_1
+                                        )
+
+               ldloca v_0
+               ldc.i4.2
+               stfld int32 Tests/TheStruct::a
+
+               ldloca v_0
+               ldc.i4.3
+               stfld int32 Tests/TheStruct::b
+
+               ldloca v_1
+               ldloca v_0
+               cpobj Tests/TheStruct
+
+               ldloca v_1
+               ldfld int32 Tests/TheStruct::a
+               ldloca v_1
+               ldfld int32 Tests/TheStruct::b
+               add
+
+               ret
+       }
+
+       .method public static int32 test_5_ldobj_stloc_optimization () {
+               .maxstack 8
+               .locals init (  
+                               valuetype Tests/TheStruct v_0, 
+                               valuetype Tests/TheStruct v_1
+                                        )
+
+               ldloca v_0
+               ldc.i4.2
+               stfld int32 Tests/TheStruct::a
+
+               ldloca v_0
+               ldc.i4.3
+               stfld int32 Tests/TheStruct::b
+
+               ldloca v_0
+               ldobj valuetype Tests/TheStruct
+               stloc.s v_1
+
+               ldloca v_1
+               ldfld int32 Tests/TheStruct::a
+               ldloca v_1
+               ldfld int32 Tests/TheStruct::b
+               add
+
+               ret
+       }
+
+       .method public static int32 test_1_cpobj_reference () {
+               .maxstack 8
+               .locals init (  
+                               object v_0, 
+                               object v_1
+                                        )
+
+               newobj instance void object::.ctor()
+               stloc v_0
+
+               ldloca v_1
+               ldloca v_0
+               cpobj object
+
+               ldloc v_0
+               ldloc v_1
+               ceq
+               ret
+       }
+
+       .method public static int32 test_1_initobj_reference () {
+               .maxstack 8
+               .locals init (  
+                               object v_0
+                                        )
+
+               newobj instance void object::.ctor()
+               stloc v_0
+
+               ldloca v_0
+               initobj object
+
+               ldloc v_0
+               ldnull
+               ceq
+               ret
+       }
+
+       .method public static int32 test_1_ldobj_reference () {
+               .maxstack 8
+               .locals init (  
+                               object v_0
+                                        )
+
+               newobj instance void object::.ctor()
+               stloc v_0
+
+               ldloc v_0
+               ldloca v_0
+               ldobj object
+               ceq
+               ret
+       }
+
+       .method public static int32 test_5_vtype_on_bb_boundary () {
+               .maxstack 8
+               .locals init (  
+                               valuetype Tests/TheStruct v_0, 
+                               valuetype Tests/TheStruct v_1
+                                        )
+
+               ldloca v_0
+               ldc.i4.2
+               stfld int32 Tests/TheStruct::a
+
+               ldloca v_0
+               ldc.i4.3
+               stfld int32 Tests/TheStruct::b
+
+               ldloc v_0
+               br L_0
+       L_0: stloc v_1
+
+               ldloca v_1
+               ldfld int32 Tests/TheStruct::a
+               ldloca v_1
+               ldfld int32 Tests/TheStruct::b
+               add
+               ret
+       }
+
+       .method public static int32 test_5_different_in_stacks () cil managed {
+               .maxstack 16
+
+                       ldc.i4.1
+                       ldc.i4.1
+                       beq L_0
+
+                       ldc.i4.3
+                       ldc.i4.3
+                       br L_1
+                       ldc.i4.3
+                       ldc.i4.3
+                       br L_2
+        L_0:   ldc.i4.2
+                       ldc.i4.3
+                       ldc.i4.1
+                       ldc.i4.1
+                       beq L_2
+        L_1:   add
+                       ret
+        L_2:   add
+                       ret
+       }
+
+       .method public static int32 test_3_larray_get_set () {
+               .locals init (
+                       int32[2]        V_0)
+                         
+                       ldc.i4.2 
+                       newobj instance void int32[0...]::.ctor(int32)
+                       stloc.0 
+                       ldloc.0 
+                       ldc.i4.0 
+                       ldc.i4 1
+                       call instance void int32[0...]::Set(int32, int32)
+                   ldloc.0 
+                   ldc.i4.1 
+                       ldc.i4 2
+                       call instance void int32[0...]::Set(int32, int32)
+
+                       ldloc.0
+                       ldc.i4.0
+                       call instance int32 int32[0...]::Get(int32)
+                       ldloc.0
+                       ldc.i4.1
+                       call instance int32 int32[0...]::Get(int32)
+                       add
+                       ret
+       }
+
+       .method public static int32 test_0_pop_side_effects () {
+               .try {
+                       ldc.r8 1
+                       ldc.r8 0
+                       div
+                       ckfinite
+                       pop
+                       leave FAIL
+               }
+               catch [mscorlib]System.ArithmeticException {
+                       pop
+                       leave L_0
+               }
+               L_0:
+               ldc.i4.0
+               ret
+               FAIL:
+               ldc.i4.1
+               ret
+       }
+
+       .method public static void regalloc_regress_78314_helper (object o) cil managed
+       {
+               ret
+       }
+
+       .method public static int32 test_1_regalloc_regress_78314 () cil managed
+       {
+    // Code size       68 (0x44)
+    .maxstack  6
+    .locals init (int32 V_0, bool V_1)
+    IL_0000:  ldc.i4.0
+    IL_0001:  stloc.0
+    IL_0002:  br.s       IL_003b
+
+    IL_0004:
+    IL_001e:  ldc.i4.s   10
+    IL_0020:  ldloc.0
+    IL_0021:  shl
+    IL_0022:  ldc.i4.s   10
+    IL_0024:  ldloc.0
+    IL_0025:  shl
+    IL_0026:  ceq
+    IL_0028:  box        [mscorlib]System.Boolean
+    IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
+    IL_0037:  ldloc.0
+    IL_0038:  ldc.i4.1
+    IL_0039:  add
+    IL_003a:  stloc.0
+    IL_003b:  ldloc.0
+    IL_003c:  ldc.i4.8
+    IL_003f:  blt.s      IL_0004
+
+       ldloc.0
+       ldc.i4.8
+       ceq
+       conv.i4
+       ret     
+  }
+
+       .method public static void try_block_end_remove_if_useless () cil managed {
+           .maxstack  8
+
+           T_START:
+               ldstr   "Start"
+                       pop
+               leave.s COMPLETE
+           T1_END:
+
+           COMPLETE:
+               ret
+
+           F1_START:
+               ldstr   "Finally1"
+                       pop
+               endfinally
+           F1_END:
+
+           .try T_START to T1_END finally handler F1_START to F1_END
+       }
+
+       .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
+               call void class Tests::try_block_end_remove_if_useless ()
+               ldc.i4.0
+               ret
+       }
+
+   .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
+    {
+        ldc.i4.0
+        switch (target)
+        target: ldstr "bar"
+               pop
+               ldc.i4.0
+        ret
+    }
+
+       // This belongs to basic-float.cs, but its hard to tell mcs/csc to
+       // generate the non .un version of the opcodes
+    .method private static  hidebysig 
+           default int32 test_4_float_branch_nan ()  cil managed 
+    {
+        // Method begins at RVA 0x27a4
+       // Code size 74 (0x4a)
+       .maxstack 2
+       .locals init (
+               float64 V_0,
+               float64 V_1,
+               int32   V_2)
+       IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
+       IL_0009:  stloc.0 
+       IL_000a:  ldc.r8 1.
+       IL_0013:  stloc.1 
+       IL_0014:  ldc.i4.0 
+       IL_0015:  stloc.2 
+       IL_0016:  ldloc.0 
+       IL_0017:  ldloc.1 
+       IL_0018:  bge.s IL_001a
+
+                               br L1
+       IL_001a:  ldloc.2 
+       IL_001b:  ret 
+       L1:
+       IL_001c:  ldloc.2 
+       IL_001d:  ldc.i4.1 
+       IL_001e:  add 
+       IL_001f:  stloc.2 
+       IL_0020:  ldloc.0 
+       IL_0021:  ldloc.1 
+       IL_0022:  ble.s IL_002e
+                               br L2
+       IL_002e:  ldloc.2 
+       IL_002f:  ret 
+       L2:
+       IL_0030:  ldloc.2 
+       IL_0031:  ldc.i4.1 
+       IL_0032:  add 
+       IL_0033:  stloc.2 
+       IL_0034:  ldloc.0 
+       IL_0035:  ldloc.1 
+       IL_0036:  blt.s IL_0038
+                               br L3           
+       IL_0038:  ldloc.2 
+       IL_0039:  ret 
+       L3:
+       IL_003a:  ldloc.2 
+       IL_003b:  ldc.i4.1 
+       IL_003c:  add 
+       IL_003d:  stloc.2 
+       IL_003e:  ldloc.0 
+       IL_003f:  ldloc.1 
+       IL_0040:  bgt.s IL_0042
+                               br L4
+       IL_0042:  ldloc.2 
+       IL_0043:  ret 
+       L4:
+       IL_0044:  ldloc.2 
+       IL_0045:  ldc.i4.1 
+       IL_0046:  add 
+       IL_0047:  stloc.2 
+       IL_0048:  ldloc.2 
+       IL_0049:  ret 
+    } // end of method Tests::test_5_float_branch_nan
+
+    .method private static  hidebysig
+           default void regress_80622_inner (object x)  cil managed
+    {
+               .locals init (unsigned int8 i)
+        // Method begins at RVA 0x2050
+        // Code size 14 (0xe)
+        .maxstack 8
+        IL_1000:  ldarg.0
+        IL_1001:  unbox unsigned int8
+        IL_1006:  ldobj unsigned int8
+        IL_000b:  conv.ovf.i4.un
+        IL_000c:  pop
+        IL_000d:  ret
+    }
+
+    // method line 2
+    .method private static  hidebysig
+           default int32 test_0_regress_80622 ()  cil managed
+    {
+        .maxstack 8
+        IL_0000:  ldc.i4 255
+        IL_0005:  box unsigned int8
+        IL_000a:  call void class Tests::regress_80622_inner (object)
+               ldc.i4.0
+        IL_000f:  ret
+    }
+
+       .method private static default int32 test_0_regresss_80190 () cil managed
+       {
+           .maxstack  2
+           .locals init (int32 V_0,
+                    int32* V_1)
+           IL_0000:  nop
+           IL_0001:  nop
+           IL_0002:  ldloca.s   V_0
+           IL_0004:  conv.u
+           IL_0005:  stloc.1
+           IL_0006:  ldloc.1
+           IL_0007:  ldc.i4.3
+           IL_0008:  stind.i4
+           IL_0009:  nop
+                                 ldc.i4.0
+                                 ret
+       }
+
+       .class interface nested public auto ansi abstract IFaceWithStaticMethod
+       {
+           .method public static  specialname 
+              default void foo ()  cil managed noinlining 
+           {
+               .maxstack 0
+               IL_0000:  ret 
+       }
+       }
+       
+       .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
+       {
+           .method public hidebysig  specialname  rtspecialname 
+           instance default void .ctor ()  cil managed 
+           {
+                       .maxstack 8
+                       ret
+               }
+
+       }
+
+       // Test that static methods in interfaces are ignored during vtable construction
+       .method private static default int32 test_0_ifaces_with_static_methods () cil managed
+       {
+               .maxstack 16
+
+               newobj instance void class Tests/AClass::.ctor()
+               pop
+               ldc.i4.0
+               ret
+       }
+
+       .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
+               ldarg.0
+               box !!0
+               brtrue HAS_VALUE
+               ldc.i4.0
+               ret
+HAS_VALUE:     ldc.i4.1
+               ret
+       }
+
+       // bug 78019
+       .method static public int32 test_0_nullable_box_brtrue () cil managed {
+
+               .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
+
+               ldloc.0
+               call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
+               ret
+       }
+
+       //Bug 372410
+       .method static public int32 test_0_ldelema_type_check () cil managed {
+               .maxstack 16
+               .locals init (object[] V_0,
+                                         object[,] V_1)
+
+               ldc.i4.1
+               newarr object
+               stloc.0
+
+               .try {
+                       ldloc.0
+                       ldc.i4.0
+                       ldelema object
+                       leave L1
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       leave ERROR1
+               }
+
+       L1:
+               ldc.i4.1
+               newarr string
+               stloc.0
+
+               .try {
+                       ldloc.0
+                       ldc.i4.0
+                       ldelema object
+                       leave ERROR2
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       leave L2
+               }
+
+       L2:
+                       ldc.i4.1
+               newarr string
+               stloc.0
+
+               .try {
+                       ldloc.0
+                       ldc.i4.0
+                       readonly. ldelema object
+                       leave L3
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       leave ERROR3
+               }
+
+       L3:
+               ldc.i4.0
+               ret
+
+
+       ERROR1:
+               ldc.i4.1
+               ret
+
+       ERROR2:
+               ldc.i4.2
+               ret
+
+       ERROR3:
+               ldc.i4.3
+               ret
+       }
+
+
+       //Bug 372410
+       .method static public int32 test_0_array_address_type_check () cil managed {
+               .maxstack 16
+               .locals init (object[] V_0,
+                                         object[,] V_1)
+
+               ldc.i4.1 
+           ldc.i4.1 
+           newobj instance void object[,]::.ctor(int32, int32)
+               stloc.1
+
+               .try {
+                       ldloc.1
+                       ldc.i4.0
+                       ldc.i4.0
+                       call instance object&  object[,]::Address(int32, int32)
+                       leave L4
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       leave ERROR4
+               }
+
+       L4:
+               ldc.i4.1 
+           ldc.i4.1 
+           newobj instance void string[,]::.ctor(int32, int32)
+               stloc.1
+
+               .try {
+                       ldloc.1
+                       ldc.i4.0
+                       ldc.i4.0
+                       call instance object&  object[,]::Address(int32, int32)
+                       leave ERROR5
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       leave L5
+               }
+
+       L5:
+               ldc.i4.1 
+           ldc.i4.1 
+           newobj instance void string[,]::.ctor(int32, int32)
+               stloc.1
+
+               .try {
+                       ldloc.1
+                       ldc.i4.0
+                       ldc.i4.0
+                       readonly. call instance object&  object[,]::Address(int32, int32)
+                       leave L6
+               } catch [mscorlib]System.ArrayTypeMismatchException {
+                       leave ERROR6
+               }
+
+       L6:
+               ldc.i4.0
+               ret
+       ERROR4:
+               ldc.i4.4
+               ret
+
+       ERROR5:
+               ldc.i4.5
+               ret
+
+       ERROR6:
+               ldc.i4.6
+               ret
+       }
+
+       .field public  static unsigned int64 'ull'
+
+       .field public  static int32 'shift2'
+
+       .method public static int32 test_0_long_shift_regalloc () cil managed
+       {
+               .locals init (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
+
+               .maxstack 4
+
+               ldc.i8  81985529234382576
+               stsfld  unsigned int64 Tests::ull
+           ldc.i4      60
+               stsfld  int32 Tests::shift2
+
+               ldsfld  unsigned int64 Tests::ull
+               stloc   'cilsimp.27'
+               ldsfld  int32 Tests::shift2
+               stloc   'cilsimp.28'
+               ldloc   'cilsimp.27'
+               ldloc   'cilsimp.28'
+               shr.un
+               ldloc   'cilsimp.27'
+               ldc.i4  64
+               ldloc   'cilsimp.28'
+               sub
+               shl
+               or
+               ldc.i8  1311768467750121216
+               ceq
+               ldc.i4.1
+               xor
+               conv.u4
+               ret
+       }
+
+       // Test calling ldfld directly on a vtype instead of a vtype address
+       .method public static int32 test_5_call_ldfld_vtype () cil managed
+       {
+               .maxstack 16
+               .locals init (
+                       valuetype Tests/TailCallStruct arg
+               )
+               ldloca 0
+               ldc.i4.2
+               stfld int32 Tests/TailCallStruct::a
+               ldloca 0
+               ldc.i4.4
+               stfld int32 Tests/TailCallStruct::b
+               ldloc.0
+               call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
+               ldfld int32 Tests/TailCallStruct::a
+               ret
+       }
+
+       .method public static int32 throw_ret () cil managed
+       {
+               ldstr "FOO"
+               newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
+               throw
+               ldc.i4.4
+               ret
+       }
+
+       .method public static int32 throw2_ret () cil managed
+       {
+               // Disable inlining
+               ldc.i4.5
+               localloc
+               pop
+
+               call int32 Tests::throw_ret ()
+               ret
+       }
+
+       // Test inlining a method which contains just a throw
+       .method public static int32 test_0_inline_throw () cil managed
+       {
+               .maxstack 16
+               .locals init (
+                               int32 v_0
+               )
+
+               .try {
+                       call int32 Tests::throw2_ret ()
+                       stloc.0
+                       leave L0
+               } catch [mscorlib]System.OverflowException {
+                       pop
+                       leave L1
+               }
+
+               L0:
+                       ldc.i4.1
+                       ret
+               L1:
+                       ldc.i4.0
+                       ret                     
+       }
+
+    .method public static int32 test_0_stelem_any_null_opt () cil managed
+    {
+               .maxstack 16
+               .locals init (
+                               object[]        V_0,
+                               int32   V_1)
+
+               ldc.i4.s 10
+               newarr [mscorlib]System.Object
+               stloc.0
+
+               ldc.i4.0
+               stloc.1
+               br L0
+
+       L1:
+               ldloc.0
+               ldloc.1
+               ldnull
+               stelem.any [mscorlib]System.Object
+               ldloc.1
+               ldc.i4.1
+               add
+               stloc.1
+       L0:
+               ldloc.1
+               ldc.i4.s 10
+               blt L1
+
+               ldc.i4.0
+               ret
+       }
+
+    // method line 2
+    .method public static  hidebysig 
+           default int32 manyargs_callee (int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h, int32 i, int32 j, int32 k, int32 l, int32 m, int32 n, int32 o, int32 p)  cil managed 
+    {
+        // Method begins at RVA 0x20f4
+       // Code size 44 (0x2c)
+       .maxstack 8
+       IL_0000:  ldarg.0 
+       IL_0001:  ldarg.1 
+       IL_0002:  add 
+       IL_0003:  ldarg.2 
+       IL_0004:  add 
+       IL_0005:  ldarg.3 
+       IL_0006:  add 
+       IL_0007:  ldarg.s 4
+       IL_0009:  add 
+       IL_000a:  ldarg.s 5
+       IL_000c:  add 
+       IL_000d:  ldarg.s 6
+       IL_000f:  add 
+       IL_0010:  ldarg.s 7
+       IL_0012:  add 
+       IL_0013:  ldarg.s 8
+       IL_0015:  add 
+       IL_0016:  ldarg.s 9
+       IL_0018:  add 
+       IL_0019:  ldarg.s 10
+       IL_001b:  add 
+       IL_001c:  ldarg.s 11
+       IL_001e:  add 
+       IL_001f:  ldarg.s 12
+       IL_0021:  add 
+       IL_0022:  ldarg.s 13
+       IL_0024:  add 
+       IL_0025:  ldarg.s 14
+       IL_0027:  add 
+       IL_0028:  ldarg.s 15
+       IL_002a:  add 
+       IL_002b:  ret 
+    } // end of method main::callee
+
+    // method line 3
+    .method public static  hidebysig 
+           default int32 manyargs_tail_caller (int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h, int32 i, int32 j, int32 k, int32 l, int32 m, int32 n, int32 o, int32 p)  cil managed 
+    {
+        // Method begins at RVA 0x2124
+       // Code size 34 (0x22)
+       .maxstack 17
+       IL_0000:  ldarg.0 
+                         ldc.i4.1
+                         add
+       IL_0001:  ldarg.1 
+       IL_0002:  ldarg.2 
+       IL_0003:  ldarg.3 
+       IL_0004:  ldarg.s 4
+       IL_0006:  ldarg.s 5
+       IL_0008:  ldarg.s 6
+       IL_000a:  ldarg.s 7
+       IL_000c:  ldarg.s 8
+       IL_000e:  ldarg.s 9
+       IL_0010:  ldarg.s 10
+       IL_0012:  ldarg.s 11
+       IL_0014:  ldarg.s 12
+       IL_0016:  ldarg.s 13
+       IL_0018:  ldarg.s 14
+                         ldc.i4.1
+                         add
+       IL_001a:  ldarg.s 15
+                         ldc.i4.1
+                         add
+                 tail.
+       IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
+       IL_0021:  ret 
+    } // end of method main::caller
+
+    // method line 4
+    .method public static  hidebysig 
+           default int32 test_139_many_args_tail_call ()  cil managed
+    {
+               // Some platforms might not be able to AOT tail calls
+               .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
+
+        // Method begins at RVA 0x2154
+       // Code size 43 (0x2b)
+       .maxstack 17
+       IL_0000:  ldc.i4.1 
+       IL_0001:  ldc.i4.2 
+       IL_0002:  ldc.i4.3 
+       IL_0003:  ldc.i4.4 
+       IL_0004:  ldc.i4.5 
+       IL_0005:  ldc.i4.6 
+       IL_0006:  ldc.i4.7 
+       IL_0007:  ldc.i4.8 
+       IL_0008:  ldc.i4.s 0x09
+       IL_000a:  ldc.i4.s 0x0a
+       IL_000c:  ldc.i4.s 0x0b
+       IL_000e:  ldc.i4.s 0x0c
+       IL_0010:  ldc.i4.s 0x0d
+       IL_0012:  ldc.i4.s 0x0e
+       IL_0014:  ldc.i4.s 0x0f
+       IL_0016:  ldc.i4.s 0x10
+       IL_0018:  call int32 class Tests::manyargs_tail_caller(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
+       IL_0028:  ret 
+    } // end of method main::Main
+
+       .class nested private auto ansi beforefieldinit R1
+          extends [mscorlib]System.MarshalByRefObject
+       {
+               .field  public  int32 test_field
+
+       .method public hidebysig  specialname  rtspecialname
+                       instance default void '.ctor' ()  cil managed
+       {
+                       ret
+               }
+       }
+
+       .method public static hidebysig
+                       default int32 return_0 () cil managed
+       {
+               ldc.i4.0
+               ret
+       }
+
+       .method public static hidebysig
+                       default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
+       {
+               .locals init (
+                       class Tests/R1 v_0
+               )
+
+               newobj instance void class Tests/R1::.ctor ()
+               stloc.0
+               ldloc.0
+               ldc.i4.0
+               volatile.
+               stfld int32 Tests/R1::test_field
+               call int32 class Tests::return_0 ()
+               ldc.i4.1
+               add
+               ret
+       }
+
+       .method public static default int32 return_2 () cil managed
+       {
+               // Prevent inlining
+               ldc.i4.s 16
+        localloc
+               pop
+               ldc.i4.s 2
+               ret
+       }
+
+       .method public static hidebysig
+                       default int32 test_1_cmov_opt_regress_463357 () cil managed
+       {
+               call int32 class Tests::return_2 ()
+               ldc.i4.0
+               ceq
+               brfalse L1
+               ldc.i4.0
+               ret
+               br L2
+       L1: nop
+       L2: nop
+               ldc.i4.1
+               ret
+       }
+
+   .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1)  cil managed 
+   {
+      .maxstack 3
+      .locals init (int32 V_0, bool V_1, bool V_2)
+      
+         ldc.i4.0
+      IL_000b:  stloc.1 
+      IL_000d:  br IL_002f
+
+         ldc.i4.1    
+         stloc.2
+      IL_001e:  ldloc.2 
+      IL_001f:  brfalse IL_0036
+
+      IL_0024:  
+      IL_002a:  br IL_0041
+    
+      IL_002f:  ldloc.1
+      IL_0030:  stloc.2 
+      IL_0031:  br IL_001e
+    
+      IL_0036:  ldc.i4 0
+      IL_003b:  stloc.0 
+      IL_003c:  br IL_0041
+    
+      IL_0041:  ldloc.0 
+      IL_0042:  ret 
+  } 
+
+    .method public static default int32 test_0_cmov_opt_regress_474718 ()  cil managed 
+    {
+        .maxstack 16
+        ldc.i4.1
+        call int32 Tests::cmov_opt_regress_474718_inner (int32)
+        ret
+   }
+
+       .method public static default int32 test_5_createarr_newobj () cil managed
+       {
+               .maxstack 16
+
+               ldc.i4 5
+               newobj void char[]::.ctor(int32)
+               ldlen
+               ret
+       }
+
+       .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
+       {
+               .maxstack 16
+               .locals init (native int)
+
+               ldc.i4.s 10
+               localloc
+               stloc.0
+
+               // Set the first value to 3
+               ldloc.0
+               ldc.i4.0
+               add             //addr
+               ldc.i4.3        //value
+               stind.i1
+
+               // Zero out the first 3 values
+               ldloc.0         //addr
+               ldc.i4.0        //value
+               ldc.i4.s 3      //size
+               initblk
+
+               // Load the first value
+               ldloc.0
+               ldc.i4.0
+               add     
+               ldind.u1
+               conv.i4
+               ret
+       }
+
+       .method public static float32 GetFloat32() cil managed noinlining
+       {
+               .maxstack  8
+               ldc.r8     0.19975845134874831
+               ret
+       }
+
+/*        Disabled until they can be fixed to run on amd64
+       .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
+       {
+               .maxstack 16
+
+               call float32 Tests::GetFloat32()
+               ldc.r8     0.19975845134874831
+               beq OK
+
+               ldc.i4.1
+               ret
+OK:
+               ldc.i4.0
+               ret
+       }
+*/
+
+       .method public static default int32 test_0_long_to_r8_un_overflow () cil managed
+       {
+               .maxstack 16
+               ldc.i8     0x00FFFFFFFFFFFFFF
+               conv.r.un
+               conv.i8
+               ldc.i8 0x100000000000000
+               beq OK_1
+
+               ldc.i4.1
+               ret
+OK_1:
+               ldc.i8     0x00FFFFFFFFFFFFFF
+               conv.r.un
+               conv.r8
+               conv.i8
+               ldc.i8 0x100000000000000
+               beq OK_2
+
+               ldc.i4.2
+               ret
+OK_2:
+               ldc.i4.0
+               ret
+       }
+
+       .field public static int32 shift1
+
+       .method public static int32 regress_497271_helper (int32 i) cil managed
+       {
+               ldarg.0
+               ret
+       }
+
+       .method public static int32 test_0_regalloc_regress_497271 () cil managed
+       {
+               .locals init (int32 var)
+
+               ldc.i4  4
+               stsfld  int32 Tests::shift1
+               ldsfld  int32 Tests::shift1
+               stloc   var
+               ldc.i4  4660
+               ldloc   var
+               shr.un
+               ldc.i4  4660
+               ldc.i4  32
+               ldloc   var
+               sub
+               shl
+               or
+               ldc.i4  1073742115
+               beq     ?L10
+?L9:
+               ldc.i4  1
+               call    int32 Tests::regress_497271_helper (int32)
+               ret
+?L10:
+               ldc.i4  0
+               call    int32 Tests::regress_497271_helper (int32)
+               ret
+       }
+
+   .field  private static  int32 Value
+
+  .method public static hidebysig  specialname 
+          default int32 regress_513931_inner ()  cil managed 
+    {                                                                 
+        // Method begins at RVA 0x225c                                
+        // Code size 52 (0x34)                                        
+        .maxstack 2                                                   
+        .locals init (                                                
+                int32   V_0,                                          
+                int32   V_1,                                          
+                bool    V_2)
+                       
+                               ldc.i4 999
+                               stsfld int32 Tests::Value
+
+        IL_0000:  nop                                                 
+        IL_0001:  ldsfld int32 Tests::Value      
+        IL_0006:  stloc.0                                             
+        IL_0007:  ldloc.0                                             
+        IL_0008:  ldc.i4.0                                            
+        IL_0009:  cgt                                                 
+        IL_000b:  ldc.i4.0                                            
+        IL_000c:  ceq                                                 
+        IL_000e:  stloc.2                                             
+        IL_000f:  ldloc.2                                             
+        IL_0010:  brtrue.s IL_0027                                    
+
+        IL_0012:  nop 
+        IL_0013:  ldloc.0 
+        IL_0014:  ldc.i4.s 0x7b
+        IL_0016:  ceq          
+        IL_0018:  ldc.i4.0     
+        IL_0019:  ceq          
+        IL_001b:  stloc.2      
+        IL_001c:  ldloc.2      
+        IL_001d:  brtrue.s IL_0023
+
+        IL_001f:  ldc.i4.m1 
+        IL_0020:  stloc.1   
+        IL_0021:  br.s IL_0032
+
+        IL_0023:  ldc.i4.1 
+        IL_0024:  stloc.1  
+        IL_0025:  br.s IL_0032
+
+        IL_0027:  
+        IL_002c:  newobj instance void class [mscorlib]System.Exception::'.ctor'()
+        IL_0031:  throw                                                                            
+        IL_0032:  ldloc.1                                                                          
+        IL_0033:  ret                                                                              
+    }
+
+       .method public static hidebysig  specialname 
+         default int32 test_0_regress_513931 ()  cil managed 
+       {
+               call int32 Tests::regress_513931_inner ()
+               pop
+               ldc.i4.0
+               ret
+       }
+
+       .method public static default int32 test_0_newarr_i8 () cil managed
+       {
+               ldc.i4 1000
+               conv.i8
+               newarr [mscorlib]System.Boolean
+               pop
+               ldc.i4 0
+               ret
+       }
+
+       .method public static specialname 
+              default int32 return_1_noinline ()  cil managed noinlining 
+       {
+               .maxstack 0
+
+               ldc.i4.1
+               ret 
+       }
+
+       // Only happens with -O=-deadce,cmov
+       .method public static default int32 test_0_cmov_unused_582322 () cil managed
+       {
+        .maxstack 2                                                   
+        .locals init (                                                
+                               int32 V_0
+               )                               
+               call int32 Tests::return_1_noinline ()
+               ldc.i4.1
+               bne.un L0
+               ldloc.s 0
+               pop
+       L0:
+               ldc.i4.0
+               ret
+       }
+
+    .method public static  hidebysig 
+           default int32 test_0_regress_586664 ()  cil managed 
+    {                                        
+        // Method begins at RVA 0x20f4       
+        // Code size 76 (0x4c)               
+        .maxstack 6                          
+        .locals init (                       
+                float64 V_0,                 
+                float64[]       V_1)         
+        IL_0000:  ldc.r8 1.                  
+        IL_0009:  ldc.r8 2.                  
+        IL_0012:  ldc.r8 1.                  
+        IL_001b:  call float64 class [mscorlib]System.Math::Pow(float64, float64)
+        IL_0020:  div                                                            
+        IL_0021:  stloc.0                                                        
+        IL_0022:  ldc.i4.2                                                       
+        IL_0023:  newarr [mscorlib]System.Double                                 
+        IL_0028:  dup                                                            
+        IL_0029:  ldc.i4.0                                                       
+        IL_002a:  ldloc.0                                                        
+        IL_002b:  neg                                                            
+        IL_002c:  stelem.r8                                                      
+        IL_002d:  dup                                                            
+        IL_002e:  ldc.i4.1                                                       
+        IL_002f:  ldloc.0
+        IL_0030:  neg
+        IL_0031:  stelem.r8
+        IL_0032:  stloc.1
+        IL_0033:  ldloc.1
+        IL_0034:  ldc.i4.0
+        IL_0035:  ldelem.r8
+        IL_0036:  ldc.r8 -0.5
+        IL_003f:  bne.un IL_004a
+
+        IL_0044:  ldc.i4.0
+        IL_0045:  br IL_004b
+
+        IL_004a:  ldc.i4.1
+        IL_004b:  ret
+    }
+
+       .method public static int32 test_2_leave_multiple_blocks_from_end ()
+       {
+               .locals init (int32 V_0)
+
+               .try {
+                       .try {
+                               nop
+                               nop
+                               leave END
+                       } finally {
+                               ldloc.0
+                               ldc.i4.1
+                               add
+                               stloc.0
+                               endfinally
+                       }
+                       nop
+                       leave END
+               } finally {
+                       ldloc.0
+                       ldc.i4.1
+                       add
+                       stloc.0
+                       endfinally
+               }
+END:
+               ldloc.0
+               ret
+       }
+
+       .method public static int32 test_3_leave_multiple_blocks_from_hole ()
+       {
+               .locals init (int32 V_0)
+
+               .try {
+                       .try {
+                               ldloc.0
+                               brtrue REST
+                               leave BEFORE_END
+REST:
+                               nop
+                               nop
+                               leave END
+                       } finally {
+                               ldloc.0
+                               ldc.i4.1
+                               add
+                               stloc.0
+                               endfinally
+                       }
+                       nop
+                       leave END
+               } finally {
+                       ldloc.0
+                       ldc.i4.1
+                       add
+                       stloc.0
+                       endfinally
+               }
+BEFORE_END:
+               ldloc.0
+               ldc.i4.1
+               add
+               stloc.0
+END:
+               ldloc.0
+               ret
+       }
+
+       .class nested private auto ansi sealed beforefieldinit Pair`2<TKey,TValue>
+                  extends [mscorlib]System.ValueType
+       {
+               .field  public  !0 key
+       .field  public  !1 'value'
+       }
+
+    .method private static hidebysig 
+           default bool ContentEquals<TKey,TValue> (valuetype Tests/Pair`2<!!TKey, !!TValue> v)  cil managed 
+    {
+       .maxstack 8
+       IL_0000:  ldarga.s 0 
+       IL_0006:  ldnull 
+                         constrained. valuetype Tests/Pair`2<!!0,!!1>
+       IL_0007:  callvirt instance bool class [mscorlib]System.Object::Equals(object)
+                         ret
+    }
+
+    .method public static hidebysig default int32 test_0_constrained_gshared_595863 () cil managed
+    {
+               .locals init (
+               valuetype Tests/Pair`2<string, string>  V_0,
+               valuetype Tests/Pair`2<string, string>  V_1)
+       IL_0000:  ldloca.s 0
+       IL_0002:  initobj valuetype Tests/Pair`2<string,string>
+       IL_0008:  ldloc.0 
+       IL_0009:  stloc.1 
+       IL_000a:  ldloca.s 1
+       IL_000c:  ldstr "A"
+       IL_0011:  stfld !0 valuetype Tests/Pair`2<string,string>::key
+       IL_0016:  ldloca.s 1
+       IL_0018:  ldstr "B"
+       IL_001d:  stfld !1 valuetype Tests/Pair`2<string,string>::'value'
+       IL_0022:  ldloc.1 
+       IL_0023:  stloc.0 
+       IL_0024:  ldloc.0 
+       IL_0025:  call bool class Tests::ContentEquals<string, string> (valuetype Tests/Pair`2<!!0,!!1>)
+                         brfalse SUCCESS
+                         ldc.i4.1
+                         ret
+       SUCCESS:
+                         ldc.i4.0
+                         ret
+    }
+
+       .method public static default int32 test_0_wrap_non_exception_throws () cil managed
+       {
+         .try {
+                   newobj instance void class [mscorlib]System.Object::'.ctor'()
+                       throw
+                 leave IL_0
+         } catch class [mscorlib]System.Runtime.CompilerServices.RuntimeWrappedException {
+                 leave IL_0
+               }
+               IL_0:
+               ldc.i4.0
+               ret
+    }
+
+       .method public static default int32 test_0_typespec_modopt () cil managed {
+               ldtoken class Tests modopt (Tests)
+               pop
+               ldc.i4.0
+               ret
+       }
+
+       .method public hidebysig static int32 SizeOfT<T>() cil managed
+       {
+               .maxstack  8
+    
+               sizeof !!0
+       ret
+       }
+
+       .method public static default int32 test_1_sizeof_gshared () cil managed {
+           call   int32 Tests::SizeOfT<int8>()
+               ldc.i4.1
+               ceq
+               ret
+       }
+
+       .method public static default int32 test_1_sizeof_ref () cil managed {
+           call   int32 Tests::SizeOfT<object>()
+               sizeof [mscorlib]System.IntPtr
+               ceq
+               ret
+       }
+
+  .field static public int32 volatile_int
+
+       .method public static default int32 test_5_volatile_load_store () cil managed {
+               ldsflda int32 class Tests::volatile_int
+               ldc.i4 5
+               volatile.
+               stind.i4
+               ldsflda int32 class Tests::volatile_int
+               volatile.
+               ldind.i4
+               ret
+       }               
+
+    .method public static 
+           default int32 regress_693905_inner (int32 x, int32 acc)  cil managed 
+    {
+        // Method begins at RVA 0x2050
+        // Code size 17 (0x11)
+        .maxstack 5
+        IL_0000:  ldarg.0 
+        IL_0001:  brtrue.s IL_0005
+
+        IL_0003:  ldarg.1 
+        IL_0004:  ret 
+        IL_0005:  ldarg.0 
+        IL_0006:  ldc.i4.1 
+        IL_0007:  sub 
+        IL_0008:  ldarg.1 
+        IL_0009:  ldc.i4.1 
+        IL_000a:  add 
+        IL_000b:  starg.s 1
+        IL_000d:  starg.s 0
+        IL_000f:  br.s IL_0000
+
+    } // end of method Test::f
+
+    .method public static 
+           default int32 test_10_regress_693905 ()  cil managed 
+       {
+               ldc.i4.s 0x0a
+        ldc.i4.0 
+        call int32 class Tests::regress_693905_inner(int32, int32)
+               ret
+       }
+
+       .method public static
+                       default int32 test_0_llvm_regress_171 () cil managed
+       {
+               .locals init (
+                       int32 i
+               )
+
+               call int32 Tests::return_1_noinline ()
+               ldc.i4.1
+               beq L1
+               ldc.i4.1
+               stloc.s 0
+               call int32 Tests::return_1_noinline ()
+               ldc.i4.0
+               beq L1
+               L1:
+               ldloc.s 0
+               ret
+       }
+
+     .field  public static int32 static_a
+
+       .method public static
+                       default int32 test_4_ldfld_stfld_static () cil managed
+       {
+               ldnull
+               ldc.i4 2
+               stfld int32 Tests::static_a
+               ldnull
+               ldfld int32 Tests::static_a
+               ldnull
+               ldflda int32 Tests::static_a
+               ldind.i4
+               add
+               ret
+       }
+
+  .method public static default int32 no_initlocals_inner () cil managed
+  {
+    .locals (
+       int32 V_0,
+       float32 V_1,
+       float64 V_2,
+       valuetype Tests/TailCallStruct V_3)
+       ldloc V_0
+       ret
+  }
+
+  .method public static default int32 test_0_no_initlocals () cil managed
+  {
+       call int32 Tests::no_initlocals_inner()
+       pop
+          ldc.i4.0
+       ret
+  }
+
+  .method public hidebysig static int32  test_5_r4_fadd_mixed() cil managed
+  {
+    // Code size       17 (0x11)
+    .maxstack  2
+    .locals init (float32 V_0,
+             float64 V_1)
+    IL_0000:  ldc.r4     3
+    IL_0005:  stloc.0
+    IL_0006:  ldc.r8     2
+    IL_000b:  stloc.1
+    IL_000c:  ldloc.0
+    IL_000d:  ldloc.1
+    IL_000e:  add
+    IL_000f:  conv.i4
+    IL_0010:  ret
+  }
+
+ .method public hidebysig static int32  test_0_fcmp_eq_r4_mixed() cil managed
+  {
+    // Code size       32 (0x20)
+    .maxstack  2
+    .locals init (float32 V_0,
+             float64 V_1)
+    IL_0000:  ldc.r4     1
+    IL_0005:  stloc.0
+    IL_0006:  ldc.r8     1
+    IL_000f:  stloc.1
+    IL_0010:  ldloc.0
+    IL_0012:  ldloc.1
+    IL_0013:  bne.un     IL_001e
+
+    IL_0018:  ldc.i4.0
+    IL_0019:  br         IL_001f
+
+    IL_001e:  ldc.i4.1
+    IL_001f:  ret
+  } // end of method Tests::test_0_fcmp_eq_r4_mixed
+
+  .method public hidebysig static int32  test_0_fceq_r4_mixed() cil managed
+  {
+    // Code size       31 (0x1f)
+    .maxstack  2
+    .locals init (float32 V_0,
+             float64 V_1,
+             bool V_2)
+    IL_0000:  ldc.r4     1
+    IL_0005:  stloc.0
+    IL_0006:  ldc.r8     1
+    IL_000b:  stloc.1
+    IL_000c:  ldloc.0
+    IL_000d:  ldloc.1
+    IL_000e:  ceq
+    IL_0010:  stloc.2
+    IL_0011:  ldloc.2
+    IL_0012:  brfalse    IL_001d
+
+    IL_0017:  ldc.i4.0
+    IL_0018:  br         IL_001e
+
+    IL_001d:  ldc.i4.1
+    IL_001e:  ret
+  } // end of method Tests::test_0_fceq_r4
+
+  .method public static int32 test_0_switch_loop () cil managed
+  {
+       .maxstack 16
+       .locals init (valuetype Tests/TailCallStruct V_0, int32 V_1)
+       ldc.i4.0
+       ldloc.0
+       ldloc.1
+       brtrue L_1
+       L_0:
+       ldc.i4.4
+       switch (L_0)
+       L_1:
+       pop
+       ret
+  }
+}
diff --git a/mono/mini/iltests.il.in b/mono/mini/iltests.il.in
deleted file mode 100644 (file)
index 35f1f8d..0000000
+++ /dev/null
@@ -1,2801 +0,0 @@
-.assembly iltests {
-  .custom instance void class [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  (
-               01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
-               63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
-}
-.assembly extern TestDriver {}
-.assembly extern mscorlib {}
-
-.class public auto ansi sealed beforefieldinit Tests {
-
-       .method static public int32 Main(string[] args) il managed {
-               .entrypoint
-               
-               ldtoken Tests
-               call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
-               ldarg.0
-               call       int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type, string[])
-               ret
-       }
-
-       // make sure the register allocator works when the return value of
-       // 'div' is discarded
-       .method static public int32 test_0_div_regalloc () il managed {
-               .locals init (
-                       int32 i
-               )
-
-               ldloc 0
-               ldc.i4.s 0xa
-               div
-               pop
-               ldc.i4.0
-               ret
-       }
-       
-       
-       .method static public int32 test_1_ceq_to_i4 () il managed {
-               .locals init (
-                       int32   foo
-               )
-               ldc.i4 500
-               stloc foo
-               ldloc foo
-               ldc.i4 500
-               ceq
-               stloc foo
-               ldloc foo
-               ret
-       }
-       
-       .method static public int32 test_3_shl_regvars () il managed {
-               .locals init (
-                       int32   a,
-                       int32   b,
-                       int32   r1,
-                       int32   r2,
-                       int32   r3
-               )
-                       
-               ldc.i4.2
-               stloc      a
-               ldc.i4.1
-               stloc      b
-       
-               ldloc      a
-               ldloc      b
-               shl 
-               stloc      r1
-               
-               ldloc      a
-               ldloc      b
-               shl 
-               stloc      r2
-               
-               ldloc      a
-               ldloc      b
-               shl 
-               stloc      r3
-               
-               ldloc      r1
-               ldc.i4.4
-               ceq
-               
-               ldloc      r2
-               ldc.i4.4
-               ceq
-               
-               ldloc      r3
-               ldc.i4.4
-               ceq
-               
-               add
-               add
-               
-               ret
-       }
-       
-       .method static public int32 test_1_fceq_to_i4 () il managed {
-       
-               .locals init (
-                       float64 foo,
-                       int32   val
-               )
-
-               ldc.r8      2
-               stloc       foo
-               
-               ldloc       foo
-               ldc.r8      2
-               ceq
-               stloc       val
-               
-               ldloc       val
-               ret
-       }
-
-       //
-       // This should be manually checked. Basically under -O=linears,
-       // you should not see tons of register spilling.
-       //
-       .method static public int32 test_1_bytedreg_free () il managed {
-               .locals init (
-                       int32   foo
-               )
-               ldc.i4 500
-               stloc foo
-               ldloc foo
-               ldc.i4 500
-               ceq
-               stloc foo
-               
-               ldloc foo
-               ldc.i4 1
-               ceq
-               stloc foo
-
-               ldloc foo
-               ldc.i4 1
-               ceq
-               stloc foo
-
-               ldloc foo
-               ldc.i4 1
-               ceq
-               stloc foo
-               
-               ldloc foo
-               ldc.i4 1
-               ceq
-               stloc foo
-               
-               ldloc foo
-               ret
-       }
-       
-       //
-       // This should be manually checked. Basically under -O=linears,
-       // you should not see tons of register spilling.
-       //
-       .method static public int32 test_0_bytesreg1_free () il managed {
-               .locals init (
-                       unsigned int8      dest,
-                       int32              src,
-                       unsigned int8&     pdest
-               )
-
-               ldloca     dest
-               stloc      pdest
-               
-               ldloc      pdest
-               ldloc      src
-               stind.i1
-               
-               ldloc      pdest
-               ldloc      src
-               stind.i1
-               
-               ldloc      pdest
-               ldloc      src
-               stind.i1
-               
-               ldloc      pdest
-               ldloc      src
-               stind.i1
-               
-               ldloc      pdest
-               ldloc      src
-               stind.i1
-               
-               ldloc      pdest
-               ldloc      src
-               stind.i1
-               
-               ldloc      pdest
-               ldind.i1
-               ret
-       }
-       
-       .method static public int32 test_1_shift_regvar () il managed {
-       
-               .locals init (
-                       int32   v7FFFFFFF,
-                       int32   v1
-               )
-               
-               ldc.i4  0x7FFFFFFF
-               stloc   v7FFFFFFF
-       
-               ldc.i4.1
-               stloc v1
-               
-               ldloc   v7FFFFFFF
-               ldloc   v1
-               shl
-               ldc.i4  0xFFFFFFFE
-               ceq
-               ret
-       }
-       
-       // this only happens with the managed pointer, not an unmanaged one.
-       .method static public int32 test_0_foo () il managed {
-       
-               .locals init (
-                       int32&  buf
-               )
-               
-               ldc.i4.5
-               localloc
-               
-               stloc buf
-               ldloc buf
-               
-               ldind.i4
-               
-               ret
-       }
-
-       .method static public int32 test_0_localloc () cil managed {
-               .locals init (native int, native int, native int, native int, int32)
-
-               ldc.i4 6
-               localloc
-               conv.i
-               stloc.0
-
-               ldc.i4 6
-               localloc
-               conv.i
-               stloc.1
-
-               ldc.i4 6
-               localloc
-               conv.i
-               stloc.2
-
-               // Variable length
-               ldc.i4 128
-               stloc.s 4
-               ldloc.s 4
-               localloc
-               conv.i
-               stloc.3
-
-               // Check zero initialized
-               ldloc.0
-               ldind.i4
-               ldc.i4.0
-               beq OK1
-               ldc.i4.1
-               br FAIL
-
-OK1:
-               ldloc.3
-               ldind.i4
-               ldc.i4.0
-               beq OK2
-               ldc.i4.2
-               br FAIL
-
-OK2:
-               ldloc.3
-               ldc.i4.s 124
-               add
-               ldind.i4
-               ldc.i4.0
-               beq OK3
-               ldc.i4.3
-               br FAIL
-
-OK3:
-               ldloc.1
-               ldc.i4 999999
-               stind.i4
-               ldloc.1
-               ldind.i4
-               ldc.i4 999999
-               beq OK4
-               ldc.i4.4
-               br FAIL
-
-OK4:
-               ldloc.0
-               ldc.i4 999999
-               stind.i4
-               ldloc.0
-               ldind.i4
-               ldc.i4 999999
-               beq OK5
-               ldc.i4.5
-               br FAIL
-
-OK5:
-               // Try allocations bigger than one page
-               ldc.i4 8196
-               localloc
-               conv.i
-               stloc.3
-               ldloc.3
-               ldc.i4 8192
-               add
-               ldc.i4 99
-               stind.i4
-               ldloc.3
-               ldc.i4 8192
-               add
-               ldind.i4
-               ldc.i4 99
-               beq PASS
-               ldc.i4.6
-               br FAIL
-
-FAIL:
-               ret
-
-PASS:  ldc.i4.0
-               ret
-       }
-
-    .method private static void do_localloc () cil managed {
-        .maxstack 3
-        .locals init (
-                unsigned int8*  V_0)
-        IL_0000:  ldc.i4.1
-        IL_0001:  ldc.i4 131072
-        IL_0006:  mul
-        IL_0007:  localloc
-        IL_0009:  stloc.0
-        IL_000a:  ret
-    }
-
-       // Check that localloc cannot be inlined
-       .method static public int32 test_0_localloc_inline () cil managed {
-               .maxstack 16
-               .locals init (
-                       int32 i
-               )
-
-               ldc.i4.0
-        stloc.0
-        br COND
-
-START:  call void class Tests::do_localloc()
-        ldloc.0
-        ldc.i4.1
-        add
-        stloc.0
-COND:   ldloc.0
-        ldc.i4 1000
-        blt START
-
-               ldc.i4.0
-               ret
-       }       
-       
-       .method static public int32 test_3_copy_used_bug () il managed {
-
-               .locals init (
-                       int32 size,
-                       int32 res
-               )
-
-               ldc.i4 0
-               stloc res
-
-               ldc.i4 1
-               stloc size
-
-               ldloc size
-               ldloc size
-               ldloc size
-               add
-               stloc size
-               ldloc size
-               add
-               stloc res
-
-               ldloc res
-               ret
-       }
-
-       // demonstrate that the copy_used_var is not a fix for the above bug
-       .method static public int32 test_3_copy_used_indir_bug () il managed {
-
-               .locals init (
-                       int32 size,
-                       int32 res
-               )
-
-               ldc.i4 0
-               stloc res
-
-               ldc.i4 1
-               stloc size
-
-               ldloc size
-               ldloca size
-               ldloc size
-               ldloc size
-               add
-               stind.i4
-               ldloc size
-               add
-               stloc res
-
-               ldloc res
-               ret
-       }
-
-       .method static public void do_nothing (int32 a) il managed {
-               ret
-       }
-       
-       // demonstrate the block_split failure: needs -O=inline
-       // mini -O=inline --compile Tests:test_0_split_block_bug iltests.exe
-       .method static public int32 test_0_split_block_bug () il managed {
-
-               .locals init (
-                       int32 i1
-               )
-
-               ldc.i4 1
-               stloc i1
- test_label:
-               ldloc i1
-               call void class Tests::do_nothing (int32)
-               ldc.i4 0
-               brtrue test_label
-               
-               ldc.i4 0
-               ret
-       }
-
-       .method public void inline_do_nothing () il managed {
-               ret
-       }
-       .method static public int32 test_1_checkthis_inlining () il managed {
-               ldnull
-               call instance void class Tests::inline_do_nothing ()
-               ldc.i4 1
-               ret
-       }
-
-       .class nested private auto ansi sealed beforefieldinit TailCallStruct 
-               extends [mscorlib]System.ValueType {
-               .field public int32 a
-               .field public int32 b
-       }
-
-       .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
-               ldarga 0
-               ldarga 0
-               ldfld int32 Tests/TailCallStruct::a
-               ldc.i4.1
-               add
-               stfld int32 Tests/TailCallStruct::a
-               ldarga 0
-               ldarga 0
-               ldfld int32 Tests/TailCallStruct::a
-               ldc.i4.2
-               add
-               stfld int32 Tests/TailCallStruct::a
-               ldarg.0
-               ret
-       }
-
-       .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
-               ldarg.0
-               tail.
-               call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
-               ret
-       }
-
-       .class nested private auto ansi sealed beforefieldinit TailCallStructBig
-               extends [mscorlib]System.ValueType {
-               .field public int32 a
-               .field public int32 b
-               .field public int32 c
-               .field public int32 d
-               .field public int32 e
-       }
-
-       .method static valuetype Tests/TailCallStructBig tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig arg) {
-               ldarga 0
-               ldarga 0
-               ldfld int32 Tests/TailCallStructBig::a
-               ldc.i4.1
-               add
-               stfld int32 Tests/TailCallStructBig::a
-               ldarg.0
-               ret
-       }
-
-       .method static valuetype Tests/TailCallStructBig tail_vret_by_addr (valuetype Tests/TailCallStructBig arg) {
-               ldarg.0
-               tail.
-               call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr_inner (valuetype Tests/TailCallStructBig)
-               ret
-       }
-
-       .method static public int32 test_3_tail_call_vret_by_addr () il managed {
-               .maxstack 16
-               .locals init (
-                       valuetype Tests/TailCallStructBig arg2
-               )
-
-               ldloca 0
-               ldc.i4.2
-               stfld int32 Tests/TailCallStructBig::a
-               ldloc.0
-               call valuetype Tests/TailCallStructBig Tests::tail_vret_by_addr (valuetype Tests/TailCallStructBig)
-               stloc.0
-
-               ldloca 0
-               ldfld int32 Tests/TailCallStructBig::a
-               ret
-       }
-
-       .method static public int32 test_9_tail_call_vret_by_val () il managed {
-               .maxstack 16
-               .locals init (
-                       valuetype Tests/TailCallStruct arg
-               )
-               ldloca 0
-               ldc.i4.2
-               stfld int32 Tests/TailCallStruct::a
-               ldloca 0
-               ldc.i4.4
-               stfld int32 Tests/TailCallStruct::b
-               ldloc.0
-               call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
-               stloc.0
-
-               ldloca 0
-               ldfld int32 Tests/TailCallStruct::a
-               ldloca 0
-               ldfld int32 Tests/TailCallStruct::b
-               add
-               ret
-       }
-
-       .method static public int32 tail3 (int32 i, int32 j) il managed {
-               ldarg.0
-               ldarg.1
-               add
-               ret
-       }
-
-       .method static public int32 tail4 (int32 i, int32 j) il managed {
-               .maxstack 16
-               .locals init (
-                       int32 k)
-
-               // Test arg0 allocated to a register
-               ldarg.0
-               ldarg.0
-               ldarg.0
-               ldarg.0
-               add
-               add
-               add
-               starg 0
-
-               // Test switched up argument variables as the actual arguments
-               ldarg.1
-               ldarg.0
-               tail.
-               call int32 Tests::tail3 (int32, int32)
-               ret
-       }
-
-       .method static public int32 test_24_tail_calls2 () il managed {
-               // Some platforms might not be able to AOT tail calls
-               .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
-
-               .maxstack 16
-               .locals init (
-                       int32 i,
-                       int32 j)
-
-               ldc.i4.4
-               stloc.0
-               ldc.i4.8
-               stloc.1
-
-               ldloc.0 
-               ldloc.1
-               call int32 Tests::tail4 (int32, int32)
-               ret
-       }
-
-       .method public static int32 test_5_jmp () cil managed {
-               // Some platforms might not be able to AOT tail calls
-               .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
-
-               ldc.i4.1
-               ldc.i4.2
-               call int32 Tests::jmp2 (int32, int32)
-               ret
-       }
-
-       .method public static int32 jmp2 (int32, int32) cil managed {
-               ldarg.0
-               ldc.i4.1
-               add
-               starg.s 0
-               ldarg.1
-               ldc.i4.1
-               add
-               starg.s 1
-               jmp int32 Tests::jmp3 (int32, int32)
-               ldc.i4.0
-               ret
-       }               
-
-       .method public static int32 jmp3 (int32 i, int32 j) cil managed {
-               ldarg.0
-               ldarg.1
-               add
-               ret
-       }
-
-       .method static public int32 test_11_switch_with_nonempty_stack () il managed {
-               .maxstack 16
-
-               ldc.i4.5
-               ldc.i4.6
-               ldc.i4.1
-               switch (L0, L1)
-       L0: 
-               add
-               ret
-       L1:
-               add
-               ret
-       }
-    .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
-               .maxstack 16
-
-        .try {
-          leave IL_0
-        }
-        finally  {
-          ldc.i4.0
-          endfinally
-        }
-        IL_0:  ldc.i4.5
-               ret
-    }
-
-       .method public static int32 test_0_conv_ovf_i8_neg () il managed {
-               .maxstack 16
-
-               ldc.i4.m1
-               conv.ovf.i8
-               conv.i4
-               ldc.i4.m1
-               beq L_OK
-               ldc.i4.1
-               ret
-       L_OK:
-               ldc.i4.0
-               ret
-       }               
-
-       .method public static int32 test_1234_conv_u4 () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.u4
-               conv.i4
-               ret
-       }
-
-       .method public static int32 test_0_conv_ovf_i_un () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.ovf.i.un
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4 0x7fffffff
-               conv.ovf.i.un
-               conv.i4
-               ldc.i4 0x7fffffff
-               beq L2
-               ldc.i4.2
-               ret
-       L2:
-               sizeof [mscorlib]System.IntPtr
-               ldc.i4 8
-               beq L5
-               .try {
-                       ldc.i4 0x80000000
-                       conv.ovf.i.un
-                       leave L4
-               } catch [mscorlib]System.OverflowException {
-                       pop
-                       leave L5
-               }
-       L4: 
-               ldc.i4.3
-               ret
-       L5:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_conv_ovf_u_un () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.ovf.u.un
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_conv_ovf_i () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.ovf.i
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_conv_ovf_u () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.ovf.u
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_1234_conv_ovf_i8_un () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.ovf.i8.un
-               conv.i4
-               ret
-       }
-
-       .method public static int32 test_0_lconv_ovf_i () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.i8
-               conv.ovf.i
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_lconv_ovf_u () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.i8
-               conv.ovf.u
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_lconv_ovf_i_un () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.i8
-               conv.ovf.i.un
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_lconv_ovf_u_un () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.i8
-               conv.ovf.u.un
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_lconv_to_ovf_i8 () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.i8
-               conv.ovf.i8
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_0_lconv_to_ovf_u8_un () cil managed {
-               .maxstack 16
-
-               ldc.i4 1234
-               conv.i8
-               conv.ovf.u8.un
-               conv.i4
-               ldc.i4 1234
-               beq L1
-               ldc.i4.1
-               ret
-       L1:
-               ldc.i4.0
-               ret
-       }
-
-       .method public static int32 test_2_lconv_to_ovf_i4_un () cil managed {
-               .maxstack 16
-               .locals init (int32 res)
-
-               ldc.i4 0x7fffffff
-               conv.u8
-               conv.ovf.i4.un
-               pop
-
-               ldc.i4.2
-               stloc res
-
-        .try {
-                       ldc.i8 0x80000000
-                       conv.ovf.i4.un
-                       pop
-                       ldc.i4.0
-                       stloc res
-                       leave RET
-               } catch [mscorlib]System.OverflowException {
-                       pop
-                       leave IL_0
-               }
-
-       IL_0:
-
-        .try {
-                       ldc.i8 0xffffffff80000000
-                       conv.ovf.i4.un
-                       pop
-                       ldc.i4.1
-                       stloc res
-                       leave RET
-               } catch [mscorlib]System.OverflowException {
-                       pop
-                       leave RET
-               }
-
-       RET:
-               ldloc res
-               ret
-       }
-
-    .method public static int32 test_1_lconv_to_ovf_i_un () cil managed {
-               .maxstack 16
-               .locals init (int32 res)
-
-               ldc.i4 0x7fffffff
-               conv.u8
-               conv.ovf.i.un
-               conv.i4
-               pop
-
-               ldc.i4.1
-               ret
-       }
-
-       .method public static int32 test_32_lconv_to_u8 () cil managed
-       {
-               .maxstack 16
-
-               ldc.i4 32
-               conv.i8
-               conv.u8
-               conv.i4
-               ret
-       }                               
-
-       .method public static int32 test_32_lconv_to_i8 () cil managed
-       {
-               .maxstack 16
-
-               ldc.i4 32
-               conv.i8
-               conv.i8
-               conv.i4
-               ret
-       }                               
-
-       .method public static int32 test_15_lconv_to_u () cil managed
-       {
-       ldc.i8 0x10000000f
-               conv.u
-               conv.i4
-               ret
-       }
-
-       .method public static int32 test_1234_fconv_u () cil managed {
-               .maxstack 16
-
-               ldc.r8 1234.0
-               conv.u
-               conv.i4
-               ret
-       }
-
-       .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed 
-       {
-               .maxstack 16
-       
-               ldc.i4.1
-               brfalse OBJECT
-       
-               ldtoken [mscorlib]System.String
-               br AFTER
-       OBJECT:
-               ldtoken [mscorlib]System.Object
-       AFTER:
-               call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
-               callvirt instance string class [mscorlib]System.Type::get_FullName ()
-               ldstr "System.String"
-               callvirt instance bool class [mscorlib]System.Object::Equals(object)
-               ldc.i4.0
-               ceq
-               ret 
-       }
-               
-       .method public static int32 test_0_bug59580  ()
-       {
-               ldc.r4          float32(0x7FC00000)
-               ldc.r4          float32(0x7FC00000)
-               bge.un          pass
-               br              fail
-       pass:
-               ldc.i4.0
-               ret
-       fail:
-               ldc.i4.1
-               ret
-       }
-       
-       .method public static int32 test_1_bug60056  () {
-               .locals init (int32 m5)
-                       
-               ldc.i4.m1
-               stloc.0
-               
-               ldc.i4.1
-               conv.u8
-               
-               ldloc.0
-               conv.i8
-               mul
-               
-               ldc.i4.m1
-               conv.i8
-               ceq
-               ret
-       }
-       
-       .method public static int32 test_1_conv_u8_cfold  () {
-               ldc.i4.m1
-               conv.u8
-               
-               ldc.i8 0x00000000ffffffff
-               
-               ceq
-               ret
-       }
-       
-       .method public static int32 test_1_array_type_mismatch_ldelema  () {
-               .locals init (int32 r)
-               
-                       ldc.i4.1
-                       newarr string
-                       ldc.i4.0 
-                       ldelema string
-                       pop
-               
-               .try {
-                       ldc.i4.1
-                       newarr string
-                       ldc.i4.0 
-                       ldelema object
-                       pop
-                       
-                       leave end
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       pop
-                       ldc.i4.1
-                       stloc.0
-                       leave end
-               }
-       end:
-               ldloc.0
-               ret
-       }
-
-       .method public static int32 test_1_conv_ovf_i8_with_i4 () {
-                       ldc.i4.m1 
-                       conv.ovf.i8
-                       conv.ovf.i4
-                       neg
-                       ret
-       }
-
-       // bug #72148
-    .method public static int32 test_0_initlocals_float_ptr () {
-       .maxstack 3
-       .locals init (
-               float32[]       V_0,
-               float32& pinned V_1,
-               unsigned int32  V_2)
-                       ldc.i4.s 0x0f
-                       newarr [mscorlib]System.Single
-                       stloc.0 
-                       ldloc.0 
-                       ldc.i4.0 
-                       ldc.r4 1.13
-                       stelem.r4 
-                       ldloc.0 
-                       ldc.i4.0 
-                       ldelema [mscorlib]System.Single
-                       stloc.1 
-                       ldloc.1 
-                       conv.i 
-                       ldind.u4 
-                       stloc.2 
-                       ldc.i4.0
-                       ret
-       }
-
-       .method public static int32 test_7_conv_ovf_u8_un () {
-       .maxstack  2
-        .locals    init (unsigned int64)
-
-        ldc.i4.7
-        conv.ovf.u8.un
-        stloc.0
-               ldloc.0
-               conv.i4
-        ret
-       }
-
-       .method public static int32 test_7_conv_ovf_u4_un () {
-       .maxstack  2
-        .locals    init (unsigned int32)
-
-        ldc.i4.7
-        conv.ovf.u4.un
-        stloc.0
-               ldloc.0
-               conv.i4
-        ret
-       }
-
-       .method public static int32 test_1_bug_74591 () {
-               .maxstack 16
-               .locals init (int32)
-
-               ldc.i4.m1
-               stloc.0
-               ldloc.0
-               conv.ovf.i8
-               ldc.i4.m1
-               conv.ovf.i8
-               mul.ovf
-               conv.i4
-               ret
-       }
-
-       .class nested public auto ansi Integer
-               extends [mscorlib]System.Object {
-
-               .field public bool n
-
-           .method public hidebysig  specialname  rtspecialname 
-           instance default void .ctor (unsigned int64 i, bool n)  cil managed 
-           {
-                       .maxstack 8
-                       ldarg.0
-                       call instance void class [mscorlib]System.Object::.ctor()
-                       ldarg.0
-                       ldarg.2
-                       stfld bool Tests/Integer::n
-                       ret
-               }
-       }
-
-       .method public static int32 test_1_bug_74726 () {
-               .maxstack 16
-
-               ldc.i4.2
-               conv.ovf.u8
-               ldc.i4.1
-               conv.ovf.u8
-               mul.ovf.un
-               ldc.i4.1
-               newobj instance void class Tests/Integer::.ctor(unsigned int64, bool)
-               ldfld bool Tests/Integer::n
-               ldc.i4.1
-               ceq
-               ret
-       }
-
-       .class nested private auto ansi sealed xxx
-       extends [mscorlib]System.ValueType
-   {
-     .field  public   object a
-
-     .method public hidebysig  specialname  rtspecialname 
-            instance default void .ctor ()  cil managed 
-     {
-                .maxstack 8
-                ret 
-     }
-   } // end of class xxx
-
-       .method public static int32 test_0_newobj_vtype () {
-               .maxstack 6
-               .locals init (
-                       valuetype Tests/xxx V_0
-               )
-
-               newobj instance void valuetype Tests/xxx::.ctor ()
-               stloc.0
-               ldloca.s 0
-               ldfld object Tests/xxx::a
-               brfalse OK
-               ldc.i4.s 1
-               ret
-       OK:
-               ldc.i4.s 0
-               ret
-       }
-
-       .method public static int32 test_0_newobj_vtype_primitive () {
-               .maxstack 6
-               .locals init (
-                       native int V_0
-               )
-
-               ldc.i4.s 10
-               newobj instance void native int::'.ctor'(int32)
-               stloc.0
-               ldloc.0
-               ldc.i4.s 10
-               beq OK
-               ldc.i4.s 1
-               ret
-       OK:
-               ldc.i4.s 0
-               ret
-       }
-
-       .method public static int32 test_1_filters () {
-               .custom instance void [TestDriver]CategoryAttribute::.ctor(string) = ( 01 00 08 21 42 49 54 43 4F 44 45 00 00 )          // ...!BITCODE..
-               .maxstack 16
-               .locals init (
-                       int32 res
-               )
-
-               .try { // 0
-                       .try {
-                               ldstr "OnErrorSub test Exception"
-                               newobj instance void class [mscorlib]System.Exception::.ctor(string)
-                               throw 
-                               leave.s IL_0033
-                       }
-                       filter {
-                               pop
-                               ldc.i4.0
-                               endfilter
-                       } {
-                               pop
-                               // Should not be called
-                               ldc.i4.2
-                               stloc res
-                               leave.s IL_0033
-                       }
-               }
-               filter {
-                       pop
-                       ldc.i4.1
-                       endfilter 
-               } {
-                 pop
-                 ldc.i4.1
-                 stloc res       
-                 leave.s IL_0033
-
-               }
-               IL_0033:
-               ldloc res
-               ret
-       }
-
-       .class nested private auto ansi sealed beforefieldinit TheStruct
-               extends [mscorlib]System.ValueType {
-               .field public int32 a
-               .field public int32 b
-       }
-
-       .method public static int32 test_5_cpobj () {
-               .maxstack 8
-               .locals init (  
-                               valuetype Tests/TheStruct v_0, 
-                               valuetype Tests/TheStruct v_1
-                                        )
-
-               ldloca v_0
-               ldc.i4.2
-               stfld int32 Tests/TheStruct::a
-
-               ldloca v_0
-               ldc.i4.3
-               stfld int32 Tests/TheStruct::b
-
-               ldloca v_1
-               ldloca v_0
-               cpobj Tests/TheStruct
-
-               ldloca v_1
-               ldfld int32 Tests/TheStruct::a
-               ldloca v_1
-               ldfld int32 Tests/TheStruct::b
-               add
-
-               ret
-       }
-
-       .method public static int32 test_5_ldobj_stloc_optimization () {
-               .maxstack 8
-               .locals init (  
-                               valuetype Tests/TheStruct v_0, 
-                               valuetype Tests/TheStruct v_1
-                                        )
-
-               ldloca v_0
-               ldc.i4.2
-               stfld int32 Tests/TheStruct::a
-
-               ldloca v_0
-               ldc.i4.3
-               stfld int32 Tests/TheStruct::b
-
-               ldloca v_0
-               ldobj valuetype Tests/TheStruct
-               stloc.s v_1
-
-               ldloca v_1
-               ldfld int32 Tests/TheStruct::a
-               ldloca v_1
-               ldfld int32 Tests/TheStruct::b
-               add
-
-               ret
-       }
-
-       .method public static int32 test_1_cpobj_reference () {
-               .maxstack 8
-               .locals init (  
-                               object v_0, 
-                               object v_1
-                                        )
-
-               newobj instance void object::.ctor()
-               stloc v_0
-
-               ldloca v_1
-               ldloca v_0
-               cpobj object
-
-               ldloc v_0
-               ldloc v_1
-               ceq
-               ret
-       }
-
-       .method public static int32 test_1_initobj_reference () {
-               .maxstack 8
-               .locals init (  
-                               object v_0
-                                        )
-
-               newobj instance void object::.ctor()
-               stloc v_0
-
-               ldloca v_0
-               initobj object
-
-               ldloc v_0
-               ldnull
-               ceq
-               ret
-       }
-
-       .method public static int32 test_1_ldobj_reference () {
-               .maxstack 8
-               .locals init (  
-                               object v_0
-                                        )
-
-               newobj instance void object::.ctor()
-               stloc v_0
-
-               ldloc v_0
-               ldloca v_0
-               ldobj object
-               ceq
-               ret
-       }
-
-       .method public static int32 test_5_vtype_on_bb_boundary () {
-               .maxstack 8
-               .locals init (  
-                               valuetype Tests/TheStruct v_0, 
-                               valuetype Tests/TheStruct v_1
-                                        )
-
-               ldloca v_0
-               ldc.i4.2
-               stfld int32 Tests/TheStruct::a
-
-               ldloca v_0
-               ldc.i4.3
-               stfld int32 Tests/TheStruct::b
-
-               ldloc v_0
-               br L_0
-       L_0: stloc v_1
-
-               ldloca v_1
-               ldfld int32 Tests/TheStruct::a
-               ldloca v_1
-               ldfld int32 Tests/TheStruct::b
-               add
-               ret
-       }
-
-       .method public static int32 test_5_different_in_stacks () cil managed {
-               .maxstack 16
-
-                       ldc.i4.1
-                       ldc.i4.1
-                       beq L_0
-
-                       ldc.i4.3
-                       ldc.i4.3
-                       br L_1
-                       ldc.i4.3
-                       ldc.i4.3
-                       br L_2
-        L_0:   ldc.i4.2
-                       ldc.i4.3
-                       ldc.i4.1
-                       ldc.i4.1
-                       beq L_2
-        L_1:   add
-                       ret
-        L_2:   add
-                       ret
-       }
-
-       .method public static int32 test_3_larray_get_set () {
-               .locals init (
-                       int32[2]        V_0)
-                         
-                       ldc.i4.2 
-                       newobj instance void int32[0...]::.ctor(int32)
-                       stloc.0 
-                       ldloc.0 
-                       ldc.i4.0 
-                       ldc.i4 1
-                       call instance void int32[0...]::Set(int32, int32)
-                   ldloc.0 
-                   ldc.i4.1 
-                       ldc.i4 2
-                       call instance void int32[0...]::Set(int32, int32)
-
-                       ldloc.0
-                       ldc.i4.0
-                       call instance int32 int32[0...]::Get(int32)
-                       ldloc.0
-                       ldc.i4.1
-                       call instance int32 int32[0...]::Get(int32)
-                       add
-                       ret
-       }
-
-       .method public static int32 test_0_pop_side_effects () {
-               .try {
-                       ldc.r8 1
-                       ldc.r8 0
-                       div
-                       ckfinite
-                       pop
-                       leave FAIL
-               }
-               catch [mscorlib]System.ArithmeticException {
-                       pop
-                       leave L_0
-               }
-               L_0:
-               ldc.i4.0
-               ret
-               FAIL:
-               ldc.i4.1
-               ret
-       }
-
-       .method public static void regalloc_regress_78314_helper (object o) cil managed
-       {
-               ret
-       }
-
-       .method public static int32 test_1_regalloc_regress_78314 () cil managed
-       {
-    // Code size       68 (0x44)
-    .maxstack  6
-    .locals init (int32 V_0, bool V_1)
-    IL_0000:  ldc.i4.0
-    IL_0001:  stloc.0
-    IL_0002:  br.s       IL_003b
-
-    IL_0004:
-    IL_001e:  ldc.i4.s   10
-    IL_0020:  ldloc.0
-    IL_0021:  shl
-    IL_0022:  ldc.i4.s   10
-    IL_0024:  ldloc.0
-    IL_0025:  shl
-    IL_0026:  ceq
-    IL_0028:  box        [mscorlib]System.Boolean
-    IL_0032:  call       void Tests::regalloc_regress_78314_helper(object)
-    IL_0037:  ldloc.0
-    IL_0038:  ldc.i4.1
-    IL_0039:  add
-    IL_003a:  stloc.0
-    IL_003b:  ldloc.0
-    IL_003c:  ldc.i4.8
-    IL_003f:  blt.s      IL_0004
-
-       ldloc.0
-       ldc.i4.8
-       ceq
-       conv.i4
-       ret     
-  }
-
-       .method public static void try_block_end_remove_if_useless () cil managed {
-           .maxstack  8
-
-           T_START:
-               ldstr   "Start"
-                       pop
-               leave.s COMPLETE
-           T1_END:
-
-           COMPLETE:
-               ret
-
-           F1_START:
-               ldstr   "Finally1"
-                       pop
-               endfinally
-           F1_END:
-
-           .try T_START to T1_END finally handler F1_START to F1_END
-       }
-
-       .method public static int32 test_0_try_block_end_remove_if_useless () cil managed {
-               call void class Tests::try_block_end_remove_if_useless ()
-               ldc.i4.0
-               ret
-       }
-
-   .method private static int32 test_0_regress_78629_switch_next_ins_target ()  cil managed
-    {
-        ldc.i4.0
-        switch (target)
-        target: ldstr "bar"
-               pop
-               ldc.i4.0
-        ret
-    }
-
-       // This belongs to basic-float.cs, but its hard to tell mcs/csc to
-       // generate the non .un version of the opcodes
-    .method private static  hidebysig 
-           default int32 test_4_float_branch_nan ()  cil managed 
-    {
-        // Method begins at RVA 0x27a4
-       // Code size 74 (0x4a)
-       .maxstack 2
-       .locals init (
-               float64 V_0,
-               float64 V_1,
-               int32   V_2)
-       IL_0000:  ldc.r8 (00 00 00 00 00 00 f8 ff)
-       IL_0009:  stloc.0 
-       IL_000a:  ldc.r8 1.
-       IL_0013:  stloc.1 
-       IL_0014:  ldc.i4.0 
-       IL_0015:  stloc.2 
-       IL_0016:  ldloc.0 
-       IL_0017:  ldloc.1 
-       IL_0018:  bge.s IL_001a
-
-                               br L1
-       IL_001a:  ldloc.2 
-       IL_001b:  ret 
-       L1:
-       IL_001c:  ldloc.2 
-       IL_001d:  ldc.i4.1 
-       IL_001e:  add 
-       IL_001f:  stloc.2 
-       IL_0020:  ldloc.0 
-       IL_0021:  ldloc.1 
-       IL_0022:  ble.s IL_002e
-                               br L2
-       IL_002e:  ldloc.2 
-       IL_002f:  ret 
-       L2:
-       IL_0030:  ldloc.2 
-       IL_0031:  ldc.i4.1 
-       IL_0032:  add 
-       IL_0033:  stloc.2 
-       IL_0034:  ldloc.0 
-       IL_0035:  ldloc.1 
-       IL_0036:  blt.s IL_0038
-                               br L3           
-       IL_0038:  ldloc.2 
-       IL_0039:  ret 
-       L3:
-       IL_003a:  ldloc.2 
-       IL_003b:  ldc.i4.1 
-       IL_003c:  add 
-       IL_003d:  stloc.2 
-       IL_003e:  ldloc.0 
-       IL_003f:  ldloc.1 
-       IL_0040:  bgt.s IL_0042
-                               br L4
-       IL_0042:  ldloc.2 
-       IL_0043:  ret 
-       L4:
-       IL_0044:  ldloc.2 
-       IL_0045:  ldc.i4.1 
-       IL_0046:  add 
-       IL_0047:  stloc.2 
-       IL_0048:  ldloc.2 
-       IL_0049:  ret 
-    } // end of method Tests::test_5_float_branch_nan
-
-    .method private static  hidebysig
-           default void regress_80622_inner (object x)  cil managed
-    {
-               .locals init (unsigned int8 i)
-        // Method begins at RVA 0x2050
-        // Code size 14 (0xe)
-        .maxstack 8
-        IL_1000:  ldarg.0
-        IL_1001:  unbox unsigned int8
-        IL_1006:  ldobj unsigned int8
-        IL_000b:  conv.ovf.i4.un
-        IL_000c:  pop
-        IL_000d:  ret
-    }
-
-    // method line 2
-    .method private static  hidebysig
-           default int32 test_0_regress_80622 ()  cil managed
-    {
-        .maxstack 8
-        IL_0000:  ldc.i4 255
-        IL_0005:  box unsigned int8
-        IL_000a:  call void class Tests::regress_80622_inner (object)
-               ldc.i4.0
-        IL_000f:  ret
-    }
-
-       .method private static default int32 test_0_regresss_80190 () cil managed
-       {
-           .maxstack  2
-           .locals init (int32 V_0,
-                    int32* V_1)
-           IL_0000:  nop
-           IL_0001:  nop
-           IL_0002:  ldloca.s   V_0
-           IL_0004:  conv.u
-           IL_0005:  stloc.1
-           IL_0006:  ldloc.1
-           IL_0007:  ldc.i4.3
-           IL_0008:  stind.i4
-           IL_0009:  nop
-                                 ldc.i4.0
-                                 ret
-       }
-
-       .class interface nested public auto ansi abstract IFaceWithStaticMethod
-       {
-           .method public static  specialname 
-              default void foo ()  cil managed noinlining 
-           {
-               .maxstack 0
-               IL_0000:  ret 
-       }
-       }
-       
-       .class nested public auto ansi AClass extends [mscorlib]System.Object implements Tests/IFaceWithStaticMethod
-       {
-           .method public hidebysig  specialname  rtspecialname 
-           instance default void .ctor ()  cil managed 
-           {
-                       .maxstack 8
-                       ret
-               }
-
-       }
-
-       // Test that static methods in interfaces are ignored during vtable construction
-       .method private static default int32 test_0_ifaces_with_static_methods () cil managed
-       {
-               .maxstack 16
-
-               newobj instance void class Tests/AClass::.ctor()
-               pop
-               ldc.i4.0
-               ret
-       }
-
-       .method private static hidebysig default int32 Foo<T> (!!T n)  cil managed {
-               ldarg.0
-               box !!0
-               brtrue HAS_VALUE
-               ldc.i4.0
-               ret
-HAS_VALUE:     ldc.i4.1
-               ret
-       }
-
-       // bug 78019
-       .method static public int32 test_0_nullable_box_brtrue () cil managed {
-
-               .locals init (valuetype [mscorlib]System.Nullable`1<int32> V_0)
-
-               ldloc.0
-               call int32 class Tests::Foo<valuetype [mscorlib]System.Nullable`1<int32>> (!!0)
-               ret
-       }
-
-       //Bug 372410
-       .method static public int32 test_0_ldelema_type_check () cil managed {
-               .maxstack 16
-               .locals init (object[] V_0,
-                                         object[,] V_1)
-
-               ldc.i4.1
-               newarr object
-               stloc.0
-
-               .try {
-                       ldloc.0
-                       ldc.i4.0
-                       ldelema object
-                       leave L1
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       leave ERROR1
-               }
-
-       L1:
-               ldc.i4.1
-               newarr string
-               stloc.0
-
-               .try {
-                       ldloc.0
-                       ldc.i4.0
-                       ldelema object
-                       leave ERROR2
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       leave L2
-               }
-
-       L2:
-                       ldc.i4.1
-               newarr string
-               stloc.0
-
-               .try {
-                       ldloc.0
-                       ldc.i4.0
-                       readonly. ldelema object
-                       leave L3
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       leave ERROR3
-               }
-
-       L3:
-               ldc.i4.0
-               ret
-
-
-       ERROR1:
-               ldc.i4.1
-               ret
-
-       ERROR2:
-               ldc.i4.2
-               ret
-
-       ERROR3:
-               ldc.i4.3
-               ret
-       }
-
-
-       //Bug 372410
-       .method static public int32 test_0_array_address_type_check () cil managed {
-               .maxstack 16
-               .locals init (object[] V_0,
-                                         object[,] V_1)
-
-               ldc.i4.1 
-           ldc.i4.1 
-           newobj instance void object[,]::.ctor(int32, int32)
-               stloc.1
-
-               .try {
-                       ldloc.1
-                       ldc.i4.0
-                       ldc.i4.0
-                       call instance object&  object[,]::Address(int32, int32)
-                       leave L4
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       leave ERROR4
-               }
-
-       L4:
-               ldc.i4.1 
-           ldc.i4.1 
-           newobj instance void string[,]::.ctor(int32, int32)
-               stloc.1
-
-               .try {
-                       ldloc.1
-                       ldc.i4.0
-                       ldc.i4.0
-                       call instance object&  object[,]::Address(int32, int32)
-                       leave ERROR5
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       leave L5
-               }
-
-       L5:
-               ldc.i4.1 
-           ldc.i4.1 
-           newobj instance void string[,]::.ctor(int32, int32)
-               stloc.1
-
-               .try {
-                       ldloc.1
-                       ldc.i4.0
-                       ldc.i4.0
-                       readonly. call instance object&  object[,]::Address(int32, int32)
-                       leave L6
-               } catch [mscorlib]System.ArrayTypeMismatchException {
-                       leave ERROR6
-               }
-
-       L6:
-               ldc.i4.0
-               ret
-       ERROR4:
-               ldc.i4.4
-               ret
-
-       ERROR5:
-               ldc.i4.5
-               ret
-
-       ERROR6:
-               ldc.i4.6
-               ret
-       }
-
-       .field public  static unsigned int64 'ull'
-
-       .field public  static int32 'shift2'
-
-       .method public static int32 test_0_long_shift_regalloc () cil managed
-       {
-               .locals init (unsigned int32 'cilsimp.28', unsigned int64 'cilsimp.27', int32 'cilsimp.26')
-
-               .maxstack 4
-
-               ldc.i8  81985529234382576
-               stsfld  unsigned int64 Tests::ull
-           ldc.i4      60
-               stsfld  int32 Tests::shift2
-
-               ldsfld  unsigned int64 Tests::ull
-               stloc   'cilsimp.27'
-               ldsfld  int32 Tests::shift2
-               stloc   'cilsimp.28'
-               ldloc   'cilsimp.27'
-               ldloc   'cilsimp.28'
-               shr.un
-               ldloc   'cilsimp.27'
-               ldc.i4  64
-               ldloc   'cilsimp.28'
-               sub
-               shl
-               or
-               ldc.i8  1311768467750121216
-               ceq
-               ldc.i4.1
-               xor
-               conv.u4
-               ret
-       }
-
-       // Test calling ldfld directly on a vtype instead of a vtype address
-       .method public static int32 test_5_call_ldfld_vtype () cil managed
-       {
-               .maxstack 16
-               .locals init (
-                       valuetype Tests/TailCallStruct arg
-               )
-               ldloca 0
-               ldc.i4.2
-               stfld int32 Tests/TailCallStruct::a
-               ldloca 0
-               ldc.i4.4
-               stfld int32 Tests/TailCallStruct::b
-               ldloc.0
-               call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
-               ldfld int32 Tests/TailCallStruct::a
-               ret
-       }
-
-       .method public static int32 throw_ret () cil managed
-       {
-               ldstr "FOO"
-               newobj instance void class [mscorlib]System.OverflowException::.ctor(string)
-               throw
-               ldc.i4.4
-               ret
-       }
-
-       .method public static int32 throw2_ret () cil managed
-       {
-               // Disable inlining
-               ldc.i4.5
-               localloc
-               pop
-
-               call int32 Tests::throw_ret ()
-               ret
-       }
-
-       // Test inlining a method which contains just a throw
-       .method public static int32 test_0_inline_throw () cil managed
-       {
-               .maxstack 16
-               .locals init (
-                               int32 v_0
-               )
-
-               .try {
-                       call int32 Tests::throw2_ret ()
-                       stloc.0
-                       leave L0
-               } catch [mscorlib]System.OverflowException {
-                       pop
-                       leave L1
-               }
-
-               L0:
-                       ldc.i4.1
-                       ret
-               L1:
-                       ldc.i4.0
-                       ret                     
-       }
-
-    .method public static int32 test_0_stelem_any_null_opt () cil managed
-    {
-               .maxstack 16
-               .locals init (
-                               object[]        V_0,
-                               int32   V_1)
-
-               ldc.i4.s 10
-               newarr [mscorlib]System.Object
-               stloc.0
-
-               ldc.i4.0
-               stloc.1
-               br L0
-
-       L1:
-               ldloc.0
-               ldloc.1
-               ldnull
-               stelem.any [mscorlib]System.Object
-               ldloc.1
-               ldc.i4.1
-               add
-               stloc.1
-       L0:
-               ldloc.1
-               ldc.i4.s 10
-               blt L1
-
-               ldc.i4.0
-               ret
-       }
-
-    // method line 2
-    .method public static  hidebysig 
-           default int32 manyargs_callee (int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h, int32 i, int32 j, int32 k, int32 l, int32 m, int32 n, int32 o, int32 p)  cil managed 
-    {
-        // Method begins at RVA 0x20f4
-       // Code size 44 (0x2c)
-       .maxstack 8
-       IL_0000:  ldarg.0 
-       IL_0001:  ldarg.1 
-       IL_0002:  add 
-       IL_0003:  ldarg.2 
-       IL_0004:  add 
-       IL_0005:  ldarg.3 
-       IL_0006:  add 
-       IL_0007:  ldarg.s 4
-       IL_0009:  add 
-       IL_000a:  ldarg.s 5
-       IL_000c:  add 
-       IL_000d:  ldarg.s 6
-       IL_000f:  add 
-       IL_0010:  ldarg.s 7
-       IL_0012:  add 
-       IL_0013:  ldarg.s 8
-       IL_0015:  add 
-       IL_0016:  ldarg.s 9
-       IL_0018:  add 
-       IL_0019:  ldarg.s 10
-       IL_001b:  add 
-       IL_001c:  ldarg.s 11
-       IL_001e:  add 
-       IL_001f:  ldarg.s 12
-       IL_0021:  add 
-       IL_0022:  ldarg.s 13
-       IL_0024:  add 
-       IL_0025:  ldarg.s 14
-       IL_0027:  add 
-       IL_0028:  ldarg.s 15
-       IL_002a:  add 
-       IL_002b:  ret 
-    } // end of method main::callee
-
-    // method line 3
-    .method public static  hidebysig 
-           default int32 manyargs_tail_caller (int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h, int32 i, int32 j, int32 k, int32 l, int32 m, int32 n, int32 o, int32 p)  cil managed 
-    {
-        // Method begins at RVA 0x2124
-       // Code size 34 (0x22)
-       .maxstack 17
-       IL_0000:  ldarg.0 
-                         ldc.i4.1
-                         add
-       IL_0001:  ldarg.1 
-       IL_0002:  ldarg.2 
-       IL_0003:  ldarg.3 
-       IL_0004:  ldarg.s 4
-       IL_0006:  ldarg.s 5
-       IL_0008:  ldarg.s 6
-       IL_000a:  ldarg.s 7
-       IL_000c:  ldarg.s 8
-       IL_000e:  ldarg.s 9
-       IL_0010:  ldarg.s 10
-       IL_0012:  ldarg.s 11
-       IL_0014:  ldarg.s 12
-       IL_0016:  ldarg.s 13
-       IL_0018:  ldarg.s 14
-                         ldc.i4.1
-                         add
-       IL_001a:  ldarg.s 15
-                         ldc.i4.1
-                         add
-                 tail.
-       IL_001c:  call int32 class Tests::manyargs_callee(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
-       IL_0021:  ret 
-    } // end of method main::caller
-
-    // method line 4
-    .method public static  hidebysig 
-           default int32 test_139_many_args_tail_call ()  cil managed
-    {
-               // Some platforms might not be able to AOT tail calls
-               .custom instance void class [TestDriver]CategoryAttribute::'.ctor'(string) =  (01 00 08 21 46 55 4C 4C 41 4F 54 00 00 ) // ...!FULLAOT..
-
-        // Method begins at RVA 0x2154
-       // Code size 43 (0x2b)
-       .maxstack 17
-       IL_0000:  ldc.i4.1 
-       IL_0001:  ldc.i4.2 
-       IL_0002:  ldc.i4.3 
-       IL_0003:  ldc.i4.4 
-       IL_0004:  ldc.i4.5 
-       IL_0005:  ldc.i4.6 
-       IL_0006:  ldc.i4.7 
-       IL_0007:  ldc.i4.8 
-       IL_0008:  ldc.i4.s 0x09
-       IL_000a:  ldc.i4.s 0x0a
-       IL_000c:  ldc.i4.s 0x0b
-       IL_000e:  ldc.i4.s 0x0c
-       IL_0010:  ldc.i4.s 0x0d
-       IL_0012:  ldc.i4.s 0x0e
-       IL_0014:  ldc.i4.s 0x0f
-       IL_0016:  ldc.i4.s 0x10
-       IL_0018:  call int32 class Tests::manyargs_tail_caller(int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32, int32)
-       IL_0028:  ret 
-    } // end of method main::Main
-
-       .class nested private auto ansi beforefieldinit R1
-          extends [mscorlib]System.MarshalByRefObject
-       {
-               .field  public  int32 test_field
-
-       .method public hidebysig  specialname  rtspecialname
-                       instance default void '.ctor' ()  cil managed
-       {
-                       ret
-               }
-       }
-
-       .method public static hidebysig
-                       default int32 return_0 () cil managed
-       {
-               ldc.i4.0
-               ret
-       }
-
-       .method public static hidebysig
-                       default int32 test_1_volatile_marshalbyref_bug_432673 () cil managed
-       {
-               .locals init (
-                       class Tests/R1 v_0
-               )
-
-               newobj instance void class Tests/R1::.ctor ()
-               stloc.0
-               ldloc.0
-               ldc.i4.0
-               volatile.
-               stfld int32 Tests/R1::test_field
-               call int32 class Tests::return_0 ()
-               ldc.i4.1
-               add
-               ret
-       }
-
-       .method public static default int32 return_2 () cil managed
-       {
-               // Prevent inlining
-               ldc.i4.s 16
-        localloc
-               pop
-               ldc.i4.s 2
-               ret
-       }
-
-       .method public static hidebysig
-                       default int32 test_1_cmov_opt_regress_463357 () cil managed
-       {
-               call int32 class Tests::return_2 ()
-               ldc.i4.0
-               ceq
-               brfalse L1
-               ldc.i4.0
-               ret
-               br L2
-       L1: nop
-       L2: nop
-               ldc.i4.1
-               ret
-       }
-
-   .method public static hidebysig default int32 cmov_opt_regress_474718_inner (int32 A_1)  cil managed 
-   {
-      .maxstack 3
-      .locals init (int32 V_0, bool V_1, bool V_2)
-      
-         ldc.i4.0
-      IL_000b:  stloc.1 
-      IL_000d:  br IL_002f
-
-         ldc.i4.1    
-         stloc.2
-      IL_001e:  ldloc.2 
-      IL_001f:  brfalse IL_0036
-
-      IL_0024:  
-      IL_002a:  br IL_0041
-    
-      IL_002f:  ldloc.1
-      IL_0030:  stloc.2 
-      IL_0031:  br IL_001e
-    
-      IL_0036:  ldc.i4 0
-      IL_003b:  stloc.0 
-      IL_003c:  br IL_0041
-    
-      IL_0041:  ldloc.0 
-      IL_0042:  ret 
-  } 
-
-    .method public static default int32 test_0_cmov_opt_regress_474718 ()  cil managed 
-    {
-        .maxstack 16
-        ldc.i4.1
-        call int32 Tests::cmov_opt_regress_474718_inner (int32)
-        ret
-   }
-
-       .method public static default int32 test_5_createarr_newobj () cil managed
-       {
-               .maxstack 16
-
-               ldc.i4 5
-               newobj void char[]::.ctor(int32)
-               ldlen
-               ret
-       }
-
-       .method public static default int32 test_0_initblk_3_regress_481458 () cil managed
-       {
-               .maxstack 16
-               .locals init (native int)
-
-               ldc.i4.s 10
-               localloc
-               stloc.0
-
-               // Set the first value to 3
-               ldloc.0
-               ldc.i4.0
-               add             //addr
-               ldc.i4.3        //value
-               stind.i1
-
-               // Zero out the first 3 values
-               ldloc.0         //addr
-               ldc.i4.0        //value
-               ldc.i4.s 3      //size
-               initblk
-
-               // Load the first value
-               ldloc.0
-               ldc.i4.0
-               add     
-               ldind.u1
-               conv.i4
-               ret
-       }
-
-       .method public static float32 GetFloat32() cil managed noinlining
-       {
-               .maxstack  8
-               ldc.r8     0.19975845134874831
-               ret
-       }
-
-/*        Disabled until they can be fixed to run on amd64
-       .method public static default int32 test_0_implicit_float_to_double_conversion () cil managed
-       {
-               .maxstack 16
-
-               call float32 Tests::GetFloat32()
-               ldc.r8     0.19975845134874831
-               beq OK
-
-               ldc.i4.1
-               ret
-OK:
-               ldc.i4.0
-               ret
-       }
-*/
-
-       .method public static default int32 test_0_long_to_r8_un_overflow () cil managed
-       {
-               .maxstack 16
-               ldc.i8     0x00FFFFFFFFFFFFFF
-               conv.r.un
-               conv.i8
-               ldc.i8 0x100000000000000
-               beq OK_1
-
-               ldc.i4.1
-               ret
-OK_1:
-               ldc.i8     0x00FFFFFFFFFFFFFF
-               conv.r.un
-               conv.r8
-               conv.i8
-               ldc.i8 0x100000000000000
-               beq OK_2
-
-               ldc.i4.2
-               ret
-OK_2:
-               ldc.i4.0
-               ret
-       }
-
-       .field public static int32 shift1
-
-       .method public static int32 regress_497271_helper (int32 i) cil managed
-       {
-               ldarg.0
-               ret
-       }
-
-       .method public static int32 test_0_regalloc_regress_497271 () cil managed
-       {
-               .locals init (int32 var)
-
-               ldc.i4  4
-               stsfld  int32 Tests::shift1
-               ldsfld  int32 Tests::shift1
-               stloc   var
-               ldc.i4  4660
-               ldloc   var
-               shr.un
-               ldc.i4  4660
-               ldc.i4  32
-               ldloc   var
-               sub
-               shl
-               or
-               ldc.i4  1073742115
-               beq     ?L10
-?L9:
-               ldc.i4  1
-               call    int32 Tests::regress_497271_helper (int32)
-               ret
-?L10:
-               ldc.i4  0
-               call    int32 Tests::regress_497271_helper (int32)
-               ret
-       }
-
-   .field  private static  int32 Value
-
-  .method public static hidebysig  specialname 
-          default int32 regress_513931_inner ()  cil managed 
-    {                                                                 
-        // Method begins at RVA 0x225c                                
-        // Code size 52 (0x34)                                        
-        .maxstack 2                                                   
-        .locals init (                                                
-                int32   V_0,                                          
-                int32   V_1,                                          
-                bool    V_2)
-                       
-                               ldc.i4 999
-                               stsfld int32 Tests::Value
-
-        IL_0000:  nop                                                 
-        IL_0001:  ldsfld int32 Tests::Value      
-        IL_0006:  stloc.0                                             
-        IL_0007:  ldloc.0                                             
-        IL_0008:  ldc.i4.0                                            
-        IL_0009:  cgt                                                 
-        IL_000b:  ldc.i4.0                                            
-        IL_000c:  ceq                                                 
-        IL_000e:  stloc.2                                             
-        IL_000f:  ldloc.2                                             
-        IL_0010:  brtrue.s IL_0027                                    
-
-        IL_0012:  nop 
-        IL_0013:  ldloc.0 
-        IL_0014:  ldc.i4.s 0x7b
-        IL_0016:  ceq          
-        IL_0018:  ldc.i4.0     
-        IL_0019:  ceq          
-        IL_001b:  stloc.2      
-        IL_001c:  ldloc.2      
-        IL_001d:  brtrue.s IL_0023
-
-        IL_001f:  ldc.i4.m1 
-        IL_0020:  stloc.1   
-        IL_0021:  br.s IL_0032
-
-        IL_0023:  ldc.i4.1 
-        IL_0024:  stloc.1  
-        IL_0025:  br.s IL_0032
-
-        IL_0027:  
-        IL_002c:  newobj instance void class [mscorlib]System.Exception::'.ctor'()
-        IL_0031:  throw                                                                            
-        IL_0032:  ldloc.1                                                                          
-        IL_0033:  ret                                                                              
-    }
-
-       .method public static hidebysig  specialname 
-         default int32 test_0_regress_513931 ()  cil managed 
-       {
-               call int32 Tests::regress_513931_inner ()
-               pop
-               ldc.i4.0
-               ret
-       }
-
-       .method public static default int32 test_0_newarr_i8 () cil managed
-       {
-               ldc.i4 1000
-               conv.i8
-               newarr [mscorlib]System.Boolean
-               pop
-               ldc.i4 0
-               ret
-       }
-
-       .method public static specialname 
-              default int32 return_1_noinline ()  cil managed noinlining 
-       {
-               .maxstack 0
-
-               ldc.i4.1
-               ret 
-       }
-
-       // Only happens with -O=-deadce,cmov
-       .method public static default int32 test_0_cmov_unused_582322 () cil managed
-       {
-        .maxstack 2                                                   
-        .locals init (                                                
-                               int32 V_0
-               )                               
-               call int32 Tests::return_1_noinline ()
-               ldc.i4.1
-               bne.un L0
-               ldloc.s 0
-               pop
-       L0:
-               ldc.i4.0
-               ret
-       }
-
-    .method public static  hidebysig 
-           default int32 test_0_regress_586664 ()  cil managed 
-    {                                        
-        // Method begins at RVA 0x20f4       
-        // Code size 76 (0x4c)               
-        .maxstack 6                          
-        .locals init (                       
-                float64 V_0,                 
-                float64[]       V_1)         
-        IL_0000:  ldc.r8 1.                  
-        IL_0009:  ldc.r8 2.                  
-        IL_0012:  ldc.r8 1.                  
-        IL_001b:  call float64 class [mscorlib]System.Math::Pow(float64, float64)
-        IL_0020:  div                                                            
-        IL_0021:  stloc.0                                                        
-        IL_0022:  ldc.i4.2                                                       
-        IL_0023:  newarr [mscorlib]System.Double                                 
-        IL_0028:  dup                                                            
-        IL_0029:  ldc.i4.0                                                       
-        IL_002a:  ldloc.0                                                        
-        IL_002b:  neg                                                            
-        IL_002c:  stelem.r8                                                      
-        IL_002d:  dup                                                            
-        IL_002e:  ldc.i4.1                                                       
-        IL_002f:  ldloc.0
-        IL_0030:  neg
-        IL_0031:  stelem.r8
-        IL_0032:  stloc.1
-        IL_0033:  ldloc.1
-        IL_0034:  ldc.i4.0
-        IL_0035:  ldelem.r8
-        IL_0036:  ldc.r8 -0.5
-        IL_003f:  bne.un IL_004a
-
-        IL_0044:  ldc.i4.0
-        IL_0045:  br IL_004b
-
-        IL_004a:  ldc.i4.1
-        IL_004b:  ret
-    }
-
-       .method public static int32 test_2_leave_multiple_blocks_from_end ()
-       {
-               .locals init (int32 V_0)
-
-               .try {
-                       .try {
-                               nop
-                               nop
-                               leave END
-                       } finally {
-                               ldloc.0
-                               ldc.i4.1
-                               add
-                               stloc.0
-                               endfinally
-                       }
-                       nop
-                       leave END
-               } finally {
-                       ldloc.0
-                       ldc.i4.1
-                       add
-                       stloc.0
-                       endfinally
-               }
-END:
-               ldloc.0
-               ret
-       }
-
-       .method public static int32 test_3_leave_multiple_blocks_from_hole ()
-       {
-               .locals init (int32 V_0)
-
-               .try {
-                       .try {
-                               ldloc.0
-                               brtrue REST
-                               leave BEFORE_END
-REST:
-                               nop
-                               nop
-                               leave END
-                       } finally {
-                               ldloc.0
-                               ldc.i4.1
-                               add
-                               stloc.0
-                               endfinally
-                       }
-                       nop
-                       leave END
-               } finally {
-                       ldloc.0
-                       ldc.i4.1
-                       add
-                       stloc.0
-                       endfinally
-               }
-BEFORE_END:
-               ldloc.0
-               ldc.i4.1
-               add
-               stloc.0
-END:
-               ldloc.0
-               ret
-       }
-
-       .class nested private auto ansi sealed beforefieldinit Pair`2<TKey,TValue>
-                  extends [mscorlib]System.ValueType
-       {
-               .field  public  !0 key
-       .field  public  !1 'value'
-       }
-
-    .method private static hidebysig 
-           default bool ContentEquals<TKey,TValue> (valuetype Tests/Pair`2<!!TKey, !!TValue> v)  cil managed 
-    {
-       .maxstack 8
-       IL_0000:  ldarga.s 0 
-       IL_0006:  ldnull 
-                         constrained. valuetype Tests/Pair`2<!!0,!!1>
-       IL_0007:  callvirt instance bool class [mscorlib]System.Object::Equals(object)
-                         ret
-    }
-
-    .method public static hidebysig default int32 test_0_constrained_gshared_595863 () cil managed
-    {
-               .locals init (
-               valuetype Tests/Pair`2<string, string>  V_0,
-               valuetype Tests/Pair`2<string, string>  V_1)
-       IL_0000:  ldloca.s 0
-       IL_0002:  initobj valuetype Tests/Pair`2<string,string>
-       IL_0008:  ldloc.0 
-       IL_0009:  stloc.1 
-       IL_000a:  ldloca.s 1
-       IL_000c:  ldstr "A"
-       IL_0011:  stfld !0 valuetype Tests/Pair`2<string,string>::key
-       IL_0016:  ldloca.s 1
-       IL_0018:  ldstr "B"
-       IL_001d:  stfld !1 valuetype Tests/Pair`2<string,string>::'value'
-       IL_0022:  ldloc.1 
-       IL_0023:  stloc.0 
-       IL_0024:  ldloc.0 
-       IL_0025:  call bool class Tests::ContentEquals<string, string> (valuetype Tests/Pair`2<!!0,!!1>)
-                         brfalse SUCCESS
-                         ldc.i4.1
-                         ret
-       SUCCESS:
-                         ldc.i4.0
-                         ret
-    }
-
-       .method public static default int32 test_0_wrap_non_exception_throws () cil managed
-       {
-         .try {
-                   newobj instance void class [mscorlib]System.Object::'.ctor'()
-                       throw
-                 leave IL_0
-         } catch class [mscorlib]System.Runtime.CompilerServices.RuntimeWrappedException {
-                 leave IL_0
-               }
-               IL_0:
-               ldc.i4.0
-               ret
-    }
-
-       .method public static default int32 test_0_typespec_modopt () cil managed {
-               ldtoken class Tests modopt (Tests)
-               pop
-               ldc.i4.0
-               ret
-       }
-
-       .method public hidebysig static int32 SizeOfT<T>() cil managed
-       {
-               .maxstack  8
-    
-               sizeof !!0
-       ret
-       }
-
-       .method public static default int32 test_1_sizeof_gshared () cil managed {
-           call   int32 Tests::SizeOfT<int8>()
-               ldc.i4.1
-               ceq
-               ret
-       }
-
-       .method public static default int32 test_1_sizeof_ref () cil managed {
-           call   int32 Tests::SizeOfT<object>()
-               sizeof [mscorlib]System.IntPtr
-               ceq
-               ret
-       }
-
-  .field static public int32 volatile_int
-
-       .method public static default int32 test_5_volatile_load_store () cil managed {
-               ldsflda int32 class Tests::volatile_int
-               ldc.i4 5
-               volatile.
-               stind.i4
-               ldsflda int32 class Tests::volatile_int
-               volatile.
-               ldind.i4
-               ret
-       }               
-
-    .method public static 
-           default int32 regress_693905_inner (int32 x, int32 acc)  cil managed 
-    {
-        // Method begins at RVA 0x2050
-        // Code size 17 (0x11)
-        .maxstack 5
-        IL_0000:  ldarg.0 
-        IL_0001:  brtrue.s IL_0005
-
-        IL_0003:  ldarg.1 
-        IL_0004:  ret 
-        IL_0005:  ldarg.0 
-        IL_0006:  ldc.i4.1 
-        IL_0007:  sub 
-        IL_0008:  ldarg.1 
-        IL_0009:  ldc.i4.1 
-        IL_000a:  add 
-        IL_000b:  starg.s 1
-        IL_000d:  starg.s 0
-        IL_000f:  br.s IL_0000
-
-    } // end of method Test::f
-
-    .method public static 
-           default int32 test_10_regress_693905 ()  cil managed 
-       {
-               ldc.i4.s 0x0a
-        ldc.i4.0 
-        call int32 class Tests::regress_693905_inner(int32, int32)
-               ret
-       }
-
-       .method public static
-                       default int32 test_0_llvm_regress_171 () cil managed
-       {
-               .locals init (
-                       int32 i
-               )
-
-               call int32 Tests::return_1_noinline ()
-               ldc.i4.1
-               beq L1
-               ldc.i4.1
-               stloc.s 0
-               call int32 Tests::return_1_noinline ()
-               ldc.i4.0
-               beq L1
-               L1:
-               ldloc.s 0
-               ret
-       }
-
-     .field  public static int32 static_a
-
-       .method public static
-                       default int32 test_4_ldfld_stfld_static () cil managed
-       {
-               ldnull
-               ldc.i4 2
-               stfld int32 Tests::static_a
-               ldnull
-               ldfld int32 Tests::static_a
-               ldnull
-               ldflda int32 Tests::static_a
-               ldind.i4
-               add
-               ret
-       }
-
-  .method public static default int32 no_initlocals_inner () cil managed
-  {
-    .locals (
-       int32 V_0,
-       float32 V_1,
-       float64 V_2,
-       valuetype Tests/TailCallStruct V_3)
-       ldloc V_0
-       ret
-  }
-
-  .method public static default int32 test_0_no_initlocals () cil managed
-  {
-       call int32 Tests::no_initlocals_inner()
-       pop
-          ldc.i4.0
-       ret
-  }
-
-  .method public hidebysig static int32  test_5_r4_fadd_mixed() cil managed
-  {
-    // Code size       17 (0x11)
-    .maxstack  2
-    .locals init (float32 V_0,
-             float64 V_1)
-    IL_0000:  ldc.r4     3
-    IL_0005:  stloc.0
-    IL_0006:  ldc.r8     2
-    IL_000b:  stloc.1
-    IL_000c:  ldloc.0
-    IL_000d:  ldloc.1
-    IL_000e:  add
-    IL_000f:  conv.i4
-    IL_0010:  ret
-  }
-
- .method public hidebysig static int32  test_0_fcmp_eq_r4_mixed() cil managed
-  {
-    // Code size       32 (0x20)
-    .maxstack  2
-    .locals init (float32 V_0,
-             float64 V_1)
-    IL_0000:  ldc.r4     1
-    IL_0005:  stloc.0
-    IL_0006:  ldc.r8     1
-    IL_000f:  stloc.1
-    IL_0010:  ldloc.0
-    IL_0012:  ldloc.1
-    IL_0013:  bne.un     IL_001e
-
-    IL_0018:  ldc.i4.0
-    IL_0019:  br         IL_001f
-
-    IL_001e:  ldc.i4.1
-    IL_001f:  ret
-  } // end of method Tests::test_0_fcmp_eq_r4_mixed
-
-  .method public hidebysig static int32  test_0_fceq_r4_mixed() cil managed
-  {
-    // Code size       31 (0x1f)
-    .maxstack  2
-    .locals init (float32 V_0,
-             float64 V_1,
-             bool V_2)
-    IL_0000:  ldc.r4     1
-    IL_0005:  stloc.0
-    IL_0006:  ldc.r8     1
-    IL_000b:  stloc.1
-    IL_000c:  ldloc.0
-    IL_000d:  ldloc.1
-    IL_000e:  ceq
-    IL_0010:  stloc.2
-    IL_0011:  ldloc.2
-    IL_0012:  brfalse    IL_001d
-
-    IL_0017:  ldc.i4.0
-    IL_0018:  br         IL_001e
-
-    IL_001d:  ldc.i4.1
-    IL_001e:  ret
-  } // end of method Tests::test_0_fceq_r4
-
-  .method public static int32 test_0_switch_loop () cil managed
-  {
-       .maxstack 16
-       .locals init (valuetype Tests/TailCallStruct V_0, int32 V_1)
-       ldc.i4.0
-       ldloc.0
-       ldloc.1
-       brtrue L_1
-       L_0:
-       ldc.i4.4
-       switch (L_0)
-       L_1:
-       pop
-       ret
-  }
-}
index 3cec2ff80da48fc91f4bc0255d73135eec27fbda..a5875f98883e3c60efd8990ff335712cdf425bbf 100644 (file)
@@ -1329,7 +1329,7 @@ mono_fill_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, int index)
  *   Return the executable code for the iface method IMT_METHOD called on THIS.
  */
 gpointer
-mono_resolve_iface_call (MonoObject *this, int imt_slot, MonoMethod *imt_method, gpointer *out_rgctx_arg)
+mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_rgctx_arg)
 {
        MonoVTable *vt;
        gpointer *imt, *vtable_slot;
@@ -1339,11 +1339,11 @@ mono_resolve_iface_call (MonoObject *this, int imt_slot, MonoMethod *imt_method,
 
        // FIXME: Optimize this
 
-       if (!this)
+       if (!this_obj)
                /* The caller will handle it */
                return NULL;
 
-       vt = this->vtable;
+       vt = this_obj->vtable;
        imt = (gpointer*)vt - MONO_IMT_SIZE;
 
        vtable_slot = mini_resolve_imt_method (vt, imt + imt_slot, imt_method, &impl_method, &aot_addr, &need_rgctx_tramp, &variant_iface);
@@ -1415,10 +1415,10 @@ is_generic_method_definition (MonoMethod *m)
 /*
  * mono_resolve_vcall:
  *
- *   Return the executable code for calling this->vtable [slot].
+ *   Return the executable code for calling this_obj->vtable [slot].
  */
 gpointer
-mono_resolve_vcall (MonoObject *this, int slot, MonoMethod *imt_method)
+mono_resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method)
 {
        MonoVTable *vt;
        MonoMethod *m, *generic_virtual = NULL;
@@ -1428,11 +1428,11 @@ mono_resolve_vcall (MonoObject *this, int slot, MonoMethod *imt_method)
 
        // FIXME: Optimize this
 
-       if (!this)
+       if (!this_obj)
                /* The caller will handle it */
                return NULL;
 
-       vt = this->vtable;
+       vt = this_obj->vtable;
 
        vtable_slot = &(vt->vtable [slot]);
 
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 29943e669299e8b6716b5a3d0682f0888d043bf0..fdbe5272fc8a0e6f17c24a6ab66fc41764ba0dd5 100644 (file)
@@ -50,7 +50,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/mono-debug-debugger.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/security-manager.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/security-core-clr.h>
@@ -69,6 +69,7 @@
 #include "jit.h"
 #include "debugger-agent.h"
 #include "seq-points.h"
+#include "aot-compiler.h"
 
 #define BRANCH_COST 10
 #define INLINE_LENGTH_LIMIT 20
@@ -1528,6 +1529,26 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count)
        }
 }
 
+static MonoInst*
+emit_runtime_constant (MonoCompile *cfg, MonoJumpInfoType patch_type, gpointer data)
+{
+       MonoInst *ins;
+
+       if (cfg->compile_aot) {
+               EMIT_NEW_AOTCONST (cfg, ins, patch_type, data);
+       } else {
+               MonoJumpInfo ji;
+               gpointer target;
+
+               ji.type = patch_type;
+               ji.data.target = data;
+               target = mono_resolve_patch_target (NULL, cfg->domain, NULL, &ji, FALSE);
+
+               EMIT_NEW_PCONST (cfg, ins, target);
+       }
+       return ins;
+}
+
 static void
 mini_emit_interface_bitmap_check (MonoCompile *cfg, int intf_bit_reg, int base_reg, int offset, MonoClass *klass)
 {
@@ -1538,10 +1559,7 @@ mini_emit_interface_bitmap_check (MonoCompile *cfg, int intf_bit_reg, int base_r
        NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, ibitmap_reg, base_reg, offset);
        MONO_ADD_INS (cfg->cbb, ins);
        args [0] = ins;
-       if (cfg->compile_aot)
-               EMIT_NEW_AOTCONST (cfg, args [1], MONO_PATCH_INFO_IID, klass);
-       else
-               EMIT_NEW_ICONST (cfg, args [1], klass->interface_id);
+       args [1] = emit_runtime_constant (cfg, MONO_PATCH_INFO_IID, klass);
        res = mono_emit_jit_icall (cfg, mono_class_interface_match, args);
        MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, intf_bit_reg, res->dreg);
 #else
@@ -1704,12 +1722,9 @@ mini_emit_class_check_inst (MonoCompile *cfg, int klass_reg, MonoClass *klass, M
 {
        if (klass_inst) {
                MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, klass_reg, klass_inst->dreg);
-       } else if (cfg->compile_aot) {
-               int const_reg = alloc_preg (cfg);
-               MONO_EMIT_NEW_CLASSCONST (cfg, const_reg, klass);
-               MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, klass_reg, const_reg);
        } else {
-               MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, klass_reg, klass);
+               MonoInst *ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_CLASS, klass);
+               MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, klass_reg, ins->dreg);
        }
        MONO_EMIT_NEW_COND_EXC (cfg, NE_UN, "InvalidCastException");
 }
@@ -2429,18 +2444,12 @@ emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoMethod *method, Mon
        int method_reg;
 
        if (COMPILE_LLVM (cfg)) {
-               method_reg = alloc_preg (cfg);
-
                if (imt_arg) {
+                       method_reg = alloc_preg (cfg);
                        MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, method_reg, imt_arg->dreg);
-               } else if (cfg->compile_aot) {
-                       MONO_EMIT_NEW_AOTCONST (cfg, method_reg, method, MONO_PATCH_INFO_METHODCONST);
                } else {
-                       MonoInst *ins;
-                       MONO_INST_NEW (cfg, ins, OP_PCONST);
-                       ins->inst_p0 = method;
-                       ins->dreg = method_reg;
-                       MONO_ADD_INS (cfg->cbb, ins);
+                       MonoInst *ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_METHODCONST, method);
+                       method_reg = ins->dreg;
                }
 
 #ifdef ENABLE_LLVM
@@ -2450,18 +2459,12 @@ emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoMethod *method, Mon
                return;
        }
 
-       method_reg = alloc_preg (cfg);
-
        if (imt_arg) {
+               method_reg = alloc_preg (cfg);
                MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, method_reg, imt_arg->dreg);
-       } else if (cfg->compile_aot) {
-               MONO_EMIT_NEW_AOTCONST (cfg, method_reg, method, MONO_PATCH_INFO_METHODCONST);
        } else {
-               MonoInst *ins;
-               MONO_INST_NEW (cfg, ins, OP_PCONST);
-               ins->inst_p0 = method;
-               ins->dreg = method_reg;
-               MONO_ADD_INS (cfg->cbb, ins);
+               MonoInst *ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_METHODCONST, method);
+               method_reg = ins->dreg;
        }
 
        mono_call_inst_add_outarg_reg (cfg, call, method_reg, MONO_ARCH_IMT_REG, FALSE);
@@ -3159,7 +3162,7 @@ emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value)
                MONO_ADD_INS (cfg->cbb, wbarrier);
        } else if (card_table && !cfg->compile_aot && !mono_gc_card_table_nursery_check ()) {
                int offset_reg = alloc_preg (cfg);
-               int card_reg  = alloc_preg (cfg);
+               int card_reg;
                MonoInst *ins;
 
                MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHR_UN_IMM, offset_reg, ptr->dreg, card_table_shift_bits);
@@ -3169,14 +3172,8 @@ emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value)
                /*We can't use PADD_IMM since the cardtable might end up in high addresses and amd64 doesn't support
                 * IMM's larger than 32bits.
                 */
-               if (cfg->compile_aot) {
-                       MONO_EMIT_NEW_AOTCONST (cfg, card_reg, NULL, MONO_PATCH_INFO_GC_CARD_TABLE_ADDR);
-               } else {
-                       MONO_INST_NEW (cfg, ins, OP_PCONST);
-                       ins->inst_p0 = card_table;
-                       ins->dreg = card_reg;
-                       MONO_ADD_INS (cfg->cbb, ins);
-               }
+               ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_GC_CARD_TABLE_ADDR, NULL);
+               card_reg = ins->dreg;
 
                MONO_EMIT_NEW_BIALU (cfg, OP_PADD, offset_reg, offset_reg, card_reg);
                MONO_EMIT_NEW_STORE_MEMBASE_IMM (cfg, OP_STOREI1_MEMBASE_IMM, offset_reg, 0, 1);
@@ -3330,12 +3327,9 @@ mini_emit_stobj (MonoCompile *cfg, MonoInst *dest, MonoInst *src, MonoClass *kla
                        } else if (context_used) {
                                iargs [2] = emit_get_rgctx_klass (cfg, context_used, klass, MONO_RGCTX_INFO_KLASS);
                        }  else {
-                               if (cfg->compile_aot) {
-                                       EMIT_NEW_CLASSCONST (cfg, iargs [2], klass);
-                               } else {
-                                       EMIT_NEW_PCONST (cfg, iargs [2], klass);
+                               iargs [2] = emit_runtime_constant (cfg, MONO_PATCH_INFO_CLASS, klass);
+                               if (!cfg->compile_aot)
                                        mono_class_compute_gc_descriptor (klass);
-                               }
                        }
 
                        if (size_ins)
@@ -3935,14 +3929,11 @@ mini_emit_check_array_type (MonoCompile *cfg, MonoInst *obj, MonoClass *array_cl
 
        if (cfg->opt & MONO_OPT_SHARED) {
                int class_reg = alloc_preg (cfg);
+               MonoInst *ins;
+
                MONO_EMIT_NEW_LOAD_MEMBASE (cfg, class_reg, vtable_reg, MONO_STRUCT_OFFSET (MonoVTable, klass));
-               if (cfg->compile_aot) {
-                       int klass_reg = alloc_preg (cfg);
-                       MONO_EMIT_NEW_CLASSCONST (cfg, klass_reg, array_class);
-                       MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, class_reg, klass_reg);
-               } else {
-                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, class_reg, array_class);
-               }
+               ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_CLASS, array_class);
+               MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, class_reg, ins->dreg);
        } else if (context_used) {
                MonoInst *vtable_ins;
 
@@ -4443,12 +4434,8 @@ emit_castclass_with_cache_nonshared (MonoCompile *cfg, MonoInst *obj, MonoClass
        EMIT_NEW_CLASSCONST (cfg, args [1], klass);
 
        /* inline cache*/
-       if (cfg->compile_aot) {
-               idx = get_castclass_cache_idx (cfg);
-               EMIT_NEW_AOTCONST (cfg, args [2], MONO_PATCH_INFO_CASTCLASS_CACHE, GINT_TO_POINTER (idx));
-       } else {
-               EMIT_NEW_PCONST (cfg, args [2], mono_domain_alloc0 (cfg->domain, sizeof (gpointer)));
-       }
+       idx = get_castclass_cache_idx (cfg);
+       args [2] = emit_runtime_constant (cfg, MONO_PATCH_INFO_CASTCLASS_CACHE, GINT_TO_POINTER (idx));
 
        /*The wrapper doesn't inline well so the bloat of inlining doesn't pay off.*/
        return emit_castclass_with_cache (cfg, klass, args);
@@ -5035,10 +5022,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono
                        }
                        mono_domain_unlock (domain);
 
-                       if (cfg->compile_aot)
-                               EMIT_NEW_AOTCONST (cfg, code_slot_ins, MONO_PATCH_INFO_METHOD_CODE_SLOT, method);
-                       else
-                               EMIT_NEW_PCONST (cfg, code_slot_ins, code_slot);
+                       code_slot_ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_METHOD_CODE_SLOT, method);
                }
                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method_code), code_slot_ins->dreg);                
        }
@@ -5686,12 +5670,26 @@ static gboolean
 is_unsafe_mov_compatible (MonoCompile *cfg, MonoClass *param_klass, MonoClass *return_klass)
 {
        uint32_t align;
+       int param_size, return_size;
 
        param_klass = mono_class_from_mono_type (mini_get_underlying_type (&param_klass->byval_arg));
+       return_klass = mono_class_from_mono_type (mini_get_underlying_type (&return_klass->byval_arg));
+
+       if (cfg->verbose_level > 3)
+               printf ("[UNSAFE-MOV-INTRISIC] %s <- %s\n", return_klass->name, param_klass->name);
 
-       //Only allow for valuetypes
-       if (!param_klass->valuetype || !return_klass->valuetype)
+       //Don't allow mixing reference types with value types
+       if (param_klass->valuetype != return_klass->valuetype) {
+               if (cfg->verbose_level > 3)
+                       printf ("[UNSAFE-MOV-INTRISIC]\tone of the args is a valuetype and the other is not\n");
                return FALSE;
+       }
+
+       if (!param_klass->valuetype) {
+               if (cfg->verbose_level > 3)
+                       printf ("[UNSAFE-MOV-INTRISIC]\targs are reference types\n");
+               return TRUE;
+       }
 
        //That are blitable
        if (param_klass->has_references || return_klass->has_references)
@@ -5699,17 +5697,51 @@ is_unsafe_mov_compatible (MonoCompile *cfg, MonoClass *param_klass, MonoClass *r
 
        /* Avoid mixing structs and primitive types/enums, they need to be handled differently in the JIT */
        if ((MONO_TYPE_ISSTRUCT (&param_klass->byval_arg) && !MONO_TYPE_ISSTRUCT (&return_klass->byval_arg)) ||
-               (!MONO_TYPE_ISSTRUCT (&param_klass->byval_arg) && MONO_TYPE_ISSTRUCT (&return_klass->byval_arg)))
+               (!MONO_TYPE_ISSTRUCT (&param_klass->byval_arg) && MONO_TYPE_ISSTRUCT (&return_klass->byval_arg))) {
+                       if (cfg->verbose_level > 3)
+                               printf ("[UNSAFE-MOV-INTRISIC]\tmixing structs and scalars\n");
                return FALSE;
+       }
 
        if (param_klass->byval_arg.type == MONO_TYPE_R4 || param_klass->byval_arg.type == MONO_TYPE_R8 ||
-               return_klass->byval_arg.type == MONO_TYPE_R4 || return_klass->byval_arg.type == MONO_TYPE_R8)
+               return_klass->byval_arg.type == MONO_TYPE_R4 || return_klass->byval_arg.type == MONO_TYPE_R8) {
+               if (cfg->verbose_level > 3)
+                       printf ("[UNSAFE-MOV-INTRISIC]\tfloat or double are not supported\n");
                return FALSE;
+       }
+
+       param_size = mono_class_value_size (param_klass, &align);
+       return_size = mono_class_value_size (return_klass, &align);
 
-       //And have the same size
-       if (mono_class_value_size (param_klass, &align) != mono_class_value_size (return_klass, &align))
+       //We can do it if sizes match
+       if (param_size == return_size) {
+               if (cfg->verbose_level > 3)
+                       printf ("[UNSAFE-MOV-INTRISIC]\tsame size\n");
+               return TRUE;
+       }
+
+       //No simple way to handle struct if sizes don't match
+       if (MONO_TYPE_ISSTRUCT (&param_klass->byval_arg)) {
+               if (cfg->verbose_level > 3)
+                       printf ("[UNSAFE-MOV-INTRISIC]\tsize mismatch and type is a struct\n");
                return FALSE;
-       return TRUE;
+       }
+
+       /*
+        * Same reg size category.
+        * A quick note on why we don't require widening here.
+        * The intrinsic is "R Array.UnsafeMov<S,R> (S s)".
+        *
+        * Since the source value comes from a function argument, the JIT will already have
+        * the value in a VREG and performed any widening needed before (say, when loading from a field).
+        */
+       if (param_size <= 4 && return_size <= 4) {
+               if (cfg->verbose_level > 3)
+                       printf ("[UNSAFE-MOV-INTRISIC]\tsize mismatch but both are of the same reg class\n");
+               return TRUE;
+       }
+
+       return FALSE;
 }
 
 static MonoInst*
@@ -5718,7 +5750,7 @@ emit_array_unsafe_mov (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst **a
        MonoClass *param_klass = mono_class_from_mono_type (fsig->params [0]);
        MonoClass *return_klass = mono_class_from_mono_type (fsig->ret);
 
-       //Valuetypes that are semantically equivalent
+       //Valuetypes that are semantically equivalent or numbers than can be widened to
        if (is_unsafe_mov_compatible (cfg, param_klass, return_klass))
                return args [0];
 
@@ -10663,12 +10695,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                EMIT_NEW_CLASSCONST (cfg, args [1], klass);
 
                                /* inline cache*/
-                               if (cfg->compile_aot) {
-                                       idx = get_castclass_cache_idx (cfg);
-                                       EMIT_NEW_AOTCONST (cfg, args [2], MONO_PATCH_INFO_CASTCLASS_CACHE, GINT_TO_POINTER (idx));
-                               } else {
-                                       EMIT_NEW_PCONST (cfg, args [2], mono_domain_alloc0 (cfg->domain, sizeof (gpointer)));
-                               }
+                               idx = get_castclass_cache_idx (cfg);
+                               args [2] = emit_runtime_constant (cfg, MONO_PATCH_INFO_CASTCLASS_CACHE, GINT_TO_POINTER (idx));
 
                                *sp++ = mono_emit_method_call (cfg, mono_isinst, args, NULL);
                                ip += 5;
@@ -12141,43 +12169,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:
+                                               ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_GC_CARD_TABLE_ADDR, NULL);
+                                               break;
+                                       case CEE_MONO_LDPTR_NURSERY_START:
+                                               ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_GC_NURSERY_START, NULL);
+                                               break;
+                                       case CEE_MONO_LDPTR_NURSERY_BITS:
+                                               ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_GC_NURSERY_BITS, NULL);
+                                               break;
+                                       case CEE_MONO_LDPTR_INT_REQ_FLAG:
+                                               ins = emit_runtime_constant (cfg, MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG, NULL);
+                                               break;
+                               }
 
                                *sp++ = ins;
                                ip += 2;
index 77c45366fc0a9b65d37abeb9655a9a5b627911e1..1abbd14540854d1fcf16e946999897b98b0e684f 100644 (file)
@@ -26,7 +26,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-memory-model.h>
@@ -419,7 +419,7 @@ mono_arch_nacl_skip_nops (guint8* code)
 
 #endif /*__native_client_codegen__*/
 
-static inline void 
+static void
 amd64_patch (unsigned char* code, gpointer target)
 {
        guint8 rex = 0;
@@ -2281,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) {
index 86de1ff8b17787666df8acf02872025871c7bafa..25d2877a68068b7de8d6e1013583b5c9b964ce4f 100644 (file)
@@ -365,6 +365,11 @@ typedef struct {
 #define MONO_ARCH_HAVE_TLS_GET_REG 1
 #endif
 
+#if defined(TARGET_APPLETVOS)
+/* No signals */
+#define MONO_ARCH_NEED_DIV_CHECK 1
+#endif
+
 /* Used for optimization, not complete */
 #define MONO_ARCH_IS_OP_MEMBASE(opcode) ((opcode) == OP_X86_PUSH_MEMBASE)
 
index 08808151cdf2ed65939e3cc071ac233703ac3ba2..bdbd4ba488a2ca217879100b175af2ddc9c79b59 100644 (file)
@@ -147,8 +147,6 @@ static int vfp_scratch2 = ARM_VFP_D1;
 
 static int i8_align;
 
-static volatile int ss_trigger_var = 0;
-
 static gpointer single_step_tramp, breakpoint_tramp;
 
 /*
@@ -680,6 +678,7 @@ mono_arm_have_fast_tls (void)
 gboolean
 mono_arm_have_tls_get (void)
 {
+       return FALSE;
 #ifdef HAVE_FAST_TLS
        return TRUE;
 #else
@@ -919,7 +918,6 @@ mono_arch_init (void)
 
        mono_mutex_init_recursive (&mini_arch_mutex);
        if (mini_get_debug_options ()->soft_breakpoints) {
-               single_step_tramp = mini_get_single_step_trampoline ();
                breakpoint_tramp = mini_get_breakpoint_trampoline ();
        } else {
                ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
@@ -1636,7 +1634,10 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
                                        ainfo->reg = fpr;
                                        ainfo->nregs = nfields;
                                        ainfo->esize = esize;
-                                       fpr += nfields;
+                                       if (esize == 4)
+                                               fpr += nfields;
+                                       else
+                                               fpr += nfields * 2;
                                        break;
                                } else {
                                        fpr = ARM_VFP_F16;
@@ -1999,20 +2000,9 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                offset += size;
        }
 
-       if (cfg->arch.seq_point_read_var) {
+       if (cfg->arch.seq_point_ss_method_var) {
                MonoInst *ins;
 
-               ins = cfg->arch.seq_point_read_var;
-
-               size = 4;
-               align = 4;
-               offset += align - 1;
-               offset &= ~(align - 1);
-               ins->opcode = OP_REGOFFSET;
-               ins->inst_basereg = cfg->frame_reg;
-               ins->inst_offset = offset;
-               offset += size;
-
                ins = cfg->arch.seq_point_ss_method_var;
                size = 4;
                align = 4;
@@ -2203,9 +2193,7 @@ mono_arch_create_vars (MonoCompile *cfg)
 
        if (cfg->gen_sdb_seq_points) {
                if (cfg->soft_breakpoints) {
-                       MonoInst *ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
-                       ins->flags |= MONO_INST_VOLATILE;
-                       cfg->arch.seq_point_read_var = ins;
+                       MonoInst *ins;
 
                        ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
                        ins->flags |= MONO_INST_VOLATILE;
@@ -2305,7 +2293,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;
@@ -2641,7 +2629,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
 
                                call->float_args = g_slist_append_mempool (cfg->mempool, call->float_args, fad);
                        } else {
-                               add_outarg_reg (cfg, call, RegTypeFP, ainfo->reg + i, load);
+                               add_outarg_reg (cfg, call, RegTypeFP, ainfo->reg + (i * 2), load);
                        }
                }
                break;
@@ -4614,7 +4602,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        int i;
                        MonoInst *info_var = cfg->arch.seq_point_info_var;
                        MonoInst *ss_trigger_page_var = cfg->arch.ss_trigger_page_var;
-                       MonoInst *ss_read_var = cfg->arch.seq_point_read_var;
                        MonoInst *ss_method_var = cfg->arch.seq_point_ss_method_var;
                        MonoInst *bp_method_var = cfg->arch.seq_point_bp_method_var;
                        MonoInst *var;
@@ -4647,8 +4634,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 
                        if (ins->flags & MONO_INST_SINGLE_STEP_LOC) {
                                if (cfg->soft_breakpoints) {
-                                       /* Load the address of the sequence point trigger variable. */
-                                       var = ss_read_var;
+                                       /* Load the address of the sequence point method variable. */
+                                       var = ss_method_var;
                                        g_assert (var);
                                        g_assert (var->opcode == OP_REGOFFSET);
                                        g_assert (arm_is_imm12 (var->inst_offset));
@@ -4657,14 +4644,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                        /* Read the value and check whether it is non-zero. */
                                        ARM_LDR_IMM (code, dreg, dreg, 0);
                                        ARM_CMP_REG_IMM (code, dreg, 0, 0);
-
-                                       /* Load the address of the sequence point method. */
-                                       var = ss_method_var;
-                                       g_assert (var);
-                                       g_assert (var->opcode == OP_REGOFFSET);
-                                       g_assert (arm_is_imm12 (var->inst_offset));
-                                       ARM_LDR_IMM (code, dreg, var->inst_basereg, var->inst_offset);
-
                                        /* Call it conditionally. */
                                        ARM_BLX_REG_COND (code, ARMCOND_NE, dreg);
                                } else {
@@ -6585,15 +6564,12 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                }
        }
 
-       if (cfg->arch.seq_point_read_var) {
-               MonoInst *read_ins = cfg->arch.seq_point_read_var;
+       if (cfg->arch.seq_point_ss_method_var) {
                MonoInst *ss_method_ins = cfg->arch.seq_point_ss_method_var;
                MonoInst *bp_method_ins = cfg->arch.seq_point_bp_method_var;
 #ifdef USE_JUMP_TABLES
                gpointer *jte;
 #endif
-               g_assert (read_ins->opcode == OP_REGOFFSET);
-               g_assert (arm_is_imm12 (read_ins->inst_offset));
                g_assert (ss_method_ins->opcode == OP_REGOFFSET);
                g_assert (arm_is_imm12 (ss_method_ins->inst_offset));
                g_assert (bp_method_ins->opcode == OP_REGOFFSET);
@@ -6601,26 +6577,21 @@ mono_arch_emit_prolog (MonoCompile *cfg)
 
 #ifdef USE_JUMP_TABLES
                jte = mono_jumptable_add_entries (3);
-               jte [0] = (gpointer)&ss_trigger_var;
-               jte [1] = single_step_tramp;
-               jte [2] = breakpoint_tramp;
+               jte [0] = &single_step_tramp;
+               jte [1] = breakpoint_tramp;
                code = mono_arm_load_jumptable_entry_addr (code, jte, ARMREG_LR);
 #else
                ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
                ARM_B (code, 2);
-               *(volatile int **)code = &ss_trigger_var;
-               code += 4;
-               *(gpointer*)code = single_step_tramp;
+               *(gpointer*)code = &single_step_tramp;
                code += 4;
                *(gpointer*)code = breakpoint_tramp;
                code += 4;
 #endif
 
                ARM_LDR_IMM (code, ARMREG_IP, ARMREG_LR, 0);
-               ARM_STR_IMM (code, ARMREG_IP, read_ins->inst_basereg, read_ins->inst_offset);
-               ARM_LDR_IMM (code, ARMREG_IP, ARMREG_LR, 4);
                ARM_STR_IMM (code, ARMREG_IP, ss_method_ins->inst_basereg, ss_method_ins->inst_offset);
-               ARM_LDR_IMM (code, ARMREG_IP, ARMREG_LR, 8);
+               ARM_LDR_IMM (code, ARMREG_IP, ARMREG_LR, 4);
                ARM_STR_IMM (code, ARMREG_IP, bp_method_ins->inst_basereg, bp_method_ins->inst_offset);
        }
 
@@ -7491,7 +7462,7 @@ mono_arch_start_single_stepping (void)
        if (ss_trigger_page)
                mono_mprotect (ss_trigger_page, mono_pagesize (), 0);
        else
-               ss_trigger_var = 1;
+               single_step_tramp = mini_get_single_step_trampoline ();
 }
        
 /*
@@ -7505,7 +7476,7 @@ mono_arch_stop_single_stepping (void)
        if (ss_trigger_page)
                mono_mprotect (ss_trigger_page, mono_pagesize (), MONO_MMAP_READ);
        else
-               ss_trigger_var = 0;
+               single_step_tramp = NULL;
 }
 
 #if __APPLE__
index f6b2e2eac93f70e3d6869f061a6630f3db6fe98c..1994ba0a6abf5d77addee2dc77a8730b3f0df1ff 100644 (file)
@@ -233,7 +233,7 @@ struct MonoLMF {
 
 typedef struct MonoCompileArch {
        gpointer seq_point_info_var, ss_trigger_page_var;
-       gpointer seq_point_read_var, seq_point_ss_method_var;
+       gpointer seq_point_ss_method_var;
        gpointer seq_point_bp_method_var;
        gpointer vret_addr_loc;
        gboolean omit_fp, omit_fp_computed;
@@ -306,7 +306,7 @@ typedef struct MonoCompileArch {
 #endif
 
 #define MONO_ARCH_HAVE_TLS_GET (mono_arm_have_tls_get ())
-#define MONO_ARCH_HAVE_TLS_GET_REG 1
+// #define MONO_ARCH_HAVE_TLS_GET_REG 1
 
 /* ARM doesn't have too many registers, so we have to use a callee saved one */
 #define MONO_ARCH_RGCTX_REG ARMREG_V5
index 309ebd82531bf937c0f302cc1955da251b7f8435..659075cc30a7f7297017b408d8df42eaf82f72c6 100644 (file)
 #include <mono/metadata/verify-internals.h>
 #include <mono/metadata/mempool-internals.h>
 #include <mono/metadata/attach.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/dtrace.h>
 
index 3b29192a5322028b7c0f72da3da9d58707c313c7..820025e4599eecfd6c581baa5e41f32368cb6675 100644 (file)
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/object-internals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/profiler.h>
 #include <mono/metadata/mono-endian.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-mlist.h>
 #include <mono/utils/mono-mmap.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 
 #include "mini.h"
 #include "trace.h"
@@ -2911,4 +2911,10 @@ 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 c01d3e74968ac783ccf060fbeb9e2027ca94323a..47265e1d10f50156070c8372ba7447619fb12436 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "config.h"
 #include "mini-gc.h"
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 static gboolean
 get_provenance (StackFrameInfo *frame, MonoContext *ctx, gpointer data)
@@ -38,7 +38,7 @@ get_provenance_func (void)
 //#if defined(MONO_ARCH_GC_MAPS_SUPPORTED)
 
 #include <mono/metadata/sgen-conf.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/utils/mono-counters.h>
 
 #define SIZEOF_SLOT ((int)sizeof (mgreg_t))
index 8e71455942f8607c35e58255640c1215f2181572..07b19c46ab0769e5f06074f067fa2fd5b9787532 100644 (file)
@@ -29,6 +29,7 @@
 #include "llvm-c/Analysis.h"
 
 #include "mini-llvm-cpp.h"
+#include "aot-compiler.h"
 
 #ifdef __MINGW32__
 
@@ -1351,7 +1352,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 ++;
@@ -1362,7 +1363,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
                        break;
                case LLVMArgVtypeByRef:
                case LLVMArgScalarByRef:
-                       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 ++;
@@ -1379,7 +1380,7 @@ 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;
                }
        }
@@ -2746,11 +2747,11 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                                for (j = 0; j < ainfo->nslots; ++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], "");
                        }
@@ -2759,7 +2760,7 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                case LLVMArgVtypeByVal: {
                        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], "");
                        }
@@ -2782,7 +2783,7 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder)
                case LLVMArgAsIArgs: {
                        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)));
@@ -2792,7 +2793,7 @@ 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;
                }
        }
@@ -3118,7 +3119,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
@@ -3132,7 +3133,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                case LLVMArgVtypeByRef:
                case LLVMArgScalarByRef: {
                        g_assert (addresses [reg]);
-                       args [pindex] = convert (ctx, addresses [reg], LLVMPointerType (type_to_llvm_arg_type (ctx, sig->params [i - sig->hasthis]), 0));
+                       args [pindex] = convert (ctx, addresses [reg], LLVMPointerType (type_to_llvm_arg_type (ctx, ainfo->type), 0));
                        break;
                }
                case LLVMArgAsIArgs:
@@ -3147,7 +3148,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);
@@ -6004,6 +6005,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:
  *
@@ -6103,7 +6117,7 @@ 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);
 
@@ -6592,7 +6606,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;
@@ -6611,9 +6625,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);
@@ -6645,11 +6658,10 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call)
                        ins->sreg1 = in->dreg;
                        ins->inst_p0 = mono_mempool_alloc0 (cfg->mempool, sizeof (LLVMArgInfo));
                        memcpy (ins->inst_p0, ainfo, sizeof (LLVMArgInfo));
-                       ins->inst_vtype = sig->params [i - sig->hasthis];
-                       ins->klass = mono_class_from_mono_type (sig->params [i - sig->hasthis]);
+                       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;
index fe5cc782f833f26e4d965be3e4667654fc703f5d..724c4aa2c8739dadfeb23d5cc49833e71eee6775 100644 (file)
@@ -44,7 +44,7 @@
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/verify.h>
 #include <mono/metadata/verify-internals.h>
@@ -53,7 +53,7 @@
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/dtrace.h>
 #include <mono/utils/mono-signal-handler.h>
index 35cd3c32040e6b60621b68a615ef98dc6a3ac001..41fd8fccadf6187eb7f2cd5aafee97303f552659 100644 (file)
@@ -42,7 +42,7 @@
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/mempool-internals.h>
 #include <mono/metadata/attach.h>
@@ -51,7 +51,7 @@
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-error-internals.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-path.h>
 #include <mono/utils/mono-tls.h>
@@ -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:
@@ -1662,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;
@@ -2147,7 +2157,7 @@ static MonoObject*
 mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
 {
        MonoMethod *invoke, *callee;
-       MonoObject *(*runtime_invoke) (MonoObject *this, void **params, MonoObject **exc, void* compiled_method);
+       MonoObject *(*runtime_invoke) (MonoObject *this_obj, void **params, MonoObject **exc, void* compiled_method);
        MonoDomain *domain = mono_domain_get ();
        MonoJitDomainInfo *domain_info;
        RuntimeInvokeInfo *info, *info2;
index b2c80c78f9e42f064a8fe1ab6ead3f35174b4e46..4bcc19b5bfb64d86d12da04f3653159639057a1f 100644 (file)
@@ -29,7 +29,7 @@
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/verify.h>
 #include <mono/metadata/verify-internals.h>
@@ -38,7 +38,7 @@
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/dtrace.h>
 
index da4a783235c2cafd0aef13b1cfa196f6d9bd9c56..09b747b525c7acf1018d3271701bccb3275e5031 100644 (file)
@@ -23,7 +23,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-mmap.h>
@@ -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:
index d31ccb4d4e27294aae14d1713b18c0dcfcfcf026..e96c0dce16cad93258db77d18358afad4e46f943 100644 (file)
@@ -39,7 +39,7 @@
 #include <mono/metadata/mono-config.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/metadata/verify.h>
 #include <mono/metadata/verify-internals.h>
@@ -50,7 +50,7 @@
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
 #include <mono/utils/mono-error-internals.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-path.h>
 #include <mono/utils/mono-tls.h>
@@ -72,6 +72,7 @@
 
 #include "mini-gc.h"
 #include "debugger-agent.h"
+#include "llvm-runtime.h"
 
 MonoTraceSpec *mono_jit_trace_calls;
 MonoMethodDesc *mono_inject_async_exc_method;
index 0d783640b5983c5f4b2b0a0268e0910d91ef4df9..11f89ba23b62eb2dc3571818fd87deba7d418e21 100644 (file)
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 124
+#define MONO_AOT_FILE_VERSION 126
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
@@ -731,8 +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,
@@ -776,6 +779,7 @@ typedef struct {
        int esize;
        /* Parameter index in the LLVM signature */
        int pindex;
+       MonoType *type;
 } LLVMArgInfo;
 
 typedef struct {
@@ -2273,7 +2277,6 @@ void      mono_analyze_liveness_gc          (MonoCompile *cfg);
 void      mono_linear_scan                  (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask);
 void      mono_global_regalloc              (MonoCompile *cfg);
 void      mono_create_jump_table            (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
-int       mono_compile_assembly             (MonoAssembly *ass, guint32 opts, const char *aot_options);
 MonoCompile *mini_method_compile            (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts, int aot_method_index);
 void      mono_destroy_compile              (MonoCompile *cfg);
 MonoJitICallInfo *mono_find_jit_opcode_emulation (int opcode);
@@ -2374,28 +2377,16 @@ gpointer mono_aot_get_gsharedvt_arg_trampoline(gpointer arg, gpointer addr);
 guint8*  mono_aot_get_unwind_info           (MonoJitInfo *ji, guint32 *unwind_info_len);
 guint32  mono_aot_method_hash               (MonoMethod *method);
 MonoMethod* mono_aot_get_array_helper_from_wrapper (MonoMethod *method);
-guint32  mono_aot_get_got_offset            (MonoJumpInfo *ji) MONO_LLVM_INTERNAL;
-gboolean mono_aot_is_shared_got_offset      (int offset) MONO_LLVM_INTERNAL;
-char*    mono_aot_get_method_name           (MonoCompile *cfg) MONO_LLVM_INTERNAL;
-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);
 gboolean mono_aot_is_pagefault              (void *ptr);
 void     mono_aot_handle_pagefault          (void *ptr);
 void     mono_aot_register_jit_icall        (const char *name, gpointer addr);
-void*    mono_aot_readonly_field_override   (MonoClassField *field);
 guint32  mono_aot_find_method_index         (MonoMethod *method);
 void     mono_aot_init_llvm_method          (gpointer aot_module, guint32 method_index);
 void     mono_aot_init_gshared_method_this  (gpointer aot_module, guint32 method_index, MonoObject *this_ins);
 void     mono_aot_init_gshared_method_rgctx  (gpointer aot_module, guint32 method_index, MonoMethodRuntimeGenericContext *rgctx);
 
 /* This is an exported function */
-MONO_API void     mono_aot_register_globals          (gpointer *globals);
-/* This too */
 MONO_API void     mono_aot_register_module           (gpointer *aot_info);
 
 void     mono_xdebug_init                   (const char *xdebug_opts);
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 e406f413205050453886872ba66ae0f40b5483c7..6b5be99a733b904cf065f9e6ddfb887057846f93 100644 (file)
@@ -2,7 +2,7 @@
 #include "config.h"
 #include "tasklets.h"
 #include "mono/metadata/exception.h"
-#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/gc-internals.h"
 #include "mini.h"
 
 #if defined(MONO_SUPPORT_TASKLETS)
index e9ac1b8a11a2a70d596a975c27b96002551092b0..4468ad30869360109c099a0d5801983aa098b522 100644 (file)
@@ -19,7 +19,7 @@
 #include <mono/metadata/tabledefs.h>
 #include <mono/metadata/mono-debug-debugger.h>
 #include <mono/metadata/profiler-private.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/arch/amd64/amd64-codegen.h>
 
 #include <mono/utils/memcheck.h>
index 00fa048d84cb5931cca2611a83f9074c251b6adb..4a604f97e16c1c72b5e6f2256774f25cbc61e4e0 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <mono/metadata/abi-details.h>
 #include <mono/metadata/appdomain.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/tabledefs.h>
index 6e79922512c9f3b165e62ebace0af1d2de63b81f..3644a936639adb502acb1082a3ca2fa1db912ab6 100644 (file)
@@ -18,7 +18,7 @@
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/mono-debug-debugger.h>
 #include <mono/metadata/profiler-private.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/arch/x86/x86-codegen.h>
 
 #include <mono/utils/memcheck.h>
index 368ec5a6d3be6fed582712f113fe1289b69755a6..5a0e871e22fecc779083f53fea42bc4945f6849a 100644 (file)
@@ -185,6 +185,17 @@ typedef mword SgenDescriptor;
 #define SGEN_MIN_ALLOWANCE_NURSERY_SIZE_RATIO 1.0
 #define SGEN_MAX_ALLOWANCE_NURSERY_SIZE_RATIO 10.0
 
+/*
+ * How much more we allow the heap to grow before triggering another major collection
+ */
+#define SGEN_DEFAULT_ALLOWANCE_HEAP_SIZE_RATIO 0.33
+
+/*
+ * How much more we allow the heap to grow, relative to the allowance, while doing
+ * a concurrent collection, before forcing its finish.
+ */
+#define SGEN_DEFAULT_CONCURRENT_HEAP_ALLOWANCE_RATIO 0.25
+
 /*
  * Default ratio of memory we want to release in a major collection in relation to the the current heap size.
  *
index 9a8d10806dac72c5f9f4bc06d4570a09cd97f68d..865916a3b88e959407a951f889290794b7ee9c9f 100644 (file)
@@ -1411,9 +1411,9 @@ job_scan_los_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob
 }
 
 static void
-init_gray_queue (void)
+init_gray_queue (gboolean use_workers)
 {
-       if (sgen_collection_is_concurrent ())
+       if (use_workers)
                sgen_workers_init_distribute_gray_queue ();
        sgen_gray_object_queue_init (&gray_queue, NULL);
 }
@@ -1522,7 +1522,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
 
        sgen_memgov_minor_collection_start ();
 
-       init_gray_queue ();
+       init_gray_queue (FALSE);
 
        gc_stats.minor_gc_count ++;
 
@@ -1686,7 +1686,7 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
                sgen_nursery_alloc_prepare_for_major ();
        }
 
-       init_gray_queue ();
+       init_gray_queue (mode == COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT);
 
        TV_GETTIME (atv);
 
@@ -1788,6 +1788,11 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
                SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done when we start or finish a major collection?");
                sgen_workers_start_all_workers (object_ops);
                gray_queue_enable_redirect (WORKERS_DISTRIBUTE_GRAY_QUEUE);
+       } else if (mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT) {
+               if (sgen_workers_have_idle_work ()) {
+                       sgen_workers_start_all_workers (object_ops);
+                       sgen_workers_join ();
+               }
        }
 
 #ifdef SGEN_DEBUG_INTERNAL_ALLOC
@@ -1915,12 +1920,6 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
                object_ops = &major_collector.major_ops_serial;
        }
 
-       /*
-        * The workers have stopped so we need to finish gray queue
-        * work that might result from finalization in the main GC
-        * thread.  Redirection must therefore be turned off.
-        */
-       sgen_gray_object_queue_disable_alloc_prepare (&gray_queue);
        g_assert (sgen_section_gray_queue_is_empty (sgen_workers_get_distribute_section_gray_queue ()));
 
        /* all the objects in the heap */
@@ -2130,12 +2129,11 @@ major_finish_concurrent_collection (gboolean forced)
        binary_protocol_concurrent_finish ();
 
        /*
-        * The major collector can add global remsets which are processed in the finishing
-        * nursery collection, below.  That implies that the workers must have finished
-        * marking before the nursery collection is allowed to run, otherwise we might miss
-        * some remsets.
+        * We need to stop all workers since we're updating the cardtable below.
+        * The workers will be resumed with a finishing pause context to avoid
+        * additional cardtable and object scanning.
         */
-       sgen_workers_wait ();
+       sgen_workers_stop_all_workers ();
 
        SGEN_TV_GETTIME (time_major_conc_collection_end);
        gc_stats.major_gc_time_concurrent += SGEN_TV_ELAPSED (time_major_conc_collection_start, time_major_conc_collection_end);
@@ -2182,7 +2180,7 @@ sgen_ensure_free_space (size_t size)
                                generation_to_collect = GENERATION_OLD;
                        }
                } else if (sgen_need_major_collection (size)) {
-                       reason = "Minor allowance";
+                       reason = concurrent_collection_in_progress ? "Forced finish concurrent collection" : "Minor allowance";
                        generation_to_collect = GENERATION_OLD;
                } else {
                        generation_to_collect = GENERATION_NURSERY;
@@ -2229,18 +2227,18 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const
 
        if (concurrent_collection_in_progress) {
                /*
-                * We update the concurrent collection.  If it finished, we're done.  If
-                * not, and we've been asked to do a nursery collection, we do that.
+                * If the concurrent worker is finished or we are asked to do a major collection
+                * then we finish the concurrent collection.
                 */
-               gboolean finish = major_should_finish_concurrent_collection () || (wait_to_finish && generation_to_collect == GENERATION_OLD);
+               gboolean finish = major_should_finish_concurrent_collection () || generation_to_collect == GENERATION_OLD;
 
                if (finish) {
                        major_finish_concurrent_collection (wait_to_finish);
                        oldest_generation_collected = GENERATION_OLD;
                } else {
+                       SGEN_ASSERT (0, generation_to_collect == GENERATION_NURSERY, "Why aren't we finishing the concurrent collection?");
                        major_update_concurrent_collection ();
-                       if (generation_to_collect == GENERATION_NURSERY)
-                               collect_nursery (NULL, FALSE);
+                       collect_nursery (NULL, FALSE);
                }
 
                goto done;
index e655347e4a22c51cdbbd15b4c0a7e7bb776fd6f5..ce34f7f4a67a7d304ff038e674c01aa38651e0c5 100644 (file)
@@ -86,7 +86,7 @@ sgen_memgov_calculate_minor_collection_allowance (void)
         * We allow the heap to grow by one third its current size before we start the next
         * major collection.
         */
-       allowance_target = new_heap_size / 3;
+       allowance_target = new_heap_size * SGEN_DEFAULT_ALLOWANCE_HEAP_SIZE_RATIO;
 
        allowance = MAX (allowance_target, MIN_MINOR_COLLECTION_ALLOWANCE);
 
@@ -112,13 +112,32 @@ sgen_memgov_calculate_minor_collection_allowance (void)
        }
 }
 
+static inline size_t
+get_heap_size (void)
+{
+       return major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage;
+}
+
 gboolean
 sgen_need_major_collection (mword space_needed)
 {
        size_t heap_size;
 
-       if (sgen_concurrent_collection_in_progress ())
+       if (sgen_concurrent_collection_in_progress ()) {
+               heap_size = get_heap_size ();
+
+               if (heap_size <= major_collection_trigger_size)
+                       return FALSE; 
+
+               /* We allow the heap to grow an additional third of the allowance during a concurrent collection */
+               if ((heap_size - major_collection_trigger_size) >
+                               (major_collection_trigger_size
+                               * (SGEN_DEFAULT_ALLOWANCE_HEAP_SIZE_RATIO / (SGEN_DEFAULT_ALLOWANCE_HEAP_SIZE_RATIO + 1))
+                               * SGEN_DEFAULT_CONCURRENT_HEAP_ALLOWANCE_RATIO)) {
+                       return TRUE;
+               }
                return FALSE;
+       }
 
        /* FIXME: This is a cop-out.  We should have some way of figuring this out. */
        if (!major_collector.have_swept ())
@@ -129,7 +148,7 @@ sgen_need_major_collection (mword space_needed)
 
        sgen_memgov_calculate_minor_collection_allowance ();
 
-       heap_size = major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage;
+       heap_size = get_heap_size ();
 
        return heap_size > major_collection_trigger_size;
 }
@@ -150,7 +169,7 @@ sgen_memgov_major_collection_start (void)
        need_calculate_minor_collection_allowance = TRUE;
 
        if (debug_print_allowance) {
-               SGEN_LOG (0, "Starting collection with heap size %ld bytes", (long)(major_collector.get_num_major_sections () * major_collector.section_size + los_memory_usage));
+               SGEN_LOG (0, "Starting collection with heap size %ld bytes", (long)get_heap_size ());
        }
 }
 
index 590e0b6dc2d017a91a6338c4fc9b587368fcf32a..40d0ed103595b9a75ba1a338599267e5a80e44d5 100644 (file)
@@ -31,6 +31,7 @@
 #include "mono/sgen/sgen-client.h"
 
 static int workers_num;
+static volatile gboolean forced_stop;
 static WorkerData *workers_data;
 
 static SgenSectionGrayQueue workers_distribute_gray_queue;
@@ -220,7 +221,7 @@ marker_idle_func (void *data_untyped)
                SGEN_ASSERT (0, workers_state != STATE_NOT_WORKING, "How did we get from WORK ENQUEUED to NOT WORKING?");
        }
 
-       if (!sgen_gray_object_queue_is_empty (&data->private_gray_queue) || workers_get_work (data)) {
+       if (!forced_stop && (!sgen_gray_object_queue_is_empty (&data->private_gray_queue) || workers_get_work (data))) {
                ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (idle_func_object_ops, &data->private_gray_queue);
 
                SGEN_ASSERT (0, !sgen_gray_object_queue_is_empty (&data->private_gray_queue), "How is our gray queue empty if we just got work?");
@@ -281,9 +282,20 @@ sgen_workers_init (int num_workers)
        mono_counters_register ("# workers finished", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_num_finished);
 }
 
+void
+sgen_workers_stop_all_workers (void)
+{
+       forced_stop = TRUE;
+
+       sgen_thread_pool_wait_for_all_jobs ();
+       sgen_thread_pool_idle_wait ();
+       SGEN_ASSERT (0, workers_state == STATE_NOT_WORKING, "Can only signal enqueue work when in no work state");
+}
+
 void
 sgen_workers_start_all_workers (SgenObjectOperations *object_ops)
 {
+       forced_stop = FALSE;
        idle_func_object_ops = object_ops;
        mono_memory_write_barrier ();
 
@@ -306,6 +318,28 @@ sgen_workers_join (void)
                SGEN_ASSERT (0, sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue), "Why is there still work left to do?");
 }
 
+/*
+ * Can only be called if the workers are stopped.
+ * If we're stopped, there are also no pending jobs.
+ */
+gboolean
+sgen_workers_have_idle_work (void)
+{
+       int i;
+
+       SGEN_ASSERT (0, forced_stop && sgen_workers_all_done (), "Checking for idle work should only happen if the workers are stopped.");
+
+       if (!sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue))
+               return TRUE;
+
+       for (i = 0; i < workers_num; ++i) {
+               if (!sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue))
+                       return TRUE;
+       }
+
+       return FALSE;
+}
+
 gboolean
 sgen_workers_all_done (void)
 {
@@ -319,13 +353,6 @@ sgen_workers_are_working (void)
        return state_is_working_or_enqueued (workers_state);
 }
 
-void
-sgen_workers_wait (void)
-{
-       sgen_thread_pool_idle_wait ();
-       SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done after we wait for them?");
-}
-
 SgenSectionGrayQueue*
 sgen_workers_get_distribute_section_gray_queue (void)
 {
index 1a5b6a77305015dcebbb99bca6b248658665083c..4a3703555ff19613ee1dcc291361ef0c356566ca 100644 (file)
@@ -29,6 +29,7 @@ struct _WorkerData {
 };
 
 void sgen_workers_init (int num_workers);
+void sgen_workers_stop_all_workers (void);
 void sgen_workers_start_all_workers (SgenObjectOperations *object_ops);
 void sgen_workers_ensure_awake (void);
 void sgen_workers_init_distribute_gray_queue (void);
@@ -37,9 +38,9 @@ void sgen_workers_wait_for_jobs_finished (void);
 void sgen_workers_distribute_gray_queue_sections (void);
 void sgen_workers_reset_data (void);
 void sgen_workers_join (void);
+gboolean sgen_workers_have_idle_work (void);
 gboolean sgen_workers_all_done (void);
 gboolean sgen_workers_are_working (void);
-void sgen_workers_wait (void);
 SgenSectionGrayQueue* sgen_workers_get_distribute_section_gray_queue (void);
 
 #endif
index 2f8f55cd53abcc3b48cbbdeee2f1fdfaf677f757..fa65a2c6f74a99808858fae0cd6918c90141726f 100644 (file)
+using System;
+using System.Collections.Generic;
+
 namespace Test {
 
-public enum YaddaYadda {
-       buba,
-       birba,
-       dadoom,
-};
-
-public enum byteenum : byte {
-       zero,
-       one,
-       two,
-       three
-}
+       enum ByteEnum : byte {
+               A = 10
+       }
 
-public enum longenum: long {
-       s0 = 0,
-       s1 = 1
-}
+       enum SByteEnum : sbyte {
+               A = -11
+       }
 
-public enum sbyteenum : sbyte {
-       d0,
-       d1
-}
+       enum ShortEnum : short {
+               A = -12
+       }
+
+       enum UShortEnum : ushort {
+               A = 13
+       }
+
+       enum IntEnum : int {
+               A = -15
+       }
+
+       enum UIntEnum : uint {
+               A = 16
+       }
+
+       enum LongEnum : long {
+               A = -153453525432334L
+       }
+
+       enum ULongEnum : ulong {
+               A = 164923797563459L
+       }
+
+       public enum YaddaYadda {
+               buba,
+               birba,
+               dadoom,
+       };
+
+       public enum byteenum : byte {
+               zero,
+               one,
+               two,
+               three
+       }
+
+       public enum longenum: long {
+               s0 = 0,
+               s1 = 1
+       }
+
+       public enum sbyteenum : sbyte {
+               d0,
+               d1
+       }
+
+       public class Tests {
+               public static int test_0_basic_enum_vals ()
+               {
+                       YaddaYadda val = YaddaYadda.dadoom;
+                       byteenum be = byteenum.one;
+                       if (val != YaddaYadda.dadoom)
+                               return 1;
+                       if (be != (byteenum)1)
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_byte_enum_hashcode ()
+               {
+                       if (ByteEnum.A.GetHashCode () != EqualityComparer<ByteEnum>.Default.GetHashCode (ByteEnum.A))
+                               return 1;
+                       if (ByteEnum.A.GetHashCode () != ((byte)ByteEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_sbyte_enum_hashcode ()
+               {
+                       if (SByteEnum.A.GetHashCode () != EqualityComparer<SByteEnum>.Default.GetHashCode (SByteEnum.A))
+                               return 1;
+                       if (SByteEnum.A.GetHashCode () != ((sbyte)SByteEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_short_enum_hashcode ()
+               {
+                       if (ShortEnum.A.GetHashCode () != EqualityComparer<ShortEnum>.Default.GetHashCode (ShortEnum.A))
+                               return 1;
+                       if (ShortEnum.A.GetHashCode () != ((short)ShortEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_ushort_enum_hashcode ()
+               {
+                       if (UShortEnum.A.GetHashCode () != EqualityComparer<UShortEnum>.Default.GetHashCode (UShortEnum.A))
+                               return 1;
+                       if (UShortEnum.A.GetHashCode () != ((ushort)UShortEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_int_enum_hashcode ()
+               {
+                       if (IntEnum.A.GetHashCode () != EqualityComparer<IntEnum>.Default.GetHashCode (IntEnum.A))
+                               return 1;
+                       if (IntEnum.A.GetHashCode () != ((int)IntEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_uint_enum_hashcode ()
+               {
+                       if (UIntEnum.A.GetHashCode () != EqualityComparer<UIntEnum>.Default.GetHashCode (UIntEnum.A))
+                               return 1;
+                       if (UIntEnum.A.GetHashCode () != ((uint)UIntEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_long_enum_hashcode ()
+               {
+                       if (LongEnum.A.GetHashCode () != EqualityComparer<LongEnum>.Default.GetHashCode (LongEnum.A))
+                               return 1;
+                       if (LongEnum.A.GetHashCode () != ((long)LongEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int test_0_ulong_enum_hashcode ()
+               {
+                       if (ULongEnum.A.GetHashCode () != EqualityComparer<ULongEnum>.Default.GetHashCode (ULongEnum.A))
+                               return 1;
+                       if (ULongEnum.A.GetHashCode () != ((ulong)ULongEnum.A).GetHashCode () )
+                               return 2;
+                       return 0;
+               }
+
+               public static int Main (String[] args) {
+                       return TestDriver.RunTests (typeof (Tests), args);
+               }
 
-public class test {
-       public static int Main () {
-               YaddaYadda val = YaddaYadda.dadoom;
-               byteenum be = byteenum.one;
-               if (val != YaddaYadda.dadoom)
-                       return 1;
-               if (be != (byteenum)1)
-                       return 2;
-               return 0;
        }
-}
 
 }
index 6570842703c7c6377e169578cd24b6062762a33f..f1f6c2f932069f57ae67e85f017d8f47b9f50fc6 100644 (file)
@@ -9,7 +9,6 @@ This is a regression test for a crash in the domain object cleaner code that did
 stop-the-world before walking the heap.
 */
 class Driver {
-
        static void AllocStuff ()
        {
                var x = new object ();
@@ -24,6 +23,8 @@ class Driver {
        }
 
        static void Main () {
+               var testTimeout = new TestTimeout ();
+               testTimeout.Start ();
                for (int i = 0; i < Math.Max (1, Environment.ProcessorCount / 2); ++i) {
                // for (int i = 0; i < 4; ++i) {
                        var t = new Thread (BackgroundNoise);
@@ -31,13 +32,21 @@ class Driver {
                        t.Start ();
                }
                
-               for (int i = 0; i < 100; ++i) {
+               const int TOTAL_ITERATIONS = 100;
+               for (int i = 0; i < TOTAL_ITERATIONS; ++i) {
                        var ad = AppDomain.CreateDomain ("domain_" + i);
                        ad.DoCallBack (new CrossAppDomainDelegate (AllocStuff));
                        AppDomain.Unload (ad);
+
                        Console.Write (".");
                        if (i > 0 && i % 20 == 0) Console.WriteLine ();
+
+                       if (!testTimeout.HaveTimeLeft ()) {
+                               var finishTime = DateTime.UtcNow;
+                               var ranFor = finishTime - testTimeout.StartTime;
+                               Console.WriteLine ("Will run out of time soon. ran for {0}, finished {1}/{2} iterations", ranFor, i+1, TOTAL_ITERATIONS);
+                       }
                }
                Console.WriteLine ("\ndone");
        }
-}
\ No newline at end of file
+}
index b6d0a9b693b87a557298e60566528b2934ef5bf4..966fff5d5b7e0b78ed964690f85846fe68e28f05 100644 (file)
@@ -44,8 +44,11 @@ class T {
     }
 
     static void Main (string[] args) {
-        
-        for (int j = 0; j < 2; j++)
+        var testTimeout = new TestTimeout ();
+        testTimeout.Start ();
+
+        const int TOTAL_ITERATIONS = 2;
+        for (int j = 0; j < TOTAL_ITERATIONS; j++)
         {
             count = 0;
 
@@ -82,6 +85,7 @@ class T {
             {
                 while (count < num_threads)
                 {
+                    Console.Write (".");
                     Monitor.Wait(count_lock);
                 }
             }
@@ -90,6 +94,15 @@ class T {
             {
                 t.Join();
             }
+
+            Console.WriteLine ();
+            if (!testTimeout.HaveTimeLeft ()) {
+                    var finishTime = DateTime.UtcNow;
+                    var ranFor = finishTime - testTimeout.StartTime;
+                    Console.WriteLine ("Will run out of time soon.  ran for {0}, finished {1}/{2} iterations", ranFor, j+1, TOTAL_ITERATIONS);
+            }
         }
+
+       Console.WriteLine ("done");
     }
 }
index b007040a62e95d33de04e626bec61a729dbeef22..41b2832d1c7dd5fbf9facb39b7c5e03e73469f7e 100755 (executable)
@@ -27,8 +27,9 @@ if ($test =~ /.*\|.*/) {
        $output = $test;
 
        #This is a silly workaround, but all tests that use extra parameters need a larger timeout.
-       $timeout_in_minutes = 5;
+       $timeout_in_minutes = 9;
 }
+$ENV{'TEST_DRIVER_TIMEOUT_SEC'} = $timeout_in_minutes * 60;
 
 $| = 0;
 print "Testing $test... ";
index 9c06bbf0668c679297b2b8d8798f7157eb3a017c..e58e009a269117778ad7472a5b7f780a33221539 100644 (file)
@@ -41,6 +41,7 @@ using System.Text.RegularExpressions;
 public class TestRunner
 {
        const string TEST_TIME_FORMAT = "mm\\:ss\\.fff";
+       const string ENV_TIMEOUT = "TEST_DRIVER_TIMEOUT_SEC";
 
        class ProcessData {
                public string test;
@@ -220,6 +221,7 @@ public class TestRunner
                                        info.UseShellExecute = false;
                                        info.RedirectStandardOutput = true;
                                        info.RedirectStandardError = true;
+                                       info.EnvironmentVariables[ENV_TIMEOUT] = timeout.ToString();
                                        Process p = new Process ();
                                        p.StartInfo = info;
 
index 0b465253d540e4a65129326cf84065755f0927f7..d03a73a3e07f9ea8849d95ab8f4600f64e98248c 100644 (file)
@@ -15,7 +15,7 @@ monoutils_sources = \
        mono-md5.c              \
        mono-sha1.c             \
        mono-logger.c           \
-       mono-logger-internal.h  \
+       mono-logger-internals.h \
        mono-codeman.c          \
        dlmalloc.h              \
        dlmalloc.c              \
@@ -36,7 +36,7 @@ monoutils_sources = \
        mono-math.c             \
        mono-mmap.c             \
        mono-mmap.h             \
-       mono-mmap-internal.h    \
+       mono-mmap-internals.h   \
        mono-mutex.c            \
        mono-mutex.h            \
        mono-lazy-init.h                \
diff --git a/mono/utils/mono-logger-internal.h b/mono/utils/mono-logger-internal.h
deleted file mode 100644 (file)
index ee88665..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef __MONO_LOGGER_INTERNAL_H__
-#define __MONO_LOGGER_INTERNAL_H__
-
-#include <glib.h>
-#include "mono-logger.h"
-
-G_BEGIN_DECLS
-
-typedef enum {
-       MONO_TRACE_ASSEMBLY             = (1<<0),
-       MONO_TRACE_TYPE                 = (1<<1),
-       MONO_TRACE_DLLIMPORT            = (1<<2),
-       MONO_TRACE_GC                   = (1<<3),
-        MONO_TRACE_CONFIG              = (1<<4),
-       MONO_TRACE_AOT                  = (1<<5),
-       MONO_TRACE_SECURITY             = (1<<6),
-       MONO_TRACE_THREADPOOL           = (1<<7),
-       MONO_TRACE_IO_THREADPOOL        = (1<<8),
-       MONO_TRACE_ALL                  = MONO_TRACE_ASSEMBLY |
-                                         MONO_TRACE_TYPE |
-                                         MONO_TRACE_DLLIMPORT |
-                                         MONO_TRACE_GC |
-                                         MONO_TRACE_CONFIG |
-                                         MONO_TRACE_AOT |
-                                         MONO_TRACE_SECURITY |
-                                         MONO_TRACE_THREADPOOL |
-                                         MONO_TRACE_IO_THREADPOOL
-} MonoTraceMask;
-
-void 
-mono_trace_cleanup (void);
-
-void 
-mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...);
-
-void 
-mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args);
-
-void 
-mono_trace_set_level (GLogLevelFlags level);
-
-void 
-mono_trace_set_mask (MonoTraceMask mask);
-
-void 
-mono_trace_push (GLogLevelFlags level, MonoTraceMask mask);
-
-void 
-mono_trace_pop (void);
-
-gboolean
-mono_trace_is_traced (GLogLevelFlags level, MonoTraceMask mask);
-
-#ifdef G_HAVE_ISO_VARARGS
-#define mono_trace_error(...)  mono_trace(G_LOG_LEVEL_ERROR, \
-                                                                                       __VA_ARGS__)
-#define mono_trace_warning(...) mono_trace(G_LOG_LEVEL_WARNING, \
-                                                                                       __VA_ARGS__)
-#define mono_trace_message(...) mono_trace(G_LOG_LEVEL_MESSAGE, \
-                                                                                       __VA_ARGS__)
-#elif defined(G_HAVE_GNUC_VARARGS)
-#define mono_trace_error(format...)    mono_trace(G_LOG_LEVEL_ERROR, \
-                                                                                       format)
-#define mono_trace_warning(format...) mono_trace(G_LOG_LEVEL_WARNING, \
-                                                                                       format)
-#define mono_trace_message(format...) mono_trace(G_LOG_LEVEL_MESSAGE, \
-                                                                                       format)
-#else /* no varargs macros */
-G_GNUC_UNUSED static void
-mono_trace_error(MonoTraceMask mask, const char *format, ...)
-{
-       va_list args;
-       va_start (args, format);
-       mono_tracev(G_LOG_LEVEL_ERROR, mask, format, args);
-       va_end (args);
-}
-
-G_GNUC_UNUSED static void
-mono_trace_warning(MonoTraceMask mask, const char *format, ...)
-{
-       va_list args;
-       va_start (args, format);
-       mono_tracev(G_LOG_LEVEL_WARNING, mask, format, args);
-       va_end (args);
-}
-
-G_GNUC_UNUSED static void
-mono_trace_message(MonoTraceMask mask, const char *format, ...)
-{
-       va_list args;
-       va_start (args, format);
-       mono_tracev(G_LOG_LEVEL_MESSAGE, mask, format, args);
-       va_end (args);
-}
-
-#endif /* !__GNUC__ */
-
-#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
-
-#define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
-#define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
-#define mono_runtime_printf_err(format, ...) g_log ("mono-rt", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
-#define mono_runtime_stdout_fflush() do { } while (0)
-
-#else
-
-#define mono_gc_printf(gc_log_file, format, ...) do {  \
-       fprintf (gc_log_file, format, ##__VA_ARGS__);   \
-       fflush (gc_log_file);   \
-} while (0)
-
-#define mono_runtime_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
-#define mono_runtime_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
-#define mono_runtime_stdout_fflush() do { fflush (stdout); } while (0)
-
-#endif
-
-
-G_END_DECLS
-
-#endif /* __MONO_LOGGER_INTERNAL_H__ */
diff --git a/mono/utils/mono-logger-internals.h b/mono/utils/mono-logger-internals.h
new file mode 100644 (file)
index 0000000..ee88665
--- /dev/null
@@ -0,0 +1,121 @@
+#ifndef __MONO_LOGGER_INTERNAL_H__
+#define __MONO_LOGGER_INTERNAL_H__
+
+#include <glib.h>
+#include "mono-logger.h"
+
+G_BEGIN_DECLS
+
+typedef enum {
+       MONO_TRACE_ASSEMBLY             = (1<<0),
+       MONO_TRACE_TYPE                 = (1<<1),
+       MONO_TRACE_DLLIMPORT            = (1<<2),
+       MONO_TRACE_GC                   = (1<<3),
+        MONO_TRACE_CONFIG              = (1<<4),
+       MONO_TRACE_AOT                  = (1<<5),
+       MONO_TRACE_SECURITY             = (1<<6),
+       MONO_TRACE_THREADPOOL           = (1<<7),
+       MONO_TRACE_IO_THREADPOOL        = (1<<8),
+       MONO_TRACE_ALL                  = MONO_TRACE_ASSEMBLY |
+                                         MONO_TRACE_TYPE |
+                                         MONO_TRACE_DLLIMPORT |
+                                         MONO_TRACE_GC |
+                                         MONO_TRACE_CONFIG |
+                                         MONO_TRACE_AOT |
+                                         MONO_TRACE_SECURITY |
+                                         MONO_TRACE_THREADPOOL |
+                                         MONO_TRACE_IO_THREADPOOL
+} MonoTraceMask;
+
+void 
+mono_trace_cleanup (void);
+
+void 
+mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...);
+
+void 
+mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args);
+
+void 
+mono_trace_set_level (GLogLevelFlags level);
+
+void 
+mono_trace_set_mask (MonoTraceMask mask);
+
+void 
+mono_trace_push (GLogLevelFlags level, MonoTraceMask mask);
+
+void 
+mono_trace_pop (void);
+
+gboolean
+mono_trace_is_traced (GLogLevelFlags level, MonoTraceMask mask);
+
+#ifdef G_HAVE_ISO_VARARGS
+#define mono_trace_error(...)  mono_trace(G_LOG_LEVEL_ERROR, \
+                                                                                       __VA_ARGS__)
+#define mono_trace_warning(...) mono_trace(G_LOG_LEVEL_WARNING, \
+                                                                                       __VA_ARGS__)
+#define mono_trace_message(...) mono_trace(G_LOG_LEVEL_MESSAGE, \
+                                                                                       __VA_ARGS__)
+#elif defined(G_HAVE_GNUC_VARARGS)
+#define mono_trace_error(format...)    mono_trace(G_LOG_LEVEL_ERROR, \
+                                                                                       format)
+#define mono_trace_warning(format...) mono_trace(G_LOG_LEVEL_WARNING, \
+                                                                                       format)
+#define mono_trace_message(format...) mono_trace(G_LOG_LEVEL_MESSAGE, \
+                                                                                       format)
+#else /* no varargs macros */
+G_GNUC_UNUSED static void
+mono_trace_error(MonoTraceMask mask, const char *format, ...)
+{
+       va_list args;
+       va_start (args, format);
+       mono_tracev(G_LOG_LEVEL_ERROR, mask, format, args);
+       va_end (args);
+}
+
+G_GNUC_UNUSED static void
+mono_trace_warning(MonoTraceMask mask, const char *format, ...)
+{
+       va_list args;
+       va_start (args, format);
+       mono_tracev(G_LOG_LEVEL_WARNING, mask, format, args);
+       va_end (args);
+}
+
+G_GNUC_UNUSED static void
+mono_trace_message(MonoTraceMask mask, const char *format, ...)
+{
+       va_list args;
+       va_start (args, format);
+       mono_tracev(G_LOG_LEVEL_MESSAGE, mask, format, args);
+       va_end (args);
+}
+
+#endif /* !__GNUC__ */
+
+#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
+
+#define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
+#define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
+#define mono_runtime_printf_err(format, ...) g_log ("mono-rt", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
+#define mono_runtime_stdout_fflush() do { } while (0)
+
+#else
+
+#define mono_gc_printf(gc_log_file, format, ...) do {  \
+       fprintf (gc_log_file, format, ##__VA_ARGS__);   \
+       fflush (gc_log_file);   \
+} while (0)
+
+#define mono_runtime_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
+#define mono_runtime_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
+#define mono_runtime_stdout_fflush() do { fflush (stdout); } while (0)
+
+#endif
+
+
+G_END_DECLS
+
+#endif /* __MONO_LOGGER_INTERNAL_H__ */
index 0b2c8a7f69b4e070157089cf25bb0d0b42a68a8f..09d72dd2f008325724e2bf60c4d25b499a1eeed5 100644 (file)
@@ -4,7 +4,7 @@
 #include <glib.h>
 
 #include "mono-compiler.h"
-#include "mono-logger-internal.h"
+#include "mono-logger-internals.h"
 
 typedef struct {
        GLogLevelFlags  level;
diff --git a/mono/utils/mono-mmap-internal.h b/mono/utils/mono-mmap-internal.h
deleted file mode 100644 (file)
index b23ba16..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * mono-mmap-internal.h: Internal virtual memory stuff.
- *
- * Copyright (C) 2014 Xamarin Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License 2.0 as published by the Free Software Foundation;
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License 2.0 along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __MONO_UTILS_MMAP_INTERNAL_H__
-#define __MONO_UTILS_MMAP_INTERNAL_H__
-
-#include "mono-compiler.h"
-
-int mono_pages_not_faulted (void *addr, size_t length);
-
-#endif /* __MONO_UTILS_MMAP_INTERNAL_H__ */
-
diff --git a/mono/utils/mono-mmap-internals.h b/mono/utils/mono-mmap-internals.h
new file mode 100644 (file)
index 0000000..ed6f015
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * mono-mmap-internals.h: Internal virtual memory stuff.
+ *
+ * Copyright (C) 2014 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __MONO_UTILS_MMAP_INTERNAL_H__
+#define __MONO_UTILS_MMAP_INTERNAL_H__
+
+#include "mono-compiler.h"
+
+int mono_pages_not_faulted (void *addr, size_t length);
+
+#endif /* __MONO_UTILS_MMAP_INTERNAL_H__ */
+
index bb1ec15d4742a387436eb28771c3304a6b68a7b7..f3b4d17c77bd9104d49c742c56b84d70a1d63eb7 100644 (file)
@@ -31,7 +31,7 @@
 #endif
 
 #include "mono-mmap.h"
-#include "mono-mmap-internal.h"
+#include "mono-mmap-internals.h"
 #include "mono-proclib.h"
 #include <mono/utils/mono-threads.h>
 
index de4f6c45b755260ea5ac0bf28b249cd2b9688ef9..15106129b7212e85ba809c4a9a13b16332e0d18e 100644 (file)
@@ -224,7 +224,7 @@ typedef struct ucontext {
        #define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->sc_r13)
        #define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->sc_r14)
        #define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->sc_r15)
-#else
+#elif !defined(HOST_WIN32)
 #define UCONTEXT_GREGS(ctx)    ((guint64*)&(((ucontext_t*)(ctx))->uc_mcontext.gregs))
 #endif
 
index 437b7421ea8cf77890ddd62176a7626584bbecdf..b9ede7e25de311bb0874f0d3dad6994e30f67eab 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-threads-posix-signals.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 
 #include <errno.h>
 
index c2791b7f497c0832067bef443cd24e6ce5f76396..f4be234ee2e1d035a49b4ca78acb097f950f650a 100644 (file)
     <ClInclude Include="..\mono\metadata\exception.h" />\r
     <ClInclude Include="..\mono\metadata\file-io.h" />\r
     <ClInclude Include="..\mono\metadata\filewatcher.h" />\r
-    <ClInclude Include="..\mono\metadata\gc-internal.h" />\r
+    <ClInclude Include="..\mono\metadata\gc-internals.h" />\r
     <ClInclude Include="..\mono\metadata\number-ms.h" />\r
     <ClInclude Include="..\mono\metadata\seq-points-data.h" />\r
     <ClInclude Include="..\mono\metadata\threadpool-ms-io.h" />\r
index 939f52048d73e8025bf515d850da7fb8096683c0..fb3441dbcd64f2ef7890e744c41e12ee353e404f 100644 (file)
     <ClInclude Include="..\mono\utils\mono-internal-hash.h" />\r
     <ClInclude Include="..\mono\utils\mono-io-portability.h" />\r
     <ClInclude Include="..\mono\utils\mono-linked-list-set.h" />\r
-    <ClInclude Include="..\mono\utils\mono-logger-internal.h" />\r
+    <ClInclude Include="..\mono\utils\mono-logger-internals.h" />\r
     <ClInclude Include="..\mono\utils\mono-logger.h" />\r
     <ClInclude Include="..\mono\utils\mono-machine.h" />\r
     <ClInclude Include="..\mono\utils\mono-math.h" />\r
index f2e02e28cbc972cb0b2a5572971a885ac23bbeaa..3e9251af29e941e13deebecaa275ca3e87c50f2c 100644 (file)
@@ -41,11 +41,11 @@ build_profiles += monotouch monotouch_runtime
 endif
 
 if INSTALL_MONOTOUCH_WATCH
-build_profiles += monotouch_watch
+build_profiles += monotouch_watch monotouch_watch_runtime
 endif
 
 if INSTALL_MONOTOUCH_TV
-build_profiles += monotouch_tv
+build_profiles += monotouch_tv monotouch_tv_runtime
 endif
 
 if INSTALL_XAMMAC
diff --git a/samples/embed/testi.c b/samples/embed/testi.c
deleted file mode 100644 (file)
index a1ea82b..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <mono/interpreter/embed.h>
-#include <mono/metadata/environment.h>
-
-/*
- * Very simple mint embedding example.
- * Compile with: 
- *     gcc -o testi testi.c `pkg-config --cflags --libs mint` -lm
- *     mcs test.cs
- * Run with:
- *     ./testi test.exe
- */
-
-static MonoString*
-gimme () {
-       return mono_string_new (mono_domain_get (), "All your monos are belong to us!");
-}
-
-typedef struct
-{
-       MonoDomain *domain;
-       const char *file;
-       int argc;
-       char **argv;
-} MainThreadArgs;
-
-static void main_thread_handler (gpointer user_data)
-{
-       MainThreadArgs *main_args=(MainThreadArgs *)user_data;
-       MonoAssembly *assembly;
-
-       assembly = mono_domain_assembly_open (main_args->domain,
-                                             main_args->file);
-       if (!assembly)
-               exit (2);
-       /*
-        * mono_jit_exec() will run the Main() method in the assembly.
-        * The return value needs to be looked up from
-        * System.Environment.ExitCode.
-        */
-       mono_interp_exec (main_args->domain, assembly, main_args->argc,
-                      main_args->argv);
-}
-
-
-int 
-main(int argc, char* argv[]) {
-       MonoDomain *domain;
-       const char *file;
-       int retval;
-       MainThreadArgs main_args;
-       
-       if (argc < 2){
-               fprintf (stderr, "Please provide an assembly to load\n");
-               return 1;
-       }
-       file = argv [1];
-       /*
-        * mono_jit_init() creates a domain: each assembly is
-        * loaded and run in a MonoDomain.
-        */
-       domain = mono_interp_init (file);
-       /*
-        * We add our special internal call, so that C# code
-        * can call us back.
-        */
-       mono_add_internal_call ("MonoEmbed::gimme", gimme);
-
-       main_args.domain=domain;
-       main_args.file=file;
-       main_args.argc=argc-1;
-       main_args.argv=argv+1;
-       
-       mono_runtime_exec_managed_code (domain, main_thread_handler,
-                                       &main_args);
-
-       retval=mono_environment_exitcode_get ();
-       
-       mono_interp_cleanup (domain);
-       return retval;
-}
-