Merge pull request #4433 from kumpera/android-fixes
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Mon, 27 Feb 2017 20:46:03 +0000 (15:46 -0500)
committerGitHub <noreply@github.com>
Mon, 27 Feb 2017 20:46:03 +0000 (15:46 -0500)
Fix a few issues on Android

328 files changed:
.gitattributes
Makefile.am
acceptance-tests/SUBMODULES.json
configure.ac
data/lock-decoder/LockTracerDecoder.cs
docs/.gitattributes [new file with mode: 0644]
docs/abc-removal.txt
external/bockbuild
external/cecil
external/corefx
external/ikvm
external/roslyn-binaries
libgc/blacklst.c
libgc/doc/README.changes
libgc/doc/README.macros
libgc/mark.c
man/gacutil.1
man/lc.1
man/macpack.1
man/mdb2ppdb.1
man/mdoc.5
man/mkbundle.1
man/mono-config.5
man/mono-service.1
man/mono-xmltool.1
man/mono.1
man/monodocer.1
man/resgen.1
man/sqlsharp.1
mcs/.gitattributes
mcs/CodingStyle
mcs/build/profiles/monodroid.make
mcs/build/profiles/monotouch_runtime.make
mcs/build/profiles/orbis.make
mcs/build/profiles/testing_aot_full.make
mcs/build/profiles/testing_aot_hybrid.make
mcs/build/profiles/winaot.make
mcs/build/profiles/xammac.make
mcs/class/Facades/System.Data.Common/Facades_System.Data.Common-net_4_x.csproj
mcs/class/Facades/System.Data.Common/System.Data.Common.dll.sources
mcs/class/Facades/System.Data.Common/TypeForwarders.cs
mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs
mcs/class/Facades/System.Net.Sockets/TypeForwarders.cs
mcs/class/Facades/netstandard/Makefile
mcs/class/Facades/netstandard/TypeForwarders.cs
mcs/class/Makefile
mcs/class/Microsoft.CSharp/Makefile
mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_x.csproj
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/Binder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfo.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfoFlags.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinderFlags.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpConvertBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetIndexBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeConstructorBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeMemberBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpIsEventBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpSetIndexBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpSetMemberBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpUnaryOperationBinder.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/DynamicContext.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/ErrorPrinter.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/Extensions.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderException.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderInternalCompilerException.cs [deleted file]
mcs/class/Microsoft.CSharp/Microsoft.CSharp.dll.sources
mcs/class/Microsoft.CSharp/corefx/SR.cs [new file with mode: 0644]
mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj
mcs/class/Mono.CSharp/Mono.CSharp.dll.sources
mcs/class/Mono.CSharp/aot.cs [new file with mode: 0644]
mcs/class/Mono.CSharp/monotouch.cs [deleted file]
mcs/class/Mono.CSharp/monotouch_Mono.CSharp.dll.sources [deleted file]
mcs/class/Mono.CSharp/monotouch_tv_Mono.CSharp.dll.sources [deleted file]
mcs/class/Mono.CSharp/monotouch_watch_Mono.CSharp.dll.sources [deleted file]
mcs/class/Mono.CSharp/orbis_Mono.CSharp.dll.sources [deleted file]
mcs/class/Mono.CSharp/testing_aot_full_Mono.CSharp.dll.sources [deleted file]
mcs/class/Mono.CSharp/winaot_Mono.CSharp.dll.sources [deleted file]
mcs/class/Mono.CodeContracts/Mono.CodeContracts.Rewrite/Rewriter.cs
mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs
mcs/class/Mono.Data.Sqlite/Test/SqliteTests.cs
mcs/class/README
mcs/class/System.Core/System.Core-net_4_x.csproj
mcs/class/System.Core/dynamic_System.Core.dll.sources
mcs/class/System.Data/Makefile
mcs/class/System.Data/System.Data-net_4_x.csproj
mcs/class/System.Data/corefx.common.sources
mcs/class/System.Data/net_4_x_System.Data.dll.sources
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs
mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs
mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs
mcs/class/System.Numerics.Vectors/SR.cs [deleted file]
mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources
mcs/class/System.Numerics.Vectors/corefx/SR.cs [new file with mode: 0644]
mcs/class/System.Numerics/Makefile
mcs/class/System.Numerics/ReferenceSources/SR.cs [deleted file]
mcs/class/System.Numerics/System.Numerics.dll.sources
mcs/class/System.Numerics/corefx/SR.cs [new file with mode: 0644]
mcs/class/System.Numerics/corefx/Vector.cs [new file with mode: 0644]
mcs/class/System.Runtime.Caching/ReferenceSources/R.Designer.cs
mcs/class/System.ServiceModel.Internals/orbis_System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel.Internals/testing_aot_full_System.ServiceModel.Internals.dll.sources [new file with mode: 0644]
mcs/class/System.ServiceModel/Test/System.ServiceModel/NetTcpBindingTest.cs
mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
mcs/class/System/Makefile
mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs [deleted file]
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs [deleted file]
mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs [deleted file]
mcs/class/System/Microsoft.VisualBasic/VBCodeGenerator.cs
mcs/class/System/Microsoft.VisualBasic/VBCodeProvider.cs [deleted file]
mcs/class/System/System-bare-net_4_x.csproj
mcs/class/System/System-net_4_x.csproj
mcs/class/System/System-secxml-net_4_x.csproj
mcs/class/System/System.CodeDom.Compiler/CodeCompiler.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CodeParser.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/Compiler.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CompilerCollection.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CompilerInfo.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CompilerProviderOption.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs [deleted file]
mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs [deleted file]
mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs
mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs
mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs
mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/Test/Microsoft.CSharp/CodeGeneratorFromExpressionTest.cs
mcs/class/System/Test/Microsoft.CSharp/CodeGeneratorIdentifierTest.cs
mcs/class/System/Test/Microsoft.VisualBasic/CodeGeneratorFromExpressionTest.cs
mcs/class/System/Test/Microsoft.VisualBasic/CodeGeneratorFromTypeTest.cs
mcs/class/System/Test/System.Diagnostics/ProcessTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs
mcs/class/System/common.sources
mcs/class/System/net_4_x_System.dll.sources
mcs/class/corlib/Assembly/AssemblyInfo.cs
mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs
mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs
mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs
mcs/class/corlib/System.Reflection.Metadata/AssemblyExtensions.cs
mcs/class/corlib/System.Runtime.Loader/AssemblyLoadContext.cs
mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
mcs/class/corlib/System/Array.cs
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System.Threading/ThreadTest.cs
mcs/class/corlib/Test/System.Threading/TimerTest.cs
mcs/class/corlib/Test/System/GCTest.cs
mcs/class/corlib/Test/System/TimeZoneInfoTest.cs
mcs/class/corlib/Test/System/TimeZoneTest.cs
mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/LambdaExpression.cs
mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs
mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs
mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKeyBlobFormat.cs
mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
mcs/class/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
mcs/class/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
mcs/class/referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
mcs/class/referencesource/System.Data/System/Data/Common/AdapterUtil.cs
mcs/class/referencesource/System.Data/System/Data/Common/DBConnectionString.cs
mcs/class/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
mcs/class/referencesource/System/compmod/system/collections/generic/stack.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
mcs/class/referencesource/mscorlib/system/AppContext/AppContext.cs
mcs/mcs/class.cs
mcs/mcs/codegen.cs
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/generic.cs
mcs/mcs/membercache.cs
mcs/mcs/method.cs
mcs/mcs/nullable.cs
mcs/mcs/statement.cs
mcs/tests/dtest-003.cs
mcs/tests/dtest-008.cs
mcs/tests/dtest-033.cs
mcs/tests/dtest-error-01.cs
mcs/tests/dtest-error-02.cs
mcs/tests/dtest-error-03.cs
mcs/tests/dtest-error-04.cs
mcs/tests/gtest-644.cs [new file with mode: 0644]
mcs/tests/gtest-645-lib.cs [new file with mode: 0644]
mcs/tests/gtest-645.cs [new file with mode: 0644]
mcs/tests/test-anon-178.cs [new file with mode: 0644]
mcs/tests/test-async-90.cs [new file with mode: 0644]
mcs/tests/test-async-91.cs [new file with mode: 0644]
mcs/tests/test-null-operator-24.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mcs/tools/cil-stringreplacer/Makefile
mcs/tools/cil-stringreplacer/cil-stringreplacer.cs
mcs/tools/linker/Descriptors/mscorlib.xml
mcs/tools/mono-symbolicate/mono-symbolicate-net_4_x.csproj
mcs/tools/mono-symbolicate/mono-symbolicate.exe.sources
mcs/tools/security/Makefile
mcs/tools/xbuild/Main.cs
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/class.c
mono/metadata/cominterop.c
mono/metadata/console-win32-uwp.c
mono/metadata/custom-attrs.c
mono/metadata/dynamic-image.c
mono/metadata/dynamic-stream.c
mono/metadata/exception.c
mono/metadata/gc-internals.h
mono/metadata/gc.c
mono/metadata/icall-windows-uwp.c
mono/metadata/icall.c
mono/metadata/image.c
mono/metadata/loader.c
mono/metadata/locales.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/metadata-verify.c
mono/metadata/metadata.c
mono/metadata/mono-basic-block.c
mono/metadata/mono-mlist.c
mono/metadata/mono-perfcounters.c
mono/metadata/mono-security-windows-uwp.c
mono/metadata/mono-security-windows.c
mono/metadata/mono-security.c
mono/metadata/object.c
mono/metadata/reflection-cache.h
mono/metadata/reflection.c
mono/metadata/remoting.c
mono/metadata/runtime.c
mono/metadata/security-core-clr.c
mono/metadata/sgen-mono.c
mono/metadata/sre-encode.c
mono/metadata/sre-save.c
mono/metadata/sre.c
mono/metadata/threadpool-io.c
mono/metadata/threadpool-worker-default.c
mono/metadata/threadpool-worker.h
mono/metadata/threadpool.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/metadata/verify.c
mono/metadata/w32error.h
mono/metadata/w32file-unix.c
mono/metadata/w32file-win32-uwp.c
mono/metadata/w32file-win32.c
mono/metadata/w32file.c
mono/metadata/w32process-unix.c
mono/metadata/w32process-win32-uwp.c
mono/metadata/w32process.c
mono/metadata/w32socket-unix.c
mono/metadata/w32socket.c
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/debugger-agent.c
mono/mini/driver.c
mono/mini/generics-interp.cs [deleted file]
mono/mini/generics.cs
mono/mini/graph.c
mono/mini/gshared.cs
mono/mini/interpreter/interp-internals.h [new file with mode: 0644]
mono/mini/interpreter/interp.c
mono/mini/interpreter/interp.h
mono/mini/interpreter/mintops.def
mono/mini/interpreter/transform.c
mono/mini/jit-icalls.c
mono/mini/method-to-ir.c
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-exceptions.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-ia64.c
mono/mini/mini-llvm.c
mono/mini/mini-mips.c
mono/mini/mini-ops.h
mono/mini/mini-ppc.c
mono/mini/mini-runtime.c
mono/mini/mini-s390x.c
mono/mini/mini-sparc.c
mono/mini/mini-trampolines.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/objects.cs
mono/mini/seq-points.c
mono/mini/ssa.c
mono/mini/tramp-amd64.c
mono/sgen/sgen-workers.c
mono/tests/Makefile.am
mono/tests/bug-46661.cs [new file with mode: 0644]
mono/tests/unhandled-exception-8.cs [new file with mode: 0644]
mono/tests/verifier/make_tests.sh
mono/utils/checked-build.c
mono/utils/checked-build.h
mono/utils/mono-context.h
mono/utils/mono-error.c
mono/utils/mono-error.h
mono/utils/mono-lazy-init.h
mono/utils/mono-poll.c
mono/utils/mono-rand-windows.c
mono/utils/mono-rand.c
mono/utils/mono-threads-coop.c
mono/utils/mono-threads.c
mono/utils/monobitset.c
mono/utils/os-event-unix.c
mono/utils/os-event-win32.c
mono/utils/os-event.h
msvc/scripts/order.xml
packaging/MacSDK/fsharp.py
packaging/MacSDK/ironlangs.py
packaging/MacSDK/mono.py
packaging/MacSDK/msbuild.py
packaging/MacSDK/packaging/resources/whitelist.txt
packaging/MacSDK/patches/fsharp-fix-mdb-support.patch [new file with mode: 0644]
packaging/MacSDK/pcl-reference-assemblies.py
packaging/MacSDK/profile.py
po/mcs/.gitattributes [new file with mode: 0644]
po/mcs/LINGUAS
runtime/.gitattributes [new file with mode: 0644]
scripts/.gitattributes
scripts/ci/run-jenkins.sh
scripts/mac-sdk-package.sh [new file with mode: 0755]

index f1689375385d253a1c413d2b07a8e9200e36e684..25a58f158fc10969d96a07b31634e05431143a84 100644 (file)
@@ -4,6 +4,9 @@ config.rpath    crlf=input
 configure.host crlf=input
 mkinstalldirs  crlf=input
 *.sh   crlf=input
+*.sources      crlf=input
+.gitattributes crlf=input
+*akefile*      crlf=input
 
 # ensure native line endings on checkout
 *.c    crlf
@@ -11,10 +14,6 @@ mkinstalldirs        crlf=input
 *.cs   crlf
 *.il   crlf
 
-.gitattributes crlf
-*akefile*      crlf
-*.sources      crlf
-
 # don't do anything to line-endings.  Let CRLFs go into the repo, and CRLF on checkout
 *.bat          -crlf
 *.sln          -crlf
index 8b34970a14e32997af77cb78cacc611f4da7bf9f..16e5ba16c16ef6a2292039a17e01d5c1abd5043a 100644 (file)
@@ -49,9 +49,6 @@ dist-hook:
 # Disable this for now because it is very slow and causes wrench to timeout:
 #      test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
 
-mac-sdk-package:
-       external/bockbuild/bb MacSDK --package
-
 pkgconfigdir = $(libdir)/pkgconfig
 noinst_DATA = mono-uninstalled.pc
 DISTCLEANFILES= mono-uninstalled.pc
index 9df7b8a5811328aafe3a0a58c0def29cf80ec5bb..1fedbe94fea1f463e15b192a8cd9d6d4592227ef 100644 (file)
@@ -18,7 +18,7 @@
   {
     "name": "ms-test-suite", 
     "url": "git@github.com:xamarin/ms-test-suite.git", 
-    "rev": "55b6637eb1de61c743323ec82db1e0cadfee5b32", 
+    "rev": "73c155f76b55839f26ba707d6d40091060e4f5d8", 
     "remote-branch": "origin/master", 
     "branch": "master", 
     "directory": "ms-test-suite"
index c339343805e6bbb5f3d8e360a8753daec8c75194..a8dcb129243b70243727efadf002dd69333022b1 100644 (file)
@@ -2,7 +2,7 @@
 #AC_PREREQ([2.62])
 
 # when bumping version number below, keep it in sync with man/mono.1 too
-AC_INIT(mono, [4.9.0],
+AC_INIT(mono, [4.9.1],
         [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
 
 AC_CONFIG_SRCDIR([README.md])
@@ -882,10 +882,6 @@ elif test x$with_runtime_preset = xhybridaot; then
    with_testing_aot_hybrid_default=yes
    TEST_PROFILE=testing_aot_hybrid 
 
-   mono_feature_disable_com='yes'
-   mono_feature_disable_remoting='yes'
-   mono_feature_disable_appdomains='yes'
-
    AOT_BUILD_FLAGS="--aot=hybrid,$INVARIANT_AOT_OPTIONS"
    AOT_RUN_FLAGS="--hybrid-aot"
 elif test x$with_runtime_preset = xaot; then
@@ -4127,6 +4123,8 @@ if test "x$enable_btls" = "xyes"; then
                BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
                if test "x$with_btls_android_ndk" != "x"; then
                        BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
+               else
+                       AC_MSG_ERROR([Need to pass the --with-btls-android-ndk argument when building with BTLS support on Android.])
                fi
        fi
 
index 08576f1a7de515eeda783c2936310d8288aa6629..1471ea511817cbed7af16759188a359021cf0ca8 100644 (file)
@@ -86,7 +86,7 @@ LOCK RULES
 Simple locks:
        Can be acquired at any point regardless of which locks are taken or not.
        No other locks can be acquired or released while holding a simple lock.
-       Reentrancy is not recomended. (warning)
+       Reentrancy is not recommended. (warning)
        Simple locks are leaf locks on the lock lattice.
 
 Complex locks:
@@ -129,7 +129,7 @@ ERROR: tried to acquire lock DomainLock at mono_domain_code_reserve_align while
 WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_class_from_name
 WARNING: tried to acquire lock ImageDataLock at mono_image_init_name_cache while holding ImageDataLock at mono_image_add_to_name_cache
        Both of those happen when filling up the name_cache, as it needs to alloc image memory.
-       This one is fixable by spliting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriatedly.
+       This one is fixable by splitting mono_image_init_name_cache into a locked and an unlocked variants and calling them appropriately.
 
 */
 
diff --git a/docs/.gitattributes b/docs/.gitattributes
new file mode 100644 (file)
index 0000000..1847f86
--- /dev/null
@@ -0,0 +1,3 @@
+check-coverage crlf=input
+check-exports  crlf=input
+produce-lists  crlf=input
index b44089c0de9ac4d5a5269fd91a6a4c8301f9c950..5c2ce91fd5f294e7a96b347bdb5f69200022c2c9 100755 (executable)
@@ -26,7 +26,7 @@ some combination of the two.
        
        To be clearer, and give an idea of what the algorithm can and
        cannot do without describing it in detail... keep in mind that
-       only "redunant" checks cannot be removed. By "redundant", I
+       only "redundant" checks cannot be removed. By "redundant", I
        mean "already explicitly checked" in the method code.
        
        Unfortunately, analyzing complex expressions is not so easy
@@ -136,7 +136,7 @@ some combination of the two.
        In the first case, the BB has exactly two exit BBs, and their
        execution conditions are easy to get from the condition of the
        branch (see the "get_relation_from_branch_instruction"
-       function, and expecially the end of "analyze_block" in
+       function, and especially the end of "analyze_block" in
        abcremoval.c.
 
        If there is a switch, the jump condition of every exit BB is
@@ -303,7 +303,7 @@ some combination of the two.
        each BB tried to examine all possible conditions between all
        variables, filling a sort of "evaluation matrix". The problem
        was that the complexity of this evaluation was quadratic (or
-       worse) on the number of variables, and that many wariables
+       worse) on the number of variables, and that many variables
        were examined even if they were not involved in any array
        access.
        
@@ -332,7 +332,7 @@ some combination of the two.
 
                    [1b] Prepare the evaluation graph (empty)
 
-                   [1b] Summarize each varible definition, and put
+                   [1b] Summarize each variable definition, and put
                         the resulting relations in the evaluation
                         graph
 
index a8efa5851f46572e4d6745e02daddc4298ce83b3..e8abd2e5568b32bd985befca308016d4526158ed 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a8efa5851f46572e4d6745e02daddc4298ce83b3
+Subproject commit e8abd2e5568b32bd985befca308016d4526158ed
index f7733aca6228f21cb06a0e4ebd58ca973643c4a6..f41352fa7dce0162d3172004617121fe28f06a88 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f7733aca6228f21cb06a0e4ebd58ca973643c4a6
+Subproject commit f41352fa7dce0162d3172004617121fe28f06a88
index f80cce4b1338b72b1b7637d4eb7675763adc13ab..c00dde208d25f180d881c37d465410ed2edd6939 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f80cce4b1338b72b1b7637d4eb7675763adc13ab
+Subproject commit c00dde208d25f180d881c37d465410ed2edd6939
index 367864ef810859ae3ce652864233b35f2dd5fdbe..7c1e61bec8c069b2cc9e214c3094b147d76bbf82 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 367864ef810859ae3ce652864233b35f2dd5fdbe
+Subproject commit 7c1e61bec8c069b2cc9e214c3094b147d76bbf82
index 69ce5c6b089b5c4bfebd7a6cd1bd7d90c0b05a03..0d4198b1299bcb019973749da4d47e90f15a1e46 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 69ce5c6b089b5c4bfebd7a6cd1bd7d90c0b05a03
+Subproject commit 0d4198b1299bcb019973749da4d47e90f15a1e46
index ae2f95cb3fe207d911dade789078327631f59aad..5e6ebcfb7a3de6675a593ee8234dff848eed4172 100644 (file)
@@ -21,7 +21,7 @@
  * See the definition of page_hash_table in gc_private.h.
  * False hits from the stack(s) are much more dangerous than false hits
  * from elsewhere, since the former can pin a large object that spans the
- * block, eventhough it does not start on the dangerous block.
+ * block, even though it does not start on the dangerous block.
  */
  
 /*
index fa6f279f518a5fac4b4778e9e869e4d82bb0539c..c30d2fc2184751a5b49d4b1c65c76655d8af6006 100644 (file)
@@ -1872,7 +1872,7 @@ Since 6.2alpha6:
  - Fixed Makefile.direct for DARWIN.  (Thanks to Manuel Serrano.)
  - There was a race between GC_pthread_detach and thread exit that could
    result in a thread structure being deallocated by GC_pthread_detach
-   eventhough it was still needed by the thread exit code.  (Thanks to
+   even though it was still needed by the thread exit code.  (Thanks to
    Dick Porter for the small test case that allowed this to be debugged.)
  - Fixed version parsing for non-alpha versions in acinclude.m4 and
    version checking in version.h.
index df0ef2cda933f68b5f2b37552a000182d38b1a5d..153a3e0f91465424070641164eae24bd5b70ae9b 100644 (file)
@@ -19,7 +19,7 @@ relatively easy to adapt to new compilers with a different set of predefined
 macros.  Currently these macros generally identify platforms instead of
 features.  In many cases, this is a mistake.
 
-3) The code currently avoids #elif, eventhough that would make it more
+3) The code currently avoids #elif, even though that would make it more
 readable.  This was done since #elif would need to be understood by ALL
 compilers used to build the collector, and that hasn't always been the case.
 It makes sense to reconsider this decision at some point, since #elif has been
index e14e5296c59f76d309ed7c7bc0d6c745019cde32..e870342e4121c2b7a92f56813605ef042502ed5f 100644 (file)
@@ -936,7 +936,7 @@ void GC_do_local_mark(mse *local_mark_stack, mse *local_top)
            /* Try to share the load, since the main stack is empty,    */
            /* and helper threads are waiting for a refill.             */
            /* The entries near the bottom of the stack are likely      */
-           /* to require more work.  Thus we return those, eventhough  */
+           /* to require more work.  Thus we return those, even though */
            /* it's harder.                                             */
            mse * p;
            mse * new_bottom = local_mark_stack
index d773851df4520e14cf02764ad48f92b6cf65fb3e..6b9ffd5c2b06f3a6926412396b477fe44c951bec 100644 (file)
@@ -8,7 +8,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH gacutil "Mono 1.0"
+.TH Mono "gacutil"
 .SH NAME
 gacutil \- Global Assembly Cache management utility.
 .SH SYNOPSIS
index f667a8f62a6851c3ffbe8ef0d5672ef2b3771312..795b855fb1cdd447727ce5ae97087105fb256660 100644 (file)
--- a/man/lc.1
+++ b/man/lc.1
@@ -9,7 +9,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH lc "Mono 2.6"
+.TH Mono "lc"
 .SH NAME
 lc \- Mono License Compiler
 .SH SYNOPSIS
index e39b080cce1245f37774efb1517dc6e4657bda6c..34c52691bd6a126c1ef5e883527a6869623a798f 100644 (file)
@@ -8,7 +8,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH macpack "Mono 1.0"
+.TH Mono "macpack"
 .SH NAME
 macpack \- Macintosh OS X Packager for managed gui assemblies
 .SH SYNOPSIS
index 0f809a59c9af5d744d2d163fb09b48fc3732dbae..0e220bc54b634baf1e68b44b26722510a536b718 100644 (file)
@@ -1,8 +1,8 @@
 .\" 
-.\" mono manual page.
+.\" mdb2ppdb manual page.
 .\" Copyright 2017 Microsoft 
 .\"
-.TH Mono "Mono 4.8.0"
+.TH Mono "mdb2ppdb"
 .SH NAME
 mdb2ppdb \- Convert Mono's debug file format (MDB) to Portable Program
 Database (PPDB) file formatn
index 440fc15a39793c8747007e4fb31ec825cfcd5c0a..3cd4bbea5558369f244d1873b7f220ec20c73074 100644 (file)
@@ -765,7 +765,7 @@ Refers to a namespace, e.g. \fIN:System\fR.
 .I "P:"
 Refers to a property.  If the property is an indexer or takes parameters, 
 the parameter types are appended to the property name and enclosed with
-paranthesis:
+parenthesis:
 \fIP:System.String.Length\fR,
 \fIP:System.String.Chars(System.Int32)\fR.
 .TP
index 3d067eb27ef9892b7d979a57b40f1d4fa17c4814..8a738a56f8384e332e678ccc94640c1dbf102d19 100644 (file)
@@ -8,7 +8,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH mkbundle "mkbundle 1.0"
+.TH Mono "mkbundle"
 .SH NAME
 mkbundle, mkbundle2 \- Creates a bundled executable.
 .SH SYNOPSIS
index 94c7b1665bc5a2fd21a17ba52b84d82136a33f1d..a8e31f3ed3356515a970d082eb42bb5537a13e2f 100644 (file)
@@ -5,7 +5,7 @@
 .\"   Miguel de Icaza (miguel@gnu.org)
 .\"   Paolo Molaro (lupus@ximian.com)
 .\"
-.TH Mono "Mono 1.0"
+.TH Mono "mono-config"
 .SH NAME
 mono-config \- Mono runtime file format configuration
 .SH DESCRIPTION
index 419289cabe5061007149b48f2163330503d2e53e..8a1a99caf1c93823c2521b1c026e7d46d89153f8 100644 (file)
@@ -8,7 +8,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH Mono "Mono 1.0"
+.TH Mono "mono-service"
 .SH NAME
 mono-service, mono-service2 \- Mono ServiceProcess host
 .SH SYNOPSIS
index 13c4928c929d5c17f51df184c463c70cad2052a9..e0c897d260dccc666581fd22670e671ec87ede2b 100644 (file)
@@ -9,7 +9,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH mono-xmltool "Mono 1.0"
+.TH Mono "mono-xmltool"
 .SH NAME
 mono-xmltool \- Mono XML validation and transformation tool. 
 .SH SYNOPSIS
index ef13ea04f687662685e404f3aeaca950df961480..4c99a8dd0d8ffe38e12cbaf81b7a5710da13c1f0 100644 (file)
@@ -7,7 +7,7 @@
 .\" Author:
 .\"   Miguel de Icaza (miguel@gnu.org)
 .\"
-.TH Mono "Mono 4.7.0"
+.TH Mono "mono"
 .SH NAME
 mono \- Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-of-Time)
 .SH SYNOPSIS
@@ -609,7 +609,7 @@ Finally, namespaces can be specified using the N: prefix:
 Don't align stack frames on the x86 architecture.  By default, Mono
 aligns stack frames to 16 bytes on x86, so that local floating point
 and SIMD variables can be properly aligned.  This option turns off the
-alignment, which usually saves one intruction per call, but might
+alignment, which usually saves one instruction per call, but might
 result in significantly lower floating point and SIMD performance.
 .TP
 \fB--jitmap\fR
@@ -1732,11 +1732,14 @@ values.
 This option allows using single-steps and breakpoints in hardware
 where we cannot do it with signals.
 .TP
-\fBsuspend-on-sigsegv\fR
-This option will suspend the program when a native SIGSEGV is received.
+\fBsuspend-on-native-crash\fR
+This option will suspend the program when a native crash occurs (SIGSEGV, SIGILL, ...).
 This is useful for debugging crashes which do not happen under gdb,
 since a live process contains more information than a core file.
 .TP
+\fBsuspend-on-sigsegv\fR
+Same as \fBsuspend-on-native-crash\fR.
+.TP
 \fBsuspend-on-exception\fR
 This option will suspend the program when an exception occurs.
 .TP
index 19d740305271c612aa69fc4b55dfafeb2a6d06be..8bbc34cb239284d9e71ff9bd8f078fcd93bde9cc 100644 (file)
@@ -237,7 +237,7 @@ to the type name, while methods append the method name (with an optional count
 of the number of generic parameters).
 .Sp
 If the constructor or method take arguments, these are listed within
-paranthesis after the constructor/method name:
+parenthesis after the constructor/method name:
 .Sp
 .I M:System.Object..ctor
 ,
@@ -259,7 +259,7 @@ Refers to a namespace, e.g.
 .I "P:"
 Refers to a property.  If the property is an indexer or takes parameters, 
 the parameter types are appended to the property name and enclosed with
-paranthesis:
+parenthesis:
 .I P:System.String.Length
 ,
 .I P:System.String.Chars(System.Int32)
index d8e9e4a98fe2a14e13c96ac13cdffa4239a8bbe6..1fd112447f8e91bbcd2d5aff11cf894a2baaaede 100644 (file)
@@ -8,7 +8,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH resgen "resgen 1.0"
+.TH Mono "resgen"
 .SH NAME
 resgen, resgen2 \- Mono/CLI Resource Generator
 .SH SYNOPSIS
index 4bf500ffd4a16a81c625ac2829e912449a895def..008fddbfc5c8253582e0ced767c1faf0f6379b55 100644 (file)
@@ -407,7 +407,7 @@ mysql      MySQL AB      MySql.Data.MySqlClient     MySql.Data
 NOTES:
 
 Ngsql is the .Net Data Provider for PosgreSQL.  The
-latest verison can be downloaded from 
+latest version can be downloaded from
 http://npgsql.projects.postgresql.org/
 
 MySql.Data is the MySQL Connector/Net for connecting to MySql databases.
index 1f9c224a2bb3dd4233a2607c98ef814c4e40d5bd..b81912bae54689d5c5ff6d0c2f685748b3bd1b1a 100644 (file)
@@ -1,2 +1,3 @@
 /LICENSE.MSPL -crlf
 /ScalableMonoIcon.svg -crlf
+/winexe.in     crlf=input
index 9d2deb9122f88a1b0759a16c4ba42b6c9272a885..54aa55d1545c99752cfe3e7e1de9bc181fafd8fc 100644 (file)
                                        code ();
                                }
 
-               * Avoid using unecessary open/close braces, vertical space
+               * Avoid using unnecessary open/close braces, vertical space
                  is usually limited:
 
                        good:
@@ -474,4 +474,4 @@ class X : Y {
                 MyHelperClass.cli.cs
                 MyHelperClass.jvm.cs
 
-       By using partial classes.
\ No newline at end of file
+       By using partial classes.
index bdc3b91261ed9f4df4a9e6319270718784f0cec8..a32065f040d6a6febdf5f443e210496b6b5c2f72 100644 (file)
@@ -25,7 +25,6 @@ PROFILE_MCS_FLAGS = \
        -d:MOBILE_DYNAMIC \
        -d:MONODROID \
        -d:ANDROID \
-       -d:NETSTANDARD \
        -nowarn:1699 \
        -nostdlib \
        $(DEFAULT_REFERENCES) \
index 4864a935530316e27aec0fe0ee71814db079e425..67408bbf9ce4416bc9d380518a3925f0002b46d3 100644 (file)
@@ -27,7 +27,6 @@ PROFILE_MCS_FLAGS = \
        -d:DISABLE_REMOTING \
        -d:DISABLE_COM \
        -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-       -d:NETSTANDARD \
        -nowarn:1699 \
        -nostdlib \
        $(DEFAULT_REFERENCES) \
index b547209cbaa99d94c4dcd1a15477512ce47b7418..a43693e04b37a3f79ab77743e051bb2f213c880a 100644 (file)
@@ -21,7 +21,6 @@ PROFILE_MCS_FLAGS = \
        -d:NET_4_0 \
        -d:NET_4_5 \
        -d:MONO \
-       -d:NETSTANDARD \
        -d:MOBILE,MOBILE_LEGACY \
        -d:FULL_AOT_DESKTOP     \
        -d:FULL_AOT_RUNTIME \
index 400e9df1b9ebba194ac5b8c5fda5e87aecc722ad..b4f51ca390401856a688861e33f4a94c855aaf7f 100644 (file)
@@ -21,7 +21,6 @@ PROFILE_MCS_FLAGS = \
        -d:NET_4_0 \
        -d:NET_4_5 \
        -d:MONO \
-       -d:NETSTANDARD \
        -d:MOBILE,MOBILE_LEGACY \
        -d:FULL_AOT_DESKTOP     \
        -d:FULL_AOT_RUNTIME \
index fcb655ecd417b34ff768cee0ad42134af9ecbdfe..2233519ac488276f553ded180e907d2587f181bf 100644 (file)
@@ -23,7 +23,6 @@ PROFILE_MCS_FLAGS = \
        -d:NET_4_0 \
        -d:NET_4_5 \
        -d:MONO \
-       -d:NETSTANDARD \
        -nowarn:1699 \
        -nostdlib \
        $(DEFAULT_REFERENCES) \
index 0380237c6cded3d70f54988eb6150fcadf2c2fac..a332d23266bad0571f424aafc774d32c849eac02 100644 (file)
@@ -21,7 +21,6 @@ PROFILE_MCS_FLAGS = \
        -d:NET_4_0 \
        -d:NET_4_5 \
        -d:MONO \
-       -d:NETSTANDARD \
        -d:MOBILE,MOBILE_LEGACY \
        -d:FULL_AOT_DESKTOP     \
        -d:FULL_AOT_RUNTIME \
index 6e84ebbb91c62eef28818e7d06158f4ad5fe7a9e..97265214662c26d192f71636e4ba90cfee19005f 100644 (file)
@@ -24,7 +24,6 @@ PROFILE_MCS_FLAGS = \
        -d:XAMMAC \
        -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
        -d:XAMARIN_MODERN \
-       -d:NETSTANDARD \
        -nowarn:1699 \
        -nostdlib \
        $(DEFAULT_REFERENCES) \
index 796e72236d6e1f66851f3f10721040c8a9c16338..ff651e4843eda2db78eb6399e7ef8161675967dd 100644 (file)
@@ -55,9 +55,7 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
-    <Compile Include="..\..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbColumn.cs" />\r
     <Compile Include="..\..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbDataReaderExtensions.Facade.cs" />\r
-    <Compile Include="..\..\..\..\external\corefx\src\System.Data.Common\src\System\Data\IColumnMappingCollection.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
     <Compile Include="TypeForwarders.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
index 883b2970bad4a9bbf3cb925a137eff367416719c..32b5e3dcfa2f0875712eb9f916c75f2cf80c3a09 100644 (file)
@@ -1,6 +1,4 @@
 TypeForwarders.cs
 AssemblyInfo.cs
 
-../../../../external/corefx/src/System.Data.Common/src/System/Data/IColumnMappingCollection.cs
-../../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbColumn.cs
 ../../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbDataReaderExtensions.Facade.cs
index 9470c9c78b2ca156ac4782396c30c7b48217b5ca..de99a9d6184e48a3c2ca79edee724a90ba118b69 100644 (file)
@@ -23,6 +23,7 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DBNull))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandBehavior))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbColumn))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbCommand))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnection))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnectionStringBuilder))]
@@ -38,6 +39,7 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowVersion))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTable))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DbType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IColumnMappingCollection))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameter))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameterCollection))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataReader))]
index 2e4028199f1e1cd52121eef23153f59452851a6c..fb688bfe397d66882a23b24462255348b4aba927 100644 (file)
@@ -25,6 +25,7 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventChannel))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCommand))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCommandEventArgs))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCounter))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventDataAttribute))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventFieldAttribute))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventFieldFormat))]
@@ -44,7 +45,3 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTask))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventWrittenEventArgs))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.NonEventAttribute))]
-
-#if NETSTANDARD
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCounter))]
-#endif
index 27258a0831aaea109cbb2b1420fa396ee1cc6147..7fd2f2898cdbcfd89116ffd99c280713c1d756c5 100644 (file)
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketInformationOptions))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketOptionLevel))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketOptionName))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveFromResult))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveMessageFromResult))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketShutdown))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketTaskExtensions))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketType))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.TcpClient))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.TcpListener))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.TransmitFileOptions))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.UdpClient))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.UdpReceiveResult))]
-
-#if NETSTANDARD
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveFromResult))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveMessageFromResult))]
-[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketTaskExtensions))]
-#endif
index 82ffbd5e0f9a28287ca5facf3600970337a59d56..7ad170e1e51367c76e10a8309cb57fdb6a129437 100644 (file)
@@ -11,9 +11,11 @@ LIBRARY = netstandard.dll
 
 KEY_FILE = ../../msfinal.pub
 SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699 /nowarn:618
-LIB_REFS = System System.Xml System.Xml.Linq System.Runtime.Serialization System.Core System.Numerics System.Net.Http System.Transactions \
+LIB_REFS = System System.Xml System.Xml.Linq System.Runtime.Serialization System.Core System.Numerics System.Numerics.Vectors System.Net.Http System.Transactions \
 System.IO.Compression System.Data System.ComponentModel.Composition System.IO.Compression.FileSystem \
-Facades/System.Security.Cryptography.Algorithms
+Facades/System.Security.Cryptography.Algorithms Facades/System.Globalization.Extensions Facades/System.Data.Common \
+Facades/System.Diagnostics.StackTrace Facades/System.Runtime.Serialization.Xml Facades/System.Runtime.Serialization.Primitives \
+Facades/System.Security.SecureString Facades/System.Threading.Overlapped Facades/System.Xml.XPath.XDocument
 
 ifeq (2.1, $(FRAMEWORK_VERSION))
 LIB_REFS += System.Web.Services
index 2f390fbbdd074bbd9f50d06c2c6fc208b00938ce..469931ab41abbf21d8037692185995172d9d6c5b 100644 (file)
@@ -5,6 +5,8 @@
 // dotnetcli\dotnet.exe Tools\GenAPI.exe -assembly:bin\ref\netstandard\2.0.0.0\netstandard.dll -writer:TypeForwards
 //
 
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.SqlServer.Server.SqlDataRecord))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.SqlServer.Server.SqlMetaData))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.CriticalHandleMinusOneIsInvalid))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.CriticalHandleZeroOrMinusOneIsInvalid))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.SafeFileHandle))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(string))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.StringComparer))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.StringComparison))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.StringNormalizationExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.StringSplitOptions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SystemException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ThreadStaticAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.ISet<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.KeyNotFoundException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.KeyValuePair<,>))]
-[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.LinkedList<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.LinkedListNode<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.LinkedList<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.List<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.Queue<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.SortedDictionary<,>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DataColumnMappingCollection))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DataTableMapping))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DataTableMappingCollection))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbColumn))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbCommand))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbCommandBuilder))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbConnection))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbConnectionStringBuilder))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbDataAdapter))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbDataReader))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbDataReaderExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbDataRecord))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbDataSourceEnumerator))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbEnumerator))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbProviderSpecificTypePropertyAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.DbTransaction))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.GroupByBehavior))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.IDbColumnSchemaGenerator))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.IdentifierCase))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.RowUpdatedEventArgs))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.RowUpdatingEventArgs))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.SchemaTableColumn))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.SchemaTableOptionalColumn))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Common.SupportedJoinOperators))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.ApplicationIntent))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SortOrder))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlBulkCopy))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlBulkCopyColumnMapping))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlBulkCopyColumnMappingCollection))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlBulkCopyOptions))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlClientFactory))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlCommand))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlConnection))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlConnectionStringBuilder))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlDataReader))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlError))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlErrorCollection))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlException))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlInfoMessageEventArgs))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlInfoMessageEventHandler))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlParameter))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlParameterCollection))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlRowsCopiedEventArgs))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlRowsCopiedEventHandler))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlClient.SqlTransaction))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.INullable))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlAlreadyFilledException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlBinary))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.DebuggerVisualizerAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.DefaultTraceListener))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.DelimitedListTraceListener))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.EventTypeFilter))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.FileVersionInfo))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.MonitoringDescriptionAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Process))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.SourceLevels))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.SourceSwitch))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.StackFrame))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.StackFrameExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.StackTrace))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Stopwatch))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Switch))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.DaylightTime))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.DigitShapes))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.EastAsianLunisolarCalendar))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.GlobalizationExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.GregorianCalendar))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.GregorianCalendarTypes))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Globalization.HebrewCalendar))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.DynamicExpressionVisitor))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.ElementInit))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.Expression))]
-[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.Expression<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.ExpressionType))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.ExpressionVisitor))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.Expression<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.GotoExpression))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.GotoExpressionKind))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Linq.Expressions.IArgumentProvider))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Matrix4x4))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Plane))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Quaternion))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Vector))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Vector2))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Vector3))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Vector4))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.Vector<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.AmbiguousMatchException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Assembly))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.AssemblyAlgorithmIdAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallerLineNumberAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallerMemberNameAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallSite))]
-[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallSite<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallSiteBinder))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallSiteHelpers))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CallSite<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CompilationRelaxations))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CompilationRelaxationsAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.VarEnum))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.VariantWrapper))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.ADVF))]
-[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.BINDPTR))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.CALLCONV))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.CONNECTDATA))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.ComTypes.DATADIR))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractResolver))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractSerializer))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractSerializerExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractSerializerSettings))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataMemberAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DateTimeFormat))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISafeSerializationData))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISerializable))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISerializationSurrogate))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISerializationSurrogateProvider))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISurrogateSelector))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.KnownTypeAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ObjectIDGenerator))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.ISecurityEncodable))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.PartialTrustVisibilityLevel))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.SecureString))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.SecureStringMarshal))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.SecurityCriticalAttribute))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.SecurityCriticalScope))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.SecurityElement))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.ClaimTypes))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.ClaimValueTypes))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Aes))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesCng))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesCryptoServiceProvider))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesManaged))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsnEncodedData))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECCurve))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDiffieHellmanPublicKey))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDsa))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDsaCng))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECParameters))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECPoint))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.FromBase64Transform))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SymmetricAlgorithm))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ToBase64Transform))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.TripleDES))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.TripleDESCng))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.TripleDESCryptoServiceProvider))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.ECDsaCertificateExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.OpenFlags))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.AbandonedMutexException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ApartmentState))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.AsyncFlowControl))]
-[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.AsyncLocal<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.AsyncLocalValueChangedArgs<>))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.AsyncLocal<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.AutoResetEvent))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Barrier))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.BarrierPostPhaseException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.NativeOverlapped))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Overlapped))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ParameterizedThreadStart))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.PreAllocatedOverlapped))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ReaderWriterLock))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ReaderWriterLockSlim))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.RegisteredWaitHandle))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadInterruptedException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadLocal<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadPool))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadPoolBoundHandle))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadPriority))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadStart))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadStartException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.ParallelLoopState))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.ParallelOptions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
-[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskCanceledException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskCompletionSource<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskContinuationOptions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskScheduler))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskSchedulerException))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.TaskStatus))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task<>))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.UnobservedTaskExceptionEventArgs))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Timers.ElapsedEventArgs))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Timers.ElapsedEventHandler))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Serialization.XmlTypeMapping))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.Extensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.IXPathNavigable))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.XDocumentExtensions))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.XmlCaseOrder))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.XmlDataType))]
 [assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.XPath.XmlSortOrder))]
index a7ed8bb8144765e5fd884cedcf5491781ac03cf1..fa9e99d722dfc86189a2cfa2bda0c2a669044e98 100644 (file)
@@ -2,6 +2,12 @@ thisdir = class
 
 pcl_facade_dirs := Facades
 
+-include ../build/config.make
+
+ifdef MCS_MODE
+MCS_MODE_dirs := Mono.Cecil.Mdb
+endif
+
 # The minimal set of csc dependencies
 basic_SUBDIRS := \
        corlib \
@@ -14,6 +20,7 @@ basic_SUBDIRS := \
        System.Xml.Linq \
        System.Runtime.InteropServices.RuntimeInformation \
        Mono.Cecil \
+       $(MCS_MODE_dirs) \
        ../tools/cil-stringreplacer
 
 # resgen is corlib specific so we need to wait until corlib is build
@@ -33,12 +40,11 @@ build_SUBDIRS :=  \
        System.Runtime.InteropServices.RuntimeInformation \
        System.IO.Compression \
        Mono.Cecil \
+       $(MCS_MODE_dirs) \
        Mono.CompilerServices.SymbolWriter      \
        PEAPI \
        ../tools/cil-stringreplacer
 
--include ../build/config.make
-
 ifdef MCS_MODE
 basic_PARALLEL_SUBDIRS := ../mcs
 build_PARALLEL_SUBDIRS := ../mcs
index ae919ca94fb481c00652d29fbe67de1180ee268a..e22eae3e178f473dd09bb49d491bd12578c5a9d0 100644 (file)
@@ -4,8 +4,10 @@ include ../../build/rules.make
 
 LIBRARY = Microsoft.CSharp.dll
 
-LIB_REFS = System.Core Mono.CSharp
+LIB_REFS = System.Core System
 LIB_MCS_FLAGS =
 
+RESX_RESOURCE_STRING = ../../../external/corefx/src/Microsoft.CSharp/src/Resources/Strings.resx
+
 include ../../build/library.make
 
index 41574527162ac270c67acea1781f1f890a86995a..e764b1041be993c46e568bc00db84e8e3859eae4 100644 (file)
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Binder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\BinderHelper.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpArgumentInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpArgumentInfoFlags.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationFlags.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpBinderFlags.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpCallFlags.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpConversionKind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpGetIndexBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpInvokeBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpInvokeConstructorBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpInvokeMemberBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpIsEventBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpSetIndexBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpSetMemberBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Error.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CController.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CError.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CErrorFactory.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CParameterizedError.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorCode.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorFacts.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorFmt.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\IErrorSink.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\MessageID.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ICSharpInvokeOrInvokeMemberBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ResetBindException.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderController.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderException.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderInternalCompilerException.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Binding\ErrorReporting.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\BindingContextBase.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\BindingContexts.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\BindingFlag.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\BinOpArgInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\BinOpKind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\BinOpSig.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\CandidateFunctionMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ConstVal.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ConstValFactory.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\COperators.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Declarations\AggregateDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Declarations\Declaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Declarations\GlobalAttributeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Declarations\NamespaceDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionKind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\EXPRFLAG.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\FileRecord.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\FundamentalTypes.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GlobalSymbolContext.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinderResult.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\InputFile.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ITypeOrNamespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\LangCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MetadataToken.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MethodKind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\NameGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\NullableLift.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\OriginalExpressions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedAttributes.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\SubstitutionContext.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AggregateSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AssemblyQualifiedNamespaceSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\EventSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\FieldSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\IndexerSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\LabelSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\LocalVariableSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MiscSymFactory.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\NamespaceOrAggregateSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\NamespaceSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\ParentSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\PropertySymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\Scope.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\Symbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolKind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolManagerBase.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolMask.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolTable.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactory.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactoryBase.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\TransparentIdentifierMemberSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\TypeParameterSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\UnresolvedAggregateSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\VariableSymbol.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ArrayIndex.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ArrayInitialization.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ArrayLength.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Assignment.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BinaryOperator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Block.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BoundAnonymousFunction.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Call.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Cast.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Class.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\CompoundOperator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Concatenate.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ConditionalOperator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Event.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExpressionIterator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Field.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\FieldInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\HoistedLocal.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\List.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\LocalVariable.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MemberGroup.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodReference.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\NamedArgumentSpecification.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Property.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Return.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Statement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Temporary.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\This.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\TypeArguments.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\TypeOf.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\TypeOrNamespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnaryOperator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnboundAnonymousFunction.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedLogicalOperator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExprVisitorBase.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ZeroInitialize.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\TypeBind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArgumentListType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArrayType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\BoundLambdaType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ErrorType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\MethodGroupType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullableType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\OpenTypePlaceholderType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ParameterModifierType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\PointerType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\Type.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeFactory.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeKind.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeTable.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\VoidType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\UnaOpSig.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\UtilityTypeExtensions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\WithType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\SpecialNames.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\SymbolTable.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\KnownName.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\NameManager.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\Names.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\Operators.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\PredefinedName.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\PredefinedType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\TokenFacts.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Syntax\TokenKind.cs" />\r
+    <Compile Include="..\..\build\common\Consts.cs" />\r
+    <Compile Include="..\..\build\common\SR.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\Binder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpArgumentInfo.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpArgumentInfoFlags.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpBinaryOperationBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpBinderFlags.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpConvertBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpGetIndexBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpGetMemberBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpInvokeBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpInvokeConstructorBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpInvokeMemberBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpIsEventBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpSetIndexBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpSetMemberBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\CSharpUnaryOperationBinder.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\DynamicContext.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\ErrorPrinter.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\Extensions.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\RuntimeBinderContext.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\RuntimeBinderException.cs" />\r
-    <Compile Include="Microsoft.CSharp.RuntimeBinder\RuntimeBinderInternalCompilerException.cs" />\r  </ItemGroup>\r
+    <Compile Include="corefx\SR.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
   <Target Name="BeforeBuild">\r
       <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
       <Name>System.Core-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../Mono.CSharp/Mono.CSharp-net_4_x.csproj">\r
-      <Project>{BEFCA993-98B4-48E9-8D68-1ACCB1FA7200}</Project>\r
-      <Name>Mono.CSharp-net_4_x</Name>\r
+    <ProjectReference Include="../System/System-net_4_x.csproj">\r
+      <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
+      <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/Binder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/Binder.cs
deleted file mode 100644 (file)
index c8d5687..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Binder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
-using System.Linq.Expressions;
-using System.Reflection;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       public static class Binder
-       {
-               public static CallSiteBinder BinaryOperation (CSharpBinderFlags flags, ExpressionType operation, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpBinaryOperationBinder (operation, flags, context, argumentInfo);
-               }
-               
-               public static CallSiteBinder Convert (CSharpBinderFlags flags, Type type, Type context)
-               {
-                       return new CSharpConvertBinder (type, context, flags);
-               }
-               
-               public static CallSiteBinder GetIndex (CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpGetIndexBinder (context, argumentInfo);
-               }
-               
-               public static CallSiteBinder GetMember (CSharpBinderFlags flags, string name, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpGetMemberBinder (name, context, argumentInfo);
-               }
-               
-               public static CallSiteBinder Invoke (CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpInvokeBinder (flags, context, argumentInfo);
-               }
-               
-               public static CallSiteBinder InvokeConstructor (CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       // What are flags for here
-                       return new CSharpInvokeConstructorBinder (context, argumentInfo);
-               }
-               
-               public static CallSiteBinder InvokeMember (CSharpBinderFlags flags, string name, IEnumerable<Type> typeArguments, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpInvokeMemberBinder (flags, name, context, typeArguments, argumentInfo);
-               }
-               
-               public static CallSiteBinder IsEvent (CSharpBinderFlags flags, string name, Type context)
-               {
-                       return new CSharpIsEventBinder (name, context);
-               }
-               
-               public static CallSiteBinder SetIndex (CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpSetIndexBinder (flags, context, argumentInfo);
-               }
-               
-               public static CallSiteBinder SetMember (CSharpBinderFlags flags, string name, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpSetMemberBinder (flags, name, context, argumentInfo);
-               }
-               
-               public static CallSiteBinder UnaryOperation (CSharpBinderFlags flags, ExpressionType operation, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       return new CSharpUnaryOperationBinder (operation, flags, context, argumentInfo);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfo.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfo.cs
deleted file mode 100644 (file)
index 2c54af2..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// CSharpArgumentInfo.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       public sealed class CSharpArgumentInfo
-       {
-               readonly CSharpArgumentInfoFlags flags;
-               readonly string name;
-               
-               CSharpArgumentInfo (CSharpArgumentInfoFlags flags, string name)
-               {
-                       this.flags = flags;
-                       this.name = name;
-               }
-               
-               public static CSharpArgumentInfo Create (CSharpArgumentInfoFlags flags, string name)
-               {
-                       return new CSharpArgumentInfo (flags, name);
-               }
-
-               internal Compiler.Argument.AType ArgumentModifier {
-                       get {
-                               if ((flags & CSharpArgumentInfoFlags.IsRef) != 0)
-                                       return Compiler.Argument.AType.Ref;
-
-                               if ((flags & CSharpArgumentInfoFlags.IsOut) != 0)
-                                       return Compiler.Argument.AType.Out;
-
-                               return Compiler.Argument.AType.None;
-                       }
-               }
-
-               internal static CallInfo CreateCallInfo (IEnumerable<CSharpArgumentInfo> argumentInfo, int skipCount)
-               {
-                       var named = from arg in argumentInfo.Skip (skipCount) where arg.IsNamed select arg.name;
-                       return new CallInfo (Math.Max (0, argumentInfo.Count () - skipCount), named);
-               }
-               
-               internal CSharpArgumentInfoFlags Flags {
-                       get { return flags; }
-               }
-
-               internal bool IsNamed {
-                       get { return (flags & CSharpArgumentInfoFlags.NamedArgument) != 0; }
-               }
-
-               internal string Name {
-                       get { return name; }
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfoFlags.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfoFlags.cs
deleted file mode 100644 (file)
index 9a9ea7e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// CSharpArgumentInfoFlags.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       [Flags]
-       public enum CSharpArgumentInfoFlags
-       {
-               None                            = 0,
-               UseCompileTimeType      = 1,
-               Constant                        = 2,
-               NamedArgument           = 4,
-               IsRef                           = 8,
-               IsOut                           = 16,
-               IsStaticType            = 32
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs
deleted file mode 100644 (file)
index 374eb0d..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// CSharpBinaryOperationBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Runtime.CompilerServices;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpBinaryOperationBinder : BinaryOperationBinder
-       {
-               IList<CSharpArgumentInfo> argumentInfo;
-               readonly CSharpBinderFlags flags;
-               readonly Type context;
-               
-               public CSharpBinaryOperationBinder (ExpressionType operation, CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (operation)
-               {
-                       this.argumentInfo = new ReadOnlyCollectionBuilder<CSharpArgumentInfo> (argumentInfo);
-                       if (this.argumentInfo.Count != 2)
-                               throw new ArgumentException ("Binary operation requires 2 arguments");
-
-                       this.flags = flags;
-                       this.context = context;
-               }
-
-               Compiler.Binary.Operator GetOperator (out bool isCompound)
-               {
-                       isCompound = false;
-                       switch (Operation) {
-                       case ExpressionType.Add:
-                               return Compiler.Binary.Operator.Addition;
-                       case ExpressionType.AddAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.Addition;
-                       case ExpressionType.And:
-                               return (flags & CSharpBinderFlags.BinaryOperationLogical) != 0 ?
-                                       Compiler.Binary.Operator.LogicalAnd : Compiler.Binary.Operator.BitwiseAnd;
-                       case ExpressionType.AndAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.BitwiseAnd;
-                       case ExpressionType.Divide:
-                               return Compiler.Binary.Operator.Division;
-                       case ExpressionType.DivideAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.Division;
-                       case ExpressionType.Equal:
-                               return Compiler.Binary.Operator.Equality;
-                       case ExpressionType.ExclusiveOr:
-                               return Compiler.Binary.Operator.ExclusiveOr;
-                       case ExpressionType.ExclusiveOrAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.ExclusiveOr;
-                       case ExpressionType.GreaterThan:
-                               return Compiler.Binary.Operator.GreaterThan;
-                       case ExpressionType.GreaterThanOrEqual:
-                               return Compiler.Binary.Operator.GreaterThanOrEqual;
-                       case ExpressionType.LeftShift:
-                               return Compiler.Binary.Operator.LeftShift;
-                       case ExpressionType.LeftShiftAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.LeftShift;
-                       case ExpressionType.LessThan:
-                               return Compiler.Binary.Operator.LessThan;
-                       case ExpressionType.LessThanOrEqual:
-                               return Compiler.Binary.Operator.LessThanOrEqual;
-                       case ExpressionType.Modulo:
-                               return Compiler.Binary.Operator.Modulus;
-                       case ExpressionType.ModuloAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.Modulus;
-                       case ExpressionType.Multiply:
-                               return Compiler.Binary.Operator.Multiply;
-                       case ExpressionType.MultiplyAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.Multiply;
-                       case ExpressionType.NotEqual:
-                               return Compiler.Binary.Operator.Inequality;
-                       case ExpressionType.Or:
-                               return (flags & CSharpBinderFlags.BinaryOperationLogical) != 0 ?
-                                       Compiler.Binary.Operator.LogicalOr : Compiler.Binary.Operator.BitwiseOr;
-                       case ExpressionType.OrAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.BitwiseOr;
-                       case ExpressionType.OrElse:
-                               return Compiler.Binary.Operator.LogicalOr;
-                       case ExpressionType.RightShift:
-                               return Compiler.Binary.Operator.RightShift;
-                       case ExpressionType.RightShiftAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.RightShift;
-                       case ExpressionType.Subtract:
-                               return Compiler.Binary.Operator.Subtraction;
-                       case ExpressionType.SubtractAssign:
-                               isCompound = true;
-                               return Compiler.Binary.Operator.Subtraction;
-                       default:
-                               throw new NotImplementedException (Operation.ToString ());
-                       }
-               }
-               
-               public override DynamicMetaObject FallbackBinaryOperation (DynamicMetaObject target, DynamicMetaObject arg, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var left = ctx.CreateCompilerExpression (argumentInfo [0], target);
-                       var right = ctx.CreateCompilerExpression (argumentInfo [1], arg);
-                       
-                       bool is_compound;
-                       var oper = GetOperator (out is_compound);
-                       Compiler.Expression expr;
-
-                       if (is_compound) {
-                               var target_expr = new Compiler.RuntimeValueExpression (target, ctx.ImportType (target.LimitType));
-                               expr = new Compiler.CompoundAssign (oper, target_expr, right, left);
-                       } else {
-                               expr = new Compiler.Binary (oper, left, right);
-                       }
-
-                       expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-                       
-                       if ((flags & CSharpBinderFlags.CheckedContext) != 0)
-                               expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (arg);
-
-                       return binder.Bind (ctx, context);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinder.cs
deleted file mode 100644 (file)
index ab977fc..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// CSharpBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Linq.Expressions;
-using Compiler = Mono.CSharp;
-using System.Reflection;
-using System.Collections.Generic;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpBinder
-       {
-               static ConstructorInfo binder_exception_ctor;
-               static object resolver = new object ();
-
-               DynamicMetaObjectBinder binder;
-               Compiler.Expression expr;
-               BindingRestrictions restrictions;
-               DynamicMetaObject errorSuggestion;
-
-               public CSharpBinder (DynamicMetaObjectBinder binder, Compiler.Expression expr, DynamicMetaObject errorSuggestion)
-               {
-                       this.binder = binder;
-                       this.expr = expr;
-                       this.restrictions = BindingRestrictions.Empty;
-                       this.errorSuggestion = errorSuggestion;
-               }
-
-               public Compiler.ResolveContext.Options ResolveOptions { get; set; }
-
-               public void AddRestrictions (DynamicMetaObject arg)
-               {
-                       restrictions = restrictions.Merge (CreateRestrictionsOnTarget (arg));
-               }
-
-               public void AddRestrictions (DynamicMetaObject[] args)
-               {
-                       restrictions = restrictions.Merge (CreateRestrictionsOnTarget (args));
-               }
-
-               public DynamicMetaObject Bind (DynamicContext ctx, Type callingType)
-               {
-                       Expression res;
-                       try {
-                               var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, callingType), ResolveOptions);
-
-                               // Static typemanager and internal caches are not thread-safe
-                               lock (resolver) {
-                                       expr = expr.Resolve (rc, Compiler.ResolveFlags.VariableOrValue);
-                               }
-
-                               if (expr == null)
-                                       throw new RuntimeBinderInternalCompilerException ("Expression resolved to null");
-
-                               res = expr.MakeExpression (new Compiler.BuilderContext ());
-                       } catch (RuntimeBinderException e) {
-                               if (errorSuggestion != null)
-                                       return errorSuggestion;
-
-                               res = CreateBinderException (e.Message);
-                       } catch (Exception) {
-                               if (errorSuggestion != null)
-                                       return errorSuggestion;
-
-                               throw;
-                       }
-
-                       return new DynamicMetaObject (res, restrictions);
-               }
-
-               Expression CreateBinderException (string message)
-               {
-                       if (binder_exception_ctor == null)
-                               binder_exception_ctor = typeof (RuntimeBinderException).GetConstructor (new[] { typeof (string) });
-
-                       //
-                       // Uses target type to keep expressions composition working
-                       //
-                       return Expression.Throw (Expression.New (binder_exception_ctor, Expression.Constant (message)), binder.ReturnType);
-               }
-
-               static BindingRestrictions CreateRestrictionsOnTarget (DynamicMetaObject arg)
-               {
-                       return arg.HasValue && arg.Value == null ?
-                               BindingRestrictions.GetInstanceRestriction (arg.Expression, null) :
-                               BindingRestrictions.GetTypeRestriction (arg.Expression, arg.LimitType);
-               }
-
-               public static BindingRestrictions CreateRestrictionsOnTarget (DynamicMetaObject[] args)
-               {
-                       if (args.Length == 0)
-                               return BindingRestrictions.Empty;
-
-                       var res = CreateRestrictionsOnTarget (args[0]);
-                       for (int i = 1; i < args.Length; ++i)
-                               res = res.Merge (CreateRestrictionsOnTarget (args[i]));
-
-                       return res;
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinderFlags.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinderFlags.cs
deleted file mode 100644 (file)
index 39ef679..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// CSharpBinderFlags.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       [Flags]
-       public enum CSharpBinderFlags
-       {
-               None                                    = 0,
-               CheckedContext                  = 1,
-               InvokeSimpleName                = 1 << 1,
-               InvokeSpecialName               = 1 << 2,
-               BinaryOperationLogical  = 1 << 3,
-               ConvertExplicit                 = 1 << 4,
-               ConvertArrayIndex               = 1 << 5,
-               ResultIndexed                   = 1 << 6,               
-               ValueFromCompoundAssignment = 1 << 7,
-               ResultDiscarded                 = 1 << 8
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpConvertBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpConvertBinder.cs
deleted file mode 100644 (file)
index 32fa472..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// CSharpConvertBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpConvertBinder : ConvertBinder
-       {
-               readonly CSharpBinderFlags flags;
-               readonly Type context;
-
-               public CSharpConvertBinder (Type type, Type context, CSharpBinderFlags flags)
-                       : base (type, (flags & CSharpBinderFlags.ConvertExplicit) != 0)
-               {
-                       this.flags = flags;
-                       this.context = context;
-               }
-
-               public override DynamicMetaObject FallbackConvert (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var expr = ctx.CreateCompilerExpression (null, target);
-
-                       if (Explicit)
-                               expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (Type), Compiler.Location.Null), expr, Compiler.Location.Null);
-                       else
-                               expr = new Compiler.ImplicitCast (expr, ctx.ImportType (Type), (flags & CSharpBinderFlags.ConvertArrayIndex) != 0);
-
-                       if ((flags & CSharpBinderFlags.CheckedContext) != 0)
-                               expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-
-                       return binder.Bind (ctx, context);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetIndexBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetIndexBinder.cs
deleted file mode 100644 (file)
index 367cc22..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// CSharpGetIndexBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpGetIndexBinder : GetIndexBinder
-       {
-               IList<CSharpArgumentInfo> argumentInfo;
-               Type callingContext;
-               
-               public CSharpGetIndexBinder (Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
-               {
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-               }
-                       
-               public override DynamicMetaObject FallbackGetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion)
-               {
-                       if (argumentInfo.Count != indexes.Length + 1) {
-                               if (errorSuggestion == null)
-                                       throw new NotImplementedException ();
-
-                               return errorSuggestion;
-                       }
-
-                       var ctx = DynamicContext.Create ();
-                       var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
-                       var args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
-                       expr = new Compiler.ElementAccess (expr, args, Compiler.Location.Null);
-                       expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (indexes);
-
-                       return binder.Bind (ctx, callingContext);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs
deleted file mode 100644 (file)
index 790ed72..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// CSharpGetMemberBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpGetMemberBinder : GetMemberBinder
-       {
-               IList<CSharpArgumentInfo> argumentInfo;
-               Type callingContext;
-               
-               public CSharpGetMemberBinder (string name, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (name, false)
-               {
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-               }
-               
-               public override DynamicMetaObject FallbackGetMember (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-
-                       var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
-                       expr = new Compiler.MemberAccess (expr, Name);
-                       expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-
-                       return binder.Bind (ctx, callingContext);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeBinder.cs
deleted file mode 100644 (file)
index 1f6b34a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// CSharpInvokeBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpInvokeBinder : InvokeBinder
-       {
-               readonly CSharpBinderFlags flags;
-               IList<CSharpArgumentInfo> argumentInfo;
-               Type callingContext;
-               
-               public CSharpInvokeBinder (CSharpBinderFlags flags, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
-               {
-                       this.flags = flags;
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-               }
-               
-               public override DynamicMetaObject FallbackInvoke (DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
-                       var c_args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), args);
-                       expr = new Compiler.Invocation (expr, c_args);
-
-                       if ((flags & CSharpBinderFlags.ResultDiscarded) == 0)
-                               expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-                       else
-                               expr = new Compiler.DynamicResultCast (ctx.ImportType (ReturnType), expr);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (args);
-
-                       return binder.Bind (ctx, callingContext);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeConstructorBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeConstructorBinder.cs
deleted file mode 100644 (file)
index b5f0b9f..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// CSharpInvokeConstructorBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpInvokeConstructorBinder : DynamicMetaObjectBinder
-       {
-               IList<CSharpArgumentInfo> argumentInfo;
-               Type callingContext;
-               Type target_return_type;
-
-               public CSharpInvokeConstructorBinder (Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
-               {
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-               }
-
-               public override DynamicMetaObject Bind (DynamicMetaObject target, DynamicMetaObject[] args)
-               {
-                       var ctx = DynamicContext.Create ();
-
-                       var type = ctx.CreateCompilerExpression (argumentInfo [0], target);
-                       target_return_type = type.Type.GetMetaInfo ();
-
-                       var c_args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), args);
-
-                       var binder = new CSharpBinder (
-                               this, new Compiler.New (type, c_args, Compiler.Location.Null), null);
-
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (args);
-
-                       return binder.Bind (ctx, callingContext);
-               }
-
-               public override Type ReturnType {
-                       get {
-                               return target_return_type;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeMemberBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpInvokeMemberBinder.cs
deleted file mode 100644 (file)
index 138e314..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// CSharpInvokeMemberBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-using SLE = System.Linq.Expressions;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpInvokeMemberBinder : InvokeMemberBinder
-       {
-               //
-               // A custom runtime invocation is needed to deal with member invocation which
-               // is not real member invocation but invocation on invocalble member.
-               //
-               // An example:
-               // class C {
-               //              dynamic f;
-               //              void Foo ()
-               //              {
-               //                      dynamic d = new C ();
-               //                      d.f.M ();
-               //              }
-               //
-               // The runtime value of `f' can be a delegate in which case we are invoking result
-               // of member invocation, this is already handled by DoResolveDynamic but we need
-               // more runtime dependencies which require Microsoft.CSharp assembly reference or
-               // a lot of reflection calls
-               //
-               class Invocation : Compiler.Invocation
-               {
-                       sealed class RuntimeDynamicInvocation : Compiler.ShimExpression
-                       {
-                               Invocation invoke;
-
-                               public RuntimeDynamicInvocation (Invocation invoke, Compiler.Expression memberExpr)
-                                       : base (memberExpr)
-                               {
-                                       this.invoke = invoke;
-                               }
-
-                               protected override Compiler.Expression DoResolve (Compiler.ResolveContext rc)
-                               {
-                                       type = expr.Type;
-                                       eclass = Compiler.ExprClass.Value;
-                                       return this;
-                               }
-
-                               //
-                               // Creates an invoke call on invocable expression
-                               //
-                               public override System.Linq.Expressions.Expression MakeExpression (Compiler.BuilderContext ctx)
-                               {
-                                       var invokeBinder = invoke.invokeBinder;
-                                       var binder = Binder.Invoke (invokeBinder.flags, invokeBinder.callingContext, invokeBinder.argumentInfo);
-
-                                       var args = invoke.Arguments;
-                                       var args_expr = new SLE.Expression[invokeBinder.argumentInfo.Count];
-
-                                       var types = new Type [args_expr.Length + 2];
-
-                                       // Required by MakeDynamic
-                                       types[0] = typeof (System.Runtime.CompilerServices.CallSite);
-                                       types[1] = expr.Type.GetMetaInfo ();
-
-                                       args_expr[0] = expr.MakeExpression (ctx);
-
-                                       for (int i = 0; i < args.Count; ++i) {
-                                               args_expr[i + 1] = args[i].Expr.MakeExpression (ctx);
-
-                                               int type_index = i + 2;
-                                               types[type_index] = args[i].Type.GetMetaInfo ();
-                                               if (args[i].IsByRef)
-                                                       types[type_index] = types[type_index].MakeByRefType ();
-                                       }
-
-                                       // Return type goes last
-                                       bool void_result = (invokeBinder.flags & CSharpBinderFlags.ResultDiscarded) != 0;
-                                       types[types.Length - 1] = void_result ? typeof (void) : invokeBinder.ReturnType;
-
-                                       //
-                                       // Much easier to use Expression.Dynamic cannot be used because it ignores ByRef arguments
-                                       // and it always generates either Func or Action and any value type argument is lost
-                                       //
-                                       Type delegateType = SLE.Expression.GetDelegateType (types);
-                                       return SLE.Expression.MakeDynamic (delegateType, binder, args_expr);
-                               }
-                       }
-
-                       readonly CSharpInvokeMemberBinder invokeBinder;
-
-                       public Invocation (Compiler.Expression expr, Compiler.Arguments arguments, CSharpInvokeMemberBinder invokeBinder)
-                               : base (expr, arguments)
-                       {
-                               this.invokeBinder = invokeBinder;
-                       }
-
-                       protected override Compiler.Expression DoResolveDynamic (Compiler.ResolveContext ec, Compiler.Expression memberExpr)
-                       {
-                               return new RuntimeDynamicInvocation (this, memberExpr).Resolve (ec);
-                       }
-               }
-
-               readonly CSharpBinderFlags flags;
-               IList<CSharpArgumentInfo> argumentInfo;
-               IList<Type> typeArguments;
-               Type callingContext;
-               
-               public CSharpInvokeMemberBinder (CSharpBinderFlags flags, string name, Type callingContext, IEnumerable<Type> typeArguments, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (name, false, CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
-               {
-                       this.flags = flags;
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-                       this.typeArguments = typeArguments.ToReadOnly ();
-               }
-               
-               public override DynamicMetaObject FallbackInvoke (DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
-               {
-                       var b = new CSharpInvokeBinder (flags, callingContext, argumentInfo);
-                       
-                       // TODO: Is errorSuggestion ever used?
-                       return b.Defer (target, args);
-               }
-               
-               public override DynamicMetaObject FallbackInvokeMember (DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var c_args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), args);
-                       var t_args = typeArguments == null ?
-                               null :
-                               new Compiler.TypeArguments (typeArguments.Select (l => new Compiler.TypeExpression (ctx.ImportType (l), Compiler.Location.Null)).ToArray ());
-
-                       var expr = ctx.CreateCompilerExpression (argumentInfo[0], target);
-
-                       //
-                       // Simple name invocation is actually member access invocation
-                       // to capture original this argument. This  brings problem when
-                       // simple name is resolved as a static invocation and member access
-                       // has to be reduced back to simple name without reporting an error
-                       //
-                       if ((flags & CSharpBinderFlags.InvokeSimpleName) != 0) {
-                               var value = expr as Compiler.RuntimeValueExpression;
-                               if (value != null)
-                                       value.IsSuggestionOnly = true;
-                       }
-
-                       expr = new Compiler.MemberAccess (expr, Name, t_args, Compiler.Location.Null);
-                       expr = new Invocation (expr, c_args, this);
-
-                       if ((flags & CSharpBinderFlags.ResultDiscarded) == 0)
-                               expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-                       else
-                               expr = new Compiler.DynamicResultCast (ctx.ImportType (ReturnType), expr);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (args);
-
-                       if ((flags & CSharpBinderFlags.InvokeSpecialName) != 0)
-                               binder.ResolveOptions |= Compiler.ResolveContext.Options.InvokeSpecialName;
-
-                       return binder.Bind (ctx, callingContext);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpIsEventBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpIsEventBinder.cs
deleted file mode 100644 (file)
index e485e40..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// CSharpIsEventBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpIsEventBinder : DynamicMetaObjectBinder
-       {
-               Type callingContext;
-               string name;
-               
-               public CSharpIsEventBinder (string name, Type callingContext)
-               {
-                       this.name = name;
-                       this.callingContext = callingContext;
-               }
-               
-               public override DynamicMetaObject Bind (DynamicMetaObject target, DynamicMetaObject[] args)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var context_type = ctx.ImportType (callingContext);
-                       var queried_type = ctx.ImportType (target.LimitType);
-                       var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, context_type), 0);
-
-                       var expr = Compiler.Expression.MemberLookup (rc, false, queried_type,
-                               name, 0, Compiler.Expression.MemberLookupRestrictions.ExactArity, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (
-                               this, new Compiler.BoolConstant (ctx.CompilerContext.BuiltinTypes, expr is Compiler.EventExpr, Compiler.Location.Null), null);
-
-                       binder.AddRestrictions (target);
-                       return binder.Bind (ctx, callingContext);
-               }
-
-               public override Type ReturnType {
-                       get {
-                               return typeof (bool);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpSetIndexBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpSetIndexBinder.cs
deleted file mode 100644 (file)
index ad2f51a..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// CSharpSetIndexBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpSetIndexBinder : SetIndexBinder
-       {
-               readonly CSharpBinderFlags flags;
-               IList<CSharpArgumentInfo> argumentInfo;
-               Type callingContext;
-
-               public CSharpSetIndexBinder (CSharpBinderFlags flags, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 2))
-               {
-                       this.flags = flags;
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-               }
-               
-               public override DynamicMetaObject FallbackSetIndex (DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
-               {
-                       if (argumentInfo.Count != indexes.Length + 2) {
-                               if (errorSuggestion == null)
-                                       throw new NotImplementedException ();
-
-                               return errorSuggestion;
-                       }
-
-                       var ctx = DynamicContext.Create ();
-                       var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
-                       var args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
-                       expr = new Compiler.ElementAccess (expr, args, Compiler.Location.Null);
-
-                       var source = ctx.CreateCompilerExpression (argumentInfo [indexes.Length + 1], value);
-
-                       // Same conversion as in SetMemberBinder
-                       if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0) {
-                               expr = new Compiler.RuntimeExplicitAssign (expr, source);
-                       } else {
-                               expr = new Compiler.SimpleAssign (expr, source);
-                       }
-                       expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-
-                       if ((flags & CSharpBinderFlags.CheckedContext) != 0)
-                               expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (value);
-                       binder.AddRestrictions (indexes);
-
-                       return binder.Bind (ctx, callingContext);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpSetMemberBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpSetMemberBinder.cs
deleted file mode 100644 (file)
index aaf2b25..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// CSharpSetMemberBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpSetMemberBinder : SetMemberBinder
-       {
-               readonly CSharpBinderFlags flags;
-               IList<CSharpArgumentInfo> argumentInfo;
-               Type callingContext;
-
-               public CSharpSetMemberBinder (CSharpBinderFlags flags, string name, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (name, false)
-               {
-                       this.flags = flags;
-                       this.callingContext = callingContext;
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-               }
-               
-               public override DynamicMetaObject FallbackSetMember (DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var source = ctx.CreateCompilerExpression (argumentInfo [1], value);
-                       var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
-
-                       // Field assignment
-                       expr = new Compiler.MemberAccess (expr, Name);
-
-                       // Compound assignment under dynamic context does not convert result
-                       // expression but when setting member type we need to do explicit
-                       // conversion to ensure type match between member type and dynamic
-                       // expression type
-                       if ((flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0) {
-                               expr = new Compiler.RuntimeExplicitAssign (expr, source);
-                       } else {
-                               expr = new Compiler.SimpleAssign (expr, source);
-                       }
-
-                       expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-
-                       if ((flags & CSharpBinderFlags.CheckedContext) != 0)
-                               expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null);
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-                       binder.AddRestrictions (value);
-
-                       return binder.Bind (ctx, callingContext);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpUnaryOperationBinder.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpUnaryOperationBinder.cs
deleted file mode 100644 (file)
index f625f5f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// CSharpUnaryOperationBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class CSharpUnaryOperationBinder : UnaryOperationBinder
-       {
-               IList<CSharpArgumentInfo> argumentInfo;
-               readonly CSharpBinderFlags flags;
-               readonly Type context;
-               
-               public CSharpUnaryOperationBinder (ExpressionType operation, CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
-                       : base (operation)
-               {
-                       this.argumentInfo = argumentInfo.ToReadOnly ();
-                       if (this.argumentInfo.Count != 1)
-                               throw new ArgumentException ("Unary operation requires 1 argument");
-
-                       this.flags = flags;
-                       this.context = context;
-               }
-       
-
-               Compiler.Unary.Operator GetOperator ()
-               {
-                       switch (Operation) {
-                       case ExpressionType.Negate:
-                               return Compiler.Unary.Operator.UnaryNegation;
-                       case ExpressionType.Not:
-                               return Compiler.Unary.Operator.LogicalNot;
-                       case ExpressionType.OnesComplement:
-                               return Compiler.Unary.Operator.OnesComplement;
-                       case ExpressionType.UnaryPlus:
-                               return Compiler.Unary.Operator.UnaryPlus;
-                       default:
-                               throw new NotImplementedException (Operation.ToString ());
-                       }
-               }
-               
-               public override DynamicMetaObject FallbackUnaryOperation (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
-               {
-                       var ctx = DynamicContext.Create ();
-                       var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
-
-                       if (Operation == ExpressionType.IsTrue) {
-                               expr = new Compiler.BooleanExpression (expr);
-                       } else if (Operation == ExpressionType.IsFalse) {
-                               expr = new Compiler.BooleanExpressionFalse (expr);
-                       } else {
-                               if (Operation == ExpressionType.Increment)
-                                       expr = new Compiler.UnaryMutator (Compiler.UnaryMutator.Mode.PreIncrement, expr, Compiler.Location.Null);
-                               else if (Operation == ExpressionType.Decrement)
-                                       expr = new Compiler.UnaryMutator (Compiler.UnaryMutator.Mode.PreDecrement, expr, Compiler.Location.Null);
-                               else
-                                       expr = new Compiler.Unary (GetOperator (), expr, Compiler.Location.Null);
-
-                               expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
-
-                               if ((flags & CSharpBinderFlags.CheckedContext) != 0)
-                                       expr = new Compiler.CheckedExpr (expr, Compiler.Location.Null);
-                       }
-
-                       var binder = new CSharpBinder (this, expr, errorSuggestion);
-                       binder.AddRestrictions (target);
-
-                       return binder.Bind (ctx, context);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/DynamicContext.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/DynamicContext.cs
deleted file mode 100644 (file)
index 9c466c5..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// DynamicContext.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using Compiler = Mono.CSharp;
-using System.Reflection;
-using System.Collections.Generic;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class DynamicContext
-       {
-               static DynamicContext dc;
-               static object compiler_initializer = new object ();
-               static object lock_object = new object ();
-
-               readonly Compiler.ModuleContainer module;
-               readonly Compiler.ReflectionImporter importer;
-
-               private DynamicContext (Compiler.ModuleContainer module, Compiler.ReflectionImporter importer)
-               {
-                       this.module = module;
-                       this.importer = importer;
-               }
-
-               public Compiler.CompilerContext CompilerContext {
-                       get {
-                               return module.Compiler;
-                       }
-               }
-
-               public Compiler.ModuleContainer Module {
-                       get {
-                               return module;
-                       }
-               }
-
-               public static DynamicContext Create ()
-               {
-                       if (dc != null)
-                               return dc;
-
-                       lock (compiler_initializer) {
-                               if (dc != null)
-                                       return dc;
-
-                               var settings = new Compiler.CompilerSettings () {
-                                       WarningLevel = 0
-                               };
-
-                               var cc = new Compiler.CompilerContext (settings, ErrorPrinter.Instance) {
-                                       IsRuntimeBinder = true
-                               };
-
-                               //
-                               // Any later loaded assemblies are handled internally by GetAssemblyDefinition
-                               // domain.AssemblyLoad cannot be used as that would be too destructive as we
-                               // would hold all loaded assemblies even if they can be never visited
-                               //
-                               // TODO: Remove this code and rely on GetAssemblyDefinition only
-                               //
-                               var module = new Compiler.ModuleContainer (cc);
-                               module.HasTypesFullyDefined = true;
-                               
-                               // Setup fake assembly, it's used mostly to simplify checks like friend-access
-                               var temp = new Compiler.AssemblyDefinitionDynamic (module, "dynamic");
-                               module.SetDeclaringAssembly (temp);
-
-                               var importer = new Compiler.ReflectionImporter (module, cc.BuiltinTypes) {
-                                       IgnorePrivateMembers = false
-                               };
-
-                               // Import all currently loaded assemblies
-                               // TODO: Rewrite this to populate type cache on-demand, that should greatly
-                               // reduce our start-up cost
-                               var domain = AppDomain.CurrentDomain;
-                               foreach (var a in AppDomain.CurrentDomain.GetAssemblies ()) {
-                                       importer.ImportAssembly (a, module.GlobalRootNamespace);
-                               }
-
-                               cc.BuiltinTypes.CheckDefinitions (module);
-                               module.InitializePredefinedTypes ();
-
-                               dc = new DynamicContext (module, importer);
-                       }
-
-                       return dc;
-               }
-
-               //
-               // Creates mcs expression from dynamic object
-               //
-               public Compiler.Expression CreateCompilerExpression (CSharpArgumentInfo info, DynamicMetaObject value)
-               {
-                       //
-                       // No type details provider, go with runtime type
-                       //
-                       if (info == null) {
-                               if (value.LimitType == typeof (object))
-                                       return new Compiler.NullLiteral (Compiler.Location.Null);
-
-                               return new Compiler.RuntimeValueExpression (value, ImportType (value.RuntimeType));
-                       }
-
-                       //
-                       // Value is known to be a type
-                       //
-                       if ((info.Flags & CSharpArgumentInfoFlags.IsStaticType) != 0)
-                               return new Compiler.TypeExpression (ImportType ((Type) value.Value), Compiler.Location.Null);
-
-                       if (value.Value == null &&
-                               (info.Flags & (CSharpArgumentInfoFlags.IsOut | CSharpArgumentInfoFlags.IsRef | CSharpArgumentInfoFlags.UseCompileTimeType)) == 0 &&
-                               value.LimitType == typeof (object)) {
-                               return new Compiler.NullLiteral (Compiler.Location.Null);
-                       }
-
-                       //
-                       // Use compilation time type when type was known not to be dynamic during compilation
-                       //
-                       Type value_type = (info.Flags & CSharpArgumentInfoFlags.UseCompileTimeType) != 0 ? value.Expression.Type : value.LimitType;
-                       var type = ImportType (value_type);
-
-                       if ((info.Flags & CSharpArgumentInfoFlags.Constant) != 0) {
-                               var c = Compiler.Constant.CreateConstantFromValue (type, value.Value, Compiler.Location.Null);
-                               //
-                               // It can be null for misused Constant flag
-                               //
-                               if (c != null)
-                                       return c;
-                       }
-
-                       return new Compiler.RuntimeValueExpression (value, type);
-               }
-
-               //
-               // Creates mcs arguments from dynamic argument info
-               //
-               public Compiler.Arguments CreateCompilerArguments (IEnumerable<CSharpArgumentInfo> info, DynamicMetaObject[] args)
-               {
-                       var res = new Compiler.Arguments (args.Length);
-                       int pos = 0;
-
-                       // enumerates over args
-                       foreach (var item in info) {
-                               var expr = CreateCompilerExpression (item, args[pos++]);
-                               if (item.IsNamed) {
-                                       res.Add (new Compiler.NamedArgument (item.Name, Compiler.Location.Null, expr, item.ArgumentModifier));
-                               } else {
-                                       res.Add (new Compiler.Argument (expr, item.ArgumentModifier));
-                               }
-
-                               if (pos == args.Length)
-                                       break;
-                       }
-
-                       return res;
-               }
-
-               public Compiler.TypeSpec ImportType (Type type)
-               {
-                       lock (lock_object) {
-                               return importer.ImportType (type);
-                       }
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/ErrorPrinter.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/ErrorPrinter.cs
deleted file mode 100644 (file)
index 874953a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ErrorPrinter.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       class ErrorPrinter : Compiler.ReportPrinter
-       {
-               public static readonly ErrorPrinter Instance = new ErrorPrinter ();
-
-               private ErrorPrinter ()
-               {
-               }
-
-               public override bool HasRelatedSymbolSupport {
-                       get {
-                               return false;
-                       }
-               }
-
-               public override void Print (Compiler.AbstractMessage msg, bool showFullPath)
-               {
-                       string text;
-                       if (msg.Code == 214) {
-                               text = "Pointers and fixed size buffers cannot be used in a dynamic context";
-                       } else {
-                               text = msg.Text;
-                       }
-
-                       throw new RuntimeBinderException (text);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/Extensions.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/Extensions.cs
deleted file mode 100644 (file)
index 9a55598..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// CSharpInvokeMemberBinder.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Dynamic;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.CompilerServices;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       static class Extensions
-       {
-               public static IList<T> ToReadOnly<T> (this IEnumerable<T> col)
-               {
-                       return col == null ? 
-                               null : new ReadOnlyCollectionBuilder<T> (col);
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs
deleted file mode 100644 (file)
index e2b38db..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// RuntimeBinderContext.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using Compiler = Mono.CSharp;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       sealed class RuntimeBinderContext : Compiler.IMemberContext
-       {
-               readonly Compiler.ModuleContainer module;
-               readonly Type callingType;
-               readonly DynamicContext ctx;
-               Compiler.TypeSpec callingTypeImported;
-
-               public RuntimeBinderContext (DynamicContext ctx, Compiler.TypeSpec callingType)
-               {
-                       this.ctx = ctx;
-                       this.module = ctx.Module;
-                       this.callingTypeImported = callingType;
-               }
-
-               public RuntimeBinderContext (DynamicContext ctx, Type callingType)
-               {
-                       this.ctx = ctx;
-                       this.module = ctx.Module;
-                       this.callingType = callingType;
-               }
-
-               #region IMemberContext Members
-
-               public Compiler.TypeSpec CurrentType {
-                       get {
-                               //
-                               // Delay importing of calling type to be compatible with .net
-                               // Some libraries are setting it to null which is invalid
-                               // but the NullReferenceException is thrown only when the context
-                               // is used and not during initialization
-                               //
-                               if (callingTypeImported == null && callingType != null)
-                                       callingTypeImported = ctx.ImportType (callingType);
-
-                               return callingTypeImported;
-                       }
-               }
-
-               public Compiler.TypeParameters CurrentTypeParameters {
-                       get { throw new NotImplementedException (); }
-               }
-
-               public Compiler.MemberCore CurrentMemberDefinition {
-                       get {
-                               return null;
-                       }
-               }
-
-               public bool IsObsolete {
-                       get {
-                               // Always true to ignore obsolete attribute checks
-                               return true;
-                       }
-               }
-
-               public bool IsUnsafe {
-                       get {
-                               // Dynamic cannot be used with pointers
-                               return false;
-                       }
-               }
-
-               public bool IsStatic {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               public Compiler.ModuleContainer Module {
-                       get {
-                               return module;
-                       }
-               }
-
-               public string GetSignatureForError ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public Compiler.ExtensionMethodCandidates LookupExtensionMethod (string name, int arity)
-               {
-                       // No extension method lookup in this context
-                       return null;
-               }
-
-               public Compiler.FullNamedExpression LookupNamespaceOrType (string name, int arity, Mono.CSharp.LookupMode mode, Mono.CSharp.Location loc)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public Compiler.FullNamedExpression LookupNamespaceAlias (string name)
-               {
-                       // No namespace aliases in this context
-                       return null;
-               }
-
-               #endregion
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderException.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderException.cs
deleted file mode 100644 (file)
index f30f77a..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// RuntimeBinderException.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       [Serializable]
-       public class RuntimeBinderException : Exception
-       {
-               public RuntimeBinderException ()
-               {
-               }
-
-               public RuntimeBinderException (string message)
-                       : base (message)
-               {
-               }
-
-               public RuntimeBinderException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected RuntimeBinderException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderInternalCompilerException.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderInternalCompilerException.cs
deleted file mode 100644 (file)
index 83e3cc2..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// RuntimeBinderInternalCompilerException.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Microsoft.CSharp.RuntimeBinder
-{
-       [Serializable]
-       public class RuntimeBinderInternalCompilerException : Exception
-       {
-               public RuntimeBinderInternalCompilerException ()
-               {
-               }
-
-               public RuntimeBinderInternalCompilerException (string message)
-                       : base (message)
-               {
-               }
-
-               public RuntimeBinderInternalCompilerException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-
-               protected RuntimeBinderInternalCompilerException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
index 3d6d20b5e756f28988a4b1e07db8e5438a1193ab..96568b47086a250a16e207c7412796ff9a4a55a8 100644 (file)
 Assembly/AssemblyInfo.cs
-Microsoft.CSharp.RuntimeBinder/Binder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfo.cs
-Microsoft.CSharp.RuntimeBinder/CSharpArgumentInfoFlags.cs
-Microsoft.CSharp.RuntimeBinder/CSharpBinaryOperationBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpBinderFlags.cs
-Microsoft.CSharp.RuntimeBinder/CSharpConvertBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpGetIndexBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpInvokeBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpInvokeConstructorBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpInvokeMemberBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpIsEventBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpSetIndexBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpSetMemberBinder.cs
-Microsoft.CSharp.RuntimeBinder/CSharpUnaryOperationBinder.cs
-Microsoft.CSharp.RuntimeBinder/DynamicContext.cs
-Microsoft.CSharp.RuntimeBinder/Extensions.cs
-Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs
-Microsoft.CSharp.RuntimeBinder/RuntimeBinderException.cs
-Microsoft.CSharp.RuntimeBinder/RuntimeBinderInternalCompilerException.cs
-Microsoft.CSharp.RuntimeBinder/CSharpBinder.cs
-Microsoft.CSharp.RuntimeBinder/ErrorPrinter.cs
+../../build/common/SR.cs
+../../build/common/Consts.cs
+
+corefx/SR.cs
+
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Binder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderHelper.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpArgumentInfo.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpArgumentInfoFlags.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpBinaryOperationBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpBinaryOperationFlags.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpBinderFlags.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpCallFlags.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpConversionKind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpConvertBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpGetIndexBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpGetMemberBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpInvokeBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpInvokeConstructorBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpInvokeMemberBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpIsEventBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpSetIndexBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpSetMemberBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpUnaryOperationBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Error.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CController.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CError.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CErrorFactory.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CParameterizedError.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorCode.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorFacts.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorFmt.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorHandling.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/IErrorSink.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/MessageID.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/UserStringBuilder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ExpressionTreeCallRewriter.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ICSharpInvokeOrInvokeMemberBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ResetBindException.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderController.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderException.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderExtensions.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderInternalCompilerException.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Binding/Better.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Binding/ErrorReporting.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingContextBase.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingContexts.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BindingFlag.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BinOpArgInfo.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BinOpKind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/BinOpSig.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/CandidateFunctionMember.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ConstVal.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ConstValFactory.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversions.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/COperators.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/AggregateDeclaration.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/Declaration.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/GlobalAttributeDeclaration.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/NamespaceDeclaration.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExplicitConversion.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionKind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/EXPRExtensions.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExprFactory.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/EXPRFLAG.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/FileRecord.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/FundamentalTypes.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GlobalSymbolContext.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinderResult.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ImplicitConversion.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/InputFile.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ITypeOrNamespace.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/LangCompiler.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MetadataToken.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodKind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodTypeInferrer.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/NameGenerator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Nullable.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/NullableLift.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Operators.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/OriginalExpressions.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/PredefinedAttributes.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/PredefinedMembers.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/SemanticChecker.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/SubstitutionContext.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/AggregateSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/AssemblyQualifiedNamespaceSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/EventSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/IndexerSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LabelSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LocalVariableSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodOrPropertySymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MiscSymFactory.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/NamespaceOrAggregateSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/NamespaceSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/ParentSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/PropertySymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/Scope.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/Symbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolKind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolLoader.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolManagerBase.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolMask.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolTable.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactory.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactoryBase.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TransparentIdentifierMemberSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TypeParameterSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/UnresolvedAggregateSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/VariableSymbol.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayIndex.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayInitialization.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayLength.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Assignment.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/BinaryOperator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Block.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/BoundAnonymousFunction.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Call.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Cast.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Class.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/CompoundOperator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Concatenate.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ConditionalOperator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Constant.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Event.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/EXPR.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExpressionIterator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Field.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/FieldInfo.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/HoistedLocal.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/List.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/LocalVariable.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/MemberGroup.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/MethodInfo.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/MethodReference.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/NamedArgumentSpecification.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Property.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/PropertyInfo.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Return.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Statement.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Temporary.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/This.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeArguments.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeOf.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/TypeOrNamespace.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UnaryOperator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UnboundAnonymousFunction.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UserDefinedConversion.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/UserDefinedLogicalOperator.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Visitors/ExpressionTreeRewriter.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Visitors/ExprVisitorBase.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ZeroInitialize.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/TypeBind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/AggregateType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ArgumentListType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ArrayType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/BoundLambdaType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ErrorType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/MethodGroupType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/NullableType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/NullType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/OpenTypePlaceholderType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ParameterModifierType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/PointerType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/PredefinedTypes.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/Type.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeArray.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeFactory.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeKind.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeParameterType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeTable.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/VoidType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/UnaOpSig.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/UtilityTypeExtensions.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/WithType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SpecialNames.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/SymbolTable.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/KnownName.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/NameManager.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/Names.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/NameTable.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/Operators.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/PredefinedName.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/PredefinedType.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/TokenFacts.cs
+../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Syntax/TokenKind.cs
diff --git a/mcs/class/Microsoft.CSharp/corefx/SR.cs b/mcs/class/Microsoft.CSharp/corefx/SR.cs
new file mode 100644 (file)
index 0000000..c4b854b
--- /dev/null
@@ -0,0 +1,134 @@
+//
+// This file was generated by resx2sr tool
+//
+
+partial class SR
+{
+       public const string InternalCompilerError = "An unexpected exception occurred while binding a dynamic operation";
+       public const string BindRequireArguments = "Cannot bind call with no calling object";
+       public const string BindCallFailedOverloadResolution = "Overload resolution failed";
+       public const string BindBinaryOperatorRequireTwoArguments = "Binary operators must be invoked with two arguments";
+       public const string BindUnaryOperatorRequireOneArgument = "Unary operators must be invoked with one argument";
+       public const string BindPropertyFailedMethodGroup = "The name '{0}' is bound to a method and cannot be used like a property";
+       public const string BindPropertyFailedEvent = "The event '{0}' can only appear on the left hand side of +";
+       public const string BindInvokeFailedNonDelegate = "Cannot invoke a non-delegate type";
+       public const string BindImplicitConversionRequireOneArgument = "Implicit conversion takes exactly one argument";
+       public const string BindExplicitConversionRequireOneArgument = "Explicit conversion takes exactly one argument";
+       public const string BindBinaryAssignmentRequireTwoArguments = "Binary operators cannot be invoked with one argument";
+       public const string BindBinaryAssignmentFailedNullReference = "Cannot perform member assignment on a null reference";
+       public const string NullReferenceOnMemberException = "Cannot perform runtime binding on a null reference";
+       public const string BindCallToConditionalMethod = "Cannot dynamically invoke method '{0}' because it has a Conditional attribute";
+       public const string BindToVoidMethodButExpectResult = "Cannot implicitly convert type 'void' to 'object'";
+       public const string BadBinaryOps = "Operator '{0}' cannot be applied to operands of type '{1}' and '{2}'";
+       public const string IntDivByZero = "Division by constant zero";
+       public const string BadIndexLHS = "Cannot apply indexing with [] to an expression of type '{0}'";
+       public const string BadIndexCount = "Wrong number of indices inside []; expected '{0}'";
+       public const string BadUnaryOp = "Operator '{0}' cannot be applied to operand of type '{1}'";
+       public const string NoImplicitConv = "Cannot implicitly convert type '{0}' to '{1}'";
+       public const string NoExplicitConv = "Cannot convert type '{0}' to '{1}'";
+       public const string ConstOutOfRange = "Constant value '{0}' cannot be converted to a '{1}'";
+       public const string AmbigBinaryOps = "Operator '{0}' is ambiguous on operands of type '{1}' and '{2}'";
+       public const string AmbigUnaryOp = "Operator '{0}' is ambiguous on an operand of type '{1}'";
+       public const string ValueCantBeNull = "Cannot convert null to '{0}' because it is a non-nullable value type";
+       public const string WrongNestedThis = "Cannot access a non-static member of outer type '{0}' via nested type '{1}'";
+       public const string NoSuchMember = "'{0}' does not contain a definition for '{1}'";
+       public const string ObjectRequired = "An object reference is required for the non-static field, method, or property '{0}'";
+       public const string AmbigCall = "The call is ambiguous between the following methods or properties: '{0}' and '{1}'";
+       public const string BadAccess = "'{0}' is inaccessible due to its protection level";
+       public const string MethDelegateMismatch = "No overload for '{0}' matches delegate '{1}'";
+       public const string AssgLvalueExpected = "The left-hand side of an assignment must be a variable, property or indexer";
+       public const string NoConstructors = "The type '{0}' has no constructors defined";
+       public const string BadDelegateConstructor = "The delegate '{0}' does not have a valid constructor";
+       public const string PropertyLacksGet = "The property or indexer '{0}' cannot be used in this context because it lacks the get accessor";
+       public const string ObjectProhibited = "Member '{0}' cannot be accessed with an instance reference; qualify it with a type name instead";
+       public const string AssgReadonly = "A readonly field cannot be assigned to (except in a constructor or a variable initializer)";
+       public const string RefReadonly = "A readonly field cannot be passed ref or out (except in a constructor)";
+       public const string AssgReadonlyStatic = "A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)";
+       public const string RefReadonlyStatic = "A static readonly field cannot be passed ref or out (except in a static constructor)";
+       public const string AssgReadonlyProp = "Property or indexer '{0}' cannot be assigned to -- it is read only";
+       public const string AbstractBaseCall = "Cannot call an abstract base member: '{0}'";
+       public const string RefProperty = "A property or indexer may not be passed as an out or ref parameter";
+       public const string ManagedAddr = "Cannot take the address of, get the size of, or declare a pointer to a managed type ('{0}')";
+       public const string FixedNotNeeded = "You cannot use the fixed statement to take the address of an already fixed expression";
+       public const string UnsafeNeeded = "Dynamic calls cannot be used in conjunction with pointers";
+       public const string BadBoolOp = "In order to be applicable as a short circuit operator a user-defined logical operator ('{0}') must have the same return type as the type of its 2 parameters";
+       public const string MustHaveOpTF = "The type ('{0}') must contain declarations of operator true and operator false";
+       public const string CheckedOverflow = "The operation overflows at compile time in checked mode";
+       public const string ConstOutOfRangeChecked = "Constant value '{0}' cannot be converted to a '{1}' (use 'unchecked' syntax to override)";
+       public const string AmbigMember = "Ambiguity between '{0}' and '{1}'";
+       public const string SizeofUnsafe = "'{0}' does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)";
+       public const string FieldInitRefNonstatic = "A field initializer cannot reference the non-static field, method, or property '{0}'";
+       public const string CallingFinalizeDepracated = "Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available.";
+       public const string CallingBaseFinalizeDeprecated = "Do not directly call your base class Finalize method. It is called automatically from your destructor.";
+       public const string BadCastInFixed = "The right hand side of a fixed statement assignment may not be a cast expression";
+       public const string NoImplicitConvCast = "Cannot implicitly convert type '{0}' to '{1}'. An explicit conversion exists (are you missing a cast?)";
+       public const string InaccessibleGetter = "The property or indexer '{0}' cannot be used in this context because the get accessor is inaccessible";
+       public const string InaccessibleSetter = "The property or indexer '{0}' cannot be used in this context because the set accessor is inaccessible";
+       public const string BadArity = "Using the generic {1} '{0}' requires '{2}' type arguments";
+       public const string BadTypeArgument = "The type '{0}' may not be used as a type argument";
+       public const string TypeArgsNotAllowed = "The {1} '{0}' cannot be used with type arguments";
+       public const string HasNoTypeVars = "The non-generic {1} '{0}' cannot be used with type arguments";
+       public const string NewConstraintNotSatisfied = "'{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}'";
+       public const string GenericConstraintNotSatisfiedRefType = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.";
+       public const string GenericConstraintNotSatisfiedNullableEnum = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. The nullable type '{3}' does not satisfy the constraint of '{1}'.";
+       public const string GenericConstraintNotSatisfiedNullableInterface = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. The nullable type '{3}' does not satisfy the constraint of '{1}'. Nullable types can not satisfy any interface constraints.";
+       public const string GenericConstraintNotSatisfiedTyVar = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no boxing conversion or type parameter conversion from '{3}' to '{1}'.";
+       public const string GenericConstraintNotSatisfiedValType = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no boxing conversion from '{3}' to '{1}'.";
+       public const string TypeVarCantBeNull = "Cannot convert null to type parameter '{0}' because it could be a non-nullable value type. Consider using 'default({0})' instead.";
+       public const string BadRetType = "'{1} {0}' has the wrong return type";
+       public const string CantInferMethTypeArgs = "The type arguments for method '{0}' cannot be inferred from the usage. Try specifying the type arguments explicitly.";
+       public const string MethGrpToNonDel = "Cannot convert method group '{0}' to non-delegate type '{1}'. Did you intend to invoke the method?";
+       public const string RefConstraintNotSatisfied = "The type '{2}' must be a reference type in order to use it as parameter '{1}' in the generic type or method '{0}'";
+       public const string ValConstraintNotSatisfied = "The type '{2}' must be a non-nullable value type in order to use it as parameter '{1}' in the generic type or method '{0}'";
+       public const string CircularConstraint = "Circular constraint dependency involving '{0}' and '{1}'";
+       public const string BaseConstraintConflict = "Type parameter '{0}' inherits conflicting constraints '{1}' and '{2}'";
+       public const string ConWithValCon = "Type parameter '{1}' has the 'struct' constraint so '{1}' cannot be used as a constraint for '{0}'";
+       public const string AmbigUDConv = "Ambiguous user defined conversions '{0}' and '{1}' when converting from '{2}' to '{3}'";
+       public const string PredefinedTypeNotFound = "Predefined type '{0}' is not defined or imported";
+       public const string PredefinedTypeBadType = "Predefined type '{0}' is declared incorrectly";
+       public const string BindToBogus = "'{0}' is not supported by the language";
+       public const string CantCallSpecialMethod = "'{0}': cannot explicitly call operator or accessor";
+       public const string BogusType = "'{0}' is a type not supported by the language";
+       public const string MissingPredefinedMember = "Missing compiler required member '{0}.{1}'";
+       public const string LiteralDoubleCast = "Literal of type double cannot be implicitly converted to type '{1}'; use an '{0}' suffix to create a literal of this type";
+       public const string UnifyingInterfaceInstantiations = "'{0}' cannot implement both '{1}' and '{2}' because they may unify for some type parameter substitutions";
+       public const string ConvertToStaticClass = "Cannot convert to static type '{0}'";
+       public const string GenericArgIsStaticClass = "'{0}': static types cannot be used as type arguments";
+       public const string PartialMethodToDelegate = "Cannot create delegate from method '{0}' because it is a partial method without an implementing declaration";
+       public const string IncrementLvalueExpected = "The operand of an increment or decrement operator must be a variable, property or indexer";
+       public const string NoSuchMemberOrExtension = "'{0}' does not contain a definition for '{1}' and no extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?)";
+       public const string ValueTypeExtDelegate = "Extension methods '{0}' defined on value type '{1}' cannot be used to create delegates";
+       public const string BadArgCount = "No overload for method '{0}' takes '{1}' arguments";
+       public const string BadArgTypes = "The best overloaded method match for '{0}' has some invalid arguments";
+       public const string BadArgType = "Argument '{0}': cannot convert from '{1}' to '{2}'";
+       public const string RefLvalueExpected = "A ref or out argument must be an assignable variable";
+       public const string BadProtectedAccess = "Cannot access protected member '{0}' via a qualifier of type '{1}'; the qualifier must be of type '{2}' (or derived from it)";
+       public const string BindToBogusProp2 = "Property, indexer, or event '{0}' is not supported by the language; try directly calling accessor methods '{1}' or '{2}'";
+       public const string BindToBogusProp1 = "Property, indexer, or event '{0}' is not supported by the language; try directly calling accessor method '{1}'";
+       public const string BadDelArgCount = "Delegate '{0}' does not take '{1}' arguments";
+       public const string BadDelArgTypes = "Delegate '{0}' has some invalid arguments";
+       public const string AssgReadonlyLocal = "Cannot assign to '{0}' because it is read-only";
+       public const string RefReadonlyLocal = "Cannot pass '{0}' as a ref or out argument because it is read-only";
+       public const string ReturnNotLValue = "Cannot modify the return value of '{0}' because it is not a variable";
+       public const string BadArgExtraRef = "Argument '{0}' should not be passed with the '{1}' keyword";
+       public const string BadArgRef = "Argument '{0}' must be passed with the '{1}' keyword";
+       public const string AssgReadonly2 = "Members of readonly field '{0}' cannot be modified (except in a constructor or a variable initializer)";
+       public const string RefReadonly2 = "Members of readonly field '{0}' cannot be passed ref or out (except in a constructor)";
+       public const string AssgReadonlyStatic2 = "Fields of static readonly field '{0}' cannot be assigned to (except in a static constructor or a variable initializer)";
+       public const string RefReadonlyStatic2 = "Fields of static readonly field '{0}' cannot be passed ref or out (except in a static constructor)";
+       public const string AssgReadonlyLocalCause = "Cannot assign to '{0}' because it is a '{1}'";
+       public const string RefReadonlyLocalCause = "Cannot pass '{0}' as a ref or out argument because it is a '{1}'";
+       public const string ThisStructNotInAnonMeth = "Anonymous methods, lambda expressions, and query expressions inside structs cannot access instance members of 'this'. Consider copying 'this' to a local variable outside the anonymous method, lambda expression or query expression and using the local instead.";
+       public const string DelegateOnNullable = "Cannot bind delegate to '{0}' because it is a member of 'System.Nullable<T>'";
+       public const string BadCtorArgCount = "'{0}' does not contain a constructor that takes '{1}' arguments";
+       public const string BadExtensionArgTypes = "'{0}' does not contain a definition for '{1}' and the best extension method overload '{2}' has some invalid arguments";
+       public const string BadInstanceArgType = "Instance argument: cannot convert from '{0}' to '{1}'";
+       public const string BadArgTypesForCollectionAdd = "The best overloaded Add method '{0}' for the collection initializer has some invalid arguments";
+       public const string InitializerAddHasParamModifiers = "The best overloaded method match '{0}' for the collection initializer element cannot be used. Collection initializer 'Add' methods cannot have ref or out parameters.";
+       public const string NonInvocableMemberCalled = "Non-invocable member '{0}' cannot be used like a method.";
+       public const string NamedArgumentSpecificationBeforeFixedArgument = "Named argument specifications must appear after all fixed arguments have been specified";
+       public const string BadNamedArgument = "The best overload for '{0}' does not have a parameter named '{1}'";
+       public const string BadNamedArgumentForDelegateInvoke = "The delegate '{0}' does not have a parameter named '{1}'";
+       public const string DuplicateNamedArgument = "Named argument '{0}' cannot be specified multiple times";
+       public const string NamedArgumentUsedInPositional = "Named argument '{0}' specifies a parameter for which a positional argument has already been given";
+}
index eaec4ddcd40395077c61ecfdfeba017c20e532b6..bcf9c8dc840837d91b897beb213bcc4e2b3e9ee0 100644 (file)
     <Compile Include="..\..\mcs\typespec.cs" />\r
     <Compile Include="..\..\mcs\visit.cs" />\r
     <Compile Include="..\..\tools\monop\outline.cs" />\r
+    <Compile Include="aot.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
index 0bbd93782bad9ef8544de3ababc6b5860cc69dcb..2bd1a5a5f4197764209bc897f79422b68546c904 100644 (file)
@@ -1,3 +1,5 @@
+Assembly/AssemblyInfo.cs
+aot.cs
 ../../mcs/anonymous.cs
 ../../mcs/argument.cs
 ../../mcs/assign.cs
@@ -55,4 +57,3 @@
 ../../build/common/Consts.cs
 ../../tools/monop/outline.cs
 ../../mcs/cs-parser.cs
-Assembly/AssemblyInfo.cs
diff --git a/mcs/class/Mono.CSharp/aot.cs b/mcs/class/Mono.CSharp/aot.cs
new file mode 100644 (file)
index 0000000..844d761
--- /dev/null
@@ -0,0 +1,105 @@
+//
+// aot.cs: AOT System.Reflection.Emit extensions to simplify mcs compilation
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if FULL_AOT_RUNTIME
+
+namespace System.Reflection.Emit
+{
+       static class AssemblyBuilderExtensions
+       {
+               public static void AddResourceFile (this AssemblyBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public static ModuleBuilder DefineDynamicModule (this AssemblyBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public static void DefineVersionInfoResource (this AssemblyBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public static void DefineUnmanagedResource (this AssemblyBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public static void Save (this AssemblyBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public static void SetEntryPoint (this AssemblyBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+       }
+
+       static class ConstructorBuilderExtensions
+       {
+               public static void AddDeclarativeSecurity (this ConstructorBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+       }
+
+       static class MethodBuilderExtensions
+       {
+               public static void AddDeclarativeSecurity (this MethodBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+       }
+
+       static class ModuleBuilderExtensions
+       {
+               public static void DefineManifestResource (this ModuleBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+       }
+
+       static class TypeBuilderExtensions
+       {
+               public static void AddDeclarativeSecurity (this TypeBuilder builder, params object[] args)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public static Type CreateType (this TypeBuilder builder)
+               {
+                       throw new NotSupportedException ();
+               }
+       }
+}
+#endif
diff --git a/mcs/class/Mono.CSharp/monotouch.cs b/mcs/class/Mono.CSharp/monotouch.cs
deleted file mode 100644 (file)
index 06feb3c..0000000
+++ /dev/null
@@ -1,824 +0,0 @@
-//
-// monotouch.cs: iOS System.Reflection.Emit API needed to simplify mcs compilation
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Reflection.Emit
-{
-       public class TypeBuilder : Type
-       {
-               #region implemented abstract members of MemberInfo
-
-               public override bool IsDefined (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override string Name {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               #region implemented abstract members of Type
-
-               public override Type GetInterface (string name, bool ignoreCase)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type[] GetInterfaces ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type GetElementType ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override EventInfo[] GetEvents (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override FieldInfo GetField (string name, BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override FieldInfo[] GetFields (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type GetNestedType (string name, BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type[] GetNestedTypes (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override TypeAttributes GetAttributeFlagsImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool HasElementTypeImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool IsArrayImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool IsByRefImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool IsCOMObjectImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool IsPointerImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool IsPrimitiveImpl ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Assembly Assembly {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string AssemblyQualifiedName {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type BaseType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string FullName {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Guid GUID {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Module Module {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string Namespace {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type UnderlyingSystemType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               public void AddInterfaceImplementation (Type interfaceType)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void AddDeclarativeSecurity (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }       
-
-               public void SetParent (object arg)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public Type CreateType()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public ConstructorBuilder DefineConstructor (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public MethodBuilder DefineMethod (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public TypeBuilder DefineNestedType (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public PropertyBuilder DefineProperty (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public EventBuilder DefineEvent (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public FieldBuilder DefineField (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public MethodBuilder DefineMethodOverride (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public static ConstructorInfo GetConstructor (Type type, ConstructorInfo constructor)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public static FieldInfo GetField (Type type, FieldInfo field)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public static MethodInfo GetMethod (Type type, MethodInfo method)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-       public class MethodBuilder : MethodBase
-       {
-               #region implemented abstract members of MemberInfo
-
-               public override bool IsDefined (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type DeclaringType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override MemberTypes MemberType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string Name {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type ReflectedType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               #region implemented abstract members of MethodBase
-
-               public override MethodImplAttributes GetMethodImplementationFlags ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override ParameterInfo[] GetParameters ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override RuntimeMethodHandle MethodHandle {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override MethodAttributes Attributes {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               public void AddDeclarativeSecurity (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public ParameterBuilder DefineParameter (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public MethodToken GetToken()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public ILGenerator GetILGenerator ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetImplementationFlags (MethodImplAttributes attributes)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetParameters (params Type[] parameterTypes)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetReturnType (object arg)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-       public class AssemblyBuilder : Assembly
-       {
-               public void AddResourceFile (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void DefineVersionInfoResource (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public ModuleBuilder DefineDynamicModule (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void DefineUnmanagedResource (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void Save (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetEntryPoint (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-       public class ConstructorBuilder : MethodBase
-       {
-               #region implemented abstract members of MemberInfo
-
-               public override bool IsDefined (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type DeclaringType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override MemberTypes MemberType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string Name {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type ReflectedType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               #region implemented abstract members of MethodBase
-
-               public override MethodImplAttributes GetMethodImplementationFlags ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override ParameterInfo[] GetParameters ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override RuntimeMethodHandle MethodHandle {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override MethodAttributes Attributes {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               public void AddDeclarativeSecurity (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public ParameterBuilder DefineParameter (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }               
-
-               public MethodToken GetToken()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public ILGenerator GetILGenerator ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetImplementationFlags (MethodImplAttributes attributes)
-               {
-                       throw new NotSupportedException ();
-               }       
-       }
-
-       public class ModuleBuilder : Module
-       {
-               public void DefineManifestResource (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public TypeBuilder DefineType (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public MethodToken GetToken()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public MethodInfo GetArrayMethod (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-       public class PropertyBuilder : PropertyInfo
-       {
-               #region implemented abstract members of MemberInfo
-
-               public override bool IsDefined (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type DeclaringType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string Name {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type ReflectedType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               #region implemented abstract members of PropertyInfo
-
-               public override MethodInfo[] GetAccessors (bool nonPublic)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override MethodInfo GetGetMethod (bool nonPublic)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override ParameterInfo[] GetIndexParameters ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override MethodInfo GetSetMethod (bool nonPublic)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override PropertyAttributes Attributes {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override bool CanRead {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override bool CanWrite {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type PropertyType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               public MethodToken GetToken()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetGetMethod (object arg)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetSetMethod (object arg)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-       public class FieldBuilder : FieldInfo
-       {
-               #region implemented abstract members of MemberInfo
-
-               public override bool IsDefined (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object[] GetCustomAttributes (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type DeclaringType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override string Name {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type ReflectedType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               #region implemented abstract members of FieldInfo
-
-               public override object GetValue (object obj)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, System.Globalization.CultureInfo culture)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override FieldAttributes Attributes {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override RuntimeFieldHandle FieldHandle {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type FieldType {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               #endregion
-
-               public void SetConstant (object arg)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-       public class EventBuilder
-       {
-               public void SetAddOnMethod (MethodBuilder mdBuilder)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetRemoveOnMethod (MethodBuilder mdBuilder)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public void SetCustomAttribute (params object[] args)
-               {
-                       throw new NotSupportedException ();
-               }
-       }
-
-}
\ No newline at end of file
diff --git a/mcs/class/Mono.CSharp/monotouch_Mono.CSharp.dll.sources b/mcs/class/Mono.CSharp/monotouch_Mono.CSharp.dll.sources
deleted file mode 100644 (file)
index 083e61a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include testing_aot_full_Mono.CSharp.dll.sources
diff --git a/mcs/class/Mono.CSharp/monotouch_tv_Mono.CSharp.dll.sources b/mcs/class/Mono.CSharp/monotouch_tv_Mono.CSharp.dll.sources
deleted file mode 100644 (file)
index 083e61a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include testing_aot_full_Mono.CSharp.dll.sources
diff --git a/mcs/class/Mono.CSharp/monotouch_watch_Mono.CSharp.dll.sources b/mcs/class/Mono.CSharp/monotouch_watch_Mono.CSharp.dll.sources
deleted file mode 100644 (file)
index 083e61a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include testing_aot_full_Mono.CSharp.dll.sources
diff --git a/mcs/class/Mono.CSharp/orbis_Mono.CSharp.dll.sources b/mcs/class/Mono.CSharp/orbis_Mono.CSharp.dll.sources
deleted file mode 100644 (file)
index 394cd48..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include monotouch_Mono.CSharp.dll.sources
diff --git a/mcs/class/Mono.CSharp/testing_aot_full_Mono.CSharp.dll.sources b/mcs/class/Mono.CSharp/testing_aot_full_Mono.CSharp.dll.sources
deleted file mode 100644 (file)
index 4c30fc6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#include Mono.CSharp.dll.sources
-../corlib/System.Reflection.Emit/PEFileKinds.cs
-../corlib/System.Reflection.Emit/MethodToken.cs
-monotouch.cs
diff --git a/mcs/class/Mono.CSharp/winaot_Mono.CSharp.dll.sources b/mcs/class/Mono.CSharp/winaot_Mono.CSharp.dll.sources
deleted file mode 100644 (file)
index 4c30fc6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#include Mono.CSharp.dll.sources
-../corlib/System.Reflection.Emit/PEFileKinds.cs
-../corlib/System.Reflection.Emit/MethodToken.cs
-monotouch.cs
index 36d6822f61114952d3e7fa6f8645bb40dbd5a101..5654252415d15a297b8a808e5598932798dac170 100644 (file)
@@ -64,7 +64,7 @@ namespace Mono.CodeContracts.Rewrite {
 
                        var readerParameters = new ReaderParameters ();
 
-                       if (options.Debug)
+                       if (options.Debug && options.WritePdbFile)
                                readerParameters.ReadSymbols = true;
 
                        var assembly = this.options.Assembly.IsFilename ?
index 45b2db176875cbf3a4dc9fc0811ae180b64a71d3..cff394bbcfa5666c232901f8914095c780de5744 100644 (file)
@@ -221,7 +221,7 @@ namespace Mono.Data.Sqlite
         case SQLiteDateFormats.UnixEpoch:\r
           return ((long)(dateValue.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond)).ToString();\r
         default:\r
-          return dateValue.ToString(_datetimeFormats[5], CultureInfo.InvariantCulture);\r
+          return dateValue.ToString(_datetimeFormats[19], CultureInfo.InvariantCulture);\r
       }\r
     }\r
 \r
index 15339454b8246054c6e0e5e751c86ca98e2ce0d9..969346d0fd454cc4d3e6f1371d03776d4f0a5009 100644 (file)
@@ -63,6 +63,38 @@ namespace MonoTests.Mono.Data.Sqlite
                        }
                }
 
+               [Test]
+               public void DateTimeConvert_UTC ()
+               {
+                       using (var connection = new SqliteConnection ($"Data Source={_databasePath};DateTimeKind=Utc")) {
+                               connection.Open ();
+
+                               using (var cmd = connection.CreateCommand ()) {
+                                       cmd.CommandText = "CREATE TABLE OnlyDates (Date1 DATETIME)";
+                                       cmd.CommandType = CommandType.Text;
+                                       cmd.ExecuteNonQuery();
+                               }
+
+                               var datetest = DateTime.UtcNow;
+
+                               var sqlInsert = "INSERT INTO TestTable (ID, Modified) VALUES (@id, @mod)";
+                               using (var cmd = connection.CreateCommand ()) {
+                                       cmd.CommandText = $"INSERT INTO OnlyDates (Date1) VALUES (@param1);";
+                                       cmd.CommandType = CommandType.Text;
+                                       cmd.Parameters.AddWithValue ("@param1", datetest);
+                                       cmd.ExecuteNonQuery();
+                               }
+
+                               using (var cmd = connection.CreateCommand ()) {
+                                       cmd.CommandText = $"SELECT Date1 FROM OnlyDates;";
+                                       cmd.CommandType = CommandType.Text;
+                                       object objRetrieved = cmd.ExecuteScalar ();
+                                       var dateRetrieved = Convert.ToDateTime (objRetrieved);
+                                       Assert.AreEqual (DateTimeKind.Unspecified, dateRetrieved.Kind);
+                               }
+                       }
+               }
+
                [Test]
                public void DateTimeConvert ()
                {
index efebe9ad5a9acc314ec75efbb1ffda5a9fb1ba7f..421c04da2bfd3b360a1fd5f2c9b17adfde0b221e 100644 (file)
@@ -134,7 +134,7 @@ testing.
                                        code ();
                                }
 
-               * Avoid using unecessary open/close braces, vertical space
+               * Avoid using unnecessary open/close braces, vertical space
                  is usually limited:
 
                        good:
index fac304161e6addedd37c2bc419987e84fdc324dd..19cd7e6be5df1d47f777be791aff7bdd0971a375 100644 (file)
@@ -90,7 +90,7 @@
     <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\DelegateHelpers.netstandard.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\HoistedLocals.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\ILGen.cs" />\r
-    <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\KeyedQueue.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\KeyedStack.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LabelInfo.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs" />\r
index 7336284054710a8c125652ea245673b3e70a1aba..27d916c49d552f573fbea9fbcaf3835ea125e6b9 100644 (file)
@@ -13,7 +13,7 @@
 ../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/CompilerScope.Storage.cs
 ../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/CompilerScope.cs
 ../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/ILGen.cs
-../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/KeyedQueue.cs
+../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/KeyedStack.cs
 ../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LabelInfo.cs
 ../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Address.cs
 ../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs
index c3b746262b5f6220f776f716ac9523251f05e8ce..d40b3e0e76d7bb3ec046e16aa1e85156cc76ddd9 100644 (file)
@@ -35,6 +35,9 @@ endif
 
 TXT_RESOURCE_STRINGS = ../referencesource/System.Data/system.data.txt
 
+RESX_RESOURCE_STRING = \
+       ../../../external/corefx/src/System.Data.Common/src/Resources/Strings.resx
+
 TEST_LIB_REFS = System.Core Mono.Data.Sqlite
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618,169,612,219,168
 
index b257d924a0a0e65f60022a80bd5b2d90718f5f1e..b50eb0df32b76be53421a064e605950032eb5de2 100644 (file)
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbCommand.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DBCommandBuilder.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbConnection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbConnectionPoolKey.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbConnectionStringBuilder.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbDataAdapter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbDataReader.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbDataReaderExtensions.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbDataRecord.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbDataSourceEnumerator.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbEnumerator.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbMetaDataColumnNames.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbParameter.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbParameterCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbProviderFactory.CreatePermission.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbProviderFactory.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbProviderSpecificTypePropertyAttribute.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DBSchemaRow.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DBSchemaTable.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DbTransaction.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DecimalStorage.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\DoubleStorage.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\FieldNameLookup.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\Groupbybehavior.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\IDbColumnSchemaGenerator.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\identifiercase.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\Int16Storage.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\Int32Storage.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\Int64Storage.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\MultipartIdentifier.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\NameValuePair.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\ObjectStorage.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\RowUpdatedEventArgs.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\Common\RowUpdatingEventArgs.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\StatementCompletedEventArgs.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\StatementCompletedEventHandler.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\StatementType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\StrongTypingException.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\UniqueConstraint.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\UpdateRowSource.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Data\updatestatus.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Xml\XmlDataDocument.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Xml\XmlDataImplementation.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.Data.Common\src\System\Xml\XPathNodePointer.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\Common\ActivityCorrelator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\OperationAbortedException.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\ProviderBase\DbConnectionPoolGroupProviderInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\ProviderBase\DbConnectionPoolProviderInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\ProviderBase\DbReferenceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\ProviderBase\TimeoutTimer.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\ApplicationIntent.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlError.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlErrorCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Data.SqlClient\src\System\Data\SqlClient\SqlInfoMessageEvent.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Private.Xml\src\Misc\HResults.cs" />\r
     <Compile Include="..\..\build\common\AssemblyRef.cs" />\r
     <Compile Include="..\..\build\common\Consts.cs" />\r
     <Compile Include="..\..\build\common\Locale.cs" />\r
     <Compile Include="..\referencesource\System.Data\bid\inc\cs\bidPrivateBase.cs" />\r
     <Compile Include="..\referencesource\System.Data\Microsoft\SqlServer\Server\SqlTriggerContext.cs" />\r
     <Compile Include="..\referencesource\System.Data\Misc\ExternDll.cs" />\r
-    <Compile Include="..\referencesource\System.Data\Misc\HResults.cs" />\r
     <Compile Include="..\referencesource\System.Data\Misc\PrivilegedConfigurationManager.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\CodeGen\datacache.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\CodeGen\StrongTypingException.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\ActivityCorrelator.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\AdapterUtil.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DbConnectionOptions.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\DbConnectionPoolKey.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DBConnectionString.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\DbConnectionStringBuilder.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DbConnectionStringCommon.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DBDataPermission.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DBDataPermissionAttribute.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\DbDataReader.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DbProviderConfigurationHandler.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DbProviderFactories.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\DbProviderFactoriesConfigurationHandler.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\DbProviderFactory.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\FieldNameLookup.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\GreenMethods.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\HandlerBase.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\MultipartIdentifier.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\Common\NameValuePair.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\NameValuePermission.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\NativeMethods.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Common\SafeNativeMethods.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\OleDb\PropertyInfoSet.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\OleDb\RowBinding.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\OleDb\SafeHandles.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\OperationAbortedException.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbBuffer.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionClosed.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionFactory.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolAuthenticationContextKey.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolCounters.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolGroup.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolGroupProviderInfo.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolIdentity.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolOptions.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbConnectionPoolProviderInfo.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbMetaDataFactory.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\DbReferenceCollection.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\TimeoutTimer.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\ProviderBase\WrappedIUnknown.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\IBinarySerialize.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\invalidudtexception.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\SqlUserDefinedAggregateAttribute.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\SqlUserDefinedTypeAttribute.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\Sql\TriggerAction.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\ApplicationIntent.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\LocalDBAPI.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlClientEncryptionType.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlClientPermission.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlConnectionString.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlConnectionStringBuilder.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlError.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlErrorCollection.cs" />\r
-    <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlInfoMessageEvent.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\SqlUtil.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\TdsEnums.cs" />\r
     <Compile Include="..\referencesource\System.Data\System\Data\SqlClient\TdsParserStaticMethods.cs" />\r
index 4ef6dc6b9c06702aed2719548535246b91ec3a26..24f91f3bef67b61465ba24629462d3c5ddb49ee7 100644 (file)
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbCommand.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DBCommandBuilder.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbConnection.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbConnectionPoolKey.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilder.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbDataAdapter.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbDataReaderExtensions.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbDataRecord.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbDataSourceEnumerator.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbEnumerator.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbMetaDataColumnNames.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbParameter.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbParameterCollection.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbProviderFactory.CreatePermission.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbProviderFactory.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbProviderSpecificTypePropertyAttribute.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DBSchemaRow.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DBSchemaTable.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DbTransaction.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DecimalStorage.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/DoubleStorage.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/FieldNameLookup.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/Groupbybehavior.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/IDbColumnSchemaGenerator.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/identifiercase.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/Int16Storage.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/Int32Storage.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/Int64Storage.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/MultipartIdentifier.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/Common/NameValuePair.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/ObjectStorage.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/RowUpdatedEventArgs.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/Common/RowUpdatingEventArgs.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/StatementCompletedEventArgs.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/StatementCompletedEventHandler.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/StatementType.cs
+../../../external/corefx/src/System.Data.Common/src/System/Data/StrongTypingException.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/UniqueConstraint.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/UpdateRowSource.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Data/updatestatus.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Xml/RegionIterator.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Xml/TreeIterator.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Xml/XmlBoundElement.cs
+../../../external/corefx/src/System.Data.Common/src/System/Xml/XmlDataDocument.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Xml/XmlDataImplementation.cs
 ../../../external/corefx/src/System.Data.Common/src/System/Xml/XPathNodePointer.cs
-../../../external/corefx/src/System.Data.Common/src/System/Xml/XmlDataDocument.cs
-
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/Common/ActivityCorrelator.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/OperationAbortedException.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbReferenceCollection.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/TimeoutTimer.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/ApplicationIntent.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlError.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlErrorCollection.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlInfoMessageEvent.cs
+../../../external/corefx/src/System.Private.Xml/src/Misc/HResults.cs
 ../referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs
 ../referencesource/System.Data/Misc/ExternDll.cs
-../referencesource/System.Data/Misc/HResults.cs
 ../referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
-../referencesource/System.Data/System/Data/Common/ActivityCorrelator.cs
 ../referencesource/System.Data/System/Data/Common/AdapterUtil.cs
 ../referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs
-../referencesource/System.Data/System/Data/Common/DbConnectionPoolKey.cs
 ../referencesource/System.Data/System/Data/Common/DBConnectionString.cs
-../referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs
 ../referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs
 ../referencesource/System.Data/System/Data/Common/DBDataPermission.cs
 ../referencesource/System.Data/System/Data/Common/DBDataPermissionAttribute.cs
-../referencesource/System.Data/System/Data/Common/DbDataReader.cs
-../referencesource/System.Data/System/Data/Common/DbProviderFactory.cs
-../referencesource/System.Data/System/Data/Common/FieldNameLookup.cs
 ../referencesource/System.Data/System/Data/Common/GreenMethods.cs
-../referencesource/System.Data/System/Data/Common/MultipartIdentifier.cs
-../referencesource/System.Data/System/Data/Common/NameValuePair.cs
 ../referencesource/System.Data/System/Data/Common/NameValuePermission.cs
 ../referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
+../referencesource/System.Data/System/Data/DataSet.cs
 ../referencesource/System.Data/System/Data/OleDb/OleDbType.cs
 ../referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs
-../referencesource/System.Data/System/Data/OperationAbortedException.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContext.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContextKey.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
-../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
-../referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
-../referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
 ../referencesource/System.Data/System/Data/ProviderBase/WrappedIUnknown.cs
 ../referencesource/System.Data/System/Data/Sql/IBinarySerialize.cs
 ../referencesource/System.Data/System/Data/Sql/invalidudtexception.cs
 ../referencesource/System.Data/System/Data/Sql/SqlUserDefinedAggregateAttribute.cs
 ../referencesource/System.Data/System/Data/Sql/SqlUserDefinedTypeAttribute.cs
 ../referencesource/System.Data/System/Data/Sql/TriggerAction.cs
-../referencesource/System.Data/System/Data/SqlClient/ApplicationIntent.cs
 ../referencesource/System.Data/System/Data/SqlClient/LocalDBAPI.cs
 ../referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionType.cs
 ../referencesource/System.Data/System/Data/SqlClient/SqlClientPermission.cs
 ../referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs
 ../referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs
-../referencesource/System.Data/System/Data/SqlClient/SqlError.cs
-../referencesource/System.Data/System/Data/SqlClient/SqlErrorCollection.cs
-../referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEvent.cs
 ../referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs
 ../referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs
-../referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
-../referencesource/System.Data/System/Data/DataSet.cs
\ No newline at end of file
+../referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs
\ No newline at end of file
index fd236c73f6b9f058f6891a15cee7ccfc8960a7cf..4977214850bd9c481c04f58cc818691a9bc1bb9b 100644 (file)
@@ -160,7 +160,7 @@ System.Data.Common/DbConnectionStringBuilderHelper.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolCounters.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
-../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
+../../../external/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
 ../referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
 # ../referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
 # ../referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
index a3335ea5506ffe67aafedba5773301d48b9cee77..4aeaf50cd931ec9a513c0d4da69bb30f1bfe1e15 100644 (file)
@@ -292,8 +292,9 @@ namespace System.Net.Http
                                }
 
                                if (header.Key == "Transfer-Encoding") {
-                                       // Chunked Transfer-Encoding is never set for HttpWebRequest. It's detected
-                                       // from ContentLength by HttpWebRequest
+                                       //
+                                       // Chunked Transfer-Encoding is set for HttpWebRequest later when Content length is checked
+                                       //
                                        values = values.Where (l => l != "chunked");
                                }
 
@@ -354,15 +355,22 @@ namespace System.Net.Http
                                                        }
                                                }
 
-                                               //
-                                               // Content length has to be set because HttpWebRequest is running without buffering
-                                               //
-                                               var contentLength = content.Headers.ContentLength;
-                                               if (contentLength != null) {
-                                                       wrequest.ContentLength = contentLength.Value;
+                                               if (request.Headers.TransferEncodingChunked == true) {
+                                                       wrequest.SendChunked = true;
                                                } else {
-                                                       await content.LoadIntoBufferAsync (MaxRequestContentBufferSize).ConfigureAwait (false);
-                                                       wrequest.ContentLength = content.Headers.ContentLength.Value;
+                                                       //
+                                                       // Content length has to be set because HttpWebRequest is running without buffering
+                                                       //
+                                                       var contentLength = content.Headers.ContentLength;
+                                                       if (contentLength != null) {
+                                                               wrequest.ContentLength = contentLength.Value;
+                                                       } else {
+                                                               if (MaxRequestContentBufferSize == 0)
+                                                                       throw new InvalidOperationException ("The content length of the request content can't be determined. Either set TransferEncodingChunked to true, load content into buffer, or set MaxRequestContentBufferSize.");
+
+                                                               await content.LoadIntoBufferAsync (MaxRequestContentBufferSize).ConfigureAwait (false);
+                                                               wrequest.ContentLength = content.Headers.ContentLength.Value;
+                                                       }
                                                }
 
                                                wrequest.ResendContentFactory = content.CopyTo;
@@ -394,7 +402,6 @@ namespace System.Net.Http
                        return CreateResponseMessage (wresponse, request, cancellationToken);
                }
 
-#if NETSTANDARD
                public bool CheckCertificateRevocationList {
                        get {
                                throw new NotImplementedException ();
@@ -460,7 +467,5 @@ namespace System.Net.Http
                                throw new NotImplementedException ();
                        }
                }
-
-#endif
        }
 }
index eb5b7ffa8207a82dcaaa6a9df7e12337a0e959f3..f796a202d543d82c8afd5c9b3d73c7aac1900b93 100644 (file)
@@ -131,7 +131,6 @@ namespace System.Net.Http
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
                }
 
-#if NETSTANDARD
                public bool CheckCertificateRevocationList {
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
@@ -170,6 +169,5 @@ namespace System.Net.Http
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
-#endif
        }
 }
index a249aad6f5b44cfd60172918b207a05e6338df27..b8c27858a26f1f9d5049f74444811b1c9d5424f2 100644 (file)
@@ -37,6 +37,8 @@ namespace System.Net.Http
                readonly Stream content;
                readonly int bufferSize;
                readonly CancellationToken cancellationToken;
+               readonly long startPosition;
+               bool contentCopied;
 
                public StreamContent (Stream content)
                        : this (content, 16 * 1024)
@@ -53,6 +55,10 @@ namespace System.Net.Http
 
                        this.content = content;
                        this.bufferSize = bufferSize;
+
+                       if (content.CanSeek) {
+                               startPosition = content.Position;
+                       }
                }
 
                //
@@ -83,6 +89,16 @@ namespace System.Net.Http
 
                protected internal override Task SerializeToStreamAsync (Stream stream, TransportContext context)
                {
+                       if (contentCopied) {
+                               if (!content.CanSeek) {
+                                       throw new InvalidOperationException ("The stream was already consumed. It cannot be read again.");
+                               }
+
+                               content.Seek (startPosition, SeekOrigin.Begin);
+                       } else {
+                               contentCopied = true;
+                       }
+
                        return content.CopyToAsync (stream, bufferSize, cancellationToken);
                }
 
@@ -92,7 +108,7 @@ namespace System.Net.Http
                                length = 0;
                                return false;
                        }
-                       length = content.Length;
+                       length = content.Length - startPosition;
                        return true;
                }
        }
index d9aab417dfa00762ff0848ae78385316ada5a7e3..72508c4883349ae19ada77271c939bfe18c04264 100644 (file)
@@ -1093,6 +1093,110 @@ namespace MonoTests.System.Net.Http
                        }
                }
 
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void Post_TransferEncodingChunked ()
+               {
+                       bool? failed = null;
+                       var listener = CreateListener (l => {
+                               try {
+                                       var request = l.Request;
+
+                                       Assert.IsNull (request.AcceptTypes, "#1");
+                                       Assert.AreEqual (-1, request.ContentLength64, "#2");
+                                       Assert.IsNull (request.ContentType, "#3");
+                                       Assert.AreEqual (0, request.Cookies.Count, "#4");
+                                       Assert.IsTrue (request.HasEntityBody, "#5");
+                                       Assert.AreEqual (TestHost, request.Headers ["Host"], "#6b");
+                                       Assert.AreEqual ("POST", request.HttpMethod, "#7");
+                                       Assert.IsFalse (request.IsAuthenticated, "#8");
+                                       Assert.IsTrue (request.IsLocal, "#9");
+                                       Assert.IsFalse (request.IsSecureConnection, "#10");
+                                       Assert.IsFalse (request.IsWebSocketRequest, "#11");
+                                       Assert.IsTrue (request.KeepAlive, "#12");
+                                       Assert.AreEqual (HttpVersion.Version11, request.ProtocolVersion, "#13");
+                                       Assert.IsNull (request.ServiceName, "#14");
+                                       Assert.IsNull (request.UrlReferrer, "#15");
+                                       Assert.IsNull (request.UserAgent, "#16");
+                                       Assert.IsNull (request.UserLanguages, "#17");
+                                       Assert.AreEqual ("chunked", request.Headers ["Transfer-Encoding"], "#18");
+                                       Assert.IsNull (request.Headers ["Content-Length"], "#19");
+                                       failed = false;
+                               } catch (Exception e) {
+                                       failed = true;
+                                       Console.WriteLine (e);
+                               }
+                       });
+
+                       try {
+                               var client = new HttpClient ();
+
+                               client.DefaultRequestHeaders.TransferEncodingChunked = true;
+
+                               var imageContent = new StreamContent (new MemoryStream ());
+
+                               var response = client.PostAsync (LocalServer, imageContent).Result;
+
+                               Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, "#101");
+                               Assert.AreEqual(false, failed, "#102");
+                       } finally {
+                               listener.Close ();
+                       }
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void Post_StreamCaching ()
+               {
+                       bool? failed = null;
+                       var listener = CreateListener (l => {
+                               try {
+                                       var request = l.Request;
+
+                                       Assert.IsNull (request.AcceptTypes, "#1");
+                                       Assert.AreEqual (0, request.ContentLength64, "#2");
+                                       Assert.IsNull (request.ContentType, "#3");
+                                       Assert.AreEqual (0, request.Cookies.Count, "#4");
+                                       Assert.IsFalse (request.HasEntityBody, "#5");
+                                       Assert.AreEqual (TestHost, request.Headers ["Host"], "#6b");
+                                       Assert.AreEqual ("POST", request.HttpMethod, "#7");
+                                       Assert.IsFalse (request.IsAuthenticated, "#8");
+                                       Assert.IsTrue (request.IsLocal, "#9");
+                                       Assert.IsFalse (request.IsSecureConnection, "#10");
+                                       Assert.IsFalse (request.IsWebSocketRequest, "#11");
+                                       Assert.IsTrue (request.KeepAlive, "#12");
+                                       Assert.AreEqual (HttpVersion.Version11, request.ProtocolVersion, "#13");
+                                       Assert.IsNull (request.ServiceName, "#14");
+                                       Assert.IsNull (request.UrlReferrer, "#15");
+                                       Assert.IsNull (request.UserAgent, "#16");
+                                       Assert.IsNull (request.UserLanguages, "#17");
+                                       Assert.IsNull (request.Headers ["Transfer-Encoding"], "#18");
+                                       Assert.AreEqual ("0", request.Headers ["Content-Length"], "#19");
+                                       failed = false;
+                               } catch (Exception e) {
+                                       failed = true;
+                                       Console.WriteLine (e);
+                               }
+                       });
+
+                       try {
+                               var client = new HttpClient ();
+
+                               var imageContent = new StreamContent (new MemoryStream ());
+
+                               var response = client.PostAsync (LocalServer, imageContent).Result;
+
+                               Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, "#101");
+                               Assert.AreEqual(false, failed, "#102");
+                       } finally {
+                               listener.Close ();
+                       }
+               }
+
                [Test]
                [Category ("MobileNotWorking")] // Missing encoding
 #if FEATURE_NO_BSD_SOCKETS
index e56094741263210f94b21d56a8bb6093ffb410ff..a7c9875186ce6fd5a144e8f56291139d203a3270 100644 (file)
@@ -149,8 +149,8 @@ namespace MonoTests.System.Net.Http
                        /*
                        sc = new StreamContent (new ExceptionStream ());
                        try {
-                           sc.CopyToAsync (m).Wait ();
-                           Assert.Fail ("#2");
+                               sc.CopyToAsync (m).Wait ();
+                               Assert.Fail ("#2");
                        } catch (AggregateException) {
                        }
                        */ 
@@ -190,6 +190,32 @@ namespace MonoTests.System.Net.Http
                        Assert.IsTrue (hit, "#10");
                }
 
+               [Test]
+               public void CopyToAsync_Twice ()
+               {
+                       var ms = new MemoryStream();
+                       ms.WriteByte(4);
+                       ms.WriteByte(12);
+                       ms.WriteByte(7);
+                       ms.Seek(1, SeekOrigin.Begin);
+
+                       var sc = new StreamContent(ms);
+
+                       var dest = new MemoryStream();
+                       var task = sc.CopyToAsync(dest);
+                       Assert.True(task.Wait(3000), "#0");
+                       Assert.AreEqual(2, dest.Length, "#1");
+                       dest.Seek(0, SeekOrigin.Begin);
+                       Assert.AreEqual(12, dest.ReadByte(), "#2");
+
+                       dest = new MemoryStream();
+                       task = sc.CopyToAsync(dest);
+                       Assert.True(task.Wait(3000), "#10");
+                       Assert.AreEqual(2, dest.Length, "#11");
+                       dest.Seek(0, SeekOrigin.Begin);
+                       Assert.AreEqual(12, dest.ReadByte(), "#12");
+               }
+
                [Test]
                public void CopyToAsync_ClosedInput ()
                {
diff --git a/mcs/class/System.Numerics.Vectors/SR.cs b/mcs/class/System.Numerics.Vectors/SR.cs
deleted file mode 100644 (file)
index 6c04e22..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// This file was generated by resx2sr tool
-//
-
-partial class SR
-{
-       public const string Arg_ArgumentOutOfRangeException = "Index was out of bounds:";
-       public const string Arg_ElementsInSourceIsGreaterThanDestination = "Number of elements in source vector is greater than the destination array";
-       public const string Arg_MultiDimArrayNotSupported = "Only one-dimensional arrays are supported";
-       public const string Arg_NullArgumentNullRef = "The method was called with a null array argument.";
-       public const string Arg_RegisterLengthOfRangeException = "length must be less than";
-       public const string Arg_TypeNotSupported = "Specified type is not supported";
-       public const string Reflection_MethodNotSupported = "Vector<T>.Count cannot be called via reflection when intrinsics are enabled.";
-}
index a5f261e85ca657317de65d24332b724e836b28b6..74524d655fd6ff961b88a57caeb632be687a868b 100644 (file)
@@ -2,11 +2,11 @@
 ../../build/common/SR.cs
 Assembly/AssemblyInfo.cs
 Assembly/TypeForwarders.cs
-SR.cs
+corefx/SR.cs
 
 ../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs
 ../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs
-../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//JitIntrinsicAttribute.cs
-../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//Register.cs
-../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//Vector_Operations.cs
-../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//Vector.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/JitIntrinsicAttribute.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Register.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector_Operations.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector.cs
diff --git a/mcs/class/System.Numerics.Vectors/corefx/SR.cs b/mcs/class/System.Numerics.Vectors/corefx/SR.cs
new file mode 100644 (file)
index 0000000..def5b09
--- /dev/null
@@ -0,0 +1,11 @@
+//
+// This file was generated by resx2sr tool
+//
+
+partial class SR
+{
+       public const string Arg_ArgumentOutOfRangeException = "Index was out of bounds:";
+       public const string Arg_ElementsInSourceIsGreaterThanDestination = "Number of elements in source vector is greater than the destination array";
+       public const string Arg_NullArgumentNullRef = "The method was called with a null array argument.";
+       public const string Arg_TypeNotSupported = "Specified type is not supported";
+}
index bc470e1b6e77c43d72f201970bbb3b488f6c8ab3..19d1e56a543b4ee70e00fe383e04279dc8dd0da3 100644 (file)
@@ -4,10 +4,12 @@ include ../../build/rules.make
 
 LIBRARY = System.Numerics.dll
 LIB_REFS = System
-LIB_MCS_FLAGS = /unsafe -nowarn:414 -nowarn:436
+LIB_MCS_FLAGS = /unsafe
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-TXT_RESOURCE_STRINGS = ../referencesource/System.Numerics/System.Numerics.txt
+RESX_RESOURCE_STRING = \
+       ../../../external/corefx/src/System.Runtime.Numerics/src/Resources/Strings.resx \
+       ../../../external/corefx/src/System.Numerics.Vectors/src/Resources/Strings.resx
 
 EXTRA_DISTFILES =
 
diff --git a/mcs/class/System.Numerics/ReferenceSources/SR.cs b/mcs/class/System.Numerics/ReferenceSources/SR.cs
deleted file mode 100644 (file)
index 3b4d7bd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// This file was generated by txt2sr tool
-//
-
-partial class SR
-{
-       public const string Argument_InvalidNumberStyles = "An undefined NumberStyles value is being used.";
-       public const string Argument_InvalidHexStyle = "With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.";
-       public const string Argument_MustBeBigInt = "The parameter must be a BigInteger.";
-       public const string Format_InvalidFormatSpecifier = "Format specifier was invalid.";
-       public const string Format_TooLarge = "The value is too large to be represented by this format specifier.";
-       public const string ArgumentOutOfRange_MustBeNonNeg = "The number must be greater than or equal to zero.";
-       public const string Overflow_BigIntInfinity = "BigInteger cannot represent infinity.";
-       public const string Overflow_NotANumber = "The value is not a number.";
-       public const string Overflow_ParseBigInteger = "The value could not be parsed.";
-       public const string Overflow_Int32 = "Value was either too large or too small for an Int32.";
-       public const string Overflow_Int64 = "Value was either too large or too small for an Int64.";
-       public const string Overflow_UInt32 = "Value was either too large or too small for a UInt32.";
-       public const string Overflow_UInt64 = "Value was either too large or too small for a UInt64.";
-       public const string Overflow_Decimal = "Value was either too large or too small for a Decimal.";
-}
index 9d03ee139172caa2c596fbed4e193c308134f950..1e56c801e93eb413f4a195e33b821d990f065615 100644 (file)
@@ -1,21 +1,34 @@
+../../build/common/Consts.cs
 ../../build/common/SR.cs
 Assembly/AssemblyInfo.cs
-ReferenceSources/SR.cs
-../referencesource/System.Numerics/System/Numerics/BigInteger.cs
-../referencesource/System.Numerics/System/Numerics/BigIntegerBuilder.cs
-../referencesource/System.Numerics/System/Numerics/BigNumber.cs
-../referencesource/System.Numerics/System/Numerics/Complex.cs
-../referencesource/System.Numerics/System/Numerics/NumericsHelpers.cs
-../referencesource/System.Numerics/System/Numerics/HashCodeHelper.cs
-../referencesource/System.Numerics/System/Numerics/JITIntrinsicAttribute.cs
-../referencesource/System.Numerics/System/Numerics/Matrix3x2.cs
-../referencesource/System.Numerics/System/Numerics/Matrix4x4.cs
-../referencesource/System.Numerics/System/Numerics/Plane.cs
-../referencesource/System.Numerics/System/Numerics/Quaternion.cs
-../referencesource/System.Numerics/System/Numerics/Vector2.cs
-../referencesource/System.Numerics/System/Numerics/Vector2_Intrinsics.cs
-../referencesource/System.Numerics/System/Numerics/Vector3.cs
-../referencesource/System.Numerics/System/Numerics/Vector3_Intrinsics.cs
-../referencesource/System.Numerics/System/Numerics/Vector4.cs
-../referencesource/System.Numerics/System/Numerics/Vector4_Intrinsics.cs
-../referencesource/System.Numerics/System/Numerics/Vector_Operations.cs
+corefx/SR.cs
+corefx/Vector.cs
+
+../../../external/corefx/src/Common/src/System/Globalization/FormatProvider.Number.cs
+../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs
+
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Globalization/FormatProvider.BigInteger.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Globalization/FormatProvider.NumberBuffer.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.BitsBuffer.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.FastReducer.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.GcdInv.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.PowMod.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/Complex.cs
+../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/NumericsHelpers.cs
+
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/JitIntrinsicAttribute.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix3x2.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix4x4.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Plane.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Quaternion.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector2.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector2_Intrinsics.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector3.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector3_Intrinsics.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector4.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector4_Intrinsics.cs
diff --git a/mcs/class/System.Numerics/corefx/SR.cs b/mcs/class/System.Numerics/corefx/SR.cs
new file mode 100644 (file)
index 0000000..e4590b7
--- /dev/null
@@ -0,0 +1,25 @@
+//
+// This file was generated by resx2sr tool
+//
+
+partial class SR
+{
+       public const string Argument_BadFormatSpecifier = "Format specifier was invalid.";
+       public const string Argument_InvalidNumberStyles = "An undefined NumberStyles value is being used.";
+       public const string Argument_InvalidHexStyle = "With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.";
+       public const string Argument_MustBeBigInt = "The parameter must be a BigInteger.";
+       public const string Format_TooLarge = "The value is too large to be represented by this format specifier.";
+       public const string ArgumentOutOfRange_MustBeNonNeg = "The number must be greater than or equal to zero.";
+       public const string Overflow_BigIntInfinity = "BigInteger cannot represent infinity.";
+       public const string Overflow_NotANumber = "The value is not a number.";
+       public const string Overflow_ParseBigInteger = "The value could not be parsed.";
+       public const string Overflow_Int32 = "Value was either too large or too small for an Int32.";
+       public const string Overflow_Int64 = "Value was either too large or too small for an Int64.";
+       public const string Overflow_UInt32 = "Value was either too large or too small for a UInt32.";
+       public const string Overflow_UInt64 = "Value was either too large or too small for a UInt64.";
+       public const string Overflow_Decimal = "Value was either too large or too small for a Decimal.";
+       public const string Arg_ArgumentOutOfRangeException = "Index was out of bounds:";
+       public const string Arg_ElementsInSourceIsGreaterThanDestination = "Number of elements in source vector is greater than the destination array";
+       public const string Arg_NullArgumentNullRef = "The method was called with a null array argument.";
+       public const string Arg_TypeNotSupported = "Specified type is not supported";
+}
diff --git a/mcs/class/System.Numerics/corefx/Vector.cs b/mcs/class/System.Numerics/corefx/Vector.cs
new file mode 100644 (file)
index 0000000..de085ba
--- /dev/null
@@ -0,0 +1,12 @@
+namespace System.Numerics
+{
+       static class Vector
+       {
+               [JitIntrinsic]
+               public static bool IsHardwareAccelerated {
+                       get {
+                               return false;
+                       }
+               }
+       }
+}
\ No newline at end of file
index 1a7d41de48d6b5f4c38838283c41fa5d55f73142..2fdeb9969656bcd1bf22f81cebb0487603ef7f46 100644 (file)
@@ -1,5 +1,5 @@
 // This is a copy of external/referencesource/System.Runtime.Caching/Resources/R.Designer.cs
-// This verison does not use ResourceManager, instead it uses hard coded strings.
+// This version does not use ResourceManager, instead it uses hard coded strings.
 // This should be removed once Mono has access to .NET resources.
 
 namespace System.Runtime.Caching.Resources {
diff --git a/mcs/class/System.ServiceModel.Internals/orbis_System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/orbis_System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..f51db67
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.Internals.dll.sources
diff --git a/mcs/class/System.ServiceModel.Internals/testing_aot_full_System.ServiceModel.Internals.dll.sources b/mcs/class/System.ServiceModel.Internals/testing_aot_full_System.ServiceModel.Internals.dll.sources
new file mode 100644 (file)
index 0000000..f51db67
--- /dev/null
@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.Internals.dll.sources
index cb78fe2be1e8ff98996257b561aefc74a1f6f482..220ea7d1938e09bc4a1b05ea0b77069b5d48b331 100644 (file)
@@ -189,6 +189,7 @@ namespace MonoTests.System.ServiceModel
                }
 
                [Test]
+               [Category ("NotWorking")] // Fails randomly
                public void StreamedConnection ()
                {
                        var host = new ServiceHost (typeof (Foo));
index 90fe714b33d6e36c80b597f874c38c872448622d..8f9f1ed0e75a17d71ec08c03c058744f3bc0830c 100644 (file)
@@ -2790,7 +2790,7 @@ namespace System.Windows.Forms {
                        //else if (format == "PenData" ) return 10;
                        //else if (format == "RiffAudio" ) return 11;
                        //else if (format == "WaveAudio" ) return 12;
-                       else if (format == "UnicodeText" ) return UTF16_STRING.ToInt32();
+                       else if (format == "UnicodeText" ) return UTF8_STRING.ToInt32();
                        //else if (format == "EnhancedMetafile" ) return 14;
                        //else if (format == "FileDrop" ) return 15;
                        //else if (format == "Locale" ) return 16;
index b471c00da1c47b3b3546ae8a63de1563bf773b31..23554997cb6a1f6bbc10ffebbdc6f1a9e587e2c3 100644 (file)
@@ -31,6 +31,7 @@ LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
 endif
 
 ifndef MOBILE_PROFILE
+LIB_MCS_FLAGS += -d:CODEDOM
 TEST_LIB_REFS = System.Drawing $(MONO_SECURITY) System.Data System.Xml System.Core System.Configuration
 else
 LIB_MCS_FLAGS += -nowarn:618
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs
deleted file mode 100644 (file)
index 26dd47b..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-//
-// Mono.CSharp CSharpCodeCompiler Class implementation
-//
-// Authors:
-//     Sean Kasun (seank@users.sf.net)
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// Copyright (c) Novell, Inc. (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.CSharp
-{
-       using System;
-       using System.CodeDom;
-       using System.CodeDom.Compiler;
-       using System.ComponentModel;
-       using System.IO;
-       using System.Text;
-       using System.Reflection;
-       using System.Collections;
-       using System.Collections.Specialized;
-       using System.Diagnostics;
-       using System.Text.RegularExpressions;
-       using System.Threading;
-       using System.Collections.Generic;
-       using System.Globalization;
-       
-       internal class CSharpCodeCompiler : CSharpCodeGenerator, ICodeCompiler
-       {
-               Mutex mcsOutMutex;
-               StringCollection mcsOutput;
-               
-               //
-               // Constructors
-               //
-               public CSharpCodeCompiler()
-               {
-               }
-
-               public CSharpCodeCompiler (IDictionary <string, string> providerOptions) :
-                       base (providerOptions)
-               {
-               }
-               
-               //
-               // Methods
-               //
-               public CompilerResults CompileAssemblyFromDom (CompilerParameters options, CodeCompileUnit e)
-               {
-                       return CompileAssemblyFromDomBatch (options, new CodeCompileUnit[] { e });
-               }
-
-               public CompilerResults CompileAssemblyFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       try {
-                               return CompileFromDomBatch (options, ea);
-                       } finally {
-                               options.TempFiles.Delete ();
-                       }
-               }
-
-               public CompilerResults CompileAssemblyFromFile (CompilerParameters options, string fileName)
-               {
-                       return CompileAssemblyFromFileBatch (options, new string[] { fileName });
-               }
-
-               public CompilerResults CompileAssemblyFromFileBatch (CompilerParameters options, string[] fileNames)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       try {
-                               return CompileFromFileBatch (options, fileNames);
-                       } finally {
-                               options.TempFiles.Delete ();
-                       }
-               }
-
-               public CompilerResults CompileAssemblyFromSource (CompilerParameters options, string source)
-               {
-                       return CompileAssemblyFromSourceBatch (options, new string[] { source });
-               }
-
-               public CompilerResults CompileAssemblyFromSourceBatch (CompilerParameters options, string[] sources)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       try {
-                               return CompileFromSourceBatch (options, sources);
-                       } finally {
-                               options.TempFiles.Delete ();
-                       }
-               }
-
-               private CompilerResults CompileFromFileBatch (CompilerParameters options, string[] fileNames)
-               {
-                       if (null == options)
-                               throw new ArgumentNullException("options");
-                       if (null == fileNames)
-                               throw new ArgumentNullException("fileNames");
-
-                       CompilerResults results=new CompilerResults(options.TempFiles);
-                       Process mcs=new Process();
-
-                       // FIXME: these lines had better be platform independent.
-                       if (Path.DirectorySeparatorChar == '\\') {
-                               mcs.StartInfo.FileName = MonoToolsLocator.Mono;
-                               mcs.StartInfo.Arguments = "\"" + MonoToolsLocator.McsCSharpCompiler + "\" ";
-                       } else {
-                               mcs.StartInfo.FileName = MonoToolsLocator.McsCSharpCompiler;
-                       }
-
-                       mcs.StartInfo.Arguments += BuildArgs (options, fileNames, ProviderOptions);
-
-                       mcsOutput = new StringCollection ();
-                       mcsOutMutex = new Mutex ();
-/*                    
-                       string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
-                       if (monoPath != null)
-                               monoPath = String.Empty;
-
-                       string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
-                       if (privateBinPath != null && privateBinPath.Length > 0)
-                               monoPath = String.Format ("{0}:{1}", privateBinPath, monoPath);
-
-                       if (monoPath.Length > 0) {
-                               StringDictionary dict = mcs.StartInfo.EnvironmentVariables;
-                               if (dict.ContainsKey ("MONO_PATH"))
-                                       dict ["MONO_PATH"] = monoPath;
-                               else
-                                       dict.Add ("MONO_PATH", monoPath);
-                       }
-*/
-                       /*
-                        * reset MONO_GC_PARAMS - we are invoking compiler possibly with another GC that
-                        * may not handle some of the options causing compilation failure
-                        */
-                       mcs.StartInfo.EnvironmentVariables ["MONO_GC_PARAMS"] = String.Empty;
-
-                       mcs.StartInfo.CreateNoWindow=true;
-                       mcs.StartInfo.UseShellExecute=false;
-                       mcs.StartInfo.RedirectStandardOutput=true;
-                       mcs.StartInfo.RedirectStandardError=true;
-                       mcs.ErrorDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
-
-                       // Use same text decoder as mcs and not user set values in Console
-                       mcs.StartInfo.StandardOutputEncoding =
-                       mcs.StartInfo.StandardErrorEncoding = Encoding.UTF8;
-                       
-                       try {
-                               mcs.Start();
-                       } catch (Exception e) {
-                               Win32Exception exc = e as Win32Exception;
-                               if (exc != null) {
-                                       throw new SystemException (String.Format ("Error running {0}: {1}", mcs.StartInfo.FileName,
-                                                                       Win32Exception.GetErrorMessage (exc.NativeErrorCode)));
-                               }
-                               throw;
-                       }
-
-                       try {
-                               mcs.BeginOutputReadLine ();
-                               mcs.BeginErrorReadLine ();
-                               mcs.WaitForExit();
-                               
-                               results.NativeCompilerReturnValue = mcs.ExitCode;
-                       } finally {
-                               mcs.CancelErrorRead ();
-                               mcs.CancelOutputRead ();
-                               mcs.Close();
-                       }
-
-                       StringCollection sc = mcsOutput;
-                      
-                       bool loadIt=true;
-                       foreach (string error_line in mcsOutput) {
-                               CompilerError error = CreateErrorFromString (error_line);
-                               if (error != null) {
-                                       results.Errors.Add (error);
-                                       if (!error.IsWarning)
-                                               loadIt = false;
-                               }
-                       }
-                       
-                       if (sc.Count > 0) {
-                               sc.Insert (0, mcs.StartInfo.FileName + " " + mcs.StartInfo.Arguments + Environment.NewLine);
-                               results.Output = sc;
-                       }
-
-                       if (loadIt) {
-                               if (!File.Exists (options.OutputAssembly)) {
-                                       StringBuilder sb = new StringBuilder ();
-                                       foreach (string s in sc)
-                                               sb.Append (s + Environment.NewLine);
-                                       
-                                       throw new Exception ("Compiler failed to produce the assembly. Output: '" + sb.ToString () + "'");
-                               }
-                               
-                               if (options.GenerateInMemory) {
-                                       using (FileStream fs = File.OpenRead(options.OutputAssembly)) {
-                                               byte[] buffer = new byte[fs.Length];
-                                               fs.Read(buffer, 0, buffer.Length);
-                                               results.CompiledAssembly = Assembly.Load(buffer, null);
-                                               fs.Close();
-                                       }
-                               } else {
-                                       // Avoid setting CompiledAssembly right now since the output might be a netmodule
-                                       results.PathToAssembly = options.OutputAssembly;
-                               }
-                       } else {
-                               results.CompiledAssembly = null;
-                       }
-                       
-                       return results;
-               }
-
-               void McsStderrDataReceived (object sender, DataReceivedEventArgs args)
-               {
-                       if (args.Data != null) {
-                               mcsOutMutex.WaitOne ();
-                               mcsOutput.Add (args.Data);
-                               mcsOutMutex.ReleaseMutex ();
-                       }
-               }               
-
-               private static string BuildArgs(CompilerParameters options,string[] fileNames, IDictionary <string, string> providerOptions)
-               {
-                       StringBuilder args=new StringBuilder();
-                       if (options.GenerateExecutable)
-                               args.Append("/target:exe ");
-                       else
-                               args.Append("/target:library ");
-
-                       string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
-                       if (privateBinPath != null && privateBinPath.Length > 0)
-                               args.AppendFormat ("/lib:\"{0}\" ", privateBinPath);
-                       
-                       if (options.Win32Resource != null)
-                               args.AppendFormat("/win32res:\"{0}\" ",
-                                       options.Win32Resource);
-
-                       if (options.IncludeDebugInformation)
-                               args.Append("/debug+ /optimize- ");
-                       else
-                               args.Append("/debug- /optimize+ ");
-
-                       if (options.TreatWarningsAsErrors)
-                               args.Append("/warnaserror ");
-
-                       if (options.WarningLevel >= 0)
-                               args.AppendFormat ("/warn:{0} ", options.WarningLevel);
-
-                       if (options.OutputAssembly == null || options.OutputAssembly.Length == 0) {
-                               string extension = (options.GenerateExecutable ? "exe" : "dll");
-                               options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, extension,
-                                       !options.GenerateInMemory);
-                       }
-                       args.AppendFormat("/out:\"{0}\" ",options.OutputAssembly);
-
-                       foreach (string import in options.ReferencedAssemblies) {
-                               if (import == null || import.Length == 0)
-                                       continue;
-
-                               args.AppendFormat("/r:\"{0}\" ",import);
-                       }
-
-                       if (options.CompilerOptions != null) {
-                               args.Append (options.CompilerOptions);
-                               args.Append (" ");
-                       }
-
-                       foreach (string embeddedResource in options.EmbeddedResources) {
-                               args.AppendFormat("/resource:\"{0}\" ", embeddedResource);
-                       }
-
-                       foreach (string linkedResource in options.LinkedResources) {
-                               args.AppendFormat("/linkresource:\"{0}\" ", linkedResource);
-                       }
-                       
-                       if (providerOptions != null && providerOptions.Count > 0) {
-                               string langver;
-
-                               if (!providerOptions.TryGetValue ("CompilerVersion", out langver))
-                                       langver = "3.5";
-
-                               if (langver.Length >= 1 && langver [0] == 'v')
-                                       langver = langver.Substring (1);
-
-                               switch (langver) {
-                                       case "2.0":
-                                               args.Append ("/langversion:ISO-2 ");
-                                               break;
-
-                                       case "3.5":
-                                               // current default, omit the switch
-                                               break;
-                               }
-                       }
-
-                       args.Append ("/noconfig ");
-
-                       args.Append (" -- ");
-                       foreach (string source in fileNames)
-                               args.AppendFormat("\"{0}\" ",source);
-                       return args.ToString();
-               }
-
-               // Keep in sync with mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
-               const string ErrorRegexPattern = @"
-                       ^
-                       (\s*(?<file>[^\(]+)                         # filename (optional)
-                        (\((?<line>\d*)(,(?<column>\d*[\+]*))?\))? # line+column (optional)
-                        :\s+)?
-                       (?<level>\w+)                               # error|warning
-                       \s+
-                       (?<number>[^:]*\d)                          # CS1234
-                       :
-                       \s*
-                       (?<message>.*)$";
-
-               static readonly Regex RelatedSymbolsRegex = new Regex(
-                       @"
-            \(Location\ of\ the\ symbol\ related\ to\ previous\ (warning|error)\)
-                       ",
-                       RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace);
-
-               private static CompilerError CreateErrorFromString(string error_string)
-               {
-                       if (error_string.StartsWith ("BETA"))
-                               return null;
-
-                       if (error_string == null || error_string == "")
-                               return null;
-
-                       CompilerError error=new CompilerError();
-                       Regex reg = new Regex (ErrorRegexPattern, RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace);
-                       Match match=reg.Match(error_string);
-                       if (!match.Success) {
-                               match = RelatedSymbolsRegex.Match (error_string);
-                               if (!match.Success) {
-                                       // We had some sort of runtime crash
-                                       error.ErrorText = error_string;
-                                       error.IsWarning = false;
-                                       error.ErrorNumber = "";
-                                       return error;
-                               } else {
-                                       // This line is a continuation of previous warning of error
-                                       return null;
-                               }
-                       }
-                       if (String.Empty != match.Result("${file}"))
-                               error.FileName=match.Result("${file}");
-                       if (String.Empty != match.Result("${line}"))
-                               error.Line=Int32.Parse(match.Result("${line}"));
-                       if (String.Empty != match.Result("${column}"))
-                               error.Column=Int32.Parse(match.Result("${column}").Trim('+'));
-
-                       string level = match.Result ("${level}");
-                       if (level == "warning")
-                               error.IsWarning = true;
-                       else if (level != "error")
-                               return null; // error CS8028 will confuse the regex.
-
-                       error.ErrorNumber=match.Result("${number}");
-                       error.ErrorText=match.Result("${message}");
-                       return error;
-               }
-
-               private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension, bool keepFile)
-               {
-                       return temp_files.AddExtension (extension, keepFile);
-               }
-
-               private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension)
-               {
-                       return temp_files.AddExtension (extension);
-               }
-
-               private CompilerResults CompileFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       if (ea == null) {
-                               throw new ArgumentNullException ("ea");
-                       }
-
-                       string[] fileNames = new string[ea.Length];
-                       StringCollection assemblies = options.ReferencedAssemblies;
-
-                       for (int i = 0; i < ea.Length; i++) {
-                               CodeCompileUnit compileUnit = ea[i];
-                               fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".cs");
-                               FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
-                               StreamWriter s = new StreamWriter (f, Encoding.UTF8);
-                               if (compileUnit.ReferencedAssemblies != null) {
-                                       foreach (string str in compileUnit.ReferencedAssemblies) {
-                                               if (!assemblies.Contains (str))
-                                                       assemblies.Add (str);
-                                       }
-                               }
-
-                               ((ICodeGenerator) this).GenerateCodeFromCompileUnit (compileUnit, s, new CodeGeneratorOptions ());
-                               s.Close ();
-                               f.Close ();
-                       }
-                       return CompileAssemblyFromFileBatch (options, fileNames);
-               }
-
-               private CompilerResults CompileFromSourceBatch (CompilerParameters options, string[] sources)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       if (sources == null) {
-                               throw new ArgumentNullException ("sources");
-                       }
-
-                       string[] fileNames = new string[sources.Length];
-
-                       for (int i = 0; i < sources.Length; i++) {
-                               fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".cs");
-                               FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
-                               using (StreamWriter s = new StreamWriter (f, Encoding.UTF8)) {
-                                       s.Write (sources[i]);
-                                       s.Close ();
-                               }
-                               f.Close ();
-                       }
-                       return CompileFromFileBatch (options, fileNames);
-               }
-       }
-}
index ecc7b1a4645f400223e493bd48916a0e9819c5a9..1c7070bb4dd67817355f2e2f195d6ded89c598bc 100644 (file)
@@ -1,12 +1,11 @@
 //
-// Mono.CSharp CSharpCodeProvider Class implementation
+// CSharpCodeGenerator:
 //
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//   Ilker Cetinkaya (mail@ilker.de)
+// Authors:
+//     Sean Kasun (seank@users.sf.net)
+//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
-// (C) 2002 Ximian, Inc.
+// Copyright (c) Novell, Inc. (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace Mono.CSharp
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using System.ComponentModel;
+using System.IO;
+using System.Text;
+using System.Reflection;
+using System.Diagnostics;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Collections.Generic;
+using System.Globalization;
+
+namespace Microsoft.CSharp
 {
-       using System;
-       using System.CodeDom;
-       using System.CodeDom.Compiler;
-       using System.Globalization;
-       using System.IO;
-       using System.Reflection;
-       using System.Collections;
-       using System.Text;
-       using System.Collections.Generic;
-       
-       internal class CSharpCodeGenerator
-               : CodeGenerator
+       partial class CSharpCodeGenerator
        {
-               IDictionary <string, string> providerOptions;
-               
-               // It is used for beautiful "for" syntax
-               bool dont_write_semicolon;
-
-               //
-               // Constructors
-               //
-               public CSharpCodeGenerator()
-               {
-                       dont_write_semicolon = false;
-               }
-
-               public CSharpCodeGenerator (IDictionary <string, string> providerOptions)
-               {
-                       this.providerOptions = providerOptions;
-               }
-
-               protected IDictionary <string, string> ProviderOptions {
-                       get { return providerOptions; }
-               }
-               
-               //
-               // Properties
-               //
-               protected override string NullToken {
-                       get {
-                               return "null";
-                       }
-               }
-
-               //
-               // Methods
-               //
-
-               protected override void GenerateArrayCreateExpression (CodeArrayCreateExpression expression)
-               {
-                       //
-                       // This tries to replicate MS behavior as good as
-                       // possible.
-                       //
-                       // The Code-Array stuff in ms.net seems to be broken
-                       // anyways, or I'm too stupid to understand it.
-                       //
-                       // I'm sick of it. If you try to develop array
-                       // creations, test them on windows. If it works there
-                       // but not in mono, drop me a note.  I'd be especially
-                       // interested in jagged-multidimensional combinations
-                       // with proper initialization :}
-                       //
-
-                       TextWriter output = Output;
-
-                       output.Write ("new ");
-
-                       CodeExpressionCollection initializers = expression.Initializers;
-                       CodeTypeReference createType = expression.CreateType;
-
-                       if (initializers.Count > 0) {
-
-                               OutputType (createType);
-
-                               if (expression.CreateType.ArrayRank == 0) {
-                                       output.Write ("[]");
-                               }
-
-                               OutputStartBrace ();
-                               ++Indent;
-                               OutputExpressionList (initializers, true);
-                               --Indent;
-                               output.Write ("}");
-                       } else {
-                               CodeTypeReference arrayType = createType.ArrayElementType;
-                               while (arrayType != null) {
-                                       createType = arrayType;
-                                       arrayType = arrayType.ArrayElementType;
-                               }
-
-                               OutputType (createType);
-
-                               output.Write ('[');
-
-                               CodeExpression size = expression.SizeExpression;
-                               if (size != null)
-                                       GenerateExpression (size);
-                               else
-                                       output.Write (expression.Size);
-
-                               output.Write(']');
-                       }
-               }
-               
-               protected override void GenerateBaseReferenceExpression (CodeBaseReferenceExpression expression)
-               {
-                       Output.Write ("base");
-               }
-               
-               protected override void GenerateCastExpression (CodeCastExpression expression)
-               {
-                       TextWriter output = Output;
-                       output.Write ("((");
-                       OutputType (expression.TargetType);
-                       output.Write (")(");
-                       GenerateExpression (expression.Expression);
-                       output.Write ("))");
-               }
-
-
-               protected override void GenerateCompileUnitStart (CodeCompileUnit compileUnit)
-               {
-                       GenerateComment (new CodeComment ("------------------------------------------------------------------------------"));
-                       GenerateComment (new CodeComment (" <autogenerated>"));
-                       GenerateComment (new CodeComment ("     This code was generated by a tool."));
-                       GenerateComment (new CodeComment ("     Mono Runtime Version: " +  System.Environment.Version));
-                       GenerateComment (new CodeComment (""));
-                       GenerateComment (new CodeComment ("     Changes to this file may cause incorrect behavior and will be lost if "));
-                       GenerateComment (new CodeComment ("     the code is regenerated."));
-                       GenerateComment (new CodeComment (" </autogenerated>"));
-                       GenerateComment (new CodeComment ("------------------------------------------------------------------------------"));
-                       Output.WriteLine ();
-                       base.GenerateCompileUnitStart (compileUnit);
-               }
-
-               protected override void GenerateCompileUnit (CodeCompileUnit compileUnit)
-               {
-                       GenerateCompileUnitStart (compileUnit);
-
-                       List<CodeNamespaceImport> imports = null;
-                       foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
-                               if (!string.IsNullOrEmpty (codeNamespace.Name))
-                                       continue;
-
-                               if (codeNamespace.Imports.Count == 0)
-                                       continue;
-
-                               if (imports == null)
-                                       imports = new List<CodeNamespaceImport> ();
-
-                               foreach (CodeNamespaceImport i in codeNamespace.Imports)
-                                       imports.Add (i);
-                       }
-
-                       if (imports != null) {
-                               imports.Sort ((a, b) => a.Namespace.CompareTo (b.Namespace));
-                               foreach (var import in imports)
-                                       GenerateNamespaceImport (import);
-
-                               Output.WriteLine ();
-                       }
-
-                       if (compileUnit.AssemblyCustomAttributes.Count > 0) {
-                               OutputAttributes (compileUnit.AssemblyCustomAttributes, 
-                                       "assembly: ", false);
-                               Output.WriteLine ("");
-                       }
-
-                       CodeNamespaceImportCollection global_imports = null;
-                       foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
-                               if (string.IsNullOrEmpty (codeNamespace.Name)) {
-                                       global_imports = codeNamespace.Imports;
-                                       codeNamespace.Imports.Clear ();
-                               }
-
-                               GenerateNamespace (codeNamespace);
-
-                               if (global_imports != null) {
-                                       codeNamespace.Imports.Clear ();
-                                       foreach (CodeNamespaceImport ns in global_imports)
-                                       codeNamespace.Imports.Add (ns);
-                                       global_imports = null;
-                               }
-                       }
-
-                       GenerateCompileUnitEnd (compileUnit);
-               }
-
-               protected override void GenerateDefaultValueExpression (CodeDefaultValueExpression e)
-               {
-                       Output.Write ("default(");
-                       OutputType (e.Type);
-                       Output.Write (')');
-               }
-
-               protected override void GenerateDelegateCreateExpression (CodeDelegateCreateExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("new ");
-                       OutputType (expression.DelegateType);
-                       output.Write ('(');
-
-                       CodeExpression targetObject = expression.TargetObject;
-                       if (targetObject != null) {
-                               GenerateExpression (targetObject);
-                               Output.Write ('.');
-                       }
-                       output.Write (GetSafeName (expression.MethodName));
-
-                       output.Write (')');
-               }
-
-               protected override void GenerateFieldReferenceExpression (CodeFieldReferenceExpression expression)
-               {
-                       CodeExpression targetObject = expression.TargetObject;
-                       if (targetObject != null) {
-                               GenerateExpression (targetObject);
-                               Output.Write ('.');
-                       }
-                       Output.Write (GetSafeName (expression.FieldName));
-               }
-               
-               protected override void GenerateArgumentReferenceExpression (CodeArgumentReferenceExpression expression)
-               {
-                       Output.Write (GetSafeName (expression.ParameterName));
-               }
-
-               protected override void GenerateVariableReferenceExpression (CodeVariableReferenceExpression expression)
-               {
-                       Output.Write (GetSafeName (expression.VariableName));
-               }
-                       
-               protected override void GenerateIndexerExpression (CodeIndexerExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       GenerateExpression (expression.TargetObject);
-                       output.Write ('[');
-                       OutputExpressionList (expression.Indices);
-                       output.Write (']');
-               }
-               
-               protected override void GenerateArrayIndexerExpression (CodeArrayIndexerExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       GenerateExpression (expression.TargetObject);
-                       output.Write ('[');
-                       OutputExpressionList (expression.Indices);
-                       output.Write (']');
-               }
-               
-               protected override void GenerateSnippetExpression (CodeSnippetExpression expression)
-               {
-                       Output.Write (expression.Value);
-               }
-               
-               protected override void GenerateMethodInvokeExpression (CodeMethodInvokeExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       GenerateMethodReferenceExpression (expression.Method);
-
-                       output.Write ('(');
-                       OutputExpressionList (expression.Parameters);
-                       output.Write (')');
-               }
-
-               protected override void GenerateMethodReferenceExpression (CodeMethodReferenceExpression expression)
-               {
-                       if (expression.TargetObject != null)
-                       {
-                               GenerateExpression (expression.TargetObject);
-                               Output.Write ('.');
-                       };
-                       Output.Write (GetSafeName (expression.MethodName));
-                       if (expression.TypeArguments.Count > 0)
-                               Output.Write (GetTypeArguments (expression.TypeArguments));
-               }
-
-               protected override void GenerateEventReferenceExpression (CodeEventReferenceExpression expression)
-               {
-                       if (expression.TargetObject != null) {
-                               GenerateExpression (expression.TargetObject);
-                               Output.Write ('.');
-                       }
-                       Output.Write (GetSafeName (expression.EventName));
-               }
-
-               protected override void GenerateDelegateInvokeExpression (CodeDelegateInvokeExpression expression)
-               {
-                       if (expression.TargetObject != null)
-                               GenerateExpression (expression.TargetObject);
-                       Output.Write ('(');
-                       OutputExpressionList (expression.Parameters);
-                       Output.Write (')');
-               }
-               
-               protected override void GenerateObjectCreateExpression (CodeObjectCreateExpression expression)
-               {
-                       Output.Write ("new ");
-                       OutputType (expression.CreateType);
-                       Output.Write ('(');
-                       OutputExpressionList (expression.Parameters);
-                       Output.Write (')');
-               }
-
-               protected override void GeneratePropertyReferenceExpression (CodePropertyReferenceExpression expression)
-               {
-                       CodeExpression targetObject = expression.TargetObject;
-                       if (targetObject != null) {
-                               GenerateExpression (targetObject);
-                               Output.Write ('.');
-                       }
-                       Output.Write (GetSafeName (expression.PropertyName ));
-               }
-
-               protected override void GeneratePropertySetValueReferenceExpression (CodePropertySetValueReferenceExpression expression)
-               {
-                       Output.Write ("value");
-               }
-
-               protected override void GenerateThisReferenceExpression (CodeThisReferenceExpression expression)
-               {
-                       Output.Write ("this");
-               }
-
-               protected override void GenerateExpressionStatement (CodeExpressionStatement statement)
-               {
-                       GenerateExpression (statement.Expression);
-                       if (dont_write_semicolon)
-                               return;
-                       Output.WriteLine(';');
-               }
-
-               protected override void GenerateIterationStatement (CodeIterationStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       dont_write_semicolon = true;
-                       output.Write ("for (");
-                       GenerateStatement (statement.InitStatement);
-                       output.Write ("; ");
-                       GenerateExpression (statement.TestExpression);
-                       output.Write ("; ");
-                       GenerateStatement (statement.IncrementStatement);
-                       output.Write (")");
-                       dont_write_semicolon = false;
-                       OutputStartBrace ();
-                       ++Indent;
-                       GenerateStatements (statement.Statements);
-                       --Indent;
-                       output.WriteLine ('}');
-               }
-
-               protected override void GenerateThrowExceptionStatement (CodeThrowExceptionStatement statement)
-               {
-                       Output.Write ("throw");
-                       if (statement.ToThrow != null) {
-                               Output.Write (' ');
-                               GenerateExpression (statement.ToThrow);
-                       }
-                       Output.WriteLine (";");
-               }
-
-               protected override void GenerateComment (CodeComment comment)
+               private CompilerResults FromFileBatch (CompilerParameters options, string[] fileNames)
                {
-                       TextWriter output = Output;
-
-                       string commentChars = null;
-
-                       if (comment.DocComment) {
-                               commentChars = "///";
-                       } else {
-                               commentChars = "//";
-                       }
-
-                       output.Write (commentChars);
-                       output.Write (' ');
-                       string text = comment.Text;
-
-                       for (int i = 0; i < text.Length; i++) {
-                               output.Write (text[i]);
-                               if (text[i] == '\r') {
-                                       if (i < (text.Length - 1) && text[i + 1] == '\n') {
-                                               continue;
-                                       }
-                                       output.Write (commentChars);
-                               } else if (text[i] == '\n') {
-                                       output.Write (commentChars);
-                               }
-                       }
+                       if (options == null)
+                               throw new ArgumentNullException (nameof(options));
 
-                       output.WriteLine ();
-               }
+                       if (fileNames == null)
+                               throw new ArgumentNullException (nameof(fileNames));
 
-               protected override void GenerateMethodReturnStatement (CodeMethodReturnStatement statement)
-               {
-                       TextWriter output = Output;
+                       CompilerResults results=new CompilerResults(options.TempFiles);
+                       Process mcs=new Process();
 
-                       if (statement.Expression != null) {
-                               output.Write ("return ");
-                               GenerateExpression (statement.Expression);
-                               output.WriteLine (";");
+                       // FIXME: these lines had better be platform independent.
+                       if (Path.DirectorySeparatorChar == '\\') {
+                               mcs.StartInfo.FileName = MonoToolsLocator.Mono;
+                               mcs.StartInfo.Arguments = "\"" + MonoToolsLocator.McsCSharpCompiler + "\" ";
                        } else {
-                               output.WriteLine ("return;");
+                               mcs.StartInfo.FileName = MonoToolsLocator.McsCSharpCompiler;
                        }
-               }
 
-               protected override void GenerateConditionStatement (CodeConditionStatement statement)
-               {
-                       TextWriter output = Output;
-                       output.Write ("if (");
-                       GenerateExpression (statement.Condition);
-                       output.Write (")");
-                       OutputStartBrace ();
+                       mcs.StartInfo.Arguments += BuildArgs (options, fileNames, _provOptions);
 
-                       ++Indent;
-                       GenerateStatements (statement.TrueStatements);
-                       --Indent;
+                       var mcsOutMutex = new Mutex ();
+/*                    
+                       string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
+                       if (monoPath != null)
+                               monoPath = String.Empty;
 
-                       CodeStatementCollection falses = statement.FalseStatements;
-                       if (falses.Count > 0) {
-                               output.Write ('}');
-                               if (Options.ElseOnClosing)
-                                       output.Write (' ');
-                               else
-                                       output.WriteLine ();
-                               output.Write ("else");
-                               OutputStartBrace ();
-                               ++Indent;
-                               GenerateStatements (falses);
-                               --Indent;
-                       }
-                       output.WriteLine ('}');
-               }
+                       string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
+                       if (privateBinPath != null && privateBinPath.Length > 0)
+                               monoPath = String.Format ("{0}:{1}", privateBinPath, monoPath);
 
-               protected override void GenerateTryCatchFinallyStatement (CodeTryCatchFinallyStatement statement)
-               {
-                       TextWriter output = Output;
-                       CodeGeneratorOptions options = Options;
-
-                       output.Write ("try");
-                       OutputStartBrace ();
-                       ++Indent;
-                       GenerateStatements (statement.TryStatements);
-                       --Indent;
-                       
-                       foreach (CodeCatchClause clause in statement.CatchClauses) {
-                               output.Write ('}');
-                               if (options.ElseOnClosing)
-                                       output.Write (' ');
+                       if (monoPath.Length > 0) {
+                               StringDictionary dict = mcs.StartInfo.EnvironmentVariables;
+                               if (dict.ContainsKey ("MONO_PATH"))
+                                       dict ["MONO_PATH"] = monoPath;
                                else
-                                       output.WriteLine ();
-                               output.Write ("catch (");
-                               OutputTypeNamePair (clause.CatchExceptionType, GetSafeName(clause.LocalName));
-                               output.Write (")");
-                               OutputStartBrace ();
-                               ++Indent;
-                               GenerateStatements (clause.Statements);
-                               --Indent;
-                       }
-
-                       CodeStatementCollection finallies = statement.FinallyStatements;
-                       if (finallies.Count > 0) {
-                               output.Write ('}');
-                               if (options.ElseOnClosing)
-                                       output.Write (' ');
-                               else
-                                       output.WriteLine ();
-                               output.Write ("finally");
-                               OutputStartBrace ();
-                               ++Indent;
-                               GenerateStatements (finallies);
-                               --Indent;
-                       }
-
-                       output.WriteLine('}');
-               }
-
-               protected override void GenerateAssignStatement (CodeAssignStatement statement)
-               {
-                       TextWriter output = Output;
-                       GenerateExpression (statement.Left);
-                       output.Write (" = ");
-                       GenerateExpression (statement.Right);
-                       if (dont_write_semicolon)
-                               return;
-                       output.WriteLine (';');
-               }
-
-               protected override void GenerateAttachEventStatement (CodeAttachEventStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       GenerateEventReferenceExpression (statement.Event);
-                       output.Write (" += ");
-                       GenerateExpression (statement.Listener);
-                       output.WriteLine (';');
-               }
-
-               protected override void GenerateRemoveEventStatement (CodeRemoveEventStatement statement)
-               {
-                       TextWriter output = Output;
-                       GenerateEventReferenceExpression (statement.Event);
-                       output.Write (" -= ");
-                       GenerateExpression (statement.Listener);
-                       output.WriteLine (';');
-               }
-
-               protected override void GenerateGotoStatement (CodeGotoStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("goto ");
-                       output.Write (GetSafeName (statement.Label));
-                       output.WriteLine (";");
-               }
-               
-               protected override void GenerateLabeledStatement (CodeLabeledStatement statement)
-               {
-                       Indent--;
-                       Output.Write (statement.Label);
-                       Output.WriteLine (":");
-                       Indent++;
-
-                       if (statement.Statement != null) {
-                               GenerateStatement (statement.Statement);
-                       }
-               }
-
-               protected override void GenerateVariableDeclarationStatement (CodeVariableDeclarationStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       OutputTypeNamePair (statement.Type, GetSafeName (statement.Name));
-
-                       CodeExpression initExpression = statement.InitExpression;
-                       if (initExpression != null) {
-                               output.Write (" = ");
-                               GenerateExpression (initExpression);
-                       }
-
-                       if (!dont_write_semicolon) {
-                               output.WriteLine (';');
-                       }
-               }
-
-               protected override void GenerateLinePragmaStart (CodeLinePragma linePragma)
-               {
-                       Output.WriteLine ();
-                       Output.Write ("#line ");
-                       Output.Write (linePragma.LineNumber);
-                       Output.Write (" \"");
-                       Output.Write (linePragma.FileName);
-                       Output.Write ("\"");
-                       Output.WriteLine ();
-               }
-
-               protected override void GenerateLinePragmaEnd (CodeLinePragma linePragma)
-               {
-                       Output.WriteLine ();
-                       Output.WriteLine ("#line default");
-                       Output.WriteLine ("#line hidden");
-               }
-
-               protected override void GenerateEvent (CodeMemberEvent eventRef, CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum) {
-                               return;
-                       }
-
-                       OutputAttributes (eventRef.CustomAttributes, null, false);
-
-                       if (eventRef.PrivateImplementationType == null) {
-                               OutputMemberAccessModifier (eventRef.Attributes);
-                       }
-
-                       Output.Write ("event ");
-
-                       if (eventRef.PrivateImplementationType != null) {
-                               OutputTypeNamePair (eventRef.Type,
-                                       eventRef.PrivateImplementationType.BaseType + "." + 
-                                       eventRef.Name);
-                       } else {
-                               OutputTypeNamePair (eventRef.Type, GetSafeName (eventRef.Name));
-                       }
-                       Output.WriteLine (';');
-               }
-
-               protected override void GenerateField (CodeMemberField field)
-               {
-                       if (IsCurrentDelegate || IsCurrentInterface) {
-                               return;
-                       }
-
-                       TextWriter output = Output;
-
-                       OutputAttributes (field.CustomAttributes, null, false);
-
-                       if (IsCurrentEnum) {
-                               Output.Write (GetSafeName (field.Name));
-                       } else {
-                               MemberAttributes attributes = field.Attributes;
-                               OutputMemberAccessModifier (attributes);
-                               OutputVTableModifier (attributes);
-                               OutputFieldScopeModifier (attributes);
-
-                               OutputTypeNamePair (field.Type, GetSafeName (field.Name));
-                       }
-
-                       CodeExpression initExpression = field.InitExpression;
-                       if (initExpression != null) {
-                               output.Write (" = ");
-                               GenerateExpression (initExpression);
-                       }
-
-                       if (IsCurrentEnum)
-                               output.WriteLine (',');
-                       else
-                               output.WriteLine (';');
-               }
-               
-               protected override void GenerateSnippetMember (CodeSnippetTypeMember member)
-               {
-                       Output.Write (member.Text);
-               }
-               
-               protected override void GenerateEntryPointMethod (CodeEntryPointMethod method, 
-                                                                 CodeTypeDeclaration declaration)
-               {
-                       OutputAttributes (method.CustomAttributes, null, false);
-
-                       Output.Write ("public static ");
-                       OutputType (method.ReturnType);
-                       Output.Write (" Main()");
-                       OutputStartBrace ();
-                       Indent++;
-                       GenerateStatements (method.Statements);
-                       Indent--;
-                       Output.WriteLine ("}");
-               }
-               
-               protected override void GenerateMethod (CodeMemberMethod method,
-                                                       CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum) {
-                               return;
-                       }
-
-                       TextWriter output = Output;
-
-                       OutputAttributes (method.CustomAttributes, null, false);
-
-                       OutputAttributes (method.ReturnTypeCustomAttributes, 
-                               "return: ", false);
-
-                       MemberAttributes attributes = method.Attributes;
-
-                       if (!IsCurrentInterface) {
-                               if (method.PrivateImplementationType == null) {
-                                       OutputMemberAccessModifier (attributes);
-                                       OutputVTableModifier (attributes);
-                                       OutputMemberScopeModifier (attributes);
+                                       dict.Add ("MONO_PATH", monoPath);
+                       }
+*/
+                       /*
+                        * reset MONO_GC_PARAMS - we are invoking compiler possibly with another GC that
+                        * may not handle some of the options causing compilation failure
+                        */
+                       mcs.StartInfo.EnvironmentVariables ["MONO_GC_PARAMS"] = String.Empty;
+
+                       mcs.StartInfo.CreateNoWindow=true;
+                       mcs.StartInfo.UseShellExecute=false;
+                       mcs.StartInfo.RedirectStandardOutput=true;
+                       mcs.StartInfo.RedirectStandardError=true;
+                       mcs.ErrorDataReceived += new DataReceivedEventHandler ((sender, args) => {
+                               if (args.Data != null) {
+                                       mcsOutMutex.WaitOne ();
+                                       results.Output.Add (args.Data);
+                                       mcsOutMutex.ReleaseMutex ();
                                }
-                       } else {
-                               OutputVTableModifier (attributes);
-                       }
-
-                       OutputType (method.ReturnType);
-                       output.Write (' ');
-
-                       CodeTypeReference privateType = method.PrivateImplementationType;
-                       if (privateType != null) {
-                               output.Write (privateType.BaseType);
-                               output.Write ('.');
-                       }
-                       output.Write (GetSafeName (method.Name));
-
-                       GenerateGenericsParameters (method.TypeParameters);
-
-                       output.Write ('(');
-                       OutputParameters (method.Parameters);
-                       output.Write (')');
-
-                       GenerateGenericsConstraints (method.TypeParameters);
-
-                       if (IsAbstract (attributes) || declaration.IsInterface)
-                               output.WriteLine (';');
-                       else {
-                               OutputStartBrace ();
-                               ++Indent;
-                               GenerateStatements (method.Statements);
-                               --Indent;
-                               output.WriteLine ('}');
-                       }
-               }
-
-               static bool IsAbstract (MemberAttributes attributes)
-               {
-                       return (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract;
-               }
-
-               protected override void GenerateProperty (CodeMemberProperty property,
-                                                         CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum) {
-                               return;
-                       }
-
-                       TextWriter output = Output;
+                       });
 
-                       OutputAttributes (property.CustomAttributes, null, false);
-
-                       MemberAttributes attributes = property.Attributes;
-
-                       if (!IsCurrentInterface) {
-                               if (property.PrivateImplementationType == null) {
-                                       OutputMemberAccessModifier (attributes);
-                                       OutputVTableModifier (attributes);
-                                       OutputMemberScopeModifier (attributes);
-                               }
-                       } else {
-                               OutputVTableModifier (attributes);
-                       }
-
-                       OutputType (property.Type);
-                       output.Write (' ');
-
-                       if (!IsCurrentInterface && property.PrivateImplementationType != null) {
-                               output.Write (property.PrivateImplementationType.BaseType);
-                               output.Write ('.');
-                       }
-
-                       // only consider property indexer if name is Item (case-insensitive 
-                       // comparison) AND property has parameters
-                       if (string.Compare(property.Name, "Item", true, CultureInfo.InvariantCulture) == 0 && property.Parameters.Count > 0) {
-                               output.Write ("this[");
-                               OutputParameters(property.Parameters);
-                               output.Write(']');
-                       } else {
-                               output.Write (GetSafeName (property.Name));
-                       }
-                       OutputStartBrace ();
-                       ++Indent;
-
-                       if (declaration.IsInterface || IsAbstract (property.Attributes))
-                       {
-                               if (property.HasGet) output.WriteLine("get;");
-                               if (property.HasSet) output.WriteLine("set;");
-                       }
-                       else
-                       {
-                               if (property.HasGet)
-                               {
-                                       output.Write ("get");
-                                       OutputStartBrace ();
-                                       ++Indent;
-
-                                       GenerateStatements (property.GetStatements);
-
-                                       --Indent;
-                                       output.WriteLine ('}');
-                               }
-
-                               if (property.HasSet)
-                               {
-                                       output.Write ("set");
-                                       OutputStartBrace ();
-                                       ++Indent;
-
-                                       GenerateStatements (property.SetStatements);
-
-                                       --Indent;
-                                       output.WriteLine ('}');
-                               }
-                       }
-
-                       --Indent;
-                       output.WriteLine ('}');
-               }
-
-               protected override void GenerateConstructor (CodeConstructor constructor, CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum || IsCurrentInterface) {
-                               return;
-                       }
-
-                       OutputAttributes (constructor.CustomAttributes, null, false);
-
-                       OutputMemberAccessModifier (constructor.Attributes);
-                       Output.Write (GetSafeName (CurrentTypeName) + "(");
-                       OutputParameters (constructor.Parameters);
-                       Output.Write (")");
-                       if (constructor.BaseConstructorArgs.Count > 0) {
-                               Output.WriteLine (" : ");
-                               Indent += 2;
-                               Output.Write ("base(");
-                               OutputExpressionList (constructor.BaseConstructorArgs);
-                               Output.Write (')');
-                               Indent -= 2;
-                       }
-                       if (constructor.ChainedConstructorArgs.Count > 0) {
-                               Output.WriteLine (" : ");
-                               Indent += 2;
-                               Output.Write("this(");
-                               OutputExpressionList (constructor.ChainedConstructorArgs);
-                               Output.Write(')');
-                               Indent -= 2;
-                       }
-                       OutputStartBrace ();
-                       Indent++;
-                       GenerateStatements (constructor.Statements);
-                       Indent--;
-                       Output.WriteLine ('}');
-               }
-
-               protected override void GenerateTypeConstructor (CodeTypeConstructor constructor)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum || IsCurrentInterface) {
-                               return;
-                       }
-
-                       OutputAttributes (constructor.CustomAttributes, null, false);
-
-                       Output.Write ("static " + GetSafeName (CurrentTypeName) + "()");
-                       OutputStartBrace ();
-                       Indent++;
-                       GenerateStatements (constructor.Statements);
-                       Indent--;
-                       Output.WriteLine ('}');
-               }
-
-               protected override void GenerateTypeStart(CodeTypeDeclaration declaration)
-               {
-                       TextWriter output = Output;
-
-                       OutputAttributes (declaration.CustomAttributes, null, false);
-
-                       if (!IsCurrentDelegate) {
-                               OutputTypeAttributes (declaration);
-
-                               output.Write (GetSafeName (declaration.Name));
-
-                               GenerateGenericsParameters (declaration.TypeParameters);
-
-                               IEnumerator enumerator = declaration.BaseTypes.GetEnumerator ();
-                               if (enumerator.MoveNext ()) {
-                                       CodeTypeReference type = (CodeTypeReference) enumerator.Current;
-
-                                       output.Write (" : ");
-                                       OutputType (type);
-
-                                       while (enumerator.MoveNext ()) {
-                                               type = (CodeTypeReference) enumerator.Current;
-
-                                               output.Write (", ");
-                                               OutputType (type);
-                                       }
-                               }
-
-                               GenerateGenericsConstraints (declaration.TypeParameters);
-                               OutputStartBrace ();
-                               ++Indent;
-                       } else {
-                               if ((declaration.TypeAttributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public) {
-                                       output.Write ("public ");
-                               }
-
-                               CodeTypeDelegate delegateDecl = (CodeTypeDelegate) declaration;
-                               output.Write ("delegate ");
-                               OutputType (delegateDecl.ReturnType);
-                               output.Write (" ");
-                               output.Write (GetSafeName (declaration.Name));
-                               output.Write ("(");
-                               OutputParameters (delegateDecl.Parameters);
-                               output.WriteLine (");");
-                       }
-               }
-
-               protected override void GenerateTypeEnd (CodeTypeDeclaration declaration)
-               {
-                       if (!IsCurrentDelegate) {
-                               --Indent;
-                               Output.WriteLine ("}");
-                       }
-               }
-
-               protected override void GenerateNamespaceStart (CodeNamespace ns)
-               {
-                       TextWriter output = Output;
+                       // Use same text decoder as mcs and not user set values in Console
+                       mcs.StartInfo.StandardOutputEncoding =
+                       mcs.StartInfo.StandardErrorEncoding = Encoding.UTF8;
                        
-                       string name = ns.Name;
-                       if (name != null && name.Length != 0) {
-                               output.Write ("namespace ");
-                               output.Write (GetSafeName (name));
-                               OutputStartBrace ();
-                               ++Indent;
-                       }
-               }
-
-               protected override void GenerateNamespaceEnd (CodeNamespace ns)
-               {
-                       string name = ns.Name;
-                       if (name != null && name.Length != 0) {
-                               --Indent;
-                               Output.WriteLine ("}");
-                       }
-               }
-
-               protected override void GenerateNamespaceImport (CodeNamespaceImport import)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("using ");
-                       output.Write (GetSafeName (import.Namespace));
-                       output.WriteLine (';');
-               }
-               
-               protected override void GenerateAttributeDeclarationsStart (CodeAttributeDeclarationCollection attributes)
-               {
-                       Output.Write ('[');
-               }
-               
-               protected override void GenerateAttributeDeclarationsEnd (CodeAttributeDeclarationCollection attributes)
-               {
-                       Output.Write (']');
-               }
-
-               private void OutputStartBrace ()
-               {
-                       if (Options.BracingStyle == "C") {
-                               Output.WriteLine ("");
-                               Output.WriteLine ("{");
-                       } else {
-                               Output.WriteLine (" {");
-                       }
-               }
-
-               private void OutputAttributes (CodeAttributeDeclarationCollection attributes, string prefix, bool inline)
-               {
-                       bool params_set = false;
-
-                       foreach (CodeAttributeDeclaration att in attributes) {
-                               if (att.Name == "System.ParamArrayAttribute") {
-                                       params_set = true;
-                                       continue;
+                       try {
+                               mcs.Start();
+                       } catch (Exception e) {
+                               Win32Exception exc = e as Win32Exception;
+                               if (exc != null) {
+                                       throw new SystemException (String.Format ("Error running {0}: {1}", mcs.StartInfo.FileName,
+                                                                       Win32Exception.GetErrorMessage (exc.NativeErrorCode)));
                                }
-
-                               GenerateAttributeDeclarationsStart (attributes);
-                               if (prefix != null) {
-                                       Output.Write (prefix);
-                               }
-                               OutputAttributeDeclaration (att);
-                               GenerateAttributeDeclarationsEnd (attributes);
-                               if (inline) {
-                                       Output.Write (" ");
-                               } else {
-                                       Output.WriteLine ();
+                               throw;
+                       }
+
+                       try {
+                               mcs.BeginOutputReadLine ();
+                               mcs.BeginErrorReadLine ();
+                               mcs.WaitForExit();
+                               
+                               results.NativeCompilerReturnValue = mcs.ExitCode;
+                       } finally {
+                               mcs.CancelErrorRead ();
+                               mcs.CancelOutputRead ();
+                               mcs.Close();
+                       }
+
+                       bool loadIt=true;
+                       foreach (string error_line in results.Output) {
+                               CompilerError error = CreateErrorFromString (error_line);
+                               if (error != null) {
+                                       results.Errors.Add (error);
+                                       if (!error.IsWarning)
+                                               loadIt = false;
                                }
                        }
-
-                       if (params_set) {
-                               if (prefix != null)
-                                       Output.Write (prefix);
-                               Output.Write ("params");
-                               if (inline)
-                                       Output.Write (" ");
-                               else
-                                       Output.WriteLine ();
-                       }
-               }
-
-               private void OutputAttributeDeclaration (CodeAttributeDeclaration attribute)
-               {
-                       Output.Write (attribute.Name.Replace ('+', '.'));
-                       Output.Write ('(');
-                       IEnumerator enumerator = attribute.Arguments.GetEnumerator ();
-                       if (enumerator.MoveNext ()) {
-                               CodeAttributeArgument argument = (CodeAttributeArgument) enumerator.Current;
-                               OutputAttributeArgument (argument);
-
-                               while (enumerator.MoveNext ()) {
-                                       Output.Write (", ");
-                                       argument = (CodeAttributeArgument) enumerator.Current;
-                                       OutputAttributeArgument (argument);
-                               }
-                       }
-                       Output.Write (')');
-               }
-
-               protected override void OutputType (CodeTypeReference type)
-               {
-                       Output.Write (GetTypeOutput (type));
-               }
-
-               private void OutputVTableModifier (MemberAttributes attributes)
-               {
-                       if ((attributes & MemberAttributes.VTableMask) == MemberAttributes.New) {
-                               Output.Write ("new ");
-                       }
-               }
-
-               protected override void OutputFieldScopeModifier (MemberAttributes attributes)
-               {
-                       switch (attributes & MemberAttributes.ScopeMask) {
-                               case MemberAttributes.Static:
-                                       Output.Write ("static ");
-                                       break;
-                               case MemberAttributes.Const:
-                                       Output.Write ("const ");
-                                       break;
-                       }
-               }
-
-
-               // Note: this method should in fact be private as in .NET 2.0, the 
-               // CSharpCodeGenerator no longer derives from CodeGenerator but we
-               // still need to make this change.
-               protected override void OutputMemberAccessModifier (MemberAttributes attributes)
-               {
-                       switch (attributes & MemberAttributes.AccessMask) {
-                               case MemberAttributes.Assembly:
-                               case MemberAttributes.FamilyAndAssembly:
-                                       Output.Write ("internal "); 
-                                       break;
-                               case MemberAttributes.Family:
-                                       Output.Write ("protected ");
-                                       break;
-                               case MemberAttributes.FamilyOrAssembly:
-                                       Output.Write ("protected internal ");
-                                       break;
-                               case MemberAttributes.Private:
-                                       Output.Write ("private ");
-                                       break;
-                               case MemberAttributes.Public:
-                                       Output.Write ("public ");
-                                       break;
-                       }
-               }
-
-               // Note: this method should in fact be private as in .NET 2.0, the 
-               // CSharpCodeGenerator no longer derives from CodeGenerator but we
-               // still need to make this change.
-               protected override void OutputMemberScopeModifier (MemberAttributes attributes)
-               {
-                       switch (attributes & MemberAttributes.ScopeMask) {
-                               case MemberAttributes.Abstract:
-                                       Output.Write ("abstract ");
-                                       break;
-                               case MemberAttributes.Final:
-                                       // do nothing
-                                       break;
-                               case MemberAttributes.Static:
-                                       Output.Write ("static ");
-                                       break;
-                               case MemberAttributes.Override:
-                                       Output.Write ("override ");
-                                       break;
-                               default:
-                                       MemberAttributes access = attributes & MemberAttributes.AccessMask;
-                                       if (access == MemberAttributes.Assembly || access == MemberAttributes.Family || access == MemberAttributes.Public) {
-                                               Output.Write ("virtual ");
-                                       }
-                                       break;
-                       }
-               }
-
-               private void OutputTypeAttributes (CodeTypeDeclaration declaration)
-               {
-                       TextWriter output = Output;
-                       TypeAttributes attributes = declaration.TypeAttributes;
-
-                       switch (attributes & TypeAttributes.VisibilityMask) {
-                               case TypeAttributes.Public:
-                               case TypeAttributes.NestedPublic:
-                                       output.Write ("public ");
-                                       break;
-                               case TypeAttributes.NestedPrivate:
-                                       output.Write ("private ");
-                                       break;
-                               case TypeAttributes.NotPublic:
-                               case TypeAttributes.NestedFamANDAssem:
-                               case TypeAttributes.NestedAssembly:
-                                       output.Write ("internal ");
-                                       break; 
-                               case TypeAttributes.NestedFamily:
-                                       output.Write ("protected ");
-                                       break;
-                               case TypeAttributes.NestedFamORAssem:
-                                       output.Write ("protected internal ");
-                                       break;
+                       
+                       if (results.Output.Count > 0) {
+                               results.Output.Insert (0, mcs.StartInfo.FileName + " " + mcs.StartInfo.Arguments + Environment.NewLine);
                        }
 
-                       if ((declaration.Attributes & MemberAttributes.New) != 0)
-                               output.Write ("new ");
-
-                       if (declaration.IsStruct) {
-                               if (declaration.IsPartial) {
-                                       output.Write ("partial ");
+                       if (loadIt) {
+                               if (!File.Exists (options.OutputAssembly)) {
+                                       StringBuilder sb = new StringBuilder ();
+                                       foreach (string s in results.Output)
+                                               sb.Append (s + Environment.NewLine);
+                                       
+                                       throw new Exception ("Compiler failed to produce the assembly. Output: '" + sb.ToString () + "'");
                                }
-                               output.Write ("struct ");
-                       } else if (declaration.IsEnum) {
-                               output.Write ("enum ");
-                       } else {
-                               if ((attributes & TypeAttributes.Interface) != 0) {
-                                       if (declaration.IsPartial) {
-                                               output.Write ("partial ");
+                               
+                               if (options.GenerateInMemory) {
+                                       using (FileStream fs = File.OpenRead(options.OutputAssembly)) {
+                                               byte[] buffer = new byte[fs.Length];
+                                               fs.Read(buffer, 0, buffer.Length);
+                                               results.CompiledAssembly = Assembly.Load(buffer, null);
+                                               fs.Close();
                                        }
-                                       output.Write ("interface ");
                                } else {
-                                       if ((attributes & TypeAttributes.Sealed) != 0)
-                                               output.Write ("sealed ");
-                                       if ((attributes & TypeAttributes.Abstract) != 0)
-                                               output.Write ("abstract ");
-                                       if (declaration.IsPartial) {
-                                               output.Write ("partial ");
-                                       }
-                                       output.Write ("class ");
+                                       // Avoid setting CompiledAssembly right now since the output might be a netmodule
+                                       results.PathToAssembly = options.OutputAssembly;
                                }
-                       }
-               }
-
-               [MonoTODO ("Implement missing special characters")]
-               protected override string QuoteSnippetString (string value)
-               {
-                       // FIXME: this is weird, but works.
-                       string output = value.Replace ("\\", "\\\\");
-                       output = output.Replace ("\"", "\\\"");
-                       output = output.Replace ("\t", "\\t");
-                       output = output.Replace ("\r", "\\r");
-                       output = output.Replace ("\n", "\\n");
-
-                       return "\"" + output + "\"";
-               }
-
-               protected override void GeneratePrimitiveExpression(CodePrimitiveExpression e)
-               {
-                       if (e.Value is char) {
-                               this.GenerateCharValue ((char) e.Value);
-                       } else if (e.Value is ushort) {
-                               ushort uc = (ushort) e.Value;
-                               Output.Write (uc.ToString(CultureInfo.InvariantCulture));
-                       } else if (e.Value is uint) {
-                               uint ui = (uint) e.Value;
-                               Output.Write (ui.ToString(CultureInfo.InvariantCulture));
-                               Output.Write ("u");
-                       } else if (e.Value is ulong) {
-                               ulong ul = (ulong) e.Value;
-                               Output.Write (ul.ToString(CultureInfo.InvariantCulture));
-                               Output.Write ("ul");
-                       } else if (e.Value is sbyte) {
-                               sbyte sb = (sbyte) e.Value;
-                               Output.Write (sb.ToString(CultureInfo.InvariantCulture));
                        } else {
-                               base.GeneratePrimitiveExpression (e);
+                               results.CompiledAssembly = null;
                        }
+                       
+                       return results;
                }
 
-               private void GenerateCharValue (char c)
-               {
-                       Output.Write ('\'');
-
-                       switch (c) {
-                               case '\0':
-                                       Output.Write ("\\0");
-                                       break;
-                               case '\t':
-                                       Output.Write ("\\t");
-                                       break;
-                               case '\n':
-                                       Output.Write ("\\n");
-                                       break;
-                               case '\r':
-                                       Output.Write ("\\r");
-                                       break;
-                               case '"':
-                                       Output.Write ("\\\"");
-                                       break;
-                               case '\'':
-                                       Output.Write ("\\'");
-                                       break;
-                               case '\\':
-                                       Output.Write ("\\\\");
-                                       break;
-                               case '\u2028':
-                                       Output.Write ("\\u");
-                                       Output.Write (((int) c).ToString ("X4", CultureInfo.InvariantCulture));
-                                       break;
-                               case '\u2029':
-                                       Output.Write ("\\u");
-                                       Output.Write (((int) c).ToString ("X4", CultureInfo.InvariantCulture));
-                                       break;
-                               default:
-                                       Output.Write (c);
-                                       break;
-                       }
-
-                       Output.Write ('\'');
-               }
-
-               protected override void GenerateSingleFloatValue (float f)
-               {
-                       base.GenerateSingleFloatValue (f);
-                       base.Output.Write ('F');
-               }
-
-               protected override void GenerateDecimalValue (decimal d)
-               {
-                       base.GenerateDecimalValue (d);
-                       base.Output.Write ('m');
-               }
-
-               protected override void GenerateParameterDeclarationExpression (CodeParameterDeclarationExpression e)
-               {
-                       OutputAttributes (e.CustomAttributes, null, true);
-                       OutputDirection (e.Direction);
-                       OutputType (e.Type);
-                       Output.Write (' ');
-                       Output.Write (GetSafeName (e.Name));
-               }
-
-               protected override void GenerateTypeOfExpression (CodeTypeOfExpression e)
-               {
-                       Output.Write ("typeof(");
-                       OutputType (e.Type);
-                       Output.Write (")");
-               }
-
-               /* 
-                * ICodeGenerator
-                */
-
-               protected override string CreateEscapedIdentifier (string value)
-               {
-                       if (value == null)
-                               throw new NullReferenceException ("Argument identifier is null.");
-                       return GetSafeName (value);
-               }
-
-               protected override string CreateValidIdentifier (string value)
+               private static string BuildArgs (CompilerParameters options, string[] fileNames, IDictionary<string, string> providerOptions)
                {
-                       if (value == null)
-                               throw new NullReferenceException ();
-
-                       if (keywordsTable == null)
-                               FillKeywordTable ();
-
-                       if (keywordsTable.Contains (value))
-                               return "_" + value;
+                       StringBuilder args=new StringBuilder();
+                       if (options.GenerateExecutable)
+                               args.Append("/target:exe ");
                        else
-                               return value;
-               }
-    
-               protected override string GetTypeOutput (CodeTypeReference type)
-               {
-                       if ((type.Options & CodeTypeReferenceOptions.GenericTypeParameter) != 0)
-                               return type.BaseType;
-
-                       string typeOutput = null;
-
-                       if (type.ArrayElementType != null) {
-                               typeOutput = GetTypeOutput (type.ArrayElementType);
-                       } else {
-                               typeOutput = DetermineTypeOutput (type);
-                       }
-
-                       int rank = type.ArrayRank;
-                       if (rank > 0) {
-                               typeOutput += '[';
-                               for (--rank; rank > 0; --rank) {
-                                       typeOutput += ',';
-                               }
-                               typeOutput += ']';
-                       }
-
-                       return typeOutput;
-               }
-
-               private string DetermineTypeOutput (CodeTypeReference type)
-               {
-                       string typeOutput = null;
-                       string baseType = type.BaseType;
-
-                       switch (baseType.ToLower (System.Globalization.CultureInfo.InvariantCulture)) {
-                               case "system.int32":
-                                       typeOutput = "int";
-                                       break;
-                               case "system.int64":
-                                       typeOutput = "long";
-                                       break;
-                               case "system.int16":
-                                       typeOutput = "short";
-                                       break;
-                               case "system.boolean":
-                                       typeOutput = "bool";
-                                       break;
-                               case "system.char":
-                                       typeOutput = "char";
-                                       break;
-                               case "system.string":
-                                       typeOutput = "string";
-                                       break;
-                               case "system.object":
-                                       typeOutput = "object";
-                                       break;
-                               case "system.void":
-                                       typeOutput = "void";
-                                       break;
-                               case "system.byte":
-                                       typeOutput = "byte";
-                                       break;
-                               case "system.sbyte":
-                                       typeOutput = "sbyte";
-                                       break;
-                               case "system.decimal":
-                                       typeOutput = "decimal";
-                                       break;
-                               case "system.double":
-                                       typeOutput = "double";
-                                       break;
-                               case "system.single":
-                                       typeOutput = "float";
-                                       break;
-                               case "system.uint16":
-                                       typeOutput = "ushort";
-                                       break;
-                               case "system.uint32":
-                                       typeOutput = "uint";
-                                       break;
-                               case "system.uint64":
-                                       typeOutput = "ulong";
-                                       break;
-                               default:
-                                       StringBuilder sb = new StringBuilder (baseType.Length);
-                                       if ((type.Options & CodeTypeReferenceOptions.GlobalReference) != 0) {
-                                               sb.Append ("global::");
-                                       }
-
-                                       int lastProcessedChar = 0;
-                                       for (int i = 0; i < baseType.Length; i++) {
-                                               char currentChar = baseType[i];
-                                               if (currentChar != '+' && currentChar != '.') {
-                                                       if (currentChar == '`') {
-                                                               sb.Append (CreateEscapedIdentifier (baseType.Substring (
-                                                                       lastProcessedChar, i - lastProcessedChar)));
-                                                               // skip ` character
-                                                               i++;
-                                                               // determine number of type arguments to output
-                                                               int end = i;
-                                                               while (end < baseType.Length && Char.IsDigit (baseType [end]))
-                                                                       end++;
-                                                               int typeArgCount = Int32.Parse (baseType.Substring (i, end - i));
-                                                               // output type arguments
-                                                               OutputTypeArguments (type.TypeArguments, sb, typeArgCount);
-                                                               // skip type argument indicator
-                                                               i = end;
-                                                               // if next character is . or +, then append .
-                                                               if ((i < baseType.Length) && ((baseType[i] == '+') || (baseType[i] == '.'))) {
-                                                                       sb.Append ('.');
-                                                                       // skip character that we just processed
-                                                                       i++;
-                                                               }
-                                                               // save postion of last processed character
-                                                               lastProcessedChar = i;
-                                                       }
-                                               } else {
-                                                       sb.Append (CreateEscapedIdentifier (baseType.Substring (
-                                                               lastProcessedChar, i - lastProcessedChar)));
-                                                       sb.Append ('.');
-                                                       // skip separator
-                                                       i++;
-                                                       // save postion of last processed character
-                                                       lastProcessedChar = i;
-                                               }
-                                       }
-
-                                       // add characters that have not yet been processed 
-                                       if (lastProcessedChar < baseType.Length) {
-                                               sb.Append (CreateEscapedIdentifier (baseType.Substring (lastProcessedChar)));
-                                       }
+                               args.Append("/target:library ");
 
-                                       typeOutput = sb.ToString ();
-                                       break;
-                       }
-                       return typeOutput;
-               }
-
-               static bool is_identifier_start_character (char c)
-               {
-                       return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '@' || Char.IsLetter (c);
-               }
-
-               static bool is_identifier_part_character (char c)
-               {
-                       return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || (c >= '0' && c <= '9') || Char.IsLetter (c);
-               }
-               
-               protected override bool IsValidIdentifier (string identifier)
-               {
-                       if (identifier == null || identifier.Length == 0)
-                               return false;
+                       string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
+                       if (privateBinPath != null && privateBinPath.Length > 0)
+                               args.AppendFormat ("/lib:\"{0}\" ", privateBinPath);
                        
-                       if (keywordsTable == null)
-                               FillKeywordTable ();
-
-                       if (keywordsTable.Contains (identifier))
-                               return false;
+                       if (options.Win32Resource != null)
+                               args.AppendFormat("/win32res:\"{0}\" ",
+                                       options.Win32Resource);
 
-                       if (!is_identifier_start_character (identifier [0]))
-                               return false;
+                       if (options.IncludeDebugInformation)
+                               args.Append("/debug+ /optimize- ");
+                       else
+                               args.Append("/debug- /optimize+ ");
 
-                       for (int i = 1; i < identifier.Length; i ++)
-                               if (! is_identifier_part_character (identifier [i]))
-                                       return false;
+                       if (options.TreatWarningsAsErrors)
+                               args.Append("/warnaserror ");
 
-                       return true;
-               }
+                       if (options.WarningLevel >= 0)
+                               args.AppendFormat ("/warn:{0} ", options.WarningLevel);
 
-               protected override bool Supports (GeneratorSupport supports)
-               {
-                       return true;
-               }
+                       if (options.OutputAssembly == null || options.OutputAssembly.Length == 0) {
+                               string extension = (options.GenerateExecutable ? "exe" : "dll");
+                               options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, extension,
+                                       !options.GenerateInMemory);
+                       }
+                       args.AppendFormat("/out:\"{0}\" ",options.OutputAssembly);
 
-               protected override void GenerateDirectives (CodeDirectiveCollection directives)
-               {
-                       foreach (CodeDirective d in directives) {
-                               if (d is CodeChecksumPragma) {
-                                       GenerateCodeChecksumPragma ((CodeChecksumPragma)d);
-                                       continue;
-                               }
-                               if (d is CodeRegionDirective) {
-                                       GenerateCodeRegionDirective ((CodeRegionDirective)d);
+                       foreach (string import in options.ReferencedAssemblies) {
+                               if (import == null || import.Length == 0)
                                        continue;
-                               }
-                               throw new NotImplementedException ("Unknown CodeDirective");
-                       }
-               }
 
-               void GenerateCodeChecksumPragma (CodeChecksumPragma pragma)
-               {
-                       Output.Write ("#pragma checksum ");
-                       Output.Write (QuoteSnippetString (pragma.FileName));
-                       Output.Write (" \"");
-                       Output.Write (pragma.ChecksumAlgorithmId.ToString ("B"));
-                       Output.Write ("\" \"");
-                       if (pragma.ChecksumData != null) {
-                               foreach (byte b in pragma.ChecksumData) {
-                                       Output.Write (b.ToString ("X2"));
-                               }
+                               args.AppendFormat("/r:\"{0}\" ",import);
                        }
-                       Output.WriteLine ("\"");
-               }
 
-               void GenerateCodeRegionDirective (CodeRegionDirective region)
-               {
-                       switch (region.RegionMode) {
-                               case CodeRegionMode.Start:
-                                       Output.Write ("#region ");
-                                       Output.WriteLine (region.RegionText);
-                                       return;
-                               case CodeRegionMode.End:
-                                       Output.WriteLine ("#endregion");
-                                       return;
+                       if (options.CompilerOptions != null) {
+                               args.Append (options.CompilerOptions);
+                               args.Append (" ");
                        }
-               }
 
-               void GenerateGenericsParameters (CodeTypeParameterCollection parameters)
-               {
-                       int count = parameters.Count;
-                       if (count == 0)
-                               return;
-
-                       Output.Write ('<');
-                       for (int i = 0; i < count - 1; ++i) {
-                               Output.Write (parameters [i].Name);
-                               Output.Write (", ");
+                       foreach (string embeddedResource in options.EmbeddedResources) {
+                               args.AppendFormat("/resource:\"{0}\" ", embeddedResource);
                        }
-                       Output.Write (parameters [count - 1].Name);
-                       Output.Write ('>');
-               }
 
-               void GenerateGenericsConstraints (CodeTypeParameterCollection parameters)
-               {
-                       int count = parameters.Count;
-                       if (count == 0)
-                               return;
-
-                       bool indented = false;
+                       foreach (string linkedResource in options.LinkedResources) {
+                               args.AppendFormat("/linkresource:\"{0}\" ", linkedResource);
+                       }
                        
-                       for (int i = 0; i < count; i++) {
-                               CodeTypeParameter p = parameters [i];
-                               bool hasConstraints = (p.Constraints.Count != 0);
-                               Output.WriteLine ();
-                               if (!hasConstraints && !p.HasConstructorConstraint)
-                                       continue;
+                       if (providerOptions != null && providerOptions.Count > 0) {
+                               string langver;
 
-                               if (!indented) {
-                                       ++Indent;
-                                       indented = true;
-                               }
+                               if (!providerOptions.TryGetValue ("CompilerVersion", out langver))
+                                       langver = "3.5";
 
-                               Output.Write ("where ");
-                               Output.Write (p.Name);
-                               Output.Write (" : ");
+                               if (langver.Length >= 1 && langver [0] == 'v')
+                                       langver = langver.Substring (1);
 
-                               for (int j = 0; j < p.Constraints.Count; j++) {
-                                       if (j > 0)
-                                               Output.Write (", ");
-                                       OutputType (p.Constraints [j]);
-                               }
+                               switch (langver) {
+                                       case "2.0":
+                                               args.Append ("/langversion:ISO-2 ");
+                                               break;
 
-                               if (p.HasConstructorConstraint) {
-                                       if (hasConstraints)
-                                               Output.Write (", ");
-                                       Output.Write ("new");
-                                       if (hasConstraints)
-                                               Output.Write (" ");
-                                       Output.Write ("()");
+                                       case "3.5":
+                                               // current default, omit the switch
+                                               break;
                                }
                        }
 
-                       if (indented)
-                               --Indent;
-               }
-
-               string GetTypeArguments (CodeTypeReferenceCollection collection)
-               {
-                       StringBuilder sb = new StringBuilder (" <");
-                       foreach (CodeTypeReference r in collection) {
-                               sb.Append (GetTypeOutput (r));
-                               sb.Append (", ");
-                       }
-                       sb.Length--;
-                       sb [sb.Length - 1] = '>';
-                       return sb.ToString ();
-               }
-
-               private void OutputTypeArguments (CodeTypeReferenceCollection typeArguments, StringBuilder sb, int count)
-               {
-                       if (count == 0) {
-                               return;
-                       } else if (typeArguments.Count == 0) {
-                               // generic type definition
-                               sb.Append ("<>");
-                               return;
-                       }
-
-                       sb.Append ('<');
-
-                       // write first type argument
-                       sb.Append (GetTypeOutput (typeArguments[0]));
-                       // subsequent type argument are prefixed by ', ' separator
-                       for (int i = 1; i < count; i++) {
-                               sb.Append (", ");
-                               sb.Append (GetTypeOutput (typeArguments[i]));
+                       args.Append ("/noconfig ");
+
+                       args.Append (" -- ");
+                       foreach (string source in fileNames)
+                               args.AppendFormat("\"{0}\" ",source);
+                       return args.ToString();
+               }
+
+               // Keep in sync with mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
+               const string ErrorRegexPattern = @"
+                       ^
+                       (\s*(?<file>[^\(]+)                         # filename (optional)
+                        (\((?<line>\d*)(,(?<column>\d*[\+]*))?\))? # line+column (optional)
+                        :\s+)?
+                       (?<level>\w+)                               # error|warning
+                       \s+
+                       (?<number>[^:]*\d)                          # CS1234
+                       :
+                       \s*
+                       (?<message>.*)$";
+
+               static readonly Regex RelatedSymbolsRegex = new Regex(
+                       @"
+            \(Location\ of\ the\ symbol\ related\ to\ previous\ (warning|error)\)
+                       ",
+                       RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace);
+
+               private static CompilerError CreateErrorFromString(string error_string)
+               {
+                       if (error_string.StartsWith ("BETA"))
+                               return null;
+
+                       if (error_string == null || error_string == "")
+                               return null;
+
+                       CompilerError error=new CompilerError();
+                       Regex reg = new Regex (ErrorRegexPattern, RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace);
+                       Match match=reg.Match(error_string);
+                       if (!match.Success) {
+                               match = RelatedSymbolsRegex.Match (error_string);
+                               if (!match.Success) {
+                                       // We had some sort of runtime crash
+                                       error.ErrorText = error_string;
+                                       error.IsWarning = false;
+                                       error.ErrorNumber = "";
+                                       return error;
+                               } else {
+                                       // This line is a continuation of previous warning of error
+                                       return null;
+                               }
                        }
+                       if (String.Empty != match.Result("${file}"))
+                               error.FileName=match.Result("${file}");
+                       if (String.Empty != match.Result("${line}"))
+                               error.Line=Int32.Parse(match.Result("${line}"));
+                       if (String.Empty != match.Result("${column}"))
+                               error.Column=Int32.Parse(match.Result("${column}").Trim('+'));
 
-                       sb.Append ('>');
-               }
+                       string level = match.Result ("${level}");
+                       if (level == "warning")
+                               error.IsWarning = true;
+                       else if (level != "error")
+                               return null; // error CS8028 will confuse the regex.
 
-#if false
-               //[MonoTODO]
-               public override void ValidateIdentifier (string identifier)
-               {
-               }
-#endif
-
-               private string GetSafeName (string id)
-               {
-                       if (keywordsTable == null) {
-                               FillKeywordTable ();
-                       }
-                       if (keywordsTable.Contains (id)) {
-                               return "@" + id;
-                       } else {
-                               return id;
-                       }
+                       error.ErrorNumber=match.Result("${number}");
+                       error.ErrorText=match.Result("${message}");
+                       return error;
                }
 
-               static void FillKeywordTable ()
+               private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension, bool keepFile)
                {
-                       lock (keywords) {
-                               if (keywordsTable == null) {
-                                       keywordsTable = new Hashtable ();
-                                       foreach (string keyword in keywords) {
-                                               keywordsTable.Add (keyword, keyword);
-                                       }
-                               }
-                       }
+                       return temp_files.AddExtension (extension, keepFile);
                }
-
-               private static Hashtable keywordsTable;
-               private static string[] keywords = new string[] {
-                       "abstract","event","new","struct","as","explicit","null","switch","base","extern",
-                       "this","false","operator","throw","break","finally","out","true",
-                       "fixed","override","try","case","params","typeof","catch","for",
-                       "private","foreach","protected","checked","goto","public",
-                       "unchecked","class","if","readonly","unsafe","const","implicit","ref",
-                       "continue","in","return","using","virtual","default",
-                       "interface","sealed","volatile","delegate","internal","do","is",
-                       "sizeof","while","lock","stackalloc","else","static","enum",
-                       "namespace",
-                       "object","bool","byte","float","uint","char","ulong","ushort",
-                       "decimal","int","sbyte","short","double","long","string","void",
-                       "partial", "yield", "where"
-               };
        }
 }
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs
deleted file mode 100644 (file)
index 9967801..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// Microsoft.CSharp CSharpCodeProvider Class implementation
-//
-// Author:
-//   Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.ComponentModel;
-using System.IO;
-using System.Security.Permissions;
-using System.Collections.Generic;
-
-namespace Microsoft.CSharp {
-
-       [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-       [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
-       public class CSharpCodeProvider : CodeDomProvider {
-               IDictionary <string, string> providerOptions;
-               
-               //
-               // Constructors
-               //
-               public CSharpCodeProvider()
-               {
-               }
-
-               public CSharpCodeProvider (IDictionary <string, string> providerOptions)
-               {
-                       this.providerOptions = providerOptions;
-               }
-
-               //
-               // Properties
-               //
-               public override string FileExtension {
-                       get {
-                               return "cs";
-                       }
-               }
-
-               //
-               // Methods
-               //
-               [Obsolete ("Use CodeDomProvider class")]
-               public override ICodeCompiler CreateCompiler()
-               {
-                       if (providerOptions != null && providerOptions.Count > 0)
-                               return new Mono.CSharp.CSharpCodeCompiler (providerOptions);
-                       return new Mono.CSharp.CSharpCodeCompiler();
-               }
-
-               [Obsolete ("Use CodeDomProvider class")]
-               public override ICodeGenerator CreateGenerator()
-               {
-                       if (providerOptions != null && providerOptions.Count > 0)
-                               return new Mono.CSharp.CSharpCodeGenerator (providerOptions);
-                       return new Mono.CSharp.CSharpCodeGenerator();
-               }
-               
-               [MonoTODO]
-               public override TypeConverter GetConverter (Type type)
-               {
-                       throw new NotImplementedException();
-               }
-
-               [MonoTODO]
-               public override void GenerateCodeFromMember (CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       throw new NotImplementedException();
-               }
-       }
-}
diff --git a/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs b/mcs/class/System/Microsoft.VisualBasic/VBCodeCompiler.cs
deleted file mode 100644 (file)
index b3721e9..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-//
-// Microsoft VisualBasic VBCodeCompiler Class implementation
-//
-// Authors:
-//     Jochen Wezel (jwezel@compumaster.de)
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (c) 2003 Jochen Wezel (http://www.compumaster.de)
-// (c) 2003 Ximian, Inc. (http://www.ximian.com)
-//
-// Modifications:
-// 2003-11-28 JW: create reference to Microsoft.VisualBasic if not explicitly done
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.ComponentModel;
-using System.IO;
-using System.Text;
-using System.Reflection;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Text.RegularExpressions;
-
-namespace Microsoft.VisualBasic
-{
-       internal class VBCodeCompiler : VBCodeGenerator, ICodeCompiler
-       {
-               public CompilerResults CompileAssemblyFromDom (CompilerParameters options, CodeCompileUnit e)
-               {
-                       return CompileAssemblyFromDomBatch (options, new CodeCompileUnit[] { e });
-               }
-
-               public CompilerResults CompileAssemblyFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       try {
-                               return CompileFromDomBatch (options, ea);
-                       } finally {
-                               options.TempFiles.Delete ();
-                       }
-               }
-
-               public CompilerResults CompileAssemblyFromFile (CompilerParameters options, string fileName)
-               {
-                       return CompileAssemblyFromFileBatch (options, new string[] { fileName });
-               }
-
-               public CompilerResults CompileAssemblyFromFileBatch (CompilerParameters options, string[] fileNames)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       try {
-                               return CompileFromFileBatch (options, fileNames);
-                       } finally {
-                               options.TempFiles.Delete ();
-                       }
-               }
-
-               public CompilerResults CompileAssemblyFromSource (CompilerParameters options, string source)
-               {
-                       return CompileAssemblyFromSourceBatch (options, new string[] { source });
-               }
-
-               public CompilerResults CompileAssemblyFromSourceBatch (CompilerParameters options, string[] sources)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       try {
-                               return CompileFromSourceBatch (options, sources);
-                       } finally {
-                               options.TempFiles.Delete ();
-                       }
-               }
-
-               static string BuildArgs (CompilerParameters options, string[] fileNames)
-               {
-                       StringBuilder args = new StringBuilder ();
-                       args.Append ("/quiet ");
-                       if (options.GenerateExecutable)
-                               args.Append ("/target:exe ");
-                       else
-                               args.Append ("/target:library ");
-
-                       /* Disabled. It causes problems now. -- Gonzalo
-                       if (options.IncludeDebugInformation)
-                               args.AppendFormat("/debug ");
-                       */
-
-                       if (options.TreatWarningsAsErrors)
-                               args.Append ("/warnaserror ");
-
-                       /* Disabled. vbnc does not support warninglevels.
-                       if (options.WarningLevel != -1)
-                               args.AppendFormat ("/wlevel:{0} ", options.WarningLevel);
-                       */
-
-                       if (options.OutputAssembly == null || options.OutputAssembly.Length == 0) {
-                               string ext = (options.GenerateExecutable ? "exe" : "dll");
-                               options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, ext, !options.GenerateInMemory);
-                       }
-
-                       args.AppendFormat ("/out:\"{0}\" ", options.OutputAssembly);
-
-                       bool Reference2MSVBFound;
-                       Reference2MSVBFound = false;
-                       if (null != options.ReferencedAssemblies) {
-                               foreach (string import in options.ReferencedAssemblies) {
-                                       if (string.Compare (import, "Microsoft.VisualBasic", true, System.Globalization.CultureInfo.InvariantCulture) == 0)
-                                               Reference2MSVBFound = true;
-                                       args.AppendFormat ("/r:\"{0}\" ", import);
-                               }
-                       }
-                       
-                       // add standard import to Microsoft.VisualBasic if missing
-                       if (!Reference2MSVBFound)
-                               args.Append ("/r:\"Microsoft.VisualBasic.dll\" ");
-
-                       if (options.CompilerOptions != null) {
-                               args.Append (options.CompilerOptions);
-                               args.Append (" ");
-                       }
-                       /* Disabled, vbnc does not support this.
-                       args.Append (" -- "); // makes vbnc not try to process filenames as options
-                       */
-                       foreach (string source in fileNames)
-                               args.AppendFormat (" \"{0}\" ", source);
-
-                       return args.ToString ();
-               }
-
-               static CompilerError CreateErrorFromString (string error_string)
-               {
-                       CompilerError error = new CompilerError ();
-                       Regex reg = new Regex (@"^(\s*(?<file>.*)?\((?<line>\d*)(,(?<column>\d*))?\)\s+)?:\s*" +
-                                               @"(?<level>Error|Warning)?\s*(?<number>.*):\s(?<message>.*)",
-                                               RegexOptions.Compiled | RegexOptions.ExplicitCapture);
-
-                       Match match = reg.Match (error_string);
-                       if (!match.Success) {
-                               return null;
-                       }
-
-                       if (String.Empty != match.Result ("${file}"))
-                               error.FileName = match.Result ("${file}").Trim ();
-
-                       if (String.Empty != match.Result ("${line}"))
-                               error.Line = Int32.Parse (match.Result ("${line}"));
-
-                       if (String.Empty != match.Result ("${column}"))
-                               error.Column = Int32.Parse (match.Result ("${column}"));
-
-                       if (match.Result ("${level}").Trim () == "Warning")
-                               error.IsWarning = true;
-
-                       error.ErrorNumber = match.Result ("${number}");
-                       error.ErrorText = match.Result ("${message}");
-                       
-                       return error;
-               }
-
-               private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension, bool keepFile)
-               {
-                       return temp_files.AddExtension (extension, keepFile);
-               }
-
-               private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension)
-               {
-                       return temp_files.AddExtension (extension);
-               }
-
-               private CompilerResults CompileFromFileBatch (CompilerParameters options, string[] fileNames)
-               {
-                       
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       if (fileNames == null) {
-                               throw new ArgumentNullException ("fileNames");
-                       }
-
-                       CompilerResults results = new CompilerResults (options.TempFiles);
-                       Process vbnc = new Process ();
-
-                       string vbnc_output = "";
-                       string[] vbnc_output_lines;
-                       // FIXME: these lines had better be platform independent.
-                       if (Path.DirectorySeparatorChar == '\\') {
-                               vbnc.StartInfo.FileName = MonoToolsLocator.Mono;
-                               vbnc.StartInfo.Arguments = MonoToolsLocator.VBCompiler + ' ' + BuildArgs (options, fileNames);
-                       } else {
-                               vbnc.StartInfo.FileName = MonoToolsLocator.VBCompiler;
-                               vbnc.StartInfo.Arguments = BuildArgs (options, fileNames);
-                       }
-                       //Console.WriteLine (vbnc.StartInfo.Arguments);
-                       vbnc.StartInfo.CreateNoWindow = true;
-                       vbnc.StartInfo.UseShellExecute = false;
-                       vbnc.StartInfo.RedirectStandardOutput = true;
-                       try {
-                               vbnc.Start ();
-                       } catch (Exception e) {
-                               Win32Exception exc = e as Win32Exception;
-                               if (exc != null) {
-                                       throw new SystemException (String.Format ("Error running {0}: {1}", vbnc.StartInfo.FileName,
-                                                                                       Win32Exception.GetErrorMessage (exc.NativeErrorCode)));
-                               }
-                               throw;
-                       }
-
-                       try {
-                               vbnc_output = vbnc.StandardOutput.ReadToEnd ();
-                               vbnc.WaitForExit ();
-                       } finally {
-                               results.NativeCompilerReturnValue = vbnc.ExitCode;
-                               vbnc.Close ();
-                       }
-
-                       bool loadIt = true;
-                       if (results.NativeCompilerReturnValue == 1) {
-                               loadIt = false;
-                               vbnc_output_lines = vbnc_output.Split (Environment.NewLine.ToCharArray ());
-                               foreach (string error_line in vbnc_output_lines) {
-                                       CompilerError error = CreateErrorFromString (error_line);
-                                       if (null != error) {
-                                               results.Errors.Add (error);
-                                       }
-                               }
-                       }
-                       
-                       if ((loadIt == false && !results.Errors.HasErrors) // Failed, but no errors? Probably couldn't parse the compiler output correctly. 
-                           || (results.NativeCompilerReturnValue != 0 && results.NativeCompilerReturnValue != 1)) // Neither success (0), nor failure (1), so it crashed. 
-                       {
-                               // Show the entire output as one big error message.
-                               loadIt = false;
-                               CompilerError error = new CompilerError (string.Empty, 0, 0, "VBNC_CRASH", vbnc_output);
-                               results.Errors.Add (error);
-                       };
-
-                       if (loadIt) {
-                               if (options.GenerateInMemory) {
-                                       using (FileStream fs = File.OpenRead (options.OutputAssembly)) {
-                                               byte[] buffer = new byte[fs.Length];
-                                               fs.Read (buffer, 0, buffer.Length);
-                                               results.CompiledAssembly = Assembly.Load (buffer, null);
-                                               fs.Close ();
-                                       }
-                               } else {
-                                       results.CompiledAssembly = Assembly.LoadFrom (options.OutputAssembly);
-                                       results.PathToAssembly = options.OutputAssembly;
-                               }
-                       } else {
-                               results.CompiledAssembly = null;
-                       }
-
-                       return results;
-               }
-
-               private CompilerResults CompileFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       if (ea == null) {
-                               throw new ArgumentNullException ("ea");
-                       }
-
-                       string[] fileNames = new string[ea.Length];
-                       StringCollection assemblies = options.ReferencedAssemblies;
-
-                       for (int i = 0; i < ea.Length; i++) {
-                               CodeCompileUnit compileUnit = ea[i];
-                               fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".vb");
-                               FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
-                               StreamWriter s = new StreamWriter (f);
-                               if (compileUnit.ReferencedAssemblies != null) {
-                                       foreach (string str in compileUnit.ReferencedAssemblies) {
-                                               if (!assemblies.Contains (str))
-                                                       assemblies.Add (str);
-                                       }
-                               }
-
-                               ((ICodeGenerator) this).GenerateCodeFromCompileUnit (compileUnit, s, new CodeGeneratorOptions ());
-                               s.Close ();
-                               f.Close ();
-                       }
-                       return CompileAssemblyFromFileBatch (options, fileNames);
-               }
-
-               private CompilerResults CompileFromSourceBatch (CompilerParameters options, string[] sources)
-               {
-                       if (options == null) {
-                               throw new ArgumentNullException ("options");
-                       }
-
-                       if (sources == null) {
-                               throw new ArgumentNullException ("sources");
-                       }
-
-                       string[] fileNames = new string[sources.Length];
-
-                       for (int i = 0; i < sources.Length; i++) {
-                               fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".vb");
-                               FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
-                               using (StreamWriter s = new StreamWriter (f)) {
-                                       s.Write (sources[i]);
-                                       s.Close ();
-                               }
-                               f.Close ();
-                       }
-                       return CompileFromFileBatch (options, fileNames);
-               }
-       }
-}
-
index eed54ad4b63bac3dda99d1e3fc5f22b9d879ccb6..042b5180078388891d1163e4c4b46acdc095419b 100644 (file)
@@ -1,25 +1,13 @@
 //
-// Microsoft.VisualBasic.VBCodeGenerator.cs
+// VBCodeGenerator.cs:
 //
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   (partially based on CSharpCodeGenerator)
-//   Jochen Wezel (jwezel@compumaster.de)
-//   Frederik Carlier (frederik.carlier@carlier-online.be)
-//   Rolf Bjarne Kvinge (RKvinge@novell.com)
+// Authors:
+//     Jochen Wezel (jwezel@compumaster.de)
+//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
-// (C) 2003 Andreas Nahr
-// (C) 2003 Jochen Wezel (http://www.compumaster.de)
+// (c) 2003 Jochen Wezel (http://www.compumaster.de)
+// (c) 2003 Ximian, Inc. (http://www.ximian.com)
 //
-// Modifications:
-// 2003-11-06 JW: some corrections regarding missing spaces in generated code (e. g. "Property ")
-// 2003-11-06 JW: QuoteSnippetString implemented
-// 2003-11-08 JW: automatically add Microsoft.VisualBasic
-// 2003-11-12 JW: some corrections to allow correct compilation
-// 2003-11-28 JW: implementing code differences into current build of this file
-// 2003-12-10 JW: added "String." for the ChrW method because mbas doesn't support it without the String currently / TODO: remove it ASAP!
-// 2007-04-13 FC: Added support for the IdentityInequality operator when comparing against Nothing
-
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
 using System;
-using System.Globalization;
-using System.Text;
-using System.Text.RegularExpressions;
 using System.CodeDom;
 using System.CodeDom.Compiler;
+using System.ComponentModel;
 using System.IO;
+using System.Text;
 using System.Reflection;
 using System.Collections;
+using System.Collections.Specialized;
+using System.Diagnostics;
+using System.Text.RegularExpressions;
 
 namespace Microsoft.VisualBasic
 {
-       internal class VBCodeGenerator : CodeGenerator
+       partial class VBCodeGenerator
        {
-               private string [] Keywords = new string [] {
-                       "AddHandler", "AddressOf", "Alias", "And",
-                       "AndAlso", "Ansi", "As", "Assembly",
-                       "Auto", "Boolean", "ByRef", "Byte", 
-                       "ByVal", "Call", "Case", "Catch", 
-                       "CBool", "CByte", "CChar", "CDate", 
-                       "CDec", "CDbl", "Char", "CInt", 
-                       "Class", "CLng", "CObj", "Const", 
-                       "CShort", "CSng", "CStr", "CType", 
-                       "Date", "Decimal", "Declare", "Default", 
-                       "Delegate", "Dim", "DirectCast", "Do", 
-                       "Double", "Each", "Else", "ElseIf", 
-                       "End", "Enum", "Erase", "Error", 
-                       "Event", "Exit", "False", "Finally", 
-                       "For", "Friend", "Function", "Get", 
-                       "GetType", "Global", "GoSub", "GoTo", "Handles", 
-                       "If", "Implements", "Imports", "In", 
-                       "Inherits", "Integer", "Interface", "Is", 
-                       "Let", "Lib", "Like", "Long", 
-                       "Loop", "Me", "Mod", "Module", 
-                       "MustInherit", "MustOverride", "MyBase", "MyClass", 
-                       "Namespace", "New", "Next", "Not", 
-                       "Nothing", "NotInheritable", "NotOverridable", "Object", 
-                       "On", "Option", "Optional", "Or", 
-                       "OrElse", "Overloads", "Overridable", "Overrides", 
-                       "ParamArray", "Partial", "Preserve", "Private", "Property", 
-                       "Protected", "Public", "RaiseEvent", "ReadOnly", 
-                       "ReDim", "REM", "RemoveHandler", "Resume", 
-                       "Return", "Select", "Set", "Shadows", 
-                       "Shared", "Short", "Single", "Static", 
-                       "Step", "Stop", "String", "Structure", 
-                       "Sub", "SyncLock", "Then", "Throw", 
-                       "To", "True", "Try", "TypeOf", 
-                       "Unicode", "Until", "Variant", "When", 
-                       "While", "With", "WithEvents", "WriteOnly", 
-                       "Xor" 
-               };
-
-               private CodeAttributeDeclarationCollection assemblyCustomAttributes;
-
-               public VBCodeGenerator()
-               {
-               }
-
-               protected override string NullToken {
-                       get {
-                               return "Nothing";
-                       }
-               }
-
-               protected override void ContinueOnNewLine (string st)
-               {
-                       Output.Write (st);
-                       Output.WriteLine (" _");
-               }
-
-               protected override void GenerateBinaryOperatorExpression (CodeBinaryOperatorExpression e)
-               {
-                       // We need to special case for comparisons against null;
-                       // in Visual Basic the "Not (Expr) Is Nothing" construct is used
-                       
-                       bool null_comparison = false;
-                       bool reverse = false;
-                       if (e.Operator == CodeBinaryOperatorType.IdentityInequality) {
-                               CodePrimitiveExpression nothing;
-                               nothing = e.Left as CodePrimitiveExpression;
-                               if (nothing == null) {
-                                       nothing = e.Right as CodePrimitiveExpression;
-                               } else {
-                                       reverse = true;
-                               }
-                               null_comparison = nothing != null && nothing.Value == null;
-                       }
-
-                       if (null_comparison) {
-                               TextWriter output = Output;
-
-                               output.Write ("(Not (");
-                               GenerateExpression (reverse ? e.Right : e.Left);
-                               output.Write (") Is ");
-                               GenerateExpression (reverse ? e.Left : e.Right);
-                               output.Write (')');
-                       } else {
-                               base.GenerateBinaryOperatorExpression (e);
-                       }
-               }
-
-               protected override void GenerateArrayCreateExpression (CodeArrayCreateExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("New ");
-
-                       CodeExpressionCollection initializers = expression.Initializers;
-                       CodeTypeReference createType = expression.CreateType;
-
-                       if (initializers.Count > 0) {
-
-                               OutputType (createType);
-                               
-                               output.Write ("() {");
-                               ++Indent;
-                               OutputExpressionList (initializers);
-                               --Indent;
-                               output.Write ("}");
-                       } else {
-                               CodeTypeReference arrayType = createType.ArrayElementType;
-                               while (arrayType != null) {
-                                       createType = arrayType;
-                                       arrayType = arrayType.ArrayElementType;
-                               }
-
-                               OutputType (createType);
-
-                               output.Write ("((");
-
-                               CodeExpression size = expression.SizeExpression;
-                               if (size != null)
-                                       GenerateExpression (size);
-                               else
-                                       output.Write (expression.Size);
-
-                               output.Write (") - 1) {}");
-                       }
-               }
-
-               protected override void GenerateBaseReferenceExpression (CodeBaseReferenceExpression expression)
-               {
-                       Output.Write ("MyBase");
-               }
-
-               protected override void GenerateCastExpression (CodeCastExpression expression)
-               {
-                       TextWriter output = Output;
-                       // ENHANCE: Use a DirectCast if it is known that expression.Expression is no Value-Type
-                       output.Write ("CType(");
-                       GenerateExpression (expression.Expression);
-                       output.Write (", ");
-                       OutputType (expression.TargetType);
-                       output.Write (")");
-               }
-
-               private bool AsBool (object datavalue)
-               {
-                       return datavalue != null && datavalue is bool && (bool) datavalue;
-               }
-               
-               private string OnOff (bool datavalue)
-               {
-                       return datavalue ? "On" : "Off";
-               }
-
-               protected override void GenerateCompileUnitStart (CodeCompileUnit compileUnit)
-               {
-                       GenerateComment (new CodeComment ("------------------------------------------------------------------------------"));
-                       GenerateComment (new CodeComment (" <autogenerated>"));
-                       GenerateComment (new CodeComment ("     This code was generated by a tool."));
-                       GenerateComment (new CodeComment ("     Mono Runtime Version: " + System.Environment.Version));
-                       GenerateComment (new CodeComment (""));
-                       GenerateComment (new CodeComment ("     Changes to this file may cause incorrect behavior and will be lost if "));
-                       GenerateComment (new CodeComment ("     the code is regenerated."));
-                       GenerateComment (new CodeComment (" </autogenerated>"));
-                       GenerateComment (new CodeComment ("------------------------------------------------------------------------------"));
-                       Output.WriteLine ();
-                       if (AsBool (compileUnit.UserData ["AllowLateBound"])) {
-                               Output.WriteLine("Option Explicit {0}", OnOff (AsBool (compileUnit.UserData ["RequireVariableDeclaration"])));
-                               Output.WriteLine("Option Strict Off");
-                       } else {
-                               Output.WriteLine("Option Explicit On"); // Strict On implies Explicit On
-                               Output.WriteLine("Option Strict On");
-                       }
-                       Output.WriteLine ();
-               }
-
-               protected override void GenerateCompileUnit (CodeCompileUnit compileUnit)
-               {
-                       assemblyCustomAttributes = compileUnit.AssemblyCustomAttributes;
-
-                       GenerateCompileUnitStart (compileUnit);
-
-                       GenerateNamespaces (compileUnit);
-
-                       // In the case there are no namespaces, and hence no Import statements, now 
-                       // is the time to emit assembly level attributes.
-                       if (assemblyCustomAttributes != null) 
-                               GenerateAssemblyAttributes ();
-
-                       GenerateCompileUnitEnd (compileUnit);
-               }
-
-               protected override void GenerateDelegateCreateExpression (CodeDelegateCreateExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("AddressOf ");
-
-                       CodeExpression targetObject = expression.TargetObject;
-                       if (targetObject != null) {
-                               GenerateExpression (targetObject);
-                               Output.Write ('.');
-                       }
-                       output.Write (expression.MethodName);
-               }
-
-               protected override void GenerateFieldReferenceExpression (CodeFieldReferenceExpression expression)
-               {
-                       CodeExpression targetObject = expression.TargetObject;
-                       if (targetObject != null) {
-                               GenerateExpression (targetObject);
-                               Output.Write ('.');
-                       }
-                       Output.Write (CreateEscapedIdentifier (expression.FieldName));
-               }
-               
-               protected override void GenerateArgumentReferenceExpression (CodeArgumentReferenceExpression expression)
-               {
-                       Output.Write (CreateEscapedIdentifier (expression.ParameterName));
-               }
-
-               protected override void GenerateVariableReferenceExpression (CodeVariableReferenceExpression expression)
-               {
-                       Output.Write (CreateEscapedIdentifier (expression.VariableName));
-               }
-               
-               protected override void GenerateIndexerExpression (CodeIndexerExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       GenerateExpression (expression.TargetObject);
-                       output.Write ('(');
-                       OutputExpressionList (expression.Indices);
-                       output.Write (')');
-               }
-               
-               protected override void GenerateArrayIndexerExpression (CodeArrayIndexerExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       GenerateExpression (expression.TargetObject);
-                       output.Write ("(");
-                       OutputExpressionList (expression.Indices);
-                       output.Write (')');
-               }
-               
-               protected override void GenerateSnippetExpression (CodeSnippetExpression expression)
-               {
-                       Output.Write (expression.Value);
-               }
-               
-               protected override void GenerateMethodInvokeExpression (CodeMethodInvokeExpression expression)
-               {
-                       TextWriter output = Output;
-
-                       GenerateMethodReferenceExpression (expression.Method);
-
-                       output.Write ('(');
-                       OutputExpressionList (expression.Parameters);
-                       output.Write (')');
-               }
-
-               protected override void GenerateMethodReferenceExpression (CodeMethodReferenceExpression expression)
-               {
-                       if (expression.TargetObject != null) {
-                               GenerateExpression (expression.TargetObject);
-                               Output.Write ('.');
-                       }
-                       Output.Write (CreateEscapedIdentifier (expression.MethodName));
-               }
-
-               protected override void GenerateEventReferenceExpression (CodeEventReferenceExpression expression)
-               {
-                       if (expression.TargetObject != null) {
-                               GenerateExpression (expression.TargetObject);
-                               Output.Write ('.');
-                               if (expression.TargetObject is CodeThisReferenceExpression) {
-                                       // We're actually creating a reference to a compiler-generated field here...
-                                       Output.Write (expression.EventName + "Event");
-                               } else {
-                                       Output.Write (CreateEscapedIdentifier (expression.EventName));
-                               }
-                       } else {
-                               Output.Write (CreateEscapedIdentifier (expression.EventName + "Event"));
-                       }
-               }
-
-               protected override void GenerateDelegateInvokeExpression (CodeDelegateInvokeExpression expression)
-               {
-                       CodeEventReferenceExpression ev = expression.TargetObject as CodeEventReferenceExpression;
-                       
-                       if (ev != null) {
-                               Output.Write ("RaiseEvent ");
-                               if (ev.TargetObject != null && !(ev.TargetObject is CodeThisReferenceExpression)) {
-                                       GenerateExpression (ev.TargetObject);
-                                       Output.Write (".");
-                               }
-                               Output.Write (ev.EventName);
-                       } else if (expression.TargetObject != null) {
-                               GenerateExpression (expression.TargetObject);
-                       }
-                       Output.Write ('(');
-                       OutputExpressionList (expression.Parameters);
-                       Output.Write (')');
-               }
-               
-               protected override void GenerateObjectCreateExpression (CodeObjectCreateExpression expression)
-               {
-                       Output.Write( "New " );
-                       OutputType (expression.CreateType);
-                       Output.Write ('(');
-                       OutputExpressionList (expression.Parameters);
-                       Output.Write (')');
-               }
-
-               protected override void GenerateParameterDeclarationExpression (CodeParameterDeclarationExpression e)
-               {
-                       OutputAttributes (e.CustomAttributes, null, LineHandling.InLine);
-                       OutputDirection (e.Direction);
-                       OutputTypeNamePair (e.Type, e.Name);
-               }
-
-               protected override void GeneratePrimitiveExpression (CodePrimitiveExpression e)
-               {
-                       if (e.Value is char) {
-                               char c = (char) e.Value;
-                               int ch = (int) c;
-                               Output.Write("Global.Microsoft.VisualBasic.ChrW(" + ch.ToString(CultureInfo.InvariantCulture) + ")");
-                       } else if (e.Value is ushort) {
-                               ushort uc = (ushort) e.Value;
-                               Output.Write (uc.ToString(CultureInfo.InvariantCulture));
-                               Output.Write ("US");
-                       } else if (e.Value is uint) {
-                               uint ui = (uint) e.Value;
-                               Output.Write (ui.ToString(CultureInfo.InvariantCulture));
-                               Output.Write ("UI");
-                       } else if (e.Value is ulong) {
-                               ulong ul = (ulong) e.Value;
-                               Output.Write (ul.ToString(CultureInfo.InvariantCulture));
-                               Output.Write ("UL");
-                       } else if (e.Value is sbyte) {
-                               sbyte sb = (sbyte) e.Value;
-                               Output.Write ("CSByte(");
-                               Output.Write (sb.ToString(CultureInfo.InvariantCulture));
-                               Output.Write (')');
-                       } else {
-                               base.GeneratePrimitiveExpression(e);
-                       }
-               }
-
-               protected override void GenerateSingleFloatValue (float s)
-               {
-                       base.GenerateSingleFloatValue (s);
-                       base.Output.Write ('!');
-               }
-
-               protected override void GeneratePropertyReferenceExpression (CodePropertyReferenceExpression expression)
-               {
-                       if (expression.TargetObject != null) {
-                               GenerateMemberReferenceExpression (expression.TargetObject, expression.PropertyName);
-                       } else {
-                               Output.Write (CreateEscapedIdentifier (expression.PropertyName));
-                       }
-               }
-
-               protected override void GeneratePropertySetValueReferenceExpression (CodePropertySetValueReferenceExpression expression)
-               {
-                       Output.Write ("Value"); 
-               }
-
-               protected override void GenerateThisReferenceExpression (CodeThisReferenceExpression expression)
-               {
-                       Output.Write ("Me");
-               }
-
-               protected override void GenerateExpressionStatement (CodeExpressionStatement statement)
-               {
-                       GenerateExpression (statement.Expression);
-                       Output.WriteLine (); //start new line
-               }
-
-               protected override void GenerateIterationStatement (CodeIterationStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       GenerateStatement (statement.InitStatement);
-                       output.Write ("Do While ");
-                       GenerateExpression (statement.TestExpression);
-                       output.WriteLine ();
-                       Indent++;
-                       GenerateStatements (statement.Statements);
-                       GenerateStatement (statement.IncrementStatement);
-                       Indent--;
-                       output.WriteLine ("Loop");
-               }
-
-               protected override void GenerateThrowExceptionStatement (CodeThrowExceptionStatement statement)
-               {
-                       Output.Write ("Throw");
-                       if (statement.ToThrow != null) {
-                               Output.Write (' ');
-                               GenerateExpression (statement.ToThrow);
-                       }
-                       Output.WriteLine ();
-               }
-
-               protected override void GenerateComment (CodeComment comment)
-               {
-                       TextWriter output = Output;
-                       string commentChars = null;
-
-                       if (comment.DocComment) {
-                               commentChars = "'''";
-                       } else {
-                               commentChars = "'";
-                       }
-       
-                       output.Write (commentChars);
-                       string text = comment.Text;
-
-                       for (int i = 0; i < text.Length; i++) {
-                               output.Write (text [i]);
-                               if (text[i] == '\r') {
-                                       if (i < (text.Length - 1) && text [i + 1] == '\n') {
-                                               continue;
+               protected override CompilerResults FromFileBatch(CompilerParameters options, string[] fileNames)
+               {
+                       if (options == null)
+                               throw new ArgumentNullException(nameof(options));
+
+                       if (fileNames == null)
+                               throw new ArgumentNullException(nameof(fileNames));
+
+                       CompilerResults results = new CompilerResults (options.TempFiles);
+                       Process vbnc = new Process ();
+
+                       string vbnc_output = "";
+                       string[] vbnc_output_lines;
+                       // FIXME: these lines had better be platform independent.
+                       if (Path.DirectorySeparatorChar == '\\') {
+                               vbnc.StartInfo.FileName = MonoToolsLocator.Mono;
+                               vbnc.StartInfo.Arguments = MonoToolsLocator.VBCompiler + ' ' + BuildArgs (options, fileNames);
+                       } else {
+                               vbnc.StartInfo.FileName = MonoToolsLocator.VBCompiler;
+                               vbnc.StartInfo.Arguments = BuildArgs (options, fileNames);
+                       }
+                       //Console.WriteLine (vbnc.StartInfo.Arguments);
+                       vbnc.StartInfo.CreateNoWindow = true;
+                       vbnc.StartInfo.UseShellExecute = false;
+                       vbnc.StartInfo.RedirectStandardOutput = true;
+                       try {
+                               vbnc.Start ();
+                       } catch (Exception e) {
+                               Win32Exception exc = e as Win32Exception;
+                               if (exc != null) {
+                                       throw new SystemException (String.Format ("Error running {0}: {1}", vbnc.StartInfo.FileName,
+                                                                                       Win32Exception.GetErrorMessage (exc.NativeErrorCode)));
+                               }
+                               throw;
+                       }
+
+                       try {
+                               vbnc_output = vbnc.StandardOutput.ReadToEnd ();
+                               vbnc.WaitForExit ();
+                       } finally {
+                               results.NativeCompilerReturnValue = vbnc.ExitCode;
+                               vbnc.Close ();
+                       }
+
+                       bool loadIt = true;
+                       if (results.NativeCompilerReturnValue == 1) {
+                               loadIt = false;
+                               vbnc_output_lines = vbnc_output.Split (Environment.NewLine.ToCharArray ());
+                               foreach (string error_line in vbnc_output_lines) {
+                                       CompilerError error = CreateErrorFromString (error_line);
+                                       if (null != error) {
+                                               results.Errors.Add (error);
                                        }
-                                       output.Write (commentChars);
-                               } else if (text [i] == '\n') {
-                                       output.Write (commentChars);
                                }
                        }
-
-                       output.WriteLine ();
-               }
-
-               protected override void GenerateMethodReturnStatement (CodeMethodReturnStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       if (statement.Expression != null) {
-                               output.Write ("Return ");
-                               GenerateExpression (statement.Expression);
-                               output.WriteLine ();
-                       } else {
-                               output.WriteLine ("Return");
-                       }
-               }
-
-               protected override void GenerateConditionStatement (CodeConditionStatement statement)
-               {
-                       TextWriter output = Output;
-                       output.Write ("If ");
-
-                       GenerateExpression (statement.Condition);
-
-                       output.WriteLine (" Then");
-                       ++Indent;
-                       GenerateStatements (statement.TrueStatements);
-                       --Indent;
-
-                       CodeStatementCollection falses = statement.FalseStatements;
-                       if (falses.Count > 0) {
-                               output.WriteLine ("Else");
-                               ++Indent;
-                               GenerateStatements (falses);
-                               --Indent;
-                       }
-                       else {
-                               if (Options.ElseOnClosing)
-                                       output.WriteLine ("Else");
-                       }
-                       output.WriteLine ("End If");
-               }
-
-               protected override void GenerateTryCatchFinallyStatement (CodeTryCatchFinallyStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       output.WriteLine ("Try ");
-                       ++Indent;
-                       GenerateStatements (statement.TryStatements);
-                       --Indent;
                        
-                       foreach (CodeCatchClause clause in statement.CatchClauses) {
-                               output.Write ("Catch ");
-                               OutputTypeNamePair (clause.CatchExceptionType, clause.LocalName);
-                               output.WriteLine ();
-                               ++Indent;
-                               GenerateStatements (clause.Statements);
-                               --Indent;
-                       }
-
-                       CodeStatementCollection finallies = statement.FinallyStatements;
-                       if (finallies.Count > 0) {
-                               output.WriteLine ("Finally");
-                               ++Indent;
-                               GenerateStatements (finallies);
-                               --Indent;
-                       }
-
-                       output.WriteLine("End Try");
-               }
-
-               protected override void GenerateAssignStatement (CodeAssignStatement statement)
-               {
-                       TextWriter output = Output;
-                       GenerateExpression (statement.Left);
-                       output.Write (" = ");
-                       GenerateExpression (statement.Right);
-                       output.WriteLine ();
-               }
-
-               protected override void GenerateAttachEventStatement (CodeAttachEventStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       Output.Write ("AddHandler ");
-                       if (statement.Event.TargetObject != null) {
-                               GenerateEventReferenceExpression (statement.Event);
-                       } else {
-                               Output.Write (CreateEscapedIdentifier (statement.Event.EventName));
-                       }
-                       Output.Write ( ", ");
-                       GenerateExpression (statement.Listener);
-                       output.WriteLine ();
-               }
-
-               protected override void GenerateRemoveEventStatement (CodeRemoveEventStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       Output.Write ("RemoveHandler ");
-                       if (statement.Event.TargetObject != null) {
-                               GenerateEventReferenceExpression (statement.Event);
-                       } else {
-                               Output.Write (CreateEscapedIdentifier (statement.Event.EventName));
-                       }
-                       Output.Write ( ", ");
-                       GenerateExpression (statement.Listener);
-                       output.WriteLine ();
-               }
-
-               protected override void GenerateGotoStatement (CodeGotoStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("goto ");
-                       output.Write (statement.Label);
-                       output.WriteLine ();
-               }
-               
-               protected override void GenerateLabeledStatement (CodeLabeledStatement statement)
-               {
-                       TextWriter output = Output;
-
-                       Indent--;
-                       output.WriteLine (statement.Label + ":");
-                       Indent++;
-                       if (statement.Statement != null) {
-                               GenerateStatement (statement.Statement);
-                       }
-               }
-
-               protected override void GenerateTypeOfExpression (CodeTypeOfExpression e)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("GetType(");
-                       OutputType (e.Type);
-                       output.Write (")");
-               }
-
-               protected override void GenerateVariableDeclarationStatement( CodeVariableDeclarationStatement statement )
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("Dim ");
-                       OutputTypeNamePair (statement.Type, statement.Name);
-
-                       CodeExpression initExpression = statement.InitExpression;
-                       if (initExpression != null) {
-                               output.Write (" = ");
-                               GenerateExpression (initExpression);
-                       }
-
-                       output.WriteLine();
-               }
-
-               protected override void GenerateLinePragmaStart (CodeLinePragma linePragma)
-               {
-                       Output.WriteLine ();
-                       Output.Write ("#ExternalSource(\"");
-                       Output.Write (linePragma.FileName);
-                       Output.Write ("\",");
-                       Output.Write (linePragma.LineNumber);
-                       Output.WriteLine (")");
-                       Output.WriteLine ("");
-               }
-
-               protected override void GenerateLinePragmaEnd (CodeLinePragma linePragma)
-               {
-                       Output.WriteLine ("#End ExternalSource");
-               }
-
-               protected override void GenerateEvent (CodeMemberEvent eventRef, CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum)
-                               return;
-
-                       TextWriter output = Output;
-
-                       OutputAttributes (eventRef.CustomAttributes, null,
-                               LineHandling.ContinueLine);
-
-                       OutputMemberAccessModifier (eventRef.Attributes);
-
-                       output.Write ("Event ");
-                       OutputTypeNamePair (eventRef.Type, GetEventName(eventRef));
-
-                       if (eventRef.ImplementationTypes.Count > 0) {
-                               OutputImplementationTypes (eventRef.ImplementationTypes, eventRef.Name);
-                       } else if (eventRef.PrivateImplementationType != null) {
-                               output.Write (" Implements ");
-                               OutputType (eventRef.PrivateImplementationType);
-                               output.Write ('.');
-                               output.Write (eventRef.Name);
-                       }
-
-                       output.WriteLine ();
-               }
-
-               protected override void GenerateField (CodeMemberField field)
-               {
-                       if (IsCurrentDelegate || IsCurrentInterface)
-                               return;
-
-                       TextWriter output = Output;
-
-                       OutputAttributes (field.CustomAttributes, null, 
-                               LineHandling.ContinueLine);
-
-                       if (IsCurrentEnum) {
-                               output.Write (field.Name);
-                       } else {
-                               MemberAttributes attributes = field.Attributes;
-                               OutputMemberAccessModifier (attributes);
-                               OutputVTableModifier (attributes);
-                               OutputFieldScopeModifier (attributes);
-                               OutputTypeNamePair (field.Type, field.Name);
-                       }
-
-                       CodeExpression initExpression = field.InitExpression;
-                       if (initExpression != null) {
-                               output.Write (" = ");
-                               GenerateExpression (initExpression);
-                       }
-
-                       output.WriteLine();
-               }
-               
-               protected override void GenerateSnippetMember (CodeSnippetTypeMember member)
-               {
-                       Output.Write (member.Text);
-               }
-               
-               protected override void GenerateEntryPointMethod (CodeEntryPointMethod method, CodeTypeDeclaration declaration)
-               {
-                       OutputAttributes (method.CustomAttributes, null,
-                               LineHandling.ContinueLine);
-
-                       Output.WriteLine ("Public Shared Sub Main()");
-                       Indent++;
-                       GenerateStatements (method.Statements);
-                       Indent--;
-                       Output.WriteLine ("End Sub");
-               }
-               
-               [MonoTODO ("partially implemented")]
-               protected override void GenerateMethod (CodeMemberMethod method, CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum)
-                               return;
-
-                       bool isSub = method.ReturnType.BaseType == typeof(void).FullName;
-
-                       TextWriter output = Output;
-
-                       OutputAttributes (method.CustomAttributes, null, 
-                               LineHandling.ContinueLine);
-
-                       MemberAttributes attributes = method.Attributes;
-
-                       if (!IsCurrentInterface) {
-                               if (method.PrivateImplementationType == null) {
-                                       OutputMemberAccessModifier (attributes);
-                                       if (IsOverloaded (method, declaration)) {
-                                               output.Write ("Overloads ");
-                                       }
-                               }
-                               OutputVTableModifier (attributes);
-                               OutputMemberScopeModifier (attributes);
-                       } else {
-                               OutputVTableModifier (attributes);
-                       }
-
-                       if (isSub)
-                               output.Write ("Sub ");
-                       else
-                               output.Write ("Function ");
-
-                       output.Write (GetMethodName(method));
-                       OutputTypeParameters (method.TypeParameters);
-                       output.Write ('(');
-                       OutputParameters (method.Parameters);
-                       output.Write (')');
-
-                       if (!isSub) {
-                               output.Write (" As ");
-                               OutputAttributes (method.ReturnTypeCustomAttributes, null,
-                                       LineHandling.InLine);
-                               OutputType (method.ReturnType);
-                       }
-
-                       if (method.ImplementationTypes.Count > 0) {
-                               OutputImplementationTypes (method.ImplementationTypes, method.Name);
-                       } else if (method.PrivateImplementationType != null) {
-                               output.Write (" Implements ");
-                               OutputType (method.PrivateImplementationType);
-                               output.Write ('.');
-                               output.Write (method.Name);
-                       }
-
-                       output.WriteLine ();
-                       if (!IsCurrentInterface) {
-                               if ((attributes & MemberAttributes.ScopeMask) != MemberAttributes.Abstract) {
-                                       ++Indent;
-                                       GenerateStatements (method.Statements);
-                                       --Indent;
-                                       if (isSub)
-                                               output.WriteLine ("End Sub");
-                                       else
-                                               output.WriteLine ("End Function");
-                               }
-                       }
-               }
-
-               protected override void GenerateProperty (CodeMemberProperty property, CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum)
-                               return;
-
-                       TextWriter output = Output;
-
-                       OutputAttributes (property.CustomAttributes, null, 
-                               LineHandling.ContinueLine);
-
-                       MemberAttributes attributes = property.Attributes;
-
-                       if (!IsCurrentInterface) {
-                               if (property.PrivateImplementationType == null) {
-                                       OutputMemberAccessModifier (attributes);
-                                       if (IsOverloaded (property, declaration)) {
-                                               output.Write ("Overloads ");
-                                       }
-                               }
-                               OutputVTableModifier (attributes);
-                               OutputMemberScopeModifier (attributes);
-                       } else {
-                               OutputVTableModifier (attributes);
-                       }
-
-                       // mark property as default property if we're dealing with an indexer
-                       if (string.Compare (GetPropertyName(property), "Item", true, CultureInfo.InvariantCulture) == 0 && property.Parameters.Count > 0) {
-                               output.Write ("Default ");
-                       }
-
-                       if (property.HasGet && (!property.HasSet))
-                               output.Write ("ReadOnly " );
-
-                       if (property.HasSet && (!property.HasGet))
-                               output.Write ("WriteOnly " );
-
-                       output.Write ("Property ");
-                       Output.Write (GetPropertyName (property));
-                       // in .NET 2.0, always output parantheses (whether or not there 
-                       // are any parameters to output
-                       Output.Write ('(');
-                       OutputParameters (property.Parameters);
-                       Output.Write (')');
-                       Output.Write (" As ");
-                       Output.Write (GetTypeOutput(property.Type));
-
-                       if (property.ImplementationTypes.Count > 0) {
-                               OutputImplementationTypes (property.ImplementationTypes, property.Name);
-                       } else if (property.PrivateImplementationType != null) {
-                               output.Write (" Implements ");
-                               OutputType (property.PrivateImplementationType);
-                               output.Write ('.');
-                               output.Write (property.Name);
-                       }
-
-                       output.WriteLine ();
-
-                       if (!IsCurrentInterface) {
-                               ++Indent;
-                               if (property.HasGet) {
-                                       output.WriteLine ("Get");
-                                       if (!IsAbstract (property.Attributes)) {
-                                               ++Indent;
-                                               GenerateStatements (property.GetStatements);
-                                               --Indent;
-                                               output.WriteLine ("End Get");
+                       if ((loadIt == false && !results.Errors.HasErrors) // Failed, but no errors? Probably couldn't parse the compiler output correctly. 
+                               || (results.NativeCompilerReturnValue != 0 && results.NativeCompilerReturnValue != 1)) // Neither success (0), nor failure (1), so it crashed. 
+                       {
+                               // Show the entire output as one big error message.
+                               loadIt = false;
+                               CompilerError error = new CompilerError (string.Empty, 0, 0, "VBNC_CRASH", vbnc_output);
+                               results.Errors.Add (error);
+                       };
+
+                       if (loadIt) {
+                               if (options.GenerateInMemory) {
+                                       using (FileStream fs = File.OpenRead (options.OutputAssembly)) {
+                                               byte[] buffer = new byte[fs.Length];
+                                               fs.Read (buffer, 0, buffer.Length);
+                                               results.CompiledAssembly = Assembly.Load (buffer, null);
+                                               fs.Close ();
                                        }
-                               }
-
-                               if (property.HasSet) {
-                                       output.WriteLine ("Set");
-                                       if (!IsAbstract (property.Attributes)) {
-                                               ++Indent;
-                                               GenerateStatements (property.SetStatements);
-                                               --Indent;
-                                               output.WriteLine ("End Set");
-                                       }
-                               }
-
-                               --Indent;
-                               output.WriteLine ("End Property");
-                       }
-               }
-
-               protected override void GenerateConstructor (CodeConstructor constructor, CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum || IsCurrentInterface)
-                               return;
-
-                       OutputAttributes (constructor.CustomAttributes, null,
-                               LineHandling.ContinueLine);
-                       OutputMemberAccessModifier (constructor.Attributes);
-                       Output.Write ("Sub New(");
-                       OutputParameters (constructor.Parameters);
-                       Output.WriteLine (")");
-                       Indent++;
-                       // check if ctor passes args on to other ctor in class
-                       CodeExpressionCollection ctorArgs = constructor.ChainedConstructorArgs;
-                       if (ctorArgs.Count > 0) {
-                               Output.Write ("Me.New(");
-                               OutputExpressionList (ctorArgs);
-                               Output.WriteLine (")");
-                       } else {
-                               // check if ctor passes args on to ctor in base class
-                               ctorArgs = constructor.BaseConstructorArgs;
-                               if (ctorArgs.Count > 0) {
-                                       Output.Write ("MyBase.New(");
-                                       OutputExpressionList (ctorArgs);
-                                       Output.WriteLine (")");
-                               } else if (IsCurrentClass) {
-                                       // call default base ctor
-                                       Output.WriteLine ("MyBase.New");
-                               }
-                       }
-                       GenerateStatements (constructor.Statements);
-                       Indent--;
-                       Output.WriteLine ("End Sub");
-               }
-               
-               protected override void GenerateTypeConstructor (CodeTypeConstructor constructor)
-               {
-                       if (IsCurrentDelegate || IsCurrentEnum || IsCurrentInterface)
-                               return;
-
-                       OutputAttributes (constructor.CustomAttributes, null,
-                               LineHandling.ContinueLine);
-
-                       Output.WriteLine ("Shared Sub New()");
-                       Indent++;
-                       GenerateStatements (constructor.Statements);
-                       Indent--;
-                       Output.WriteLine ("End Sub");
-               }
-
-               [MonoTODO ("partially implemented")]
-               protected override void GenerateTypeStart (CodeTypeDeclaration declaration)
-               {
-                       TextWriter output = Output;
-
-                       OutputAttributes (declaration.CustomAttributes, null, 
-                               LineHandling.ContinueLine);
-
-                       TypeAttributes attributes = declaration.TypeAttributes;
-
-                       if (IsCurrentDelegate) {
-                               CodeTypeDelegate delegateDecl = (CodeTypeDelegate) declaration;
-
-                               if ((attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public) {
-                                       output.Write ("Public ");
-                               }
-
-                               bool isSub = delegateDecl.ReturnType.BaseType == typeof (void).FullName;
-                               if (isSub) {
-                                       output.Write ("Delegate Sub ");
                                } else {
-                                       output.Write ("Delegate Function ");
+                                       results.CompiledAssembly = Assembly.LoadFrom (options.OutputAssembly);
+                                       results.PathToAssembly = options.OutputAssembly;
                                }
-
-                               output.Write (CreateEscapedIdentifier (delegateDecl.Name));
-                               OutputTypeParameters (delegateDecl.TypeParameters);
-                               output.Write ("(");
-                               OutputParameters (delegateDecl.Parameters);
-                               Output.Write (")");
-                               if (!isSub) {
-                                       Output.Write (" As ");
-                                       OutputType (delegateDecl.ReturnType);
-                               }
-                               Output.WriteLine ("");
                        } else {
-                               OutputTypeAttributes (declaration);
-                               output.Write (CreateEscapedIdentifier (declaration.Name));
-                               OutputTypeParameters (declaration.TypeParameters);
-
-                               if (IsCurrentEnum) {
-                                       if (declaration.BaseTypes.Count > 0) {
-                                               output.Write (" As ");
-                                               OutputType (declaration.BaseTypes[0]);
-                                       }
-                                       output.WriteLine ();
-                                       ++Indent;
-                               } else {
-                                       ++Indent;
-
-                                       bool firstInherits = true;
-                                       bool firstImplements = true;
-
-                                       for (int i = 0; i < declaration.BaseTypes.Count; i++) {
-                                               // a struct can only implement interfaces
-                                               // an interface can only inherit from other interface
-
-                                               CodeTypeReference typeRef = declaration.BaseTypes[i];
-                                               
-                                               if (firstInherits && !declaration.IsStruct && !typeRef.IsInterface) {
-                                                       output.WriteLine ();
-                                                       output.Write ("Inherits ");
-                                                       firstInherits = false;
-                                               } else if (!declaration.IsInterface && firstImplements) {
-                                                       output.WriteLine ();
-                                                       output.Write ("Implements ");
-                                                       firstImplements = false;
-                                               } else {
-                                                       output.Write (", ");
-                                               }
-                                               OutputType (typeRef);
-                                       }
-                                       output.WriteLine ();
-                               }
-                       }
-               }
-
-               protected override void GenerateTypeEnd (CodeTypeDeclaration declaration)
-               {
-                       if (IsCurrentDelegate) {
-                               return;
+                               results.CompiledAssembly = null;
                        }
-                       string output = string.Empty;
-
-                       --Indent;
-                       if (declaration.IsStruct)
-                               output = "End Structure";
-                       if (declaration.IsInterface)
-                               output = "End Interface";
-                       if (declaration.IsEnum)
-                               output = "End Enum";
-                       if (declaration.IsClass)
-                               output = "End Class";
-
-                       Output.WriteLine (output);
-               }
-
-               protected override void GenerateNamespace(CodeNamespace ns)
-               {
-                       GenerateNamespaceImports (ns);
-
-                       // Assembly level attributes can't be emitted before the Import statements
-                       // in the file.  
-                       if (assemblyCustomAttributes != null)
-                               GenerateAssemblyAttributes ();
-
-                       Output.WriteLine ();
-
-                       GenerateCommentStatements (ns.Comments);
-                       GenerateNamespaceStart (ns); 
-                       GenerateTypes (ns);
-                       GenerateNamespaceEnd (ns);
-               }
 
-
-               protected override void GenerateNamespaceStart (CodeNamespace ns)
-               {
-                       TextWriter output = Output;
-                       
-                       string name = ns.Name;
-                       if (name != null && name != string.Empty) {
-                               output.Write ("Namespace ");
-                               output.WriteLine (name);
-                               ++Indent;
-                       }
-               }
-
-               protected override void GenerateNamespaceEnd (CodeNamespace ns)
-               {
-                       string name = ns.Name;
-                       if (name != null && name != string.Empty) {
-                               --Indent;
-                               Output.WriteLine ("End Namespace");
-                       }
-               }
-
-               protected override void GenerateNamespaceImport (CodeNamespaceImport import)
-               {
-                       TextWriter output = Output;
-
-                       output.Write ("Imports ");
-                       output.Write (import.Namespace);
-                       output.WriteLine ();
-               }
-               
-               protected override void GenerateAttributeDeclarationsStart (CodeAttributeDeclarationCollection attributes)
-               {
-                       Output.Write ('<');
-               }
-               
-               protected override void GenerateAttributeDeclarationsEnd (CodeAttributeDeclarationCollection attributes)
-               {
-                       Output.Write (">");
-               }
-
-               private void OutputAttributes (CodeAttributeDeclarationCollection attributes, string prefix, LineHandling lineHandling) {
-                       if (attributes.Count == 0) {
-                               return;
-                       }
-
-                       GenerateAttributeDeclarationsStart (attributes);
-
-                       IEnumerator enumerator = attributes.GetEnumerator ();
-                       if (enumerator.MoveNext ()) {
-                               CodeAttributeDeclaration att = (CodeAttributeDeclaration) enumerator.Current;
-                               if (prefix != null) {
-                                       Output.Write (prefix);
-                               }
-                               OutputAttributeDeclaration (att);
-
-                               while (enumerator.MoveNext ()) {
-                                       Output.Write (", ");
-                                       if (lineHandling != LineHandling.InLine) {
-                                               ContinueOnNewLine ("");
-                                               Output.Write (" ");
-                                       }
-                                       att = (CodeAttributeDeclaration) enumerator.Current;
-                                       if (prefix != null) {
-                                               Output.Write (prefix);
-                                       }
-                                       OutputAttributeDeclaration (att);
-                               }
-                       }
-                       GenerateAttributeDeclarationsEnd (attributes);
-                       Output.Write (" ");
-
-                       switch (lineHandling) {
-                               case LineHandling.ContinueLine:
-                                       ContinueOnNewLine ("");
-                                       break;
-                               case LineHandling.NewLine:
-                                       Output.WriteLine ();
-                                       break;
-                       }
+                       return results;
                }
 
-               protected override void OutputAttributeArgument (CodeAttributeArgument argument)
+               static string BuildArgs (CompilerParameters options, string[] fileNames)
                {
-                       string name = argument.Name;
-                       if (name != null && name.Length > 0) {
-                               Output.Write (name);
-                               Output.Write (":=");
-                       }
-                       GenerateExpression (argument.Value);
-               }
+                       StringBuilder args = new StringBuilder ();
+                       args.Append ("/quiet ");
+                       if (options.GenerateExecutable)
+                               args.Append ("/target:exe ");
+                       else
+                               args.Append ("/target:library ");
 
-               private void OutputAttributeDeclaration (CodeAttributeDeclaration attribute)
-               {
-                       Output.Write (attribute.Name.Replace ('+', '.'));
-                       Output.Write ('(');
-                       IEnumerator enumerator = attribute.Arguments.GetEnumerator ();
-                       if (enumerator.MoveNext ()) {
-                               CodeAttributeArgument argument = (CodeAttributeArgument) enumerator.Current;
-                               OutputAttributeArgument (argument);
+                       /* Disabled. It causes problems now. -- Gonzalo
+                       if (options.IncludeDebugInformation)
+                               args.AppendFormat("/debug ");
+                       */
 
-                               while (enumerator.MoveNext ()) {
-                                       Output.Write (", ");
-                                       argument = (CodeAttributeArgument) enumerator.Current;
-                                       OutputAttributeArgument (argument);
-                               }
-                       }
-                       Output.Write (')');
-               }
+                       if (options.TreatWarningsAsErrors)
+                               args.Append ("/warnaserror ");
 
-               protected override void OutputDirection (FieldDirection direction)
-               {
-                       switch (direction) {
-                       case FieldDirection.In:
-                               Output.Write ("ByVal ");
-                               break;
-                       case FieldDirection.Out:
-                       case FieldDirection.Ref:
-                               Output.Write ("ByRef ");
-                               break;
-                       }
-               }
+                       /* Disabled. vbnc does not support warninglevels.
+                       if (options.WarningLevel != -1)
+                               args.AppendFormat ("/wlevel:{0} ", options.WarningLevel);
+                       */
 
-               protected override void OutputFieldScopeModifier (MemberAttributes attributes)
-               {
-                       switch (attributes & MemberAttributes.ScopeMask) {
-                       case MemberAttributes.Static:
-                               Output.Write ("Shared ");
-                               break;
-                       case MemberAttributes.Const:
-                               Output.Write ("Const ");
-                               break;
+                       if (options.OutputAssembly == null || options.OutputAssembly.Length == 0) {
+                               string ext = (options.GenerateExecutable ? "exe" : "dll");
+                               options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, ext, !options.GenerateInMemory);
                        }
-               }
 
-               private void OutputImplementationTypes (CodeTypeReferenceCollection implementationTypes, string member)
-               {
-                       IEnumerator enumerator = implementationTypes.GetEnumerator ();
-                       if (enumerator.MoveNext ()) {
-                               Output.Write (" Implements ");
-
-                               CodeTypeReference typeReference = (CodeTypeReference) enumerator.Current;
-                               OutputType (typeReference);
-                               Output.Write ('.');
-                               OutputIdentifier (member);
+                       args.AppendFormat ("/out:\"{0}\" ", options.OutputAssembly);
 
-                               while (enumerator.MoveNext ()) {
-                                       Output.Write (" , ");
-                                       typeReference = (CodeTypeReference) enumerator.Current;
-                                       OutputType (typeReference);
-                                       Output.Write ('.');
-                                       OutputIdentifier (member);
+                       bool Reference2MSVBFound;
+                       Reference2MSVBFound = false;
+                       if (null != options.ReferencedAssemblies) {
+                               foreach (string import in options.ReferencedAssemblies) {
+                                       if (string.Compare (import, "Microsoft.VisualBasic", true, System.Globalization.CultureInfo.InvariantCulture) == 0)
+                                               Reference2MSVBFound = true;
+                                       args.AppendFormat ("/r:\"{0}\" ", import);
                                }
                        }
-               }
-
-               protected override void OutputMemberAccessModifier (MemberAttributes attributes)
-               {
-                       switch (attributes & MemberAttributes.AccessMask) {
-                       case MemberAttributes.Assembly:
-                       case MemberAttributes.FamilyAndAssembly:
-                               Output.Write ("Friend "); 
-                               break;
-                       case MemberAttributes.Family:
-                               Output.Write ("Protected ");
-                               break;
-                       case MemberAttributes.FamilyOrAssembly:
-                               Output.Write ("Protected Friend ");
-                               break;
-                       case MemberAttributes.Private:
-                               Output.Write ("Private ");
-                               break;
-                       case MemberAttributes.Public:
-                               Output.Write ("Public ");
-                               break;
-                       }
-               }
-
-               private void OutputVTableModifier (MemberAttributes attributes)
-               {
-                       if ((attributes & MemberAttributes.VTableMask) == MemberAttributes.New)
-                               Output.Write ("Shadows ");
-               }
-
-               protected override void OutputMemberScopeModifier (MemberAttributes attributes)
-               {
-                       switch (attributes & MemberAttributes.ScopeMask) {
-                       case MemberAttributes.Abstract:
-                               Output.Write ("MustOverride ");
-                               break;
-                       case MemberAttributes.Final:
-                               // do nothing
-                               break;
-                       case MemberAttributes.Static:
-                               Output.Write ("Shared ");
-                               break;
-                       case MemberAttributes.Override:
-                               Output.Write ("Overrides ");
-                               break;
-                       case MemberAttributes.Overloaded:
-                               // based on http://gendotnet.com/Code%20Gen%20Articles/codedom.htm
-                               Output.Write ("Overloads ");
-
-                               MemberAttributes access_ovl = attributes & MemberAttributes.AccessMask;
-                               if (access_ovl == MemberAttributes.Public || access_ovl == MemberAttributes.Family)
-                                       Output.Write ("Overridable ");
-                               break;
-                       default:
-                               //
-                               // FUNNY! if the scope value is
-                               // rubbish (0 or >Const), and access
-                               // is public, protected make it
-                               // "virtual".
-                               //
-                               // i'm not sure whether this is 100%
-                               // correct, but it seems to be MS
-                               // behavior.
-                               //
-                               // On MS.NET 2.0, internal properties
-                               // are also marked "virtual".
-                               //
-                               MemberAttributes access = attributes & MemberAttributes.AccessMask;
-                               if (access == MemberAttributes.Public || 
-                                       access == MemberAttributes.Family || access == MemberAttributes.Assembly)
-                                       Output.Write ("Overridable ");
-                               break;
-                       }
-               }
-
-               protected override void OutputOperator (CodeBinaryOperatorType op)
-               {
-                       switch (op) {
-                       case CodeBinaryOperatorType.Add:
-                               Output.Write ("+");
-                               break;
-                       case CodeBinaryOperatorType.Subtract:
-                               Output.Write ("-");
-                               break;
-                       case CodeBinaryOperatorType.Multiply:
-                               Output.Write ("*");
-                               break;
-                       case CodeBinaryOperatorType.Divide:
-                               Output.Write ("/");
-                               break;
-                       case CodeBinaryOperatorType.Modulus:
-                               Output.Write ("Mod");
-                               break;
-                       case CodeBinaryOperatorType.Assign:
-                               Output.Write ("=");
-                               break;
-                       case CodeBinaryOperatorType.IdentityInequality:
-                               Output.Write ("<>");
-                               break;
-                       case CodeBinaryOperatorType.IdentityEquality:
-                               Output.Write ("Is");
-                               break;
-                       case CodeBinaryOperatorType.ValueEquality:
-                               Output.Write ("=");
-                               break;
-                       case CodeBinaryOperatorType.BitwiseOr:
-                               Output.Write ("Or");
-                               break;
-                       case CodeBinaryOperatorType.BitwiseAnd:
-                               Output.Write ("And");
-                               break;
-                       case CodeBinaryOperatorType.BooleanOr:
-                               Output.Write ("OrElse");
-                               break;
-                       case CodeBinaryOperatorType.BooleanAnd:
-                               Output.Write ("AndAlso");
-                               break;
-                       case CodeBinaryOperatorType.LessThan:
-                               Output.Write ("<");
-                               break;
-                       case CodeBinaryOperatorType.LessThanOrEqual:
-                               Output.Write ("<=");
-                               break;
-                       case CodeBinaryOperatorType.GreaterThan:
-                               Output.Write (">");
-                               break;
-                       case CodeBinaryOperatorType.GreaterThanOrEqual:
-                               Output.Write (">=");
-                               break;
-                       }
-               }
-
-               private void OutputTypeAttributes (CodeTypeDeclaration declaration)
-               {
-                       TextWriter output = Output;
-                       TypeAttributes attributes = declaration.TypeAttributes;
-
-                       if (declaration.IsPartial)
-                               output.Write ("Partial ");
                        
-                       switch (attributes & TypeAttributes.VisibilityMask) {
-                       case TypeAttributes.Public:
-                       case TypeAttributes.NestedPublic:
-                               output.Write ("Public ");
-                               break;
-                       case TypeAttributes.NestedPrivate:
-                               output.Write ("Private ");
-                               break;
-                       case TypeAttributes.NotPublic:
-                       case TypeAttributes.NestedFamANDAssem:
-                       case TypeAttributes.NestedAssembly:
-                               output.Write ("Friend ");
-                               break; 
-                       case TypeAttributes.NestedFamily:
-                               output.Write ("Protected ");
-                               break;
-                       case TypeAttributes.NestedFamORAssem:
-                               output.Write ("Protected Friend ");
-                               break;
-                       }
-
-                       if (declaration.IsStruct) {
-                               output.Write ("Structure ");
-                       } else if (declaration.IsEnum) {
-                               output.Write ("Enum ");
-                       } else {
-                               if ((attributes & TypeAttributes.Interface) != 0) {
-                                       output.Write ("Interface ");
-                               } else {
-                                       if ((attributes & TypeAttributes.Sealed) != 0)
-                                               output.Write ("NotInheritable ");
+                       // add standard import to Microsoft.VisualBasic if missing
+                       if (!Reference2MSVBFound)
+                               args.Append ("/r:\"Microsoft.VisualBasic.dll\" ");
 
-                                       if ((attributes & TypeAttributes.Abstract) != 0)
-                                               output.Write ("MustInherit ");
-
-                                       output.Write ("Class ");
-                               }
+                       if (options.CompilerOptions != null) {
+                               args.Append (options.CompilerOptions);
+                               args.Append (" ");
                        }
-               }
+                       /* Disabled, vbnc does not support this.
+                       args.Append (" -- "); // makes vbnc not try to process filenames as options
+                       */
+                       foreach (string source in fileNames)
+                               args.AppendFormat (" \"{0}\" ", source);
 
-               void OutputTypeParameters (CodeTypeParameterCollection parameters)
-               {
-                       int count = parameters.Count;
-                       if (count == 0)
-                               return;
-
-                       Output.Write ("(Of ");
-                       for (int i = 0; i < count; ++i) {
-                               if (i > 0)
-                                       Output.Write (", ");
-                               CodeTypeParameter p = parameters [i];
-                               Output.Write (p.Name);
-                               OutputTypeParameterConstraints (p);
-                       }
-                       Output.Write (')');
+                       return args.ToString ();
                }
 
-               void OutputTypeParameterConstraints (CodeTypeParameter parameter)
+               static CompilerError CreateErrorFromString (string error_string)
                {
-                       int constraint_count = parameter.Constraints.Count +
-                               (parameter.HasConstructorConstraint ? 1 : 0);
-
-                       if (constraint_count == 0)
-                               return;
+                       CompilerError error = new CompilerError ();
+                       Regex reg = new Regex (@"^(\s*(?<file>.*)?\((?<line>\d*)(,(?<column>\d*))?\)\s+)?:\s*" +
+                                               @"(?<level>Error|Warning)?\s*(?<number>.*):\s(?<message>.*)",
+                                               RegexOptions.Compiled | RegexOptions.ExplicitCapture);
 
-                       Output.Write (" As ");
-
-                       if (constraint_count > 1)
-                               Output.Write (" {");
-
-                       for (int i = 0; i < parameter.Constraints.Count; i++) {
-                               if (i > 0)
-                                       Output.Write (", ");
-                               OutputType (parameter.Constraints [i]);
+                       Match match = reg.Match (error_string);
+                       if (!match.Success) {
+                               return null;
                        }
 
-                       if (parameter.HasConstructorConstraint) {
-                               if (constraint_count > 1)
-                                       Output.Write (", ");
-                               Output.Write ("New");
-                       }
+                       if (String.Empty != match.Result ("${file}"))
+                               error.FileName = match.Result ("${file}").Trim ();
 
-                       if (constraint_count > 1)
-                               Output.Write ("}");
-               }
+                       if (String.Empty != match.Result ("${line}"))
+                               error.Line = Int32.Parse (match.Result ("${line}"));
 
-               protected override void OutputTypeNamePair (CodeTypeReference typeRef, String name)
-               {
-                       if (name.Length == 0)
-                               name = "__exception";
-                       Output.Write (CreateEscapedIdentifier(name) + " As " + GetTypeOutput (typeRef));
-               }
+                       if (String.Empty != match.Result ("${column}"))
+                               error.Column = Int32.Parse (match.Result ("${column}"));
 
-               protected override void OutputType (CodeTypeReference type)
-               {
-                       Output.Write (GetTypeOutput (type));
-               }
+                       if (match.Result ("${level}").Trim () == "Warning")
+                               error.IsWarning = true;
 
-               protected override string QuoteSnippetString (string value)
-               {
-                       StringBuilder mySBuilder = new StringBuilder(value.Length);
-                       mySBuilder.Append ("\"");
-                       bool inQuotes = true;
-                       for (int MyCounter = 0; MyCounter < value.Length; MyCounter++) {
-                               if (value[MyCounter] == 34) //quotation mark
-                               {
-                                       if (!inQuotes) {
-                                               mySBuilder.Append ("&\"");
-                                               inQuotes = true;
-                                       }
-                                       mySBuilder.Append (value[MyCounter]);
-                                       mySBuilder.Append (value[MyCounter]);
-                               }
-                               else if (value[MyCounter] >= 32) //standard ansi/unicode characters
-                               {
-                                       if (!inQuotes) {
-                                               mySBuilder.Append ("&\"");
-                                               inQuotes = true;
-                                       }
-                                       mySBuilder.Append (value[MyCounter]);
-                               }
-                               else //special chars, e.g. line break
-                               {
-                                       if (inQuotes) {
-                                               mySBuilder.Append ("\"");
-                                               inQuotes = false;
-                                       }
-                                       mySBuilder.Append ("&Microsoft.VisualBasic.ChrW(");
-                                       mySBuilder.Append ((int)value[MyCounter]); 
-                                       mySBuilder.Append (")");
-                               }
-                       }
-                       if (inQuotes)
-                               mySBuilder.Append ("\"");
-                       return mySBuilder.ToString();
-               }
-
-               private void GenerateMemberReferenceExpression (CodeExpression targetObject, string memberName)
-               {
-                       GenerateExpression (targetObject);
-                       Output.Write ('.');
-                       Output.Write (memberName);
-               }
+                       error.ErrorNumber = match.Result ("${number}");
+                       error.ErrorText = match.Result ("${message}");
                        
-               /* 
-                * ICodeGenerator
-                */
-
-               protected override string CreateEscapedIdentifier (string value)
-               {
-                       for (int x = 0; x < Keywords.Length; x++)
-                               if (value.ToLower().Equals (Keywords[x].ToLower()))
-                                       return "[" + value + "]";
-                       return value;
-               }
-
-               protected override string CreateValidIdentifier (string value)
-               {
-                       for (int x = 0; x < Keywords.Length; x++)
-                               if (value.ToLower().Equals (Keywords[x].ToLower()))
-                                       return "_" + value;
-                       return value;
-               }
-
-               protected override string GetTypeOutput (CodeTypeReference type)
-               {
-                       string output;
-                       CodeTypeReference arrayType;
-
-                       arrayType = type.ArrayElementType;
-                       if (arrayType != null)
-                               output = GetTypeOutput (arrayType);
-                       else {
-                               switch (type.BaseType) {
-                               case "System.DateTime":
-                                       output = "Date";
-                                       break;
-                               case "System.Decimal":
-                                       output = "Decimal";
-                                       break;
-                               case "System.Double":
-                                       output = "Double";
-                                       break;
-                               case "System.Single":
-                                       output = "Single";
-                                       break;
-                               case "System.Byte":
-                                       output = "Byte";
-                                       break;
-                               case "System.Int32":
-                                       output = "Integer";
-                                       break;
-                               case "System.Int64":
-                                       output = "Long";
-                                       break;
-                               case "System.Int16":
-                                       output = "Short";
-                                       break;
-                               case "System.Boolean":
-                                       output = "Boolean";
-                                       break;
-                               case "System.Char":
-                                       output = "Char";
-                                       break;
-                               case "System.String":
-                                       output = "String";
-                                       break;
-                               case "System.Object":
-                                       output = "Object";
-                                       break;
-                               case "System.SByte":
-                                       output = "SByte";
-                                       break;
-                               case "System.UInt16":
-                                       output = "UShort";
-                                       break;
-                               case "System.UInt32":
-                                       output = "UInteger";
-                                       break;
-                               case "System.UInt64":
-                                       output = "ULong";
-                                       break;
-                               default:
-                                       output = type.BaseType.Replace('+', '.');
-                                       output = CreateEscapedIdentifier (output);
-                                       break;
-                               }
-                       }
-
-                       int rank = type.ArrayRank;
-                       if (rank > 0) {
-                               output += "(";
-                               for (--rank; rank > 0; --rank)
-                                       output += ",";
-                               output += ")";
-                       }
-
-                       return output;
-               }
-
-               protected override bool IsValidIdentifier (string identifier)
-               {
-                       for (int x = 0; x < Keywords.Length; x++)
-                               if (identifier.ToLower().Equals (Keywords[x].ToLower()))
-                                       return false;
-                       return true;
-               }
-
-               protected override bool Supports (GeneratorSupport supports)
-               {
-                       return true;
-               }
-
-               private bool IsOverloaded (CodeMemberProperty property, CodeTypeDeclaration type)
-               {
-                       if ((property.Attributes & MemberAttributes.Overloaded) == MemberAttributes.Overloaded) {
-                               return true;
-                       }
-
-                       foreach (CodeTypeMember member in type.Members) {
-                               CodeMemberProperty p = member as CodeMemberProperty;
-                               if (p == null) {
-                                       // member is not a property
-                                       continue;
-                               }
-
-                               if (p != property && p.Name == property.Name && p.PrivateImplementationType == null)
-                                       return true;
-                       }
-                       return false;
-               }
-
-               private bool IsOverloaded (CodeMemberMethod method, CodeTypeDeclaration type)
-               {
-                       if ((method.Attributes & MemberAttributes.Overloaded) == MemberAttributes.Overloaded) {
-                               return true;
-                       }
-
-                       foreach (CodeTypeMember member in type.Members) {
-                               CodeMemberMethod m = member as CodeMemberMethod;
-                               if (m == null) {
-                                       // member is not a method
-                                       continue;
-                               }
-
-                               if (!(m is CodeTypeConstructor) && !(m is CodeConstructor) && m != method && m.Name == method.Name && m.PrivateImplementationType == null)
-                                       return true;
-                       }
-                       return false;
-               }
-
-               private string GetEventName (CodeMemberEvent evt)
-               {
-                       if (evt.PrivateImplementationType == null)
-                               return evt.Name;
-
-                       string baseType = evt.PrivateImplementationType.BaseType.Replace ('.', '_');
-                       return baseType + "_" + evt.Name;
-               }
-
-               private string GetMethodName (CodeMemberMethod method)
-               {
-                       if (method.PrivateImplementationType == null)
-                               return method.Name;
-
-                       string baseType = method.PrivateImplementationType.BaseType.Replace ('.', '_');
-                       return baseType + "_" + method.Name;
-               }
-
-               private string GetPropertyName (CodeMemberProperty property)
-               {
-                       if (property.PrivateImplementationType == null)
-                               return property.Name;
-
-                       string baseType = property.PrivateImplementationType.BaseType.Replace ('.', '_');
-                       return baseType + "_" + property.Name;
-               }
-
-               static bool IsAbstract (MemberAttributes attributes)
-               {
-                       return (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract;
-               }
-
-               private void GenerateAssemblyAttributes ()
-               {
-                       OutputAttributes (assemblyCustomAttributes,
-                               "Assembly: ", LineHandling.NewLine);
-                       assemblyCustomAttributes = null;
+                       return error;
                }
 
-               private enum LineHandling
+               private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension, bool keepFile)
                {
-                       InLine,
-                       ContinueLine,
-                       NewLine
+                       return temp_files.AddExtension (extension, keepFile);
                }
        }
-}
+}
\ No newline at end of file
diff --git a/mcs/class/System/Microsoft.VisualBasic/VBCodeProvider.cs b/mcs/class/System/Microsoft.VisualBasic/VBCodeProvider.cs
deleted file mode 100644 (file)
index 5a28fdf..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Microsoft.VisualBasic.VBCodeProvider.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Andreas Nahr
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.ComponentModel;
-using System.IO;
-using System.Security.Permissions;
-
-namespace Microsoft.VisualBasic {
-
-       [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-       [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
-       public class VBCodeProvider : CodeDomProvider {
-
-               public VBCodeProvider()
-               {
-               }
-
-               public VBCodeProvider(System.Collections.Generic.IDictionary<string, string> providerOptions)
-               {
-                       // TODO: Do something meaningful here...
-               }
-
-               public override string FileExtension {
-                       get {
-                               return "vb";
-                       }
-               }
-
-               public override LanguageOptions LanguageOptions {
-                       get {
-                               return LanguageOptions.CaseInsensitive;
-                       }
-               }
-
-               [Obsolete ("Use CodeDomProvider class")]
-               public override ICodeCompiler CreateCompiler()
-               {
-                       return new Microsoft.VisualBasic.VBCodeCompiler ();
-               }
-
-               [Obsolete ("Use CodeDomProvider class")]
-               public override ICodeGenerator CreateGenerator()
-               {
-                       return new Microsoft.VisualBasic.VBCodeGenerator();
-               }
-               
-               public override TypeConverter GetConverter (Type type)
-               {
-                       return TypeDescriptor.GetConverter (type);
-               }
-
-               [MonoTODO]
-               public override void GenerateCodeFromMember (CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       throw new NotImplementedException();
-               }
-       }
-}
index a33e3dcd76b98990ed665e812132cee8ef8326bb..51afd4cef7b7944cb3ba85b3abd3435423f0ce8f 100644 (file)
@@ -29,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,436</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -37,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,436</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeObject.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeTypeReference.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CSharpHelpers.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\IO\TempFileCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpCodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpCodeProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpMemberAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpModifierAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpTypeAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBCodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBCodeProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBMemberAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBModiferAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBTypeAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArgumentReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArrayCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArrayIndexerExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAssignStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttachEventStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeArgument.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeArgumentCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeDeclarationCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBaseReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBinaryOperatorExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBinaryOperatorType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCastExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCatchClause.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCatchClauseCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeChecksumPragma.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeComment.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCommentStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCommentStatementCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCompileUnit.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeConditionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeConstructor.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDefaultValueExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDelegateCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDelegateInvokeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirectionExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirective.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirectiveCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeEntryPointMethod.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeEventReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpressionCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpressionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeFieldReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeGotoStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeIndexerExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeIterationStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeLabeledStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeLinePragma.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberEvent.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberField.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberMethod.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberProperty.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMethodInvokeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\codemethodreferenceexpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMethodReturnStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceImport.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceImportCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeObjectCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeParameterDeclarationExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeParameterDeclarationExpressionCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePrimitiveExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePropertyReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePropertySetValueReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRegionDirective.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRegionMode.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRemoveEventStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetCompileUnit.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetTypeMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeStatementCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeThisReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeThrowExceptionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTryCatchFinallyStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeConstructor.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDeclarationCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDelegate.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeMemberCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeOfExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeParameter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeParameterCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeVariableDeclarationStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeVariableReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeDomProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeGeneratorOptions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeParser.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeValidator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerError.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerErrorCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerParameters.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerParameters.Evidence.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerResults.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerResults.Evidence.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ExposedTabStringIndentedTextWriter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\GeneratorSupport.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeParser.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\LanguageOptions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\FieldDirection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\MemberAttributes.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\Collections\Specialized\FixedStringLookup.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Runtime.Extensions\src\System\CodeDom\Compiler\IndentedTextWriter.cs" />\r
     <Compile Include="..\..\build\common\SR.cs" />\r
     <Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArgumentReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArrayCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArrayIndexerExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAssignStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttachEventStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeArgument.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeArgumentCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeDeclaration.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeDeclarationCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBaseReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBinaryOperatorExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBinaryOperatorType.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCastExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCatchClause.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCatchClauseCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeChecksumPragma.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeComment.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCommentStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCommentStatementCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCompileUnit.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeConditionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeConstructor.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDefaultValueExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDelegateCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDelegateInvokeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirectionExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirective.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirectiveCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeEntryPointMethod.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeEventReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpressionCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpressionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeFieldReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeGotoStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeIndexerExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeIterationStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeLabeledStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeLinePragma.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberEvent.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberField.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberMethod.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberProperty.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMethodInvokeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\codemethodreferenceexpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMethodReturnStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespace.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceImport.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceImportCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeObject.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeObjectCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeParameterDeclarationExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeParameterDeclarationExpressionCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePrimitiveExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePropertyReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePropertySetValueReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRegionDirective.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRegionMode.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRemoveEventStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetCompileUnit.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetTypeMember.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeStatementCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeThisReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeThrowExceptionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTryCatchFinallyStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeConstructor.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDeclaration.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDeclarationCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDelegate.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeMember.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeMemberCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeOfExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeParameter.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeParameterCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReference.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReferenceCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeVariableDeclarationStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeVariableReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeGenerator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeGeneratorOptions.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeValidator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerError.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerErrorCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerParameters.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratedCodeAttribute.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratorSupport.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeCompiler.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeGenerator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeParser.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\IndentTextWriter.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\LanguageOptions.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\FieldDirection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\MemberAttributes.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\bithelper.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\debugview.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\iset.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\bitvector32.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\casesensitivestringdictionary.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\collectionsutil.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\collections\specialized\fixedstringlookup.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\hybriddictionary.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\inotifycollectionchanged.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\iordereddictionary.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="corefx\ZLibNative.cs" />\r
-    <Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
     <Compile Include="Microsoft.CSharp\CSharpCodeGenerator.cs" />\r
-    <Compile Include="Microsoft.CSharp\CSharpCodeProvider.cs" />\r
-    <Compile Include="Microsoft.VisualBasic\VBCodeCompiler.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeGenerator.cs" />\r
-    <Compile Include="Microsoft.VisualBasic\VBCodeProvider.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeX509ChainHandle.cs" />\r
     <Compile Include="Microsoft.Win32\IntranetZoneCredentialPolicy.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventArgs.cs" />\r
     <Compile Include="ReferenceSources\SR2.cs" />\r
     <Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
     <Compile Include="ReferenceSources\Win32Exception.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeDomProvider.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeParser.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\Compiler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerCollection.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerInfo.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerProviderOption.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerProviderOptionsCollection.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerResults.cs" />\r
     <Compile Include="System.CodeDom.Compiler\Executor.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\TempFileCollection.cs" />\r
     <Compile Include="System.Configuration\ApplicationScopedSettingAttribute.cs" />\r
     <Compile Include="System.Configuration\ApplicationSettingsBase.cs" />\r
     <Compile Include="System.Configuration\ApplicationSettingsGroup.cs" />\r
index fec6c0fd10413fa06af74a38e31cda008a50f346..088e73f7b1097713fb4cbc13e5c3d9793d3d964d 100644 (file)
@@ -29,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,436</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -37,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,436</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeObject.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeTypeReference.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CSharpHelpers.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\IO\TempFileCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpCodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpCodeProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpMemberAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpModifierAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpTypeAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBCodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBCodeProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBMemberAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBModiferAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBTypeAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArgumentReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArrayCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArrayIndexerExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAssignStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttachEventStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeArgument.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeArgumentCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeDeclarationCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBaseReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBinaryOperatorExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBinaryOperatorType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCastExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCatchClause.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCatchClauseCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeChecksumPragma.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeComment.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCommentStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCommentStatementCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCompileUnit.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeConditionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeConstructor.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDefaultValueExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDelegateCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDelegateInvokeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirectionExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirective.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirectiveCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeEntryPointMethod.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeEventReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpressionCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpressionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeFieldReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeGotoStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeIndexerExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeIterationStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeLabeledStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeLinePragma.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberEvent.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberField.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberMethod.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberProperty.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMethodInvokeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\codemethodreferenceexpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMethodReturnStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceImport.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceImportCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeObjectCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeParameterDeclarationExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeParameterDeclarationExpressionCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePrimitiveExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePropertyReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePropertySetValueReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRegionDirective.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRegionMode.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRemoveEventStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetCompileUnit.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetTypeMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeStatementCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeThisReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeThrowExceptionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTryCatchFinallyStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeConstructor.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDeclarationCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDelegate.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeMemberCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeOfExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeParameter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeParameterCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeVariableDeclarationStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeVariableReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeDomProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeGeneratorOptions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeParser.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeValidator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerError.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerErrorCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerParameters.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerParameters.Evidence.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerResults.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerResults.Evidence.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ExposedTabStringIndentedTextWriter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\GeneratorSupport.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeParser.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\LanguageOptions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\FieldDirection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\MemberAttributes.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\Collections\Specialized\FixedStringLookup.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Runtime.Extensions\src\System\CodeDom\Compiler\IndentedTextWriter.cs" />\r
     <Compile Include="..\..\build\common\SR.cs" />\r
     <Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArgumentReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArrayCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArrayIndexerExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAssignStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttachEventStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeArgument.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeArgumentCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeDeclaration.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeDeclarationCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBaseReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBinaryOperatorExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBinaryOperatorType.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCastExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCatchClause.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCatchClauseCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeChecksumPragma.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeComment.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCommentStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCommentStatementCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCompileUnit.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeConditionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeConstructor.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDefaultValueExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDelegateCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDelegateInvokeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirectionExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirective.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirectiveCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeEntryPointMethod.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeEventReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpressionCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpressionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeFieldReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeGotoStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeIndexerExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeIterationStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeLabeledStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeLinePragma.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberEvent.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberField.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberMethod.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberProperty.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMethodInvokeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\codemethodreferenceexpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMethodReturnStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespace.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceImport.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceImportCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeObject.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeObjectCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeParameterDeclarationExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeParameterDeclarationExpressionCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePrimitiveExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePropertyReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePropertySetValueReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRegionDirective.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRegionMode.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRemoveEventStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetCompileUnit.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetTypeMember.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeStatementCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeThisReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeThrowExceptionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTryCatchFinallyStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeConstructor.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDeclaration.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDeclarationCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDelegate.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeMember.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeMemberCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeOfExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeParameter.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeParameterCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReference.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReferenceCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeVariableDeclarationStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeVariableReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeGenerator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeGeneratorOptions.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeValidator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerError.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerErrorCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerParameters.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratedCodeAttribute.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratorSupport.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeCompiler.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeGenerator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeParser.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\IndentTextWriter.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\LanguageOptions.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\FieldDirection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\MemberAttributes.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\bithelper.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\debugview.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\iset.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\bitvector32.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\casesensitivestringdictionary.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\collectionsutil.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\collections\specialized\fixedstringlookup.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\hybriddictionary.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\inotifycollectionchanged.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\iordereddictionary.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="corefx\ZLibNative.cs" />\r
-    <Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
     <Compile Include="Microsoft.CSharp\CSharpCodeGenerator.cs" />\r
-    <Compile Include="Microsoft.CSharp\CSharpCodeProvider.cs" />\r
-    <Compile Include="Microsoft.VisualBasic\VBCodeCompiler.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeGenerator.cs" />\r
-    <Compile Include="Microsoft.VisualBasic\VBCodeProvider.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeX509ChainHandle.cs" />\r
     <Compile Include="Microsoft.Win32\IntranetZoneCredentialPolicy.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventArgs.cs" />\r
     <Compile Include="ReferenceSources\SR2.cs" />\r
     <Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
     <Compile Include="ReferenceSources\Win32Exception.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeDomProvider.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeParser.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\Compiler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerCollection.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerInfo.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerProviderOption.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerProviderOptionsCollection.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerResults.cs" />\r
     <Compile Include="System.CodeDom.Compiler\Executor.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\TempFileCollection.cs" />\r
     <Compile Include="System.Configuration\ApplicationScopedSettingAttribute.cs" />\r
     <Compile Include="System.Configuration\ApplicationSettingsBase.cs" />\r
     <Compile Include="System.Configuration\ApplicationSettingsGroup.cs" />\r
index 834627696966194f86a68ae68e6a2db75a2099ea..575b6497c248d1f06d675d7bb8e544cf6a929f17 100644 (file)
@@ -29,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,436</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -37,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,436</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeObject.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeTypeReference.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\CSharpHelpers.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\IO\TempFileCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpCodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpCodeProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpMemberAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpModifierAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\CSharp\CSharpTypeAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBCodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBCodeProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBMemberAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBModiferAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\Microsoft\VisualBasic\VBTypeAttributeConverter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArgumentReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArrayCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeArrayIndexerExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAssignStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttachEventStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeArgument.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeArgumentCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeAttributeDeclarationCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBaseReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBinaryOperatorExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeBinaryOperatorType.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCastExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCatchClause.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCatchClauseCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeChecksumPragma.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeComment.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCommentStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCommentStatementCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeCompileUnit.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeConditionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeConstructor.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDefaultValueExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDelegateCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDelegateInvokeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirectionExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirective.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeDirectiveCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeEntryPointMethod.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeEventReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpressionCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeExpressionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeFieldReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeGotoStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeIndexerExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeIterationStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeLabeledStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeLinePragma.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberEvent.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberField.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberMethod.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMemberProperty.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMethodInvokeExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\codemethodreferenceexpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeMethodReturnStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespace.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceImport.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeNamespaceImportCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeObjectCreateExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeParameterDeclarationExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeParameterDeclarationExpressionCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePrimitiveExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePropertyReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodePropertySetValueReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRegionDirective.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRegionMode.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeRemoveEventStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetCompileUnit.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeSnippetTypeMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeStatementCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeThisReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeThrowExceptionStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTryCatchFinallyStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeConstructor.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDeclarationCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeDelegate.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeMember.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeMemberCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeOfExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeParameter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeParameterCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeTypeReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeVariableDeclarationStatement.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\CodeVariableReferenceExpression.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeDomProvider.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeGeneratorOptions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeParser.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CodeValidator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerError.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerErrorCollection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerInfo.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerParameters.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerParameters.Evidence.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerResults.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\CompilerResults.Evidence.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ExposedTabStringIndentedTextWriter.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\GeneratorSupport.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeCompiler.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeGenerator.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\ICodeParser.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\Compiler\LanguageOptions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\FieldDirection.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\CodeDom\MemberAttributes.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.CodeDom\src\System\Collections\Specialized\FixedStringLookup.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />\r
     <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.Runtime.Extensions\src\System\CodeDom\Compiler\IndentedTextWriter.cs" />\r
     <Compile Include="..\..\build\common\SR.cs" />\r
     <Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArgumentReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArrayCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeArrayIndexerExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAssignStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttachEventStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeArgument.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeArgumentCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeDeclaration.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeAttributeDeclarationCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBaseReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBinaryOperatorExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeBinaryOperatorType.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCastExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCatchClause.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCatchClauseCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeChecksumPragma.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeComment.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCommentStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCommentStatementCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeCompileUnit.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeConditionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeConstructor.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDefaultValueExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDelegateCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDelegateInvokeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirectionExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirective.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeDirectiveCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeEntryPointMethod.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeEventReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpressionCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeExpressionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeFieldReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeGotoStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeIndexerExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeIterationStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeLabeledStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeLinePragma.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberEvent.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberField.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberMethod.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMemberProperty.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMethodInvokeExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\codemethodreferenceexpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeMethodReturnStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespace.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceImport.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeNamespaceImportCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeObject.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeObjectCreateExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeParameterDeclarationExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeParameterDeclarationExpressionCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePrimitiveExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePropertyReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodePropertySetValueReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRegionDirective.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRegionMode.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeRemoveEventStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetCompileUnit.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeSnippetTypeMember.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeStatementCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeThisReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeThrowExceptionStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTryCatchFinallyStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeConstructor.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDeclaration.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDeclarationCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeDelegate.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeMember.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeMemberCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeOfExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeParameter.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeParameterCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReference.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReferenceCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeTypeReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeVariableDeclarationStatement.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\CodeVariableReferenceExpression.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeGenerator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeGeneratorOptions.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CodeValidator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerError.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerErrorCollection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\CompilerParameters.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratedCodeAttribute.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratorSupport.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeCompiler.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeGenerator.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\ICodeParser.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\IndentTextWriter.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\compiler\LanguageOptions.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\FieldDirection.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\codedom\MemberAttributes.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\bithelper.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\debugview.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\generic\iset.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\bitvector32.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\casesensitivestringdictionary.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\collectionsutil.cs" />\r
-    <Compile Include="..\referencesource\System\compmod\system\collections\specialized\fixedstringlookup.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\hybriddictionary.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\inotifycollectionchanged.cs" />\r
     <Compile Include="..\referencesource\System\compmod\system\collections\specialized\iordereddictionary.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="corefx\ZLibNative.cs" />\r
-    <Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
     <Compile Include="Microsoft.CSharp\CSharpCodeGenerator.cs" />\r
-    <Compile Include="Microsoft.CSharp\CSharpCodeProvider.cs" />\r
-    <Compile Include="Microsoft.VisualBasic\VBCodeCompiler.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeGenerator.cs" />\r
-    <Compile Include="Microsoft.VisualBasic\VBCodeProvider.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeX509ChainHandle.cs" />\r
     <Compile Include="Microsoft.Win32\IntranetZoneCredentialPolicy.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventArgs.cs" />\r
     <Compile Include="ReferenceSources\SR2.cs" />\r
     <Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
     <Compile Include="ReferenceSources\Win32Exception.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeDomProvider.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CodeParser.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\Compiler.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerCollection.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerInfo.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerProviderOption.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerProviderOptionsCollection.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\CompilerResults.cs" />\r
     <Compile Include="System.CodeDom.Compiler\Executor.cs" />\r
-    <Compile Include="System.CodeDom.Compiler\TempFileCollection.cs" />\r
     <Compile Include="System.Configuration\ApplicationScopedSettingAttribute.cs" />\r
     <Compile Include="System.Configuration\ApplicationSettingsBase.cs" />\r
     <Compile Include="System.Configuration\ApplicationSettingsGroup.cs" />\r
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeCompiler.cs b/mcs/class/System/System.CodeDom.Compiler/CodeCompiler.cs
deleted file mode 100644 (file)
index f80945d..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// System.CodeDom.Compiler.CodeCompiler.cs
-//
-// Authors:
-//   Jackson Harper (Jackson@LatitudeGeo.com)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002 Jackson Harper, All rights reserved
-// (C) 2003 Andreas Nahr
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.IO;
-using System.Text;
-using System.Reflection;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Security.Permissions;
-
-namespace System.CodeDom.Compiler {
-
-       public abstract class CodeCompiler : CodeGenerator, ICodeCompiler
-       {
-
-               protected CodeCompiler ()
-               {
-               }
-
-               protected abstract string CompilerName {
-                       get;
-               }
-       
-               protected abstract string FileExtension {
-                       get;
-               }
-
-               protected abstract string CmdArgsFromParameters (CompilerParameters options);
-
-               protected virtual CompilerResults FromDom (CompilerParameters options, CodeCompileUnit e)
-               {
-                       return FromDomBatch (options, new CodeCompileUnit[]{e});
-               }
-       
-               protected virtual CompilerResults FromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
-               {
-                       string[] fileNames = new string[ea.Length];
-                       int i = 0;
-                       if (options == null)
-                               options = new CompilerParameters ();
-                       
-                       StringCollection assemblies = options.ReferencedAssemblies;
-
-                       foreach (CodeCompileUnit e in ea) {
-                               fileNames[i] = Path.ChangeExtension (Path.GetTempFileName(), FileExtension);
-                               FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
-                               StreamWriter s = new StreamWriter (f);
-                               if (e.ReferencedAssemblies != null) {
-                                       foreach (string str in e.ReferencedAssemblies) {
-                                               if (!assemblies.Contains (str))
-                                                       assemblies.Add (str);
-                                       }
-                               }
-
-                               ((ICodeGenerator)this).GenerateCodeFromCompileUnit (e, s, new CodeGeneratorOptions());
-                               s.Close();
-                               f.Close();
-                               i++;
-                       }
-                       return Compile (options, fileNames, false);
-               }
-
-               protected virtual CompilerResults FromFile (CompilerParameters options, string fileName)
-               {
-                       return FromFileBatch (options, new string[] {fileName});
-               }
-
-               protected virtual CompilerResults FromFileBatch (CompilerParameters options, string[] fileNames)
-               {
-                       return Compile (options, fileNames, true);
-               }
-
-               protected virtual CompilerResults FromSource (CompilerParameters options, string source)
-               {
-                       return FromSourceBatch(options, new string[]{source});
-               }
-
-               protected virtual CompilerResults FromSourceBatch (CompilerParameters options, string[] sources)
-               {
-                       string[] fileNames = new string[sources.Length];
-                       int i = 0;
-                       foreach (string source in sources) {
-                               fileNames[i] = Path.ChangeExtension (Path.GetTempFileName(), FileExtension);
-                               FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
-                               StreamWriter s = new StreamWriter (f);
-                               s.Write (source);
-                               s.Close ();
-                               f.Close ();
-                               i++;
-                       }
-                       return Compile (options, fileNames, false);
-               }
-
-               [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
-               private CompilerResults Compile (CompilerParameters options, string[] fileNames, bool keepFiles)
-               {
-                       if (null == options)
-                               throw new ArgumentNullException ("options");
-                       if (null == fileNames)
-                               throw new ArgumentNullException ("fileNames");
-
-                       options.TempFiles = new TempFileCollection ();
-                       foreach (string file in fileNames) {
-                               options.TempFiles.AddFile (file, keepFiles);
-                       }
-                       options.TempFiles.KeepFiles = keepFiles;
-
-                       string std_output = String.Empty;
-                       string err_output = String.Empty;
-                       string cmd = String.Concat (CompilerName, " ", CmdArgsFromParameters (options));
-
-                       CompilerResults results = new CompilerResults (new TempFileCollection ());
-                       results.NativeCompilerReturnValue = Executor.ExecWaitWithCapture (cmd,
-                               options.TempFiles, ref std_output, ref err_output);
-
-                       string[] compiler_output_lines = std_output.Split (Environment.NewLine.ToCharArray ());
-                       foreach (string error_line in compiler_output_lines)
-                               ProcessCompilerOutputLine (results, error_line);
-
-                       if (results.Errors.Count == 0)
-                               results.PathToAssembly = options.OutputAssembly;
-                       return results;
-               }
-
-               [MonoTODO]
-               protected virtual string GetResponseFileCmdArgs (CompilerParameters options, string cmdArgs)
-               {
-                       // FIXME I'm not sure what this function should do...
-                       throw new NotImplementedException ();
-               }
-
-               CompilerResults ICodeCompiler.CompileAssemblyFromDom (CompilerParameters options, CodeCompileUnit e)
-               {
-                       return FromDom (options, e);
-               }
-
-               CompilerResults ICodeCompiler.CompileAssemblyFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
-               {
-                       return FromDomBatch (options, ea);
-               }
-
-               CompilerResults ICodeCompiler.CompileAssemblyFromFile (CompilerParameters options, string fileName)
-               {
-                       return FromFile (options, fileName);
-               }
-
-               CompilerResults ICodeCompiler.CompileAssemblyFromFileBatch (CompilerParameters options, string[] fileNames)
-               {
-                       return FromFileBatch (options, fileNames);
-               }
-
-
-               CompilerResults ICodeCompiler.CompileAssemblyFromSource (CompilerParameters options, string source)
-               {
-                       return FromSource (options, source);
-               }
-
-
-               CompilerResults ICodeCompiler.CompileAssemblyFromSourceBatch (CompilerParameters options, string[] sources)
-               {
-                       return FromSourceBatch (options, sources);
-               }
-
-               protected static string JoinStringArray (string[] sa, string separator)
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       int length = sa.Length;
-                       if (length > 1) {
-                               for (int i=0; i < length - 1; i++) {
-                                       sb.Append ("\"");
-                                       sb.Append (sa [i]);
-                                       sb.Append ("\"");
-                                       sb.Append (separator);
-                               }
-                       }
-                       if (length > 0) {
-                               sb.Append ("\"");
-                               sb.Append (sa [length - 1]);
-                               sb.Append ("\"");
-                       }
-                       return sb.ToString ();
-               }
-
-               protected abstract void ProcessCompilerOutputLine (CompilerResults results, string line);
-
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs b/mcs/class/System/System.CodeDom.Compiler/CodeDomConfigurationHandler.cs
deleted file mode 100644 (file)
index bfc7990..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.Configuration.CodeDomConfigurationHandler
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if CONFIGURATION_DEP
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-using System.IO;
-
-namespace System.CodeDom.Compiler
-{
-       internal sealed class CodeDomConfigurationHandler: ConfigurationSection
-       {
-               static ConfigurationPropertyCollection properties;
-               static ConfigurationProperty compilersProp;
-               static CompilerCollection default_compilers;
-
-               static CodeDomConfigurationHandler ()
-               {
-                       default_compilers = new CompilerCollection ();
-                       compilersProp = new ConfigurationProperty ("compilers", typeof (CompilerCollection), default_compilers);
-                       properties = new ConfigurationPropertyCollection ();
-                       properties.Add (compilersProp);
-               }
-
-               public CodeDomConfigurationHandler ()
-               {
-               }
-               
-               protected override void InitializeDefault ()
-               {
-                       compilersProp = new ConfigurationProperty ("compilers", typeof (CompilerCollection), default_compilers);
-               }
-               
-               [MonoTODO]
-                protected override void PostDeserialize ()
-                {
-                        base.PostDeserialize ();
-                }
-
-                protected override object GetRuntimeObject ()
-                {
-                        return this;
-                }
-
-               [ConfigurationProperty ("compilers")]
-                public CompilerCollection Compilers {
-                        get { return (CompilerCollection) base [compilersProp]; }
-                }
-
-               public CompilerInfo[] CompilerInfos {
-                       get {
-                               CompilerCollection cc = (CompilerCollection)base [compilersProp];
-                               if (cc == null)
-                                       return null;
-                               return cc.CompilerInfos;
-                       }
-               }
-               
-               protected override ConfigurationPropertyCollection Properties {
-                        get { return properties; }
-                }
-       }
-}
-#endif
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs b/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs
deleted file mode 100644 (file)
index 192f1c0..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-//
-// System.CodeDom.Compiler.CodeDomProvider.cs
-//
-// Authors:
-//   Daniel Stodden (stodden@in.tum.de)
-//   Marek Safar (marek.safar@seznam.cz)
-//   Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//   Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2002,2003,2004,2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Configuration;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-
-#pragma warning disable 618
-
-namespace System.CodeDom.Compiler {
-
-       [ComVisible (true)]
-       [ToolboxItem (false)]
-       public abstract class CodeDomProvider : Component
-       {
-               //
-               // Constructors
-               //
-               protected CodeDomProvider()
-               {
-               }
-
-               //
-               // Properties
-               //
-               public virtual string FileExtension {
-                       get {
-                               return String.Empty;
-                       }
-               }
-
-               public virtual LanguageOptions LanguageOptions {
-                       get {
-                               return LanguageOptions.None;
-                       }
-               }
-
-               //
-               // Methods
-               //
-               [Obsolete ("ICodeCompiler is obsolete")]
-               public abstract ICodeCompiler CreateCompiler();
-
-               [Obsolete ("ICodeGenerator is obsolete")]
-               public abstract ICodeGenerator CreateGenerator();
-               
-               public virtual ICodeGenerator CreateGenerator (string fileName)
-               {
-                       return CreateGenerator();
-               }
-
-               public virtual ICodeGenerator CreateGenerator (TextWriter output)
-               {
-                       return CreateGenerator();
-               }
-
-               [Obsolete ("ICodeParser is obsolete")]
-               public virtual ICodeParser CreateParser()
-               {
-                       return null;
-               }
-
-               public virtual TypeConverter GetConverter (Type type)
-               {
-                       return TypeDescriptor.GetConverter (type);
-               }
-
-               public virtual CompilerResults CompileAssemblyFromDom (CompilerParameters options, params CodeCompileUnit[] compilationUnits)
-               {
-                       ICodeCompiler cc = CreateCompiler ();
-                       if (cc == null)
-                               throw GetNotImplemented ();
-                       return cc.CompileAssemblyFromDomBatch (options, compilationUnits);
-               }
-
-               public virtual CompilerResults CompileAssemblyFromFile (CompilerParameters options, params string[] fileNames)
-               {
-                       ICodeCompiler cc = CreateCompiler ();
-                       if (cc == null)
-                               throw GetNotImplemented ();
-                       return cc.CompileAssemblyFromFileBatch (options, fileNames);
-               }
-
-               public virtual CompilerResults CompileAssemblyFromSource (CompilerParameters options, params string[] sources)
-               {
-                       ICodeCompiler cc = CreateCompiler ();
-                       if (cc == null)
-                               throw GetNotImplemented ();
-                       return cc.CompileAssemblyFromSourceBatch (options, sources);
-               }
-
-               public virtual string CreateEscapedIdentifier (string value)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       return cg.CreateEscapedIdentifier (value);
-               }
-
-#if CONFIGURATION_DEP
-               [ComVisible (false)]
-               [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-               public static CodeDomProvider CreateProvider (string language)
-               {
-                       CompilerInfo ci = GetCompilerInfo (language);
-                       return (ci == null) ? null : ci.CreateProvider ();
-               }
-               [ComVisible (false)]
-               public static CodeDomProvider CreateProvider (string language, IDictionary<string, string> providerOptions)
-               {
-                       CompilerInfo ci = GetCompilerInfo (language);
-                       return ci == null ? null : ci.CreateProvider (providerOptions);
-               }
-
-#endif
-               public virtual string CreateValidIdentifier (string value)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       return cg.CreateValidIdentifier (value);
-               }
-
-               public virtual void GenerateCodeFromCompileUnit (CodeCompileUnit compileUnit, 
-                       TextWriter writer, CodeGeneratorOptions options)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       cg.GenerateCodeFromCompileUnit (compileUnit, writer, options);
-               }
-
-               public virtual void GenerateCodeFromExpression (CodeExpression expression, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       cg.GenerateCodeFromExpression (expression, writer, options);
-               }
-
-               public virtual void GenerateCodeFromMember (CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       // Documented to always throw an exception (if not overriden)
-                       throw GetNotImplemented ();
-                       // Note: the pattern is different from other GenerateCodeFrom* because 
-                       // ICodeGenerator doesn't have a GenerateCodeFromMember member
-               }
-
-               public virtual void GenerateCodeFromNamespace (CodeNamespace codeNamespace, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       cg.GenerateCodeFromNamespace (codeNamespace, writer, options);
-               }
-
-               public virtual void GenerateCodeFromStatement (CodeStatement statement, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       cg.GenerateCodeFromStatement (statement, writer, options);
-               }
-
-               public virtual void GenerateCodeFromType (CodeTypeDeclaration codeType, TextWriter writer, CodeGeneratorOptions options)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       cg.GenerateCodeFromType (codeType, writer, options);
-               }
-
-#if CONFIGURATION_DEP
-               [ComVisible (false)]
-               [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-               public static CompilerInfo[] GetAllCompilerInfo ()
-               {
-
-                       return (Config == null) ? null : Config.CompilerInfos;
-               }
-
-
-               [ComVisible (false)]
-               [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-               public static CompilerInfo GetCompilerInfo (string language)
-               {
-                       if (language == null)
-                               throw new ArgumentNullException ("language");
-                       if (Config == null)
-                               return null;
-                       CompilerCollection cc = Config.Compilers;
-                       return cc[language];
-               }
-
-               [ComVisible (false)]
-               [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-               public static string GetLanguageFromExtension (string extension)
-               {
-                       if (extension == null)
-                               throw new ArgumentNullException ("extension");
-
-                       if (Config != null) 
-                               return Config.Compilers.GetLanguageFromExtension (extension);
-                       return null;
-               }
-#else
-               public static CompilerInfo[] GetAllCompilerInfo () { return null; }
-               public static CompilerInfo GetCompilerInfo (string language) { return null; }
-               public static string GetLanguageFromExtension (string extension) { return null; }
-#endif
-
-               public virtual string GetTypeOutput (CodeTypeReference type)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       return cg.GetTypeOutput (type);
-               }
-
-#if CONFIGURATION_DEP
-               [ComVisible (false)]
-               [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-               public static bool IsDefinedExtension (string extension)
-               {
-                       if (extension == null)
-                               throw new ArgumentNullException ("extension");
-
-                       if (Config != null)
-                               return (Config.Compilers.GetCompilerInfoForExtension (extension) != null);
-                       
-                       return false;
-               }
-
-               [ComVisible (false)]
-               [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-               public static bool IsDefinedLanguage (string language)
-               {
-                       if (language == null)
-                               throw new ArgumentNullException ("language");
-
-                       if (Config != null)
-                               return (Config.Compilers.GetCompilerInfoForLanguage (language) != null);
-
-                       return false;
-               }
-#endif
-
-               public virtual bool IsValidIdentifier (string value)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       return cg.IsValidIdentifier (value);
-               }
-
-               public virtual CodeCompileUnit Parse (TextReader codeStream)
-               {
-                       ICodeParser cp = CreateParser ();
-                       if (cp == null)
-                               throw GetNotImplemented ();
-                       return cp.Parse (codeStream);
-               }
-
-               public virtual bool Supports (GeneratorSupport supports)
-               {
-                       ICodeGenerator cg = CreateGenerator ();
-                       if (cg == null)
-                               throw GetNotImplemented ();
-                       return cg.Supports (supports);
-               }
-
-#if CONFIGURATION_DEP
-               static CodeDomConfigurationHandler Config {
-                       get { return ConfigurationManager.GetSection ("system.codedom") as CodeDomConfigurationHandler; }
-               }
-#endif
-               
-               //
-               // This is used to prevent confusing Moma about methods not implemented.
-               //
-               Exception GetNotImplemented ()
-               {
-                       return new NotImplementedException ();
-               }               
-       }
-}
-
-#pragma warning restore 618
\ No newline at end of file
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeParser.cs b/mcs/class/System/System.CodeDom.Compiler/CodeParser.cs
deleted file mode 100644 (file)
index 7dc96a3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.CodeDom.Compiler.CodeParser.cs
-//
-// Author:
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Andreas Nahr
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.IO;
-
-namespace System.CodeDom.Compiler 
-{
-
-       public abstract class CodeParser : ICodeParser
-       {
-
-               protected CodeParser ()
-               {
-               }
-
-               public abstract CodeCompileUnit Parse (TextReader codeStream);
-       }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/Compiler.cs b/mcs/class/System/System.CodeDom.Compiler/Compiler.cs
deleted file mode 100644 (file)
index 2abea72..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// System.Web.Configuration.CompilerCollection
-//
-// Authors:
-//     Chris Toshok (toshok@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if CONFIGURATION_DEP
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Configuration;
-
-namespace System.CodeDom.Compiler
-{
-       internal sealed class Compiler : ConfigurationElement
-       {
-               static ConfigurationProperty compilerOptionsProp;
-               static ConfigurationProperty extensionProp;
-               static ConfigurationProperty languageProp;
-               static ConfigurationProperty typeProp;
-               static ConfigurationProperty warningLevelProp;
-               static ConfigurationProperty providerOptionsProp;
-               
-               static ConfigurationPropertyCollection properties;
-
-               static Compiler ()
-               {
-                       compilerOptionsProp = new ConfigurationProperty("compilerOptions", typeof (string), "");
-                       extensionProp = new ConfigurationProperty("extension", typeof (string), "");
-                       languageProp = new ConfigurationProperty("language", typeof (string), "", ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
-                       typeProp = new ConfigurationProperty("type", typeof (string), "", ConfigurationPropertyOptions.IsRequired);
-                       warningLevelProp = new ConfigurationProperty("warningLevel", typeof (int), 0,
-                                                                    TypeDescriptor.GetConverter (typeof (int)),
-                                                                    new IntegerValidator (0, 4),
-                                                                    ConfigurationPropertyOptions.None);
-                       providerOptionsProp = new ConfigurationProperty ("", typeof (CompilerProviderOptionsCollection), null, null, null,
-                                                                        ConfigurationPropertyOptions.IsDefaultCollection);
-                       
-                       properties = new ConfigurationPropertyCollection ();
-                       properties.Add (compilerOptionsProp);
-                       properties.Add (extensionProp);
-                       properties.Add (languageProp);
-                       properties.Add (typeProp);
-                       properties.Add (warningLevelProp);
-                       properties.Add (providerOptionsProp);
-               }
-
-               internal Compiler ()
-               {
-               }
-
-               public Compiler (string compilerOptions, string extension, string language, string type, int warningLevel)
-               {
-                       this.CompilerOptions = compilerOptions;
-                       this.Extension = extension;
-                       this.Language = language;
-                       this.Type = type;
-                       this.WarningLevel = warningLevel;
-               }
-
-               [ConfigurationProperty ("compilerOptions", DefaultValue = "")]
-               public string CompilerOptions {
-                       get { return (string) base[compilerOptionsProp]; }
-                       internal set { base[compilerOptionsProp] = value; }
-               }
-
-               [ConfigurationProperty ("extension", DefaultValue = "")]
-               public string Extension {
-                       get { return (string) base[extensionProp]; }
-                       internal set { base[extensionProp] = value; }
-               }
-
-               [ConfigurationProperty ("language", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
-               public string Language {
-                       get { return (string) base[languageProp]; }
-                       internal set { base[languageProp] = value; }
-               }
-
-               [ConfigurationProperty ("type", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired)]
-               public string Type {
-                       get { return (string) base[typeProp]; }
-                       internal set { base[typeProp] = value; }
-               }
-
-               [IntegerValidator (MinValue = 0, MaxValue = 4)]
-               [ConfigurationProperty ("warningLevel", DefaultValue = "0")]
-               public int WarningLevel {
-                       get { return (int) base[warningLevelProp]; }
-                       internal set { base[warningLevelProp] = value; }
-               }
-
-               [ConfigurationProperty ("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
-               public CompilerProviderOptionsCollection ProviderOptions {
-                       get { return (CompilerProviderOptionsCollection) base [providerOptionsProp]; }
-                       internal set { base [providerOptionsProp] = value; }
-               }
-
-               public Dictionary <string, string> ProviderOptionsDictionary {
-                       get { return ProviderOptions.ProviderOptions; }
-               }
-               
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerCollection.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerCollection.cs
deleted file mode 100644 (file)
index d6331ea..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// System.Web.Configuration.CompilerCollection
-//
-// Authors:
-//     Chris Toshok (toshok@ximian.com)
-//
-// (C) 2005 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if CONFIGURATION_DEP
-
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace System.CodeDom.Compiler
-{
-       [ConfigurationCollection (typeof (Compiler), AddItemName = "compiler", CollectionType = ConfigurationElementCollectionType.BasicMap)]
-       internal sealed class CompilerCollection : ConfigurationElementCollection
-       {
-               static readonly string defaultCompilerVersion = "3.5";
-               static ConfigurationPropertyCollection properties;
-               static List <CompilerInfo> compiler_infos;
-               static Dictionary <string, CompilerInfo> compiler_languages;
-               static Dictionary <string, CompilerInfo> compiler_extensions;
-               
-               static CompilerCollection ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-                       compiler_infos = new List <CompilerInfo> ();
-                       compiler_languages = new Dictionary <string, CompilerInfo> (16, StringComparer.OrdinalIgnoreCase);
-                       compiler_extensions = new Dictionary <string, CompilerInfo> (6, StringComparer.OrdinalIgnoreCase);
-                               
-                       CompilerInfo compiler = new CompilerInfo ();
-                        compiler.Languages = "c#;cs;csharp";
-                        compiler.Extensions = ".cs";
-                        compiler.TypeName = "Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
-                       compiler.ProviderOptions = new Dictionary <string, string> (1);
-                       compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
-                       AddCompilerInfo (compiler);
-
-                       compiler = new CompilerInfo ();
-                       compiler.Languages = "vb;vbs;visualbasic;vbscript";
-                        compiler.Extensions = ".vb";
-                        compiler.TypeName = "Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
-                       compiler.ProviderOptions = new Dictionary <string, string> (1);
-                       compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
-                       AddCompilerInfo (compiler);
-
-                       compiler = new CompilerInfo ();
-                        compiler.Languages = "js;jscript;javascript";
-                        compiler.Extensions = ".js";
-                        compiler.TypeName = "Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=8.0.1100.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
-                       compiler.ProviderOptions = new Dictionary <string, string> (1);
-                       compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
-                       AddCompilerInfo (compiler);
-
-                       compiler = new CompilerInfo ();
-                        compiler.Languages = "vj#;vjs;vjsharp";
-                        compiler.Extensions = ".jsl;.java";
-                        compiler.TypeName = "Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
-                       compiler.ProviderOptions = new Dictionary <string, string> (1);
-                       compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
-                       AddCompilerInfo (compiler);
-
-                       compiler = new CompilerInfo ();
-                        compiler.Languages = "c++;mc;cpp";
-                        compiler.Extensions = ".h";
-                        compiler.TypeName = "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
-                       compiler.ProviderOptions = new Dictionary <string, string> (1);
-                       compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
-                       AddCompilerInfo (compiler);
-               }
-
-               public CompilerCollection ()
-               {
-               }
-
-               static void AddCompilerInfo (CompilerInfo ci)
-               {
-                       ci.Init ();
-                       compiler_infos.Add (ci);
-
-                       string[] languages = ci.GetLanguages ();
-                       if (languages != null)
-                               foreach (string language in languages)
-                                       compiler_languages [language] = ci;
-                       
-                       string[] extensions = ci.GetExtensions ();
-                       if (extensions != null)
-                               foreach (string extension in extensions)
-                                       compiler_extensions [extension] = ci;
-               }
-
-               static void AddCompilerInfo (Compiler compiler)
-               {
-                       CompilerInfo ci = new CompilerInfo ();
-                       ci.Languages = compiler.Language;
-                       ci.Extensions = compiler.Extension;
-                       ci.TypeName = compiler.Type;
-                       ci.ProviderOptions = compiler.ProviderOptionsDictionary;
-                       ci.CompilerOptions = compiler.CompilerOptions;
-                       ci.WarningLevel = compiler.WarningLevel;
-                       AddCompilerInfo (ci);
-               }
-               
-               protected override void BaseAdd (ConfigurationElement element)
-               {
-                       Compiler compiler = element as Compiler;
-                       if (compiler != null)
-                               AddCompilerInfo (compiler);
-                       base.BaseAdd (element);
-               }
-               
-               protected override bool ThrowOnDuplicate {
-                        get { return false; }
-                }
-               
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new Compiler ();
-               }
-
-               public CompilerInfo GetCompilerInfoForLanguage (string language)
-               {
-                       if (compiler_languages.Count == 0)
-                               return null;
-                       
-                       CompilerInfo ci;
-                       if (compiler_languages.TryGetValue (language, out ci))
-                               return ci;
-                       
-                       return null;
-               }
-
-               public CompilerInfo GetCompilerInfoForExtension (string extension)
-               {
-                       if (compiler_extensions.Count == 0)
-                               return null;
-                       
-                       CompilerInfo ci;
-                       if (compiler_extensions.TryGetValue (extension, out ci))
-                               return ci;
-                       
-                       return null;
-               }
-
-               public string GetLanguageFromExtension (string extension)
-               {
-                       CompilerInfo ci = GetCompilerInfoForExtension (extension);
-                       if (ci == null)
-                               return null;
-                       string[] languages = ci.GetLanguages ();
-                       if (languages != null && languages.Length > 0)
-                               return languages [0];
-                       return null;
-               }
-               
-               public Compiler Get (int index)
-               {
-                       return (Compiler) BaseGet (index);
-               }
-
-               public Compiler Get (string language)
-               {
-                       return (Compiler) BaseGet (language);
-               }
-
-               protected override object GetElementKey (ConfigurationElement element)
-               {
-                       return ((Compiler)element).Language;
-               }
-
-               public string GetKey (int index)
-               {
-                       return (string)BaseGetKey (index);
-               }
-
-               public string[ ] AllKeys {
-                       get {
-                               string[] keys = new string[compiler_infos.Count];
-                               for (int i = 0; i < Count; i++)
-                                       keys[i] = compiler_infos[i].Languages;
-                               return keys;
-                       }
-               }
-               
-               public override ConfigurationElementCollectionType CollectionType {
-                       get { return ConfigurationElementCollectionType.BasicMap; }
-               }
-
-               protected override string ElementName {
-                       get { return "compiler"; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               public Compiler this[int index] {
-                       get { return (Compiler) BaseGet (index); }
-               }
-
-               public new CompilerInfo this[string language] {
-                       get {
-                               return GetCompilerInfoForLanguage (language);
-                       }
-               }
-
-               public CompilerInfo[] CompilerInfos {
-                       get {
-                               return compiler_infos.ToArray ();
-                       }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerInfo.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerInfo.cs
deleted file mode 100644 (file)
index fa78dd2..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// System.CodeDom.Compiler CompilerInfo class
-//
-// Author:
-//     Marek Safar (marek.safar@seznam.cz)
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// Copyright (c) 2004,2005 Novell, Inc. (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Configuration;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Security.Permissions;
-
-namespace System.CodeDom.Compiler {
-
-       [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-       public sealed class CompilerInfo
-       {
-               internal string Languages;
-               internal string Extensions;
-               internal string TypeName;
-               internal int WarningLevel;
-               internal string CompilerOptions;
-               internal Dictionary <string, string> ProviderOptions;
-               
-               bool inited;
-               Type type;
-
-               internal CompilerInfo ()
-               {
-               }
-
-               internal void Init ()
-               {
-                       if (inited)
-                               return;
-
-                       inited = true;
-                       type = Type.GetType (TypeName);
-                       if (type == null)
-                               return;
-
-                       if (!typeof (CodeDomProvider).IsAssignableFrom (type))
-                               type = null;
-               }
-
-               public Type CodeDomProviderType {
-                       get {
-                               if (type == null) {
-                                       type = Type.GetType (TypeName, false);
-#if CONFIGURATION_DEP
-                                       if (type == null)
-                                               throw new ConfigurationErrorsException ("Unable to locate compiler type '" + TypeName + "'");
-#endif
-                               }
-                               
-                               return type;
-                       }
-               }
-
-               
-               public bool IsCodeDomProviderTypeValid {
-                       get { return type != null; }
-               }
-
-               public CompilerParameters CreateDefaultCompilerParameters ()
-               {
-                       CompilerParameters cparams = new CompilerParameters ();
-                       if (CompilerOptions == null)
-                               cparams.CompilerOptions = String.Empty;
-                       else
-                               cparams.CompilerOptions = CompilerOptions;
-                       cparams.WarningLevel = WarningLevel;
-
-                       return cparams;
-               }
-
-               public CodeDomProvider CreateProvider ()
-               {
-                       return CreateProvider (ProviderOptions);
-               }
-
-               public          
-               CodeDomProvider CreateProvider (IDictionary<string, string> providerOptions)
-               {
-                       Type providerType = CodeDomProviderType;
-                       if (providerOptions != null && providerOptions.Count > 0) {
-                               ConstructorInfo ctor = providerType.GetConstructor (new [] { typeof (IDictionary <string, string>) });
-                               if (ctor != null)
-                                       return (CodeDomProvider) ctor.Invoke (new object[] { providerOptions });
-                       }
-                       
-                       return (CodeDomProvider) Activator.CreateInstance (providerType);
-               }
-
-               public override bool Equals (object o)
-               {
-                       if (!(o is CompilerInfo))
-                               return false;
-
-                       CompilerInfo c = (CompilerInfo) o;
-                       return c.TypeName == TypeName;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return TypeName.GetHashCode ();
-               }
-
-               public string [] GetExtensions ()
-               {
-                       return Extensions.Split (';');
-               }
-
-               public string [] GetLanguages ()
-               {
-                       return Languages.Split (';');
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerProviderOption.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerProviderOption.cs
deleted file mode 100644 (file)
index 19b72a7..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// System.Web.Configuration.CompilerProviderOptionsCollection.cs
-//
-// Authors:
-//     Marek Habersack (mhabersack@novell.com)
-//
-// (C) 2007 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if CONFIGURATION_DEP
-using System;
-using System.Configuration;
-
-namespace System.CodeDom.Compiler
-{
-       internal sealed class CompilerProviderOption : ConfigurationElement
-       {
-               static ConfigurationProperty nameProp;
-               static ConfigurationProperty valueProp;
-               static ConfigurationPropertyCollection properties;
-               
-               static CompilerProviderOption ()
-               {
-                       nameProp = new ConfigurationProperty ("name", typeof (string), "",
-                                                             ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
-                       valueProp = new ConfigurationProperty ("value", typeof (string), "",
-                                                              ConfigurationPropertyOptions.IsRequired);
-
-                       properties = new ConfigurationPropertyCollection ();
-                       properties.Add (nameProp);
-                       properties.Add (valueProp);
-               }
-
-               [ConfigurationProperty ("name", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
-               public string Name {
-                       get { return (string) base [nameProp]; }
-                       set { base [nameProp] = value; }
-               }
-
-               [ConfigurationProperty ("value", DefaultValue = "", Options = ConfigurationPropertyOptions.IsRequired)]
-               public string Value {
-                       get { return (string) base [valueProp]; }
-                       set { base [valueProp] = value; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs
deleted file mode 100644 (file)
index 5ff8def..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// System.Web.Configuration.CompilerProviderOptionsCollection.cs
-//
-// Authors:
-//     Marek Habersack (mhabersack@novell.com)
-//
-// (C) 2007 Novell, Inc (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if CONFIGURATION_DEP
-using System;
-using System.Configuration;
-using System.Collections.Generic;
-
-namespace System.CodeDom.Compiler
-{
-       [ConfigurationCollection (typeof (CompilerProviderOption), CollectionType = ConfigurationElementCollectionType.BasicMap, AddItemName = "providerOption")]
-       internal sealed class CompilerProviderOptionsCollection : ConfigurationElementCollection
-       {
-               static ConfigurationPropertyCollection properties;
-
-               static CompilerProviderOptionsCollection ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-               }
-
-               public CompilerProviderOptionsCollection ()
-               {
-               }
-
-               protected override ConfigurationElement CreateNewElement ()
-               {
-                       return new CompilerProviderOption ();
-               }
-
-               public CompilerProviderOption Get (int index)
-               {
-                       return (CompilerProviderOption) BaseGet (index);
-               }
-
-               public CompilerProviderOption Get (string name)
-               {
-                       return (CompilerProviderOption) BaseGet (name);
-               }
-
-               protected override object GetElementKey (ConfigurationElement element)
-               {
-                       return ((CompilerProviderOption) element).Name;
-               }
-
-               public string GetKey (int index)
-               {
-                       return (string) BaseGetKey (index);
-               }
-
-               public string[] AllKeys {
-                       get {
-                               int count = Count;
-                               string[] keys = new string [count];
-                               for (int i = 0; i < count; i++)
-                                       keys [i] = this [i].Name;
-
-                               return keys;
-                       }
-               }
-
-               protected override string ElementName {
-                       get { return "providerOption"; }
-               }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
-
-               public Dictionary <string, string> ProviderOptions {
-                       get {
-                               int count = Count;
-
-                               if (count == 0)
-                                       return null;
-
-                               Dictionary <string, string> ret = new Dictionary <string, string> (count);
-                               CompilerProviderOption opt;
-                               
-                               for (int i = 0; i < count; i++) {
-                                       opt = this [i];
-                                       ret.Add (opt.Name, opt.Value);
-                               }
-
-                               return ret;
-                       }
-               }
-               
-               public CompilerProviderOption this [int index] {
-                       get { return (CompilerProviderOption) BaseGet (index); }
-               }
-
-               public new CompilerProviderOption this [string name] {
-                       get {
-                               foreach (CompilerProviderOption c in this) {
-                                       if (c.Name == name)
-                                               return c;
-                               }
-
-                               return null;
-                       }
-               }
-       }
-}
-#endif
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs
deleted file mode 100644 (file)
index dce0a54..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// System.CodeDom.Compiler.CompilerResults.cs
-//
-// Authors:
-//   Daniel Stodden (stodden@in.tum.de)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections.Specialized;
-using System.Reflection;
-using System.Security.Permissions;
-using System.Security.Policy;
-
-namespace System.CodeDom.Compiler {
-
-       [Serializable]
-       [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-       [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
-       public class CompilerResults {
-
-               private Assembly compiledAssembly;
-               private CompilerErrorCollection errors = new CompilerErrorCollection ();
-               private Evidence evidence;
-               private int nativeCompilerReturnValue = 0;
-               private StringCollection output = new StringCollection ();
-               private string pathToAssembly;
-               private TempFileCollection tempFiles;
-               
-               //
-               // Constructors
-               //
-               public CompilerResults (TempFileCollection tempFiles)
-               {
-                       this.tempFiles = tempFiles;
-               }
-
-               //
-               // Properties
-               //
-               public Assembly CompiledAssembly {
-                       get {
-                               if ((compiledAssembly == null) && (pathToAssembly != null))
-                                       compiledAssembly = Assembly.LoadFrom (pathToAssembly);
-                               return compiledAssembly;
-                       }
-                       set {
-                               compiledAssembly = value;
-                       }
-               }
-
-               public CompilerErrorCollection Errors {
-                       get {
-                               if (errors == null)
-                                       errors = new CompilerErrorCollection();
-                               return errors;
-                       }
-               }
-
-               [Obsolete]
-               public Evidence Evidence {
-                       get { return evidence; }
-                       [SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
-                       set { evidence = value; }
-               }
-
-               public int NativeCompilerReturnValue {
-                       get {
-                               return nativeCompilerReturnValue;
-                       }
-                       set {
-                               nativeCompilerReturnValue = value;
-                       }
-               }
-
-               public StringCollection Output {
-                       get {
-                               if (output == null)
-                                       output = new StringCollection();
-                               return output;
-                       }
-                       internal set {
-                               output = value;
-                       }
-               }
-
-               public string PathToAssembly {
-                       get {
-                               return pathToAssembly;
-                       }
-                       set {
-                               pathToAssembly = value;
-                       }
-               }
-
-               public TempFileCollection TempFiles {
-                       get {
-                               return tempFiles;
-                       }
-                       set {
-                               tempFiles = value;
-                       }
-               }
-       }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs b/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs
deleted file mode 100644 (file)
index dfa0d9a..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-//
-// System.CodeDom.Compiler TempFileCollection Class implementation
-//
-// Author:
-//     Dick Porter (dick@ximian.com)
-//
-// (C) Copyright 2003 Ximian, Inc.
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom.Compiler {
-
-       [Serializable]
-       [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
-       public class TempFileCollection:ICollection, IEnumerable, IDisposable
-       {
-               Hashtable filehash;
-               string tempdir;
-               bool keepfiles;
-               string basepath;
-               Random rnd;
-               string ownTempDir;
-               
-               public TempFileCollection ()
-                       : this (String.Empty, false)
-               {
-               }
-
-               public TempFileCollection(string tempDir)
-                       : this (tempDir, false)
-               {
-               }
-
-               public TempFileCollection(string tempDir, bool keepFiles)
-               {
-                       filehash=new Hashtable();
-                       tempdir = (tempDir == null) ? String.Empty : tempDir;
-                       keepfiles=keepFiles;
-               }
-
-               public string BasePath
-               {
-                       get {
-                               if(basepath==null) {
-                               
-                                       if (rnd == null)
-                                               rnd = new Random ();
-
-                                       // note: this property *cannot* change TempDir property
-                                       string temp = tempdir;
-                                       if (temp.Length == 0) {
-                                               if (ownTempDir != null) {
-                                                       temp = ownTempDir;
-                                                       Directory.CreateDirectory (temp);
-                                               } else {
-                                                       temp = CreateOwnTempDir ();
-                                               }
-                                       }
-
-                                       // Create a temporary file at the target directory. This ensures
-                                       // that the generated file name is unique.
-                                       int test_counter = 1000;
-                                       while (true) {
-                                               int num = rnd.Next ();
-                                               num++;
-                                               basepath = Path.Combine (temp, num.ToString("x"));
-                                               string path = basepath + ".tmp";
-
-                                               try {
-                                                       using (var f = new FileStream (path, FileMode.CreateNew)) {
-                                                               break;
-                                                       }
-                                               } catch (IOException) {
-                                                       if (test_counter-- > 0)
-                                                               continue;
-
-                                                       throw;
-                                               }
-                                       }
-
-#if MONO_FEATURE_CAS
-                                       // and you must have discovery access to the combined path
-                                       // note: the cache behaviour is tested in the CAS tests
-                                       if (SecurityManager.SecurityEnabled) {
-                                               new FileIOPermission (FileIOPermissionAccess.PathDiscovery, basepath).Demand ();
-                                       }
-#endif
-                               }
-
-                               return(basepath);
-                       }
-               }
-
-               string CreateOwnTempDir ()
-               {
-                       // this call ensure the Environment permissions check
-                       string basedir = Path.GetTempPath ();
-                       
-                       // Create a subdirectory with the correct user permissions
-                       int res = -1;
-                       bool win32 = false;
-                       switch (Environment.OSVersion.Platform) {
-                       case PlatformID.Win32S:
-                       case PlatformID.Win32Windows:
-                       case PlatformID.Win32NT:
-                       case PlatformID.WinCE:
-                               win32 = true;
-                               res = 0;
-                               break;
-                       }
-
-                       do {
-                               int num = rnd.Next ();
-                               num++;
-                               ownTempDir = Path.Combine (basedir, num.ToString("x"));
-                               if (Directory.Exists (ownTempDir))
-                                       continue;
-                               if (win32)
-                                       Directory.CreateDirectory (ownTempDir);
-                               else
-                                       res = mkdir (ownTempDir, 0x1c0);
-                               if (res != 0) {
-                                       if (!Directory.Exists (ownTempDir))
-                                               throw new IOException ();
-                                       // Somebody already created the dir, keep trying
-                               }
-                       } while (res != 0);
-                       return ownTempDir;
-               }
-
-               int ICollection.Count {
-                       get {
-                               return filehash.Count;
-                       }
-               }
-               
-               public int Count
-               {
-                       get {
-                               return(filehash.Count);
-                       }
-               }
-
-               public bool KeepFiles
-               {
-                       get {
-                               return(keepfiles);
-                       }
-                       set {
-                               keepfiles=value;
-                       }
-               }
-
-               public string TempDir
-               {
-                       get {
-                               // note: we only return what we were supplied so there
-                               // is no permission protecting this information
-                               return tempdir;
-                       }
-               }
-
-               public string AddExtension(string fileExtension)
-               {
-                       return(AddExtension(fileExtension, keepfiles));
-               }
-
-               public string AddExtension(string fileExtension, bool keepFile)
-               {
-                       string filename=BasePath+"."+fileExtension;
-                       AddFile(filename, keepFile);
-                       return(filename);
-               }
-
-               public void AddFile(string fileName, bool keepFile)
-               {
-                       filehash.Add(fileName, keepFile);
-               }
-
-               public void CopyTo(string[] fileNames, int start)
-               {
-                       filehash.Keys.CopyTo(fileNames, start);
-               }
-
-               void ICollection.CopyTo(Array array, int start)
-               {
-                       filehash.Keys.CopyTo(array, start);
-               }
-
-               object ICollection.SyncRoot {
-                       get {
-                               return null;
-                       }
-               }
-
-               bool ICollection.IsSynchronized {
-                       get {
-                               return(false);
-                       }
-               }
-               
-               void IDisposable.Dispose() 
-               {
-                       Dispose(true);
-               }
-               
-               public void Delete()
-               {
-                       bool allDeleted = true;
-                       string[] filenames = new string[filehash.Count];
-                       filehash.Keys.CopyTo (filenames, 0);
-
-                       foreach(string file in filenames) {
-                               if((bool)filehash[file]==false) {
-                                       File.Delete(file);
-                                       filehash.Remove(file);
-                               } else
-                                       allDeleted = false;
-                       }
-                       if (basepath != null) {
-                               string tmpFile = basepath + ".tmp";
-                               File.Delete (tmpFile);
-                               basepath = null;
-                       }
-                       if (allDeleted && ownTempDir != null && filenames.Length > 0) {
-                               Directory.Delete (ownTempDir, true);
-                       }
-               }
-
-               IEnumerator IEnumerable.GetEnumerator ()
-               {
-                       return(filehash.Keys.GetEnumerator());
-               }
-               
-               public IEnumerator GetEnumerator()
-               {
-                       return(filehash.Keys.GetEnumerator());
-               }
-
-               protected virtual void Dispose(bool disposing)
-               {
-                       Delete();
-                       if (disposing) {
-                               GC.SuppressFinalize (true);
-                       }
-               }
-
-               ~TempFileCollection()
-               {
-                       Dispose(false);
-               }
-               
-               [DllImport ("libc")] private static extern int mkdir (string olpath, uint mode);
-       }
-}
index c63b1781660d77a48c9dd8b8f77dc1aae07f7a8a..2533129e7e5682876c582442c9f229ca7386838a 100644 (file)
@@ -145,22 +145,33 @@ namespace System.Net.Sockets
 
                        IsCompleted = true;
 
+                       /* It is possible that this.socket is modified by this.Init which has been called by the callback. This
+                        * would lead to inconsistency, as we would for example not release the correct socket.ReadSem or
+                        * socket.WriteSem.
+                        * For example, this can happen with AcceptAsync followed by a ReceiveAsync on the same
+                        * SocketAsyncEventArgs */
+                       Socket completedSocket = socket;
+                       SocketOperation completedOperation = operation;
+
                        AsyncCallback callback = AsyncCallback;
                        if (callback != null) {
                                ThreadPool.UnsafeQueueUserWorkItem (_ => callback (this), null);
                        }
 
-                       switch (operation) {
+                       /* Warning: any field on the current SocketAsyncResult might have changed, as the callback might have
+                        * called this.Init */
+
+                       switch (completedOperation) {
                        case SocketOperation.Receive:
                        case SocketOperation.ReceiveFrom:
                        case SocketOperation.ReceiveGeneric:
                        case SocketOperation.Accept:
-                               socket.ReadSem.Release ();
+                               completedSocket.ReadSem.Release ();
                                break;
                        case SocketOperation.Send:
                        case SocketOperation.SendTo:
                        case SocketOperation.SendGeneric:
-                               socket.WriteSem.Release ();
+                               completedSocket.WriteSem.Release ();
                                break;
                        }
 
index 605948300d2018eec1892c2253505506cd2e3243..5397ec1fa33a4c43acae4fc9fc6553ac2b4a2ad0 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NETSTANDARD
-
 namespace System.Net.Sockets
 {
        public struct SocketReceiveFromResult
@@ -36,5 +34,3 @@ namespace System.Net.Sockets
                public EndPoint RemoteEndPoint;
        }
 }
-
-#endif
index f06b339949dd634490528d9dc9e81c5de0f55a1a..ba0ecca5b998c217ac16e988aa52ed771c0c463b 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NETSTANDARD
-
 namespace System.Net.Sockets
 {
        public struct SocketReceiveMessageFromResult
@@ -38,5 +36,3 @@ namespace System.Net.Sockets
                public IPPacketInformation PacketInformation;
        }
 }
-
-#endif
index 33bb55a7b0e4a93a5e861ffa0306a9fdcc459e68..aee91fd55e36f5c9a6190ef623c0766d107f1888 100644 (file)
@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-#if NETSTANDARD
-
 using System.Collections.Generic;
 using System.Threading.Tasks;
 
@@ -250,5 +248,3 @@ namespace System.Net.Sockets
         }
     }
 }
-
-#endif
index a12aa233b71643e260d48e1ed79834390f9d6de0..fc0125df25a8fbd10362b6bfb2acea030bcdfde9 100644 (file)
@@ -404,7 +404,7 @@ namespace System.Net {
                }
 
                public long ContentLength64 {
-                       get { return content_length; }
+                       get { return is_chunked ? -1 : content_length; }
                }
 
                public string ContentType {
index 407c997f8aaf33390c82e7abc2380a1bfeed77d1..fde53c5199d68ec10d1235f9aa6a5f4fe64474bc 100644 (file)
@@ -137,7 +137,7 @@ namespace MonoTests.Microsoft.CSharp
                                sb.Length = 0;
                                Assert.AreEqual ("6.445F", Generate (new CodePrimitiveExpression ((float) 6.445), sw), "#8");
                                sb.Length = 0;
-                               Assert.AreEqual ("5.76", Generate (new CodePrimitiveExpression ((double) 5.76), sw), "#9");
+                               Assert.AreEqual ("5.76D", Generate (new CodePrimitiveExpression ((double) 5.76), sw), "#9");
                                sb.Length = 0;
                                Assert.AreEqual ("7.667m", Generate (new CodePrimitiveExpression ((decimal) 7.667), sw), "#10");
                                sb.Length = 0;
index 417a25cb28ef35470653c5bdf5c9d97156db4190..2ce32bf88f514caee91ec26c07b654d1dd8d19ea 100644 (file)
@@ -49,7 +49,7 @@ namespace MonoTests.Microsoft.CSharp
                }
 
                [Test]
-               [ExpectedException (typeof (NullReferenceException))]
+               [ExpectedException (typeof (ArgumentNullException))]
                public void TestCreateEscapedIdentifierNullArg ()
                {
                        gen.CreateEscapedIdentifier (null);
index 4582c85759f69ff6e43f7fc70020d497a16f16cf..e9b664da744f0639f54910e6296b176048532827 100644 (file)
@@ -118,9 +118,9 @@ namespace MonoTests.Microsoft.VisualBasic
                                sb.Length = 0;
                                Assert.AreEqual ("6.445!", Generate (new CodePrimitiveExpression ((float) 6.445), sw), "#8");
                                sb.Length = 0;
-                               Assert.AreEqual ("5.76", Generate (new CodePrimitiveExpression ((double) 5.76), sw), "#9");
+                               Assert.AreEqual ("5.76R", Generate (new CodePrimitiveExpression ((double) 5.76), sw), "#9");
                                sb.Length = 0;
-                               Assert.AreEqual ("7.667", Generate (new CodePrimitiveExpression ((decimal) 7.667), sw), "#10");
+                               Assert.AreEqual ("7.667D", Generate (new CodePrimitiveExpression ((decimal) 7.667), sw), "#10");
                                sb.Length = 0;
                                Assert.AreEqual ("true", Generate (new CodePrimitiveExpression (true), sw), "#11");
                                sb.Length = 0;
index c4c193b7154ee1d023ab4c2d8cb745f9791e2ba9..1e92e0e69df08f7bee5943bf91b33320bd9f079c 100644 (file)
@@ -202,9 +202,6 @@ namespace MonoTests.Microsoft.VisualBasic
                                "Public MustInherit Class Test1{0}" +
                                "    {0}" +
                                "    Public MustOverride Property Name() As String{0}" +
-                               "        Get{0}" +
-                               "        Set{0}" +
-                               "    End Property{0}" +
                                "End Class{0}", NewLine), code);
                }
 
index dcf83695f06517fa3d91dd10a1519d2bf7f5cf91..cb3827785af4dab4ced082075e03b608d27e1861 100644 (file)
@@ -14,6 +14,7 @@ using System.Diagnostics;
 using System.IO;
 using System.Text;
 using System.Threading;
+using System.Runtime.InteropServices;
 
 using NUnit.Framework;
 
@@ -1130,5 +1131,60 @@ namespace MonoTests.System.Diagnostics
 
                        string v = Process.GetProcessById (1).ProcessName;
                }
+
+               [Test]
+               public void NonChildProcessWaitForExit ()
+               {
+                       if (!RunningOnUnix)
+                               Assert.Ignore ("accessing parent pid, only available on unix");
+
+                       using (Process process = Process.GetProcessById (getppid ()))
+                       using (ManualResetEvent mre = new ManualResetEvent (false))
+                       {
+                               Assert.IsFalse (process.WaitForExit (10), "#1");
+                               Assert.IsFalse (process.HasExited, "#2");
+                               Assert.Throws<InvalidOperationException>(delegate { int exitCode = process.ExitCode; }, "#3");
+
+                               process.Exited += (s, e) => mre.Set ();
+                               process.EnableRaisingEvents = true;
+                               Assert.IsFalse (mre.WaitOne (100), "#4");
+
+                               Assert.IsFalse (process.WaitForExit (10), "#5");
+                               Assert.IsFalse (process.HasExited, "#6");
+                               Assert.Throws<InvalidOperationException>(delegate { int exitCode = process.ExitCode; }, "#7");
+                       }
+               }
+
+               [Test]
+               public void NonChildProcessName ()
+               {
+                       if (!RunningOnUnix)
+                               Assert.Ignore ("accessing parent pid, only available on unix");
+
+                       using (Process process = Process.GetProcessById (getppid ()))
+                       {
+                               string pname = process.ProcessName;
+                               Assert.IsNotNull (pname, "#1");
+                               AssertHelper.IsNotEmpty (pname, "#2");
+                       }
+               }
+
+               [Test]
+               public void NonChildProcessId ()
+               {
+                       if (!RunningOnUnix)
+                               Assert.Ignore ("accessing parent pid, only available on unix");
+
+                       int ppid;
+                       using (Process process = Process.GetProcessById (ppid = getppid ()))
+                       {
+                               int pid = process.Id;
+                               Assert.AreEqual (ppid, pid, "#1");
+                               AssertHelper.Greater (pid, 0, "#2");
+                       }
+               }
+
+               [DllImport ("libc")]
+               static extern int getppid();
        }
 }
index 7a0851912ea37254f1112bfdf066d53932551903..6e82f9d6db81626de695abee6c8d6a34496b8425 100755 (executable)
@@ -4541,10 +4541,8 @@ namespace MonoTests.System.Net.Sockets
                                        mSent.Set ();
                                }, clientSocket);
 
-                               if (!mSent.WaitOne (1500))
-                                       throw new TimeoutException ();
-                               if (!mReceived.WaitOne (1500))
-                                       throw new TimeoutException ();
+                               Assert.IsTrue (mSent.WaitOne (5000), "#1");
+                               Assert.IsTrue (mReceived.WaitOne (5000), "#2");
                        } finally {
                                if (File.Exists (temp))
                                        File.Delete (temp);
@@ -4675,6 +4673,26 @@ namespace MonoTests.System.Net.Sockets
 
                        Assert.IsTrue (mre.WaitOne (1000), "ConnectedAsync timeout");
                }
+
+               [Test] // Covers https://bugzilla.xamarin.com/show_bug.cgi?id=52549
+               public void SocketMismatchProtocol ()
+               {
+                       try {
+                               using (Socket socket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Tcp));
+                               Assert.Fail ("#1");
+                       } catch (SocketException e) {
+                               // Only work on OSX
+                               // Assert.AreEqual(SocketError.ProtocolType, e.SocketErrorCode, "#2");
+                       }
+
+                       try {
+                               using (Socket socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Udp));
+                               Assert.Fail ("#3");
+                       } catch (SocketException e) {
+                               // Only work on OSX
+                               // Assert.AreEqual(SocketError.ProtocolType, e.SocketErrorCode, "#4");
+                       }
+               }
        }
 }
 
index 1e0e703aa162f7be0dace4ecc8d23723c9f3919c..b19688cf44cddcd6f2c9ada44d5259c8253967e0 100644 (file)
@@ -159,14 +159,20 @@ namespace MonoTests.System.Net.WebSockets
                [Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void CloseAsyncTest ()
                {
-                       Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
+                       if (!socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000)) {
+                               Assert.Inconclusive (socket.State.ToString ());
+                               return;
+                       }
+
                        Assert.AreEqual (WebSocketState.Open, socket.State);
 
                        Assert.IsTrue (socket.CloseAsync (WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).Wait (5000));
                        Assert.AreEqual (WebSocketState.Closed, socket.State);
                }
 
-               [Test, ExpectedException (typeof (InvalidOperationException))]
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               [Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void SendAsyncArgTest_NotConnected ()
                {
                        socket.SendAsync (new ArraySegment<byte> (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None);
@@ -180,7 +186,9 @@ namespace MonoTests.System.Net.WebSockets
                        socket.SendAsync (new ArraySegment<byte> (), WebSocketMessageType.Text, true, CancellationToken.None);
                }
 
-               [Test, ExpectedException (typeof (InvalidOperationException))]
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               [Category ("MobileNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
                public void ReceiveAsyncArgTest_NotConnected ()
                {
                        socket.ReceiveAsync (new ArraySegment<byte> (new byte[0]), CancellationToken.None);
index 3d8ec9b6b72de298fa8b80f2d25ba27e6743bc3c..0efb5c416616ff5afe66dca900605ad7dfb2d037 100644 (file)
@@ -375,7 +375,6 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/compmod/system/collections/specialized/bitvector32.cs
 ../referencesource/System/compmod/system/collections/specialized/casesensitivestringdictionary.cs
 ../referencesource/System/compmod/system/collections/specialized/collectionsutil.cs
-../referencesource/System/compmod/system/collections/specialized/fixedstringlookup.cs
 ../referencesource/System/compmod/system/collections/specialized/hybriddictionary.cs
 ../referencesource/System/compmod/system/collections/specialized/inotifycollectionchanged.cs
 ../referencesource/System/compmod/system/collections/specialized/iordereddictionary.cs
@@ -922,10 +921,11 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/misc/WeakHashtable.cs
 
 ../referencesource/System/compmod/system/codedom/compiler/GeneratedCodeAttribute.cs
-../referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs
 
 ../referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs
 
+../../../external/corefx/src/System.Runtime.Extensions/src/System/CodeDom/Compiler/IndentedTextWriter.cs
+
 ../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/CompressionLevel.cs
 ../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/CompressionMode.cs
 ../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/GZipStream.cs
index a84f4b08af008c971b9be251740dc40aa81e6aa7..a8a0fad0838669d850b7a562eba7cc15b1d308f7 100644 (file)
@@ -1,11 +1,8 @@
 #include common.sources
 
-Microsoft.CSharp/CSharpCodeCompiler.cs
 Microsoft.CSharp/CSharpCodeGenerator.cs
-Microsoft.CSharp/CSharpCodeProvider.cs
-Microsoft.VisualBasic/VBCodeCompiler.cs
 Microsoft.VisualBasic/VBCodeGenerator.cs
-Microsoft.VisualBasic/VBCodeProvider.cs
+
 Microsoft.Win32/IntranetZoneCredentialPolicy.cs
 Microsoft.Win32/PowerModeChangedEventArgs.cs
 Microsoft.Win32/PowerModeChangedEventHandler.cs
@@ -29,18 +26,7 @@ Microsoft.Win32/UserPreferenceChangingEventHandler.cs
 
 System/MonoToolsLocator.cs
 
-System.CodeDom.Compiler/CodeCompiler.cs
-System.CodeDom.Compiler/CodeDomConfigurationHandler.cs
-System.CodeDom.Compiler/CodeDomProvider.cs
-System.CodeDom.Compiler/CodeParser.cs
-System.CodeDom.Compiler/Compiler.cs
-System.CodeDom.Compiler/CompilerCollection.cs
-System.CodeDom.Compiler/CompilerInfo.cs
-System.CodeDom.Compiler/CompilerProviderOption.cs
-System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs
-System.CodeDom.Compiler/CompilerResults.cs
 System.CodeDom.Compiler/Executor.cs
-System.CodeDom.Compiler/TempFileCollection.cs
 System.Configuration/ApplicationScopedSettingAttribute.cs
 System.Configuration/ApplicationSettingsBase.cs
 System.Configuration/ApplicationSettingsGroup.cs
@@ -259,6 +245,9 @@ Mono.Net.Dns/SimpleResolverEventArgs.cs
 ReferenceSources/BinaryCompatibility.cs
 ReferenceSources/ConfigurationManagerInternalFactory.cs
 ReferenceSources/SR2.cs
+
+../referencesource/System/misc/PrivilegedConfigurationManager.cs
+
 ../referencesource/System/compmod/system/diagnostics/ConsoleTraceListener.cs
 ../referencesource/System/compmod/system/diagnostics/FilterElement.cs
 ../referencesource/System/compmod/system/diagnostics/PerfCounterSection.cs
@@ -268,103 +257,124 @@ ReferenceSources/SR2.cs
 ../referencesource/System/compmod/system/diagnostics/TraceSection.cs
 ../referencesource/System/compmod/system/diagnostics/TypedElement.cs
 ../referencesource/System/compmod/system/diagnostics/XmlWriterTraceListener.cs
-../referencesource/System/misc/PrivilegedConfigurationManager.cs
 
-../referencesource/System/compmod/system/codedom/CodeArgumentReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeArrayCreateExpression.cs
-../referencesource/System/compmod/system/codedom/CodeArrayIndexerExpression.cs
-../referencesource/System/compmod/system/codedom/CodeAssignStatement.cs
-../referencesource/System/compmod/system/codedom/CodeAttachEventStatement.cs
-../referencesource/System/compmod/system/codedom/CodeAttributeArgumentCollection.cs
-../referencesource/System/compmod/system/codedom/CodeAttributeArgument.cs
-../referencesource/System/compmod/system/codedom/CodeAttributeDeclarationCollection.cs
-../referencesource/System/compmod/system/codedom/CodeAttributeDeclaration.cs
-../referencesource/System/compmod/system/codedom/CodeBaseReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeBinaryOperatorExpression.cs
-../referencesource/System/compmod/system/codedom/CodeBinaryOperatorType.cs
-../referencesource/System/compmod/system/codedom/CodeCastExpression.cs
-../referencesource/System/compmod/system/codedom/CodeCatchClauseCollection.cs
-../referencesource/System/compmod/system/codedom/CodeCatchClause.cs
-../referencesource/System/compmod/system/codedom/CodeChecksumPragma.cs
-../referencesource/System/compmod/system/codedom/CodeComment.cs
-../referencesource/System/compmod/system/codedom/CodeCommentStatementCollection.cs
-../referencesource/System/compmod/system/codedom/CodeCommentStatement.cs
-../referencesource/System/compmod/system/codedom/CodeCompileUnit.cs
-../referencesource/System/compmod/system/codedom/CodeConditionStatement.cs
-../referencesource/System/compmod/system/codedom/CodeConstructor.cs
-../referencesource/System/compmod/system/codedom/CodeDefaultValueExpression.cs
-../referencesource/System/compmod/system/codedom/CodeDelegateCreateExpression.cs
-../referencesource/System/compmod/system/codedom/CodeDelegateInvokeExpression.cs
-../referencesource/System/compmod/system/codedom/CodeDirectionExpression.cs
-../referencesource/System/compmod/system/codedom/CodeDirectiveCollection.cs
-../referencesource/System/compmod/system/codedom/CodeDirective.cs
-../referencesource/System/compmod/system/codedom/CodeEntryPointMethod.cs
-../referencesource/System/compmod/system/codedom/CodeEventReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeExpressionCollection.cs
-../referencesource/System/compmod/system/codedom/CodeExpression.cs
-../referencesource/System/compmod/system/codedom/CodeExpressionStatement.cs
-../referencesource/System/compmod/system/codedom/CodeFieldReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeGotoStatement.cs
-../referencesource/System/compmod/system/codedom/CodeIndexerExpression.cs
-../referencesource/System/compmod/system/codedom/CodeIterationStatement.cs
-../referencesource/System/compmod/system/codedom/CodeLabeledStatement.cs
-../referencesource/System/compmod/system/codedom/CodeLinePragma.cs
-../referencesource/System/compmod/system/codedom/CodeMemberEvent.cs
-../referencesource/System/compmod/system/codedom/CodeMemberField.cs
-../referencesource/System/compmod/system/codedom/CodeMemberMethod.cs
-../referencesource/System/compmod/system/codedom/CodeMemberProperty.cs
-../referencesource/System/compmod/system/codedom/CodeMethodInvokeExpression.cs
-../referencesource/System/compmod/system/codedom/codemethodreferenceexpression.cs
-../referencesource/System/compmod/system/codedom/CodeMethodReturnStatement.cs
-../referencesource/System/compmod/system/codedom/CodeNamespaceCollection.cs
-../referencesource/System/compmod/system/codedom/CodeNamespace.cs
-../referencesource/System/compmod/system/codedom/CodeNamespaceImportCollection.cs
-../referencesource/System/compmod/system/codedom/CodeNamespaceImport.cs
-../referencesource/System/compmod/system/codedom/CodeObjectCreateExpression.cs
-../referencesource/System/compmod/system/codedom/CodeObject.cs
-../referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpressionCollection.cs
-../referencesource/System/compmod/system/codedom/CodeParameterDeclarationExpression.cs
-../referencesource/System/compmod/system/codedom/CodePrimitiveExpression.cs
-../referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodePropertySetValueReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeRegionDirective.cs
-../referencesource/System/compmod/system/codedom/CodeRegionMode.cs
-../referencesource/System/compmod/system/codedom/CodeRemoveEventStatement.cs
-../referencesource/System/compmod/system/codedom/CodeSnippetCompileUnit.cs
-../referencesource/System/compmod/system/codedom/CodeSnippetExpression.cs
-../referencesource/System/compmod/system/codedom/CodeSnippetStatement.cs
-../referencesource/System/compmod/system/codedom/CodeSnippetTypeMember.cs
-../referencesource/System/compmod/system/codedom/CodeStatementCollection.cs
-../referencesource/System/compmod/system/codedom/CodeStatement.cs
-../referencesource/System/compmod/system/codedom/CodeThisReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeThrowExceptionStatement.cs
-../referencesource/System/compmod/system/codedom/CodeTryCatchFinallyStatement.cs
-../referencesource/System/compmod/system/codedom/CodeTypeConstructor.cs
-../referencesource/System/compmod/system/codedom/CodeTypeDeclarationCollection.cs
-../referencesource/System/compmod/system/codedom/CodeTypeDeclaration.cs
-../referencesource/System/compmod/system/codedom/CodeTypeDelegate.cs
-../referencesource/System/compmod/system/codedom/CodeTypeMemberCollection.cs
-../referencesource/System/compmod/system/codedom/CodeTypeMember.cs
-../referencesource/System/compmod/system/codedom/CodeTypeOfExpression.cs
-../referencesource/System/compmod/system/codedom/CodeTypeParameterCollection.cs
-../referencesource/System/compmod/system/codedom/CodeTypeParameter.cs
-../referencesource/System/compmod/system/codedom/CodeTypeReferenceCollection.cs
-../referencesource/System/compmod/system/codedom/CodeTypeReference.cs
-../referencesource/System/compmod/system/codedom/CodeTypeReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/CodeVariableDeclarationStatement.cs
-../referencesource/System/compmod/system/codedom/CodeVariableReferenceExpression.cs
-../referencesource/System/compmod/system/codedom/FieldDirection.cs
-../referencesource/System/compmod/system/codedom/MemberAttributes.cs
+../../../external/corefx/src/Common/src/System/CSharpHelpers.cs
+
+../../../external/corefx/src/Common/src/System/IO/TempFileCollection.cs
 
-../referencesource/System/compmod/system/codedom/compiler/CodeGenerator.cs
-../referencesource/System/compmod/system/codedom/compiler/CodeGeneratorOptions.cs
-../referencesource/System/compmod/system/codedom/compiler/CodeValidator.cs
-../referencesource/System/compmod/system/codedom/compiler/CompilerError.cs
-../referencesource/System/compmod/system/codedom/compiler/CompilerErrorCollection.cs
-../referencesource/System/compmod/system/codedom/compiler/CompilerParameters.cs
-../referencesource/System/compmod/system/codedom/compiler/GeneratorSupport.cs
-../referencesource/System/compmod/system/codedom/compiler/ICodeCompiler.cs
-../referencesource/System/compmod/system/codedom/compiler/ICodeGenerator.cs
-../referencesource/System/compmod/system/codedom/compiler/ICodeParser.cs
-../referencesource/System/compmod/system/codedom/compiler/LanguageOptions.cs
+../../../external/corefx/src/Common/src/System/CodeDom/CodeObject.cs
+../../../external/corefx/src/Common/src/System/CodeDom/CodeTypeReference.cs
+../../../external/corefx/src/Common/src/System/CodeDom/CodeTypeReferenceCollection.cs
 
+../../../external/corefx/src/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/CSharp/CSharpCodeProvider.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/CSharp/CSharpMemberAttributeConverter.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/CSharp/CSharpModifierAttributeConverter.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/CSharp/CSharpTypeAttributeConverter.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/VisualBasic/VBCodeProvider.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/VisualBasic/VBMemberAttributeConverter.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/VisualBasic/VBModiferAttributeConverter.cs
+../../../external/corefx/src/System.CodeDom/src/Microsoft/VisualBasic/VBTypeAttributeConverter.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeArgumentReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeArrayCreateExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeArrayIndexerExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeAssignStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeAttachEventStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeAttributeArgument.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeAttributeArgumentCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeAttributeDeclaration.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeAttributeDeclarationCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeBaseReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeBinaryOperatorExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeBinaryOperatorType.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeCastExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeCatchClause.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeCatchClauseCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeChecksumPragma.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeComment.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeCommentStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeCommentStatementCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeCompileUnit.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeConditionStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeConstructor.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeDefaultValueExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeDelegateCreateExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeDelegateInvokeExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeDirectionExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeDirective.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeDirectiveCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeEntryPointMethod.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeEventReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeExpressionCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeExpressionStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeFieldReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeGotoStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeIndexerExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeIterationStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeLabeledStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeLinePragma.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeMemberEvent.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeMemberField.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeMemberMethod.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeMemberProperty.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeMethodInvokeExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/codemethodreferenceexpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeMethodReturnStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeNamespace.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeNamespaceCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeNamespaceImport.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeNamespaceImportCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeObjectCreateExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeParameterDeclarationExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeParameterDeclarationExpressionCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodePrimitiveExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodePropertyReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodePropertySetValueReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeRegionDirective.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeRegionMode.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeRemoveEventStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeSnippetCompileUnit.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeSnippetExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeSnippetStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeSnippetTypeMember.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeStatementCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeThisReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeThrowExceptionStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTryCatchFinallyStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeConstructor.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeDeclaration.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeDeclarationCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeDelegate.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeMember.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeMemberCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeOfExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeParameter.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeParameterCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeTypeReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeVariableDeclarationStatement.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/CodeVariableReferenceExpression.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CodeCompiler.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CodeDomProvider.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CodeGenerator.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CodeGeneratorOptions.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CodeParser.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CodeValidator.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerError.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerErrorCollection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerInfo.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerParameters.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerParameters.Evidence.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerResults.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/CompilerResults.Evidence.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/ExposedTabStringIndentedTextWriter.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/GeneratorSupport.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/ICodeCompiler.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/ICodeGenerator.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/ICodeParser.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/Compiler/LanguageOptions.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/FieldDirection.cs
+../../../external/corefx/src/System.CodeDom/src/System/CodeDom/MemberAttributes.cs
+../../../external/corefx/src/System.CodeDom/src/System/Collections/Specialized/FixedStringLookup.cs
index 59ef32f147fd6f9c8ecade952d86e5a3403592ff..6e1e9ef1264ab13c08957d9d6938eeed71c9497a 100644 (file)
@@ -76,8 +76,6 @@ using System.Runtime.InteropServices;
 [assembly: InternalsVisibleTo ("System, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
 [assembly: InternalsVisibleTo ("System.Core, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)]
 
-[assembly: InternalsVisibleTo ("System.Numerics, PublicKey=00000000000000000400000000000000")]
-
 [assembly: InternalsVisibleTo ("System.Runtime.WindowsRuntime, PublicKey=00000000000000000400000000000000")]
 [assembly: InternalsVisibleTo ("System.Runtime.WindowsRuntime.UI.Xaml, PublicKey=00000000000000000400000000000000")]
 
index 4cb362578ffc865092dfd2afd68af0c9e4151536..b71d5f1185b060e4e7a4145924c6abbc931a1078 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NETSTANDARD
-
 namespace System.Diagnostics.Tracing
 {
        public class EventCounter
@@ -41,5 +39,3 @@ namespace System.Diagnostics.Tracing
                }
        }
 }
-
-#endif
index bb1b719404a992efd5277abda3f6909cdecc3ede..5241e8c38b69eb4cfabcfc52e663e90076ebd543 100644 (file)
@@ -271,14 +271,12 @@ namespace System.Diagnostics.Tracing
                {
                }
 
-#if NETSTANDARD
                [MonoTODO]
                public event EventHandler<EventCommandEventArgs> EventCommandExecuted
                {
                        add { throw new NotImplementedException (); }
                        remove { throw new NotImplementedException (); }
                }
-#endif
 
                [MonoTODO]
                public static string GenerateManifest (Type eventSourceType, string assemblyPathToIncludeInManifest)
index adb9998e66ef4a999312c29926c33e762c4b8e3c..762dad80fd402117bf211eecb5528ad5902f89dd 100644 (file)
@@ -22,7 +22,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !FULL_AOT_RUNTIME || IOS_REFLECTION
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
@@ -35,5 +34,3 @@ namespace System.Reflection.Emit {
                WindowApplication = 3
        }
 }
-
-#endif
index 19da0435b5a9c2a9f84c2955bad869b98b9267c4..01f1d9583dc2f8ebbc4a99f8d9fc92266c0d02d1 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NETSTANDARD
-
 namespace System.Reflection.Metadata
 {
        public static class AssemblyExtensions
@@ -42,5 +40,3 @@ namespace System.Reflection.Metadata
                }
        }
 }
-
-#endif
\ No newline at end of file
index 3297ac2342a84dd961e621ae968f04260d124739..1e9b5c8dc6bd260b907be43ba567b09e88ba5263 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NETSTANDARD
-
 namespace System.Runtime.Loader
 {
        //
@@ -106,5 +104,3 @@ namespace System.Runtime.Loader
 #pragma warning restore
        }
 }
-
-#endif
\ No newline at end of file
index 960ecf6e7b857595371308d71456e4c2fe0dad93..3bd11264b1a8fd04c929d3e03b624fb743621c0b 100644 (file)
@@ -98,17 +98,16 @@ namespace System.Threading
 
                private void DoCallBack (object timedOut)
                {
-                       if (_callback != null) {
-                               try {
-                                       _callback (_state, (bool)timedOut); 
-                               } catch {}
-                       }
-
-                       lock (this) 
-                       {
-                               _callsInProcess--;
-                               if (_unregistered && _callsInProcess == 0 && _finalEvent != null)
-                                       NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle);
+                       try {
+                               if (_callback != null)
+                                       _callback (_state, (bool)timedOut);
+                       } finally {
+                               lock (this)
+                               {
+                                       _callsInProcess--;
+                                       if (_unregistered && _callsInProcess == 0 && _finalEvent != null)
+                                               NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle);
+                               }
                        }
                }
 
index 8f6e0aa098e40b238d2738503705207086c3eb80..d2565a3c209a771fa2ad03c1a5b423c87ea06d9c 100644 (file)
@@ -1290,6 +1290,34 @@ namespace System
                        }
                }
 
+               public static void Reverse<T>(T[] array)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException (nameof (array));
+
+                       Reverse (array, 0, array.Length);
+               }
+
+               public static void Reverse<T>(T[] array, int index, int length)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException (nameof (array));
+                       if (index < 0 || length < 0)
+                               throw new ArgumentOutOfRangeException ((index < 0 ? nameof (index) : nameof (length)));
+                       if (array.Length - index < length)
+                               throw new ArgumentException ();
+
+                       int i = index;
+                       int j = index + length - 1;
+                       while (i < j) {
+                               T temp = array [i];
+                               array [i] = array [j];
+                               array [j] = temp;
+                               i++;
+                               j--;
+                       }
+               }
+
                [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
                public static void Sort (Array array)
                {
@@ -3130,6 +3158,30 @@ namespace System
                        return new ReadOnlyCollection<T> (array);
                }
 
+               public static void Fill<T> (T[] array, T value)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException (nameof (array));
+
+                       for (int i = 0; i < array.Length; i++)
+                               array [i] = value;
+               }
+
+               public static void Fill<T> (T[] array, T value, int startIndex, int count)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException (nameof (array));
+
+                       if (startIndex < 0 || startIndex > array.Length)
+                               throw new ArgumentOutOfRangeException (nameof (startIndex));
+
+                       if (count < 0 || startIndex > array.Length - count)
+                               throw new ArgumentOutOfRangeException (nameof (count));
+
+                       for (int i = startIndex; i < startIndex + count; i++)
+                               array [i] = value;
+               }
+
                public static T Find<T> (T [] array, Predicate<T> match)
                {
                        if (array == null)
index bbb5051574b32924789a8df1ca4d12a63e6812fe..7a12080c6a89b822ca68d4806c861d4785655836 100644 (file)
@@ -826,7 +826,7 @@ namespace System
                                        return tz.BaseUtcOffset;
                        }
 
-                       if (tzRule != null && tz.IsInDST (tzRule, stdUtcDateTime)) {
+                       if (tzRule != null && tz.IsInDST (tzRule, dateTime)) {
                                // Replicate what .NET does when given a time which falls into the hour which is lost when
                                // DST starts. isDST should always be true but the offset should be BaseUtcOffset without the
                                // DST delta while in that hour.
@@ -883,7 +883,7 @@ namespace System
                        AdjustmentRule rule = GetApplicableRule (dateTime);
                        if (rule != null) {
                                DateTime tpoint = TransitionPoint (rule.DaylightTransitionEnd, dateTime.Year);
-                               if (dateTime > tpoint - rule.DaylightDelta  && dateTime <= tpoint)
+                               if (dateTime > tpoint - rule.DaylightDelta && dateTime <= tpoint)
                                        return true;
                        }
                                
@@ -913,7 +913,6 @@ namespace System
                                DST_start -= BaseUtcOffset;
                                DST_end -= (BaseUtcOffset + rule.DaylightDelta);
                        }
-
                        return (dateTime >= DST_start && dateTime < DST_end);
                }
                
@@ -1199,31 +1198,16 @@ namespace System
                                        return false;
                        }
 
-                       var inDelta = false;
-                       for (var i =  transitions.Count - 1; i >= 0; i--) {
-                               var pair = transitions [i];
-                               DateTime ttime = pair.Key;
-                               TimeType ttype = pair.Value;
-
-                               var delta =  new TimeSpan (0, 0, ttype.Offset) - BaseUtcOffset;
-
-                               if ((ttime + delta) > date) {
-                                       inDelta = ttime <= date;
-                                       continue;
-                               }
-
-                               offset =  new TimeSpan (0, 0, ttype.Offset);
-                               if (inDelta) {
-                                       // Replicate what .NET does when given a time which falls into the hour which is lost when
-                                       // DST starts. isDST should be true but the offset should be the non-DST offset.
-                                       isDst = transitions [i - 1].Value.IsDst;
-                               } else {
-                                       isDst = ttype.IsDst;
+                       AdjustmentRule current = GetApplicableRule(date);
+                       if (current != null) {
+                               DateTime tStart = TransitionPoint(current.DaylightTransitionStart, date.Year);
+                               DateTime tEnd = TransitionPoint(current.DaylightTransitionEnd, date.Year);
+                               if ((date >= tStart) && (date <= tEnd)) {
+                                       offset = baseUtcOffset + current.DaylightDelta; 
+                                       isDst = true;
+                                       return true;
                                }
-
-                               return true;
                        }
-
                        return false;
                }
 
@@ -1513,7 +1497,7 @@ namespace System
 
                        if (zone.IsAmbiguousTime (time)) {
                                isAmbiguousLocalDst = true;
-                               return baseOffset;
+//                             return baseOffset;
                        }
 
                        return zone.GetUtcOffset (time, out isDaylightSavings);
index ae5bdbfd586d3391d656861047590897068957ca..a84fa27a77d742a5faaebda98b46758d2bff70e6 100644 (file)
@@ -912,20 +912,18 @@ namespace MonoTests.System.Threading
                [Test]
                public void SetNameInThreadPoolThread ()
                {
-                       for (int i = 0; i < 10; ++i) {
-                               Task t = Task.Run (delegate () {
-                                       Thread.CurrentThread.Name = "x/" + i;
-                                       Assert.AreEqual (Thread.CurrentThread.Name, "x/" + i, "#1");
+                       Task t = Task.Run (delegate () {
+                               Thread.CurrentThread.Name = "ThreadName1";
+                               Assert.AreEqual (Thread.CurrentThread.Name, "ThreadName1", "#1");
 
-                                       try {
-                                               Thread.CurrentThread.Name = "y/" + i;
-                                               Assert.Fail ("#2");
-                                       } catch (InvalidOperationException) {
-                                       }
-                               });
+                               try {
+                                       Thread.CurrentThread.Name = "ThreadName2";
+                                       Assert.Fail ("#2");
+                               } catch (InvalidOperationException) {
+                               }
+                       });
 
-                               t.Wait ();
-                       }
+                       t.Wait ();
                }
 
                void CheckIsRunning (string s, Thread t)
index ce1c9793fc57daeef63df5687cbea2c505ac916d..b9ae6d1709ad07c3bd99073e4271bb4947271360 100644 (file)
@@ -19,6 +19,7 @@ namespace MonoTests.System.Threading {
                // this bucket is used to avoid non-theadlocal issues
                class Bucket {
                        public int count;
+                       public ManualResetEventSlim mre = new ManualResetEventSlim (false); 
                }
 
                [SetUp]
@@ -36,37 +37,52 @@ namespace MonoTests.System.Threading {
                {
                }
 
+               private void Callback2 (object foo)
+               {
+                       Bucket b = foo as Bucket;
+                       Interlocked.Increment (ref b.count);
+                       b.mre.Set ();
+               }
+
+
                [Test]
                public void TestDueTime ()
                {
                        Bucket bucket = new Bucket();
 
-                       using (Timer t = new Timer (o => Callback (o), bucket, 200, Timeout.Infinite)) {
-                               Thread.Sleep (50);
-                               Assert.AreEqual (0, bucket.count, "#1");
-                               Thread.Sleep (200);
-                               Assert.AreEqual (1, bucket.count, "#2");
-                               Thread.Sleep (500);
-                               Assert.AreEqual (1, bucket.count, "#3");
-                               t.Change (10, 10);
-                               Thread.Sleep (1000);
-                               Assert.IsTrue(bucket.count > 20, "#4");
+                       using (Timer t = new Timer (o => Callback2 (o), bucket, 200, Timeout.Infinite)) {
+                               Assert.IsTrue (bucket.mre.Wait (5000), "#-1");
+                               Assert.AreEqual (1, bucket.count, "#1");
                        }
                }
 
+               [Test]
+               public void TestDispose ()
+               {       
+                       Bucket bucket = new Bucket();
+
+                       using (Timer t = new Timer (o => Callback2 (o), bucket, 10, 10)) {
+                               Assert.IsTrue (bucket.mre.Wait (5000), "#-1");
+                       }
+                       //If the callback is called after dispose, it will NRE and be reported
+                       bucket.mre = null;
+                       int c = bucket.count;
+                       Assert.IsTrue (c > 0, "#1");
+               }
+
                [Test]
                public void TestChange ()
                {
                        Bucket bucket = new Bucket();
 
-                       using (Timer t = new Timer (o => Callback (o), bucket, 10, 10)) {
-                               Thread.Sleep (500);
+                       using (Timer t = new Timer (o => Callback2 (o), bucket, 10, 10)) {
+                               Assert.IsTrue (bucket.mre.Wait (5000), "#-1");
                                int c = bucket.count;
-                               Assert.IsTrue (c > 20, "#1 " + c.ToString ());
-                               t.Change (100, 100);
+                               Assert.IsTrue (c > 0, "#1 " + c);
+                               t.Change (100000, 1000000);
                                c = bucket.count;
                                Thread.Sleep (500);
-                               Assert.IsTrue (bucket.count <= c + 20, "#2 " + c.ToString ());
+                               Assert.IsTrue (bucket.count <= c + 1, "#2 " + c);
                        }
                }
 
@@ -75,31 +91,16 @@ namespace MonoTests.System.Threading {
                {
                        Bucket bucket = new Bucket();
 
-                       using (Timer t = new Timer (o => Callback (o), bucket, 0, Timeout.Infinite)) {
-                               Thread.Sleep (100);
+                       using (Timer t = new Timer (o => Callback2 (o), bucket, 0, Timeout.Infinite)) {
+                               Assert.IsTrue (bucket.mre.Wait (5000), "#-1");
+                               bucket.mre.Reset ();
                                Assert.AreEqual (1, bucket.count, "#1");
                                t.Change (0, Timeout.Infinite);
-                               Thread.Sleep (100);
+                               Assert.IsTrue (bucket.mre.Wait (5000), "#1.5");
                                Assert.AreEqual (2, bucket.count, "#2");
                        }
                }
 
-               [Test]
-               public void TestDispose ()
-               {       
-                       Bucket bucket = new Bucket();
-
-                       using (Timer t = new Timer (o => Callback (o), bucket, 10, 10)) {
-                               Thread.Sleep (200);
-                       }
-
-                       Thread.Sleep (20);
-                       int c = bucket.count;
-                       Assert.IsTrue (bucket.count > 5, "#1");
-                       Thread.Sleep (200);
-                       Assert.AreEqual (c, bucket.count, "#2");
-               }
-
                [Test] // bug #320950
                public void TestDispose2 ()
                {
index 6ce65b4b432018862fbbef3c5a45cb9d2d2db94a..59d50b92845a3700771805437d2708be9c4b7eff 100644 (file)
@@ -27,6 +27,7 @@
 //
 
 using System;
+using System.Threading;
 using System.Threading.Tasks;
 
 using NUnit.Framework;
@@ -57,7 +58,10 @@ namespace MonoTests.System {
                [Test]
                public void ReRegisterForFinalizeTest ()
                {
-                       Run_ReRegisterForFinalizeTest ();
+                       var thread =  new Thread (Run_ReRegisterForFinalizeTest);
+                       thread.Start ();
+                       thread.Join ();
+
                        var t = Task.Factory.StartNew (() => {
                                do {
                                        GC.Collect ();
index 27c167f04862d3d763272eb03a92d4e8c2bf5fa8..d25889f6de69f7c78b1f148d45a06107c212ce32 100644 (file)
@@ -300,7 +300,7 @@ namespace MonoTests.System
                        }
                
                        [Test]
-                       public void DSTTransisions ()
+                       public void DSTTransitions ()
                        {
                                DateTime beforeDST = new DateTime (2007, 03, 25, 0, 59, 59, DateTimeKind.Unspecified);
                                DateTime startDST = new DateTime (2007, 03, 25, 2, 0, 0, DateTimeKind.Unspecified);
@@ -308,12 +308,12 @@ namespace MonoTests.System
                                DateTime afterDST = new DateTime (2007, 10, 28, 2, 0, 0, DateTimeKind.Unspecified);
                                Assert.IsFalse (london.IsDaylightSavingTime (beforeDST), "Just before DST");
                                Assert.IsTrue (london.IsDaylightSavingTime (startDST), "the first seconds of DST");
-                               Assert.IsFalse (london.IsDaylightSavingTime (endDST), "The last seconds of DST");
+                               Assert.IsTrue (london.IsDaylightSavingTime (endDST), "The last seconds of DST");
                                Assert.IsFalse (london.IsDaylightSavingTime (afterDST), "Just after DST");
                        }
                
                        [Test]
-                       public void DSTTransisionsUTC ()
+                       public void DSTTransitionsUTC ()
                        {
                                DateTime beforeDST = new DateTime (2007, 03, 25, 0, 59, 59, DateTimeKind.Utc);
                                DateTime startDST = new DateTime (2007, 03, 25, 1, 0, 0, DateTimeKind.Utc);
@@ -1179,8 +1179,8 @@ namespace MonoTests.System
 
                                d = dst1End.Add (-dstOffset);
                                Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
-                               Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
-                               Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
+                               Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
+                               Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,1,0, 1))));
 
                                d = dst2Start.Add (dstOffset);
                                Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
@@ -1189,8 +1189,8 @@ namespace MonoTests.System
 
                                d = dst2End.Add (-dstOffset);
                                Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0,-1))));
-                               Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
-                               Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
+                               Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset (d));
+                               Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,1,0, 1))));
                        }
 
                  [Test]
index 612cac79c3b0d60ca2a56d4c48d257273b16d770..0b9897a32e6fb9c4d7f52979921eed51f24352ad 100644 (file)
@@ -14,6 +14,7 @@ using System;
 using System.IO;
 using System.Threading;
 using System.Globalization;
+using System.Reflection;
 using System.Runtime.Serialization.Formatters.Binary;
 
 namespace MonoTests.System {
@@ -270,6 +271,47 @@ public class TimeZoneTest {
                Assert.IsTrue (tz.ToLocalTime (dst_start_utc.Add (new TimeSpan (1, 0, 0))) < tz.ToLocalTime (dst_start_utc.Add (new TimeSpan (1, 1, 0))), "0:4:00 < 0:4:01");
        }
 
+               [Test]
+               public void GetUTCNowAtDSTBoundaries ()
+               {
+                       TimeZoneInfo.TransitionTime startTransition = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 2, 0, 0), 3, 5, DayOfWeek.Sunday);
+
+                       TimeZoneInfo.TransitionTime endTransition = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 3, 0, 0), 10, 5, DayOfWeek.Sunday);
+
+                       TimeSpan delta = TimeSpan.FromMinutes(60.0);
+                       TimeZoneInfo.AdjustmentRule adjustment = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule(new DateTime(1970, 1, 1), DateTime.MaxValue.Date, delta, startTransition, endTransition);
+                       TimeZoneInfo.TransitionTime startTrans = adjustment.DaylightTransitionStart;
+                       TimeZoneInfo.TransitionTime endTrans = adjustment.DaylightTransitionEnd;
+                       TimeZoneInfo.AdjustmentRule[] adjustments = { adjustment };
+
+                       TimeZoneInfo tzInfo = TimeZoneInfo.CreateCustomTimeZone("MY Standard Time", TimeSpan.Zero, "MST", "MST", "MDT", adjustments);
+
+                       // There is no .NET API to set timezone. Use reflection to assign time zone to the TimeZoneInfo.local field.
+                       FieldInfo localTimeZone = typeof(TimeZoneInfo).GetField("local", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
+                       localTimeZone.SetValue(null, tzInfo);
+
+                       DateTime st = new DateTime(2016, 3, 27, 1, 0, 0, DateTimeKind.Local);
+                       Assert.IsTrue (!tzInfo.IsDaylightSavingTime(st));       
+                       Assert.IsTrue (!tzInfo.IsAmbiguousTime(st));
+                       Assert.IsTrue ((TimeZoneInfo.ConvertTimeToUtc(st).Hour == 1));
+                       st = new DateTime(2016, 3, 27, 3, 0, 0, DateTimeKind.Local);
+                       Assert.IsTrue (tzInfo.IsDaylightSavingTime(st));        
+                       Assert.IsTrue (!tzInfo.IsAmbiguousTime(st));
+                       Assert.IsTrue ((TimeZoneInfo.ConvertTimeToUtc(st).Hour == 2));
+                       st = new DateTime(2016, 10, 30, 2, 0, 0, DateTimeKind.Local);
+                       Assert.IsTrue (tzInfo.IsDaylightSavingTime(st));        
+                       Assert.IsTrue (!tzInfo.IsAmbiguousTime(st));
+                       Assert.IsTrue ((TimeZoneInfo.ConvertTimeToUtc(st).Hour == 1));
+                       st = new DateTime(2016, 10, 30, 3, 0, 0, DateTimeKind.Local);
+                       Assert.IsTrue (!tzInfo.IsDaylightSavingTime(st));       
+                       Assert.IsTrue (tzInfo.IsAmbiguousTime(st));
+                       Assert.IsTrue ((TimeZoneInfo.ConvertTimeToUtc(st).Hour == 3));
+                       st = new DateTime(2016, 10, 30, 4, 0, 0, DateTimeKind.Local);
+                       Assert.IsTrue (!tzInfo.IsDaylightSavingTime(st));       
+                       Assert.IsTrue (!tzInfo.IsAmbiguousTime(st));
+                       Assert.IsTrue ((TimeZoneInfo.ConvertTimeToUtc(st).Hour == 4));
+               }
+
                [Test]
                public void GetUtcOffsetAtDSTBoundary ()
                {
@@ -302,11 +344,12 @@ public class TimeZoneTest {
                                Assert.Ignore (tz.StandardName + " did not observe daylight saving time during " + year + ".");
 
                        var standardOffset = tz.GetUtcOffset(daylightChanges.Start.AddMinutes(-1));
+                       var dstOffset = tz.GetUtcOffset(daylightChanges.Start.AddMinutes(61));
 
                        Assert.AreEqual(standardOffset, tz.GetUtcOffset (dst_end));
-                       Assert.AreEqual(standardOffset, tz.GetUtcOffset (dst_end.Add (daylightChanges.Delta.Negate ().Add (TimeSpan.FromSeconds(1)))));
-                       Assert.AreEqual(standardOffset, tz.GetUtcOffset (dst_end.Add(daylightChanges.Delta.Negate ())));
-                       Assert.AreNotEqual(standardOffset, tz.GetUtcOffset (dst_end.Add(daylightChanges.Delta.Negate ().Add (TimeSpan.FromSeconds(-1)))));
+                       Assert.AreEqual(dstOffset, tz.GetUtcOffset (dst_end.Add (daylightChanges.Delta.Negate ().Add (TimeSpan.FromSeconds(1)))));
+                       Assert.AreEqual(dstOffset, tz.GetUtcOffset (dst_end.Add(daylightChanges.Delta.Negate ())));
+                       Assert.AreEqual(dstOffset, tz.GetUtcOffset (dst_end.Add(daylightChanges.Delta.Negate ().Add (TimeSpan.FromSeconds(-1)))));
                }
 
 
index 3e70f3f8c7decb7165936e0dfecd27c366703d76..1318e3550a6db9eb21452141acb3f93af9617dfb 100644 (file)
@@ -139,12 +139,10 @@ namespace System.Linq.Expressions {
             return LambdaCompiler.Compile(this, debugInfoGenerator);
         }
 
-#if NETSTANDARD
         public Delegate Compile(bool preferInterpretation) {
             // TODO: add logic for preferInterpretation
             return Compile();
         }
-#endif
 
         /// <summary>
         /// Compiles the lambda into a method definition.
@@ -207,12 +205,10 @@ namespace System.Linq.Expressions {
             return (TDelegate)(object)LambdaCompiler.Compile(this, debugInfoGenerator);
         }
 
-#if NETSTANDARD
         public new TDelegate Compile(bool preferInterpretation) {
             // TODO: add logic for preferInterpretation
             return Compile();
         }
-#endif
 
         /// <summary>
         /// Creates a new expression that is like this one, but using the
index 373609195c25680febccfacc678a393fa3cfeb06..d1dc03000a9f0b6357a67dd3f7b9c72da5e9be1a 100644 (file)
@@ -694,7 +694,6 @@ namespace System.Linq
             foreach (TSource element in second) yield return element;
         }
 
-#if NETSTANDARD
         public static IEnumerable<TSource> Append<TSource>(this IEnumerable<TSource> source, TSource element)
         {
             if (source == null) throw Error.ArgumentNull("source");
@@ -718,7 +717,6 @@ namespace System.Linq
             yield return element;
             foreach (TSource e1 in source) yield return e1;
         }
-#endif
 
         public static IEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector) {
             if (first == null) throw Error.ArgumentNull("first");
index 55e173b3542badb18b08af2c5308bbe8c8e4a400..5cfafbab8874ece62523d9b5d9ca0795501987c4 100644 (file)
@@ -242,7 +242,6 @@ namespace System.Security.Cryptography {
             }
         }
 
-#if NETSTANDARD
         public static CngAlgorithm ECDiffieHellman {
             get {
                 throw new NotImplementedException ();
@@ -254,6 +253,5 @@ namespace System.Security.Cryptography {
                 throw new NotImplementedException ();
             }
         }
-#endif
     }
 }
index 6592635e850ebd0fac3eb658c01244722426e99a..8ee5e598f41d662afd7ade5de742bca5ffb20547 100644 (file)
@@ -119,7 +119,6 @@ namespace System.Security.Cryptography {
             }
         }
 
-#if NETSTANDARD
         public static CngKeyBlobFormat EccFullPrivateBlob {
             get {
                 throw new NotImplementedException ();
@@ -131,7 +130,6 @@ namespace System.Security.Cryptography {
                 throw new NotImplementedException ();
             }
         }
-#endif
 
         public static CngKeyBlobFormat GenericPrivateBlob {
             get {
index 79202306c85226934f4be7a334f6ffd7c7be5ad2..04f11603a17954cdd8a8f3d6c32be367f8c70c65 100644 (file)
@@ -41,7 +41,6 @@ namespace System.Security.Cryptography {
             return CryptoConfig.CreateFromName(algorithm) as ECDsa;
         }
 
-#if NETSTANDARD
         public static ECDsa Create (ECCurve curve)
         {
             throw new NotImplementedException ();
@@ -71,7 +70,6 @@ namespace System.Security.Cryptography {
         {
             throw new NotImplementedException ();
         }
-#endif
 
         //
         // Signature operations
index ec51a5c6653a1842a70a4e1abd92b39506c56a87..b0267ab9983b832e9bd385c318469aa00218336f 100644 (file)
@@ -31,11 +31,9 @@ namespace System.Security.Cryptography {
             throw new NotImplementedException ();
         }
 
-#if NETSTANDARD
         public ECDsaCng(ECCurve curve) {
             throw new NotImplementedException ();
         }
-#endif
 
         public CngKey Key {
             get {
index 78764bb468033653fb802d0a842c0913176993a3..ca99748e84c73add118aad5e1e94a9a983481e4b 100644 (file)
@@ -18,12 +18,10 @@ namespace System.Security.Cryptography
             throw new NotImplementedException ();
         }
 
-#if NETSTANDARD
         public RSACng(CngKey key)
         {
             throw new NotImplementedException ();
         }
-#endif
 
         public CngKey Key
         {
index 62eb1dcc3f870757e03d70d408281fbd5f2dad9e..7fcf6f07ab366112bb4c983199863ae276f13591 100644 (file)
@@ -13,6 +13,7 @@ namespace System.Data {
     using System.Data;
     using System.Runtime.Serialization;
 
+#if !COREFX
     /// <devdoc>
     ///    <para>DEV: The exception that is throwing from strong typed DataSet when user access to DBNull value.</para>
     /// </devdoc>
@@ -39,7 +40,7 @@ namespace System.Data {
             HResult = HResults.StrongTyping;
         }
     }
-
+#endif
 
     /// <devdoc>
     ///    <para>DEV: The exception that is throwing in generating strong typed DataSet when name conflict happens.</para>
index 1e5ea43e2710b9e2f6698d8b679b66e4c28040a4..32bc1e964e2ce57e1305e48a1772c2add589af41 100644 (file)
@@ -55,6 +55,8 @@ namespace System.Data.Common {
         // The resource Framework.txt will ensure proper string text based on the appropriate
         // locale.
 
+        public const CompareOptions DefaultCompareOptions = CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase;
+
         static internal Task<T> CreatedTaskWithException<T>(Exception ex) {
             TaskCompletionSource<T> completion = new TaskCompletionSource<T>();
             completion.SetException(ex);
@@ -77,27 +79,9 @@ namespace System.Data.Common {
             }
         }
 
-        // NOTE: Initializing a Task in SQL CLR requires the "UNSAFE" permission set (http://msdn.microsoft.com/en-us/library/ms172338.aspx)
-        // Therefore we are lazily initializing these Tasks to avoid forcing customers to use the "UNSAFE" set when they are actually using no Async features (See Dev11 Bug #193253)
-        static private Task<bool> _trueTask = null;
-        static internal Task<bool> TrueTask {
-            get {
-                if (_trueTask == null) {
-                    _trueTask = Task.FromResult<bool>(true);
-                }
-                return _trueTask;
-            }
-        }
+        static internal Task<bool> s_trueTask = Task.FromResult<bool>(true);
 
-        static private Task<bool> _falseTask = null;
-        static internal Task<bool> FalseTask {
-            get {
-                if (_falseTask == null) {
-                    _falseTask = Task.FromResult<bool>(false);
-                }
-                return _falseTask;
-            }
-        }
+        static internal Task<bool> s_falseTask = Task.FromResult<bool>(true);
         
         [BidMethod] // this method accepts BID format as an argument, this attribute allows FXCopBid rule to validate calls to it
         static private void TraceException(
index ed7b7b4c5d1c02ff0fba43ea712a1a476c508c9a..e2e362e7a24bdd10327ec3eb06d224930d01df11 100644 (file)
@@ -86,7 +86,7 @@ namespace System.Data.Common {
             _encryptedUsersConnectionString = connectionOptions.UsersConnectionString(false);
             _hasPassword = connectionOptions.HasPasswordKeyword;
             _parsetable = connectionOptions.Parsetable;
-            _keychain = connectionOptions.KeyChain;
+            _keychain = connectionOptions._keyChain;
 
             // we do not want to serialize out user password unless directed so by "persist security info=true"
             // otherwise all instances of user's password will be replaced with "*"
index 11257cc6dea9b8de67dbe9f4e2c387041bb40660..6f283876b38dc2f30734294825f5937e3869e781 100644 (file)
@@ -107,7 +107,7 @@ namespace System.Data.Common {
 
         private readonly string        _usersConnectionString;
         private readonly Hashtable     _parsetable;
-        internal readonly NameValuePair KeyChain;
+        internal readonly NameValuePair _keyChain;
         internal readonly bool HasPasswordKeyword;
         internal readonly bool HasUserIdKeyword;
 
@@ -143,7 +143,7 @@ namespace System.Data.Common {
 
             // first pass on parsing, initial syntax check
             if (0 < _usersConnectionString.Length) {
-                KeyChain = ParseInternal(_parsetable, _usersConnectionString, true, synonyms, UseOdbcRules);
+                _keyChain = ParseInternal(_parsetable, _usersConnectionString, true, synonyms, UseOdbcRules);
                 HasPasswordKeyword = (_parsetable.ContainsKey(KEY.Password) || _parsetable.ContainsKey(SYNONYM.Pwd));
                 HasUserIdKeyword = (_parsetable.ContainsKey(KEY.User_ID) || _parsetable.ContainsKey(SYNONYM.UID));
             }
@@ -155,7 +155,7 @@ namespace System.Data.Common {
             HasUserIdKeyword = connectionOptions.HasUserIdKeyword;
             UseOdbcRules = connectionOptions.UseOdbcRules;
             _parsetable = connectionOptions._parsetable;
-            KeyChain = connectionOptions.KeyChain;
+            _keyChain = connectionOptions._keyChain;
         }
 
 
@@ -201,7 +201,7 @@ namespace System.Data.Common {
         }
 
         public bool IsEmpty {
-            get { return (null == KeyChain); }
+            get { return (null == _keyChain); }
         }
 
         internal Hashtable Parsetable {
@@ -439,7 +439,7 @@ namespace System.Data.Common {
             int copyPosition = 0;
             bool expanded = false;
 
-            for(NameValuePair current = KeyChain; null != current; current = current.Next) {
+            for(NameValuePair current = _keyChain; null != current; current = current.Next) {
                 value = current.Value;
 
                 // remove duplicate keyswords from connectionstring
@@ -517,7 +517,7 @@ namespace System.Data.Common {
             int copyPosition = 0;
 
             StringBuilder builder = new StringBuilder(_usersConnectionString.Length);
-            for(NameValuePair current = KeyChain; null != current; current = current.Next) {
+            for(NameValuePair current = _keyChain; null != current; current = current.Next) {
                 if ((current.Name == keyword) && (current.Value == this[keyword])) {
                     // only replace the parse end-result value instead of all values
                     // so that when duplicate-keywords occur other original values remain in place
@@ -929,7 +929,7 @@ namespace System.Data.Common {
             int copyPosition = 0;
             NameValuePair head = null, tail = null, next = null;
             StringBuilder builder = new StringBuilder(_usersConnectionString.Length);
-            for(NameValuePair current = KeyChain; null != current; current = current.Next) {
+            for(NameValuePair current = _keyChain; null != current; current = current.Next) {
                 if ((KEY.Password != current.Name) && (SYNONYM.Pwd != current.Name)) {
                     builder.Append(_usersConnectionString, copyPosition, current.Length);
                     if (fakePassword) {
index c95844c82a82efbecd9aba0a91827f07157dfdc3..9646eb88b49a320cae96980114160abb2fc7f1eb 100644 (file)
@@ -262,7 +262,7 @@ internal static partial class Bid
     [BidMethod]
     [BidArgumentType(typeof(string))] // format string should have a string spec (%ls) for an Activity ID argument as last
     internal static void CorrelationTrace(string fmtPrintfW, System.Int32 a1) {
-        if ((modFlags & System.Data.Common.ActivityCorrelator.CorrelationTracePoints) != 0
+        if ((modFlags & Bid.ApiGroup.Correlation) != 0
             && (modFlags & Bid.ApiGroup.Trace) != 0 && modID != NoData) {
             System.Data.Common.ActivityCorrelator.ActivityId actId = System.Data.Common.ActivityCorrelator.Next();
             NativeMethods.Trace(modID, UIntPtr.Zero, UIntPtr.Zero, fmtPrintfW, a1, actId.ToString());
@@ -273,7 +273,7 @@ internal static partial class Bid
     [BidArgumentType(typeof(string))] // format string should have a string spec (%ls) for an Activity ID argument as last
     internal static void CorrelationTrace(string fmtPrintfW)
     {
-        if ((modFlags & System.Data.Common.ActivityCorrelator.CorrelationTracePoints) != 0
+        if ((modFlags & Bid.ApiGroup.Correlation) != 0
             && (modFlags & Bid.ApiGroup.Trace) != 0 && modID != NoData) {
             System.Data.Common.ActivityCorrelator.ActivityId actId = System.Data.Common.ActivityCorrelator.Next();
             NativeMethods.Trace(modID, UIntPtr.Zero, UIntPtr.Zero, fmtPrintfW, actId.ToString());
@@ -283,7 +283,7 @@ internal static partial class Bid
     [BidMethod]
     [BidArgumentType(typeof(string))] // format string should have a string spec (%ls) for an Activity ID argument as last
     internal static void CorrelationTrace(string fmtPrintfW, System.Int32 a1, System.Int32 a2) {
-        if ((modFlags & System.Data.Common.ActivityCorrelator.CorrelationTracePoints) != 0
+        if ((modFlags & Bid.ApiGroup.Correlation) != 0
             && (modFlags & Bid.ApiGroup.Trace) != 0 && modID != NoData) {
             System.Data.Common.ActivityCorrelator.ActivityId actId = System.Data.Common.ActivityCorrelator.Next();
             NativeMethods.Trace(modID, UIntPtr.Zero, UIntPtr.Zero, fmtPrintfW, a1, a2, actId.ToString());
index eb8d46d665f2ecc7389528bf84f1f2e211424909..2a88477ebb7106342eac3e23b62d255ecd892b31 100644 (file)
@@ -227,6 +227,22 @@ namespace System.Collections.Generic {
             _array[_size] = default(T);     // Free memory quicker.
             return item;
         }
+
+#if MONO
+        public bool TryPop(out T result)
+        {
+            if (_size == 0)
+            {
+                result = default(T);
+                return false;
+            }
+
+            _version++;
+            result = _array[--_size];
+            _array[_size] = default(T);     // Free memory quicker.
+            return true;
+        }
+#endif
     
         // Pushes an item to the top of the stack.
         // 
index 7ee9e5355447cb061ce177d92c1f1ccaed1de71b..a978e8e73ab7a590ce9e510bb6de9c7291917ca5 100644 (file)
@@ -472,7 +472,6 @@ namespace System.Text.RegularExpressions {
             }
         }
 
-#if NETSTANDARD
         [CLSCompliant (false)]
         protected IDictionary Caps
         {
@@ -527,7 +526,6 @@ namespace System.Text.RegularExpressions {
                 }
             }
         }
-#endif
 
         /// <devdoc>
         ///    <para>
index 48b508d50de2970bf5ccd25d8a6fa9c1b55b9447..a2fec93aa83a2cf51db3652a3158783d2efd1d4b 100644 (file)
@@ -33,7 +33,6 @@ namespace System
             }
         }
 
-#if NETSTANDARD
         public static string TargetFrameworkName
         {
             get
@@ -46,7 +45,6 @@ namespace System
         {
             throw new NotImplementedException();
         }
-#endif
 
         #region Switch APIs
 #if !MONO
index e5d0b1f173584fe1676d1379efa1df8a35346731..fe79b444e36e6600d1a1b227e831fe5a3d278c1b 100644 (file)
@@ -1443,7 +1443,11 @@ namespace Mono.CSharp
                                        targs.Arguments = new TypeSpec[hoisted_tparams.Length];
                                        for (int i = 0; i < hoisted_tparams.Length; ++i) {
                                                var tp = hoisted_tparams[i];
-                                               var local_tp = new TypeParameter (tp, null, new MemberName (tp.Name, Location), null);
+                                               var tp_name = tp.Name;
+#if DEBUG
+                                               tp_name += "_Proxy";
+#endif
+                                               var local_tp = new TypeParameter (tp, null, new MemberName (tp_name, Location), null);
                                                tparams.Add (local_tp);
 
                                                targs.Add (new SimpleName (tp.Name, Location));
@@ -1459,6 +1463,12 @@ namespace Mono.CSharp
                                        var mutator = new TypeParameterMutator (hoisted_tparams, tparams);
                                        return_type = mutator.Mutate (return_type);
                                        local_param_types = mutator.Mutate (local_param_types);
+
+                                       var inflator = new TypeParameterInflator (this, null, hoisted_tparams, targs.Arguments);
+                                       for (int i = 0; i < hoisted_tparams.Length; ++i) {
+                                               var tp_spec = (TypeParameterSpec) targs.Arguments [i];
+                                               tp_spec.InflateConstraints (inflator, tp_spec);
+                                       }
                                } else {
                                        member_name = new MemberName (name);
                                }
@@ -1471,7 +1481,7 @@ namespace Mono.CSharp
                                        base_parameters[i].Resolve (this, i);
                                }
 
-                               var cloned_params = ParametersCompiled.CreateFullyResolved (base_parameters, method.Parameters.Types);
+                               var cloned_params = ParametersCompiled.CreateFullyResolved (base_parameters, local_param_types);
                                if (method.Parameters.HasArglist) {
                                        cloned_params.FixedParameters[0] = new Parameter (null, "__arglist", Parameter.Modifier.NONE, null, Location);
                                        cloned_params.Types[0] = Module.PredefinedTypes.RuntimeArgumentHandle.Resolve ();
index d5ba75c12813af9d07e4b3182134f82cc3e557f9..c580a8a7291562eeeb31b519ece86ec395d146b7 100644 (file)
@@ -1070,7 +1070,10 @@ namespace Mono.CSharp
                                        var ie = new InstanceEmitter (instance_copy, IsAddressCall (instance_copy, call_op, method.DeclaringType));
 
                                        if (Arguments == null) {
-                                               ie.EmitLoad (ec, true);
+                                               if (ConditionalAccess)
+                                                       ie.Emit (ec, true);
+                                               else
+                                                       ie.EmitLoad (ec, true);
                                        }
                                } else if (!InstanceExpressionOnStack) {
                                        var ie = new InstanceEmitter (InstanceExpression, IsAddressCall (InstanceExpression, call_op, method.DeclaringType));
index 8475a9e489428c0d98d91267b7b40954a54be3c2..5dff5e73d79361861f97b7d05bbd45432db84ac4 100644 (file)
@@ -3352,6 +3352,8 @@ namespace Mono.CSharp {
                                // introduce redundant storey but with `this' only but it's tricky to avoid
                                // at this stage as we don't know what expressions follow base
                                //
+                               // TODO: It's needed only when the method with base call is moved to a storey
+                               //
                                if (rc.CurrentAnonymousMethod != null) {
                                        if (targs == null && method.IsGeneric) {
                                                targs = method.TypeArguments;
index 2968ee08584f544f7869efba43e4007b9f259888..c7747f014fdee5da31e0b772c45dbdaa148c769c 100644 (file)
@@ -3448,7 +3448,7 @@ namespace Mono.CSharp
                        }
                }
 
-               static CSharp.Operator.OpType ConvertBinaryToUserOperator (Operator op)
+               public static CSharp.Operator.OpType ConvertBinaryToUserOperator (Operator op)
                {
                        switch (op) {
                        case Operator.Addition:
@@ -12174,21 +12174,23 @@ namespace Mono.CSharp
                                args);
                }
 
-               protected override Expression DoResolve (ResolveContext ec)
+               protected override Expression DoResolve (ResolveContext rc)
                {
-                       Expression e = base.DoResolve (ec);
+                       Expression e = base.DoResolve (rc);
                        if (type == null)
                                return null;
 
                        if (type.IsDelegate) {
-                               ec.Report.Error (1958, Initializers.Location,
+                               rc.Report.Error (1958, Initializers.Location,
                                        "Object and collection initializers cannot be used to instantiate a delegate");
                        }
 
-                       Expression previous = ec.CurrentInitializerVariable;
-                       ec.CurrentInitializerVariable = new InitializerTargetExpression (this);
-                       initializers.Resolve (ec);
-                       ec.CurrentInitializerVariable = previous;
+                       Expression previous = rc.CurrentInitializerVariable;
+                       rc.CurrentInitializerVariable = new InitializerTargetExpression (this);
+                       using (rc.With (ResolveContext.Options.DontSetConditionalAccessReceiver, false)) {
+                               initializers.Resolve (rc);
+                       }
+                       rc.CurrentInitializerVariable = previous;
 
                        dynamic = e as DynamicExpressionStatement;
                        if (dynamic != null)
index fdf5b81f92c38a4ef8dba73e5c202a990383eec3..8ddef4f36947b630ee655efd11adbe80fa385b5c 100644 (file)
@@ -428,13 +428,13 @@ namespace Mono.CSharp {
                public TypeParameter (TypeParameterSpec spec, TypeSpec parentSpec, MemberName name, Attributes attrs)
                        : base (null, name, attrs)
                {
-                       this.spec = new TypeParameterSpec (parentSpec, spec.DeclaredPosition, spec.MemberDefinition, spec.SpecialConstraint, spec.Variance, null) {
+                       this.spec = new TypeParameterSpec (parentSpec, spec.DeclaredPosition, this, spec.SpecialConstraint, spec.Variance, null) {
                                BaseType = spec.BaseType,
                                InterfacesDefined = spec.InterfacesDefined,
                                TypeArguments = spec.TypeArguments
                        };
                }
-               
+
                #region Properties
 
                public override AttributeTargets AttributeTargets {
@@ -2162,6 +2162,10 @@ namespace Mono.CSharp {
                                return this;
 
                        var mutated = (InflatedTypeSpec) MemberwiseClone ();
+#if DEBUG
+                       mutated.ID += 1000000;
+#endif
+
                        if (decl != DeclaringType) {
                                // Gets back MethodInfo in case of metaInfo was inflated
                                //mutated.info = MemberCache.GetMember<TypeSpec> (DeclaringType.GetDefinition (), this).info;
index d3b0f86d8164bd2338d66fe6ca7a8df689bf07cc..48f5f09c7047e903979cd61343b77948d945e162 100644 (file)
@@ -373,8 +373,13 @@ namespace Mono.CSharp {
                                        var entry_pm = entry as IParametersMember;
                                        if (entry_pm != null) {
                                                entry_param = entry_pm.Parameters;
-                                               if (!TypeSpecComparer.Override.IsEqual (entry_param, member_param))
-                                                       continue;
+                                               if (entry.DeclaringType != member.DeclaringType) {
+                                                       if (!TypeSpecComparer.Override.IsEqual (entry_param, member_param))
+                                                               continue;
+                                               } else {
+                                                       if (!TypeSpecComparer.Equals (entry_param.Types, member_param.Types))
+                                                               continue;
+                                               }
                                        }
                                }
 
index 5cce6a10361339e95669211d7dceaa38065f5afd..c2b993564e2b354b066ca651e60f816da3707d00 100644 (file)
@@ -444,6 +444,10 @@ namespace Mono.CSharp {
                        return ms;
                }
 
+#if DEBUG
+               int counter = 100000;
+#endif
+
                public MethodSpec MakeGenericMethod (IMemberContext context, params TypeSpec[] targs)
                {
                        if (targs == null)
@@ -465,6 +469,10 @@ namespace Mono.CSharp {
                        inflated.constraints = TypeParameterSpec.InflateConstraints (inflator, constraints ?? GenericDefinition.TypeParameters);
                        inflated.state |= StateFlags.PendingMakeMethod;
 
+#if DEBUG
+                       inflated.ID += counter;
+                       counter += 100000;
+#endif
                        //                      if (inflated.parent == null)
                        //                              inflated.parent = parent;
 
@@ -1867,6 +1875,7 @@ namespace Mono.CSharp {
                        if (debug_builder == null)
                                return;
 
+#if !FULL_AOT_RUNTIME
                        var token = ConstructorBuilder.GetToken ();
                        int t = token.Token;
 #if STATIC
@@ -1875,6 +1884,7 @@ namespace Mono.CSharp {
 #endif
 
                        debug_builder.DefineMethod (file, t);
+#endif
                }
 
                #region IMethodData Members
@@ -2197,6 +2207,7 @@ namespace Mono.CSharp {
                        if (debug_builder == null)
                                return;
 
+#if !FULL_AOT_RUNTIME
                        var token = builder.GetToken ();
                        int t = token.Token;
 #if STATIC
@@ -2205,6 +2216,7 @@ namespace Mono.CSharp {
 #endif
 
                        debug_builder.DefineMethod (file, t);
+#endif
                }
        }
 
index 93314df322ad9c202cbc1667077a1f050738f27e..754c888e8b1158711b9f4200666e7a22e6ff273f 100644 (file)
@@ -695,6 +695,20 @@ namespace Mono.CSharp.Nullable
                                        Right = Unwrap.CreateUnwrapped (Right);
                                        UnwrapRight = Right as Unwrap;
                                }
+
+                               if (Left.Type.BuiltinType == BuiltinTypeSpec.Type.Decimal) {
+                                       var decimal_operators = MemberCache.GetUserOperator (Left.Type, Binary.ConvertBinaryToUserOperator (Binary.Oper), false);
+
+                                       Arguments args = new Arguments (2);
+                                       args.Add (new Argument (Left));
+                                       args.Add (new Argument (Right));
+
+                                       const OverloadResolver.Restrictions restr = OverloadResolver.Restrictions.ProbingOnly |
+                                               OverloadResolver.Restrictions.NoBaseMembers | OverloadResolver.Restrictions.BaseMembersIncluded;
+
+                                       var res = new OverloadResolver (decimal_operators, restr, loc);
+                                       UserOperator = res.ResolveOperator (rc, ref args);
+                               }
                        }
 
                        type = Binary.Type;
index fbb060f52960da9af8218171c9cf6991e8b102cc..4f67eb3240f38407e24a36fc3c384b3f60714489 100644 (file)
@@ -1301,7 +1301,7 @@ namespace Mono.CSharp {
                                                // Special case hoisted return value (happens in try/finally scenario)
                                                //
                                                if (ec.TryFinallyUnwind != null) {
-                                                       exit_label = TryFinally.EmitRedirectedReturn (ec, async_body);
+                                                       exit_label = TryFinally.EmitRedirectedReturn (ec, async_body, unwind_protect);
                                                }
 
                                                var async_return = (IAssignMethod)storey.HoistedReturnValue;
@@ -1311,7 +1311,7 @@ namespace Mono.CSharp {
                                                expr.Emit (ec);
 
                                                if (ec.TryFinallyUnwind != null)
-                                                       exit_label = TryFinally.EmitRedirectedReturn (ec, async_body);
+                                                       exit_label = TryFinally.EmitRedirectedReturn (ec, async_body, unwind_protect);
                                        }
 
                                        ec.Emit (OpCodes.Leave, exit_label);
@@ -1460,7 +1460,7 @@ namespace Mono.CSharp {
 
                        if (ec.TryFinallyUnwind != null && IsLeavingFinally (label.Block)) {
                                var async_body = (AsyncInitializer) ec.CurrentAnonymousMethod;
-                               l = TryFinally.EmitRedirectedJump (ec, async_body, l, label.Block);
+                               l = TryFinally.EmitRedirectedJump (ec, async_body, l, label.Block, unwind_protect);
                        }
 
                        ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l);
@@ -1867,7 +1867,7 @@ namespace Mono.CSharp {
 
                        if (ec.TryFinallyUnwind != null) {
                                var async_body = (AsyncInitializer) ec.CurrentAnonymousMethod;
-                               l = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block);
+                               l = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block, unwind_protect);
                        }
 
                        ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l);
@@ -1915,7 +1915,7 @@ namespace Mono.CSharp {
 
                        if (ec.TryFinallyUnwind != null) {
                                var async_body = (AsyncInitializer) ec.CurrentAnonymousMethod;
-                               l = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block);
+                               l = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block, unwind_protect);
                        }
 
                        ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l);
@@ -6997,7 +6997,7 @@ namespace Mono.CSharp {
        {
                ExplicitBlock fini;
                List<DefiniteAssignmentBitSet> try_exit_dat;
-               List<Label> redirected_jumps;
+               List<Tuple<Label, bool>> redirected_jumps;
                Label? start_fin_label;
 
                public TryFinally (Statement stmt, ExplicitBlock fini, Location loc)
@@ -7123,7 +7123,7 @@ namespace Mono.CSharp {
                        return false;
                }
 
-               public static Label EmitRedirectedJump (EmitContext ec, AsyncInitializer initializer, Label label, Block labelBlock)
+               public static Label EmitRedirectedJump (EmitContext ec, AsyncInitializer initializer, Label label, Block labelBlock, bool unwindProtect)
                {
                        int idx;
                        if (labelBlock != null) {
@@ -7143,7 +7143,7 @@ namespace Mono.CSharp {
                                if (labelBlock != null && !fin.IsParentBlock (labelBlock))
                                        break;
 
-                               fin.EmitRedirectedExit (ec, label, initializer, set_return_state);
+                               fin.EmitRedirectedExit (ec, label, initializer, set_return_state, unwindProtect);
                                set_return_state = false;
 
                                if (fin.start_fin_label == null) {
@@ -7156,26 +7156,26 @@ namespace Mono.CSharp {
                        return label;
                }
 
-               public static Label EmitRedirectedReturn (EmitContext ec, AsyncInitializer initializer)
+               public static Label EmitRedirectedReturn (EmitContext ec, AsyncInitializer initializer, bool unwindProtect)
                {
-                       return EmitRedirectedJump (ec, initializer, initializer.BodyEnd, null);
+                       return EmitRedirectedJump (ec, initializer, initializer.BodyEnd, null, unwindProtect);
                }
 
-               void EmitRedirectedExit (EmitContext ec, Label label, AsyncInitializer initializer, bool setReturnState)
+               void EmitRedirectedExit (EmitContext ec, Label label, AsyncInitializer initializer, bool setReturnState, bool unwindProtect)
                {
                        if (redirected_jumps == null) {
-                               redirected_jumps = new List<Label> ();
+                               redirected_jumps = new List<Tuple<Label, bool>> ();
 
                                // Add fallthrough label
-                               redirected_jumps.Add (ec.DefineLabel ());
+                               redirected_jumps.Add (Tuple.Create (ec.DefineLabel (), false));
 
                                if (setReturnState)
                                        initializer.HoistedReturnState = ec.GetTemporaryField (ec.Module.Compiler.BuiltinTypes.Int, true);
                        }
 
-                       int index = redirected_jumps.IndexOf (label);
+                       int index = redirected_jumps.FindIndex (l => l.Item1 == label);
                        if (index < 0) {
-                               redirected_jumps.Add (label);
+                               redirected_jumps.Add (Tuple.Create (label, unwindProtect));
                                index = redirected_jumps.Count - 1;
                        }
 
@@ -7199,10 +7199,34 @@ namespace Mono.CSharp {
 
                        var initializer = (AsyncInitializer)ec.CurrentAnonymousMethod;
                        initializer.HoistedReturnState.EmitLoad (ec);
-                       ec.Emit (OpCodes.Switch, redirected_jumps.ToArray ());
+
+                       var jumps_table = new Label [redirected_jumps.Count];
+                       List<Tuple<Label, Label>> leave_redirect = null;
+                       for (int i = 0; i < jumps_table.Length; ++i) {
+                               var val = redirected_jumps [i];
+
+                               if (val.Item2) {
+                                       if (leave_redirect == null)
+                                               leave_redirect = new List<Tuple<Label, Label>> ();
+                                       var label = ec.DefineLabel ();
+                                       leave_redirect.Add (Tuple.Create (label, val.Item1));
+                                       jumps_table [i] = label;
+                               } else {
+                                       jumps_table [i] = val.Item1;
+                               }
+                       }
+
+                       ec.Emit (OpCodes.Switch, jumps_table);
+
+                       if (leave_redirect != null) {
+                               foreach (var entry in leave_redirect) {
+                                       ec.MarkLabel (entry.Item1);
+                                       ec.Emit (OpCodes.Leave, entry.Item2);
+                               }
+                       }
 
                        // Mark fallthrough label
-                       ec.MarkLabel (redirected_jumps [0]);
+                       ec.MarkLabel (jumps_table [0]);
                }
 
                protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
index f09a598caf316290ea4852c5ab69334206dd0981..e0dfde276fba9a93e35fabefc6859b9e9f16b459 100644 (file)
@@ -207,11 +207,14 @@ class Tester : DynamicObjectMock
                }
        }
 
-       static FieldInfo flags = typeof (CSharpArgumentInfo).GetField ("flags", BindingFlags.NonPublic | BindingFlags.Instance);
+       static PropertyInfo flags = typeof (CSharpArgumentInfo).GetProperty ("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
 
        static void AssertArgument (CallSiteBinder obj, CSharpArgumentInfo[] expected, string name)
        {
-               var ai = obj.GetType ().GetField ("argumentInfo", BindingFlags.NonPublic | BindingFlags.Instance);
+               var ai = obj.GetType ().GetField ("_argumentInfo", BindingFlags.NonPublic | BindingFlags.Instance);
+               if (ai == null)
+                       throw new ApplicationException ("Could not find 'argumentInfo' private field on " + obj.GetType ());
+
                IList<CSharpArgumentInfo> values = (IList<CSharpArgumentInfo>) ai.GetValue (obj);
                if (values.Count != expected.Length)
                        throw new ApplicationException (name + ": Array length does not match " + values.Count + " != " + expected.Length);
index 42433a3e9cdb64e7a0656020c14bcc1c20e131b4..9039c1f09002342be383d112e1e43f964ffee5c7 100644 (file)
@@ -66,7 +66,7 @@ public class Test
 
                if (Disposable.Counter != 1)
                        return false;
-
+/*
                try {
                        using (dynamic u = new Disposable ()) {
                                u.VV ();
@@ -79,7 +79,7 @@ public class Test
                using (dynamic u = new Disposable ()) {
                        u.Test ();
                }
-
+*/
                return true;
        }
 
index f64fdc0b53c2afa1e247eaee8f0739dd7615ab60..c01a0fae71b21f738ea359eb178e8072826c8707 100644 (file)
@@ -40,6 +40,7 @@ public class Test
                a[4] ^= b;
                
                dynamic d = 1;
+/*
                b = byte.MaxValue;
                try {
                        checked {
@@ -50,7 +51,7 @@ public class Test
                }
                        
                b += d;
-               
+*/
                try {
                        checked {
                                a.Byte += 100;
index a7ee0ef60afa5ad270ba610721609ccbac0c1da4..2cba37f3e8f32417a72aef55721f2934eac6f0ff 100644 (file)
@@ -23,7 +23,7 @@ class Tester
                        () => {
                                dynamic d = 1;
                                d ();
-                       }, "Cannot invoke a non-delegate type `int'");
+                       }, "Cannot invoke a non-delegate type");
        }
        
        void Using_1 ()
@@ -31,7 +31,7 @@ class Tester
                AssertError (
                        () => {
                                using (dynamic d = 1) { }
-                       }, "Cannot implicitly convert type `int' to `System.IDisposable'");
+                       }, "Cannot implicitly convert type 'int' to 'System.IDisposable'");
        }
        
        void Unsafe_1 ()
@@ -39,7 +39,7 @@ class Tester
                dynamic d = 1;
                AssertError (
                        () => Helper.Foo (d),
-                       "Pointers and fixed size buffers cannot be used in a dynamic context");
+                       "Dynamic calls cannot be used in conjunction with pointers");
        }
        
        void NullableConversion ()
@@ -50,7 +50,7 @@ class Tester
                                dynamic b = false;
                                byte? b2 = null;
                                b &= b2;
-                       }, "Operator `&=' cannot be applied to operands of type `bool' and `byte?'");
+                       }, "Operator '&=' cannot be applied to operands of type 'bool' and 'byte?'");
        }
        
 #pragma warning restore 169
index 58578fe3b50ab5351a159c1babe4262593ee6f06..b0c186b8ebe77a5c871e1dfd9b773c1f6fdaae82 100644 (file)
@@ -34,7 +34,7 @@ public class Test
                        d.Foo ();
                        return 1;
                } catch (RuntimeBinderException e) {
-                       if (e.Message != "`A.N.Foo()' is inaccessible due to its protection level")
+                       if (e.Message != "'object' does not contain a definition for 'Foo'")
                                return 2;
                }
                
@@ -42,7 +42,7 @@ public class Test
                        var x = d.Property;
                        return 3;
                } catch (RuntimeBinderException e) {
-                       if (e.Message != "`A.N.Property.get' is inaccessible due to its protection level")
+                       if (e.Message != "'object' does not contain a definition for 'Property'")
                                return 4;
                }
 
@@ -50,7 +50,7 @@ public class Test
                        var x = d [4];
                        return 5;
                } catch (RuntimeBinderException e) {
-                       if (e.Message != "`A.N.this[int]' is inaccessible due to its protection level")
+                       if (e.Message != "Cannot apply indexing with [] to an expression of type 'object'")
                                return 6;
                }
 
index dea56ec61efc0932d51eec86219ad44962a3a50d..0417292753ed3c6a6e02347766d9b00bf04465a2 100644 (file)
@@ -19,7 +19,7 @@ public class Test
                try {
                        getter.Target (getter, new C ());
                } catch (RuntimeBinderException e) {
-                       if (e.Message == "`C' does not contain a definition for `n'")
+                       if (e.Message == "'C' does not contain a definition for 'n'")
                                return 0;
 
                        return 2;
index b08555808a2011b40f1a1dbea436fab9e9154e93..cd610bf123ae74ffa87f4150ad8b7a2c4d5476ad 100644 (file)
@@ -16,7 +16,7 @@ public class Test
                        d.Value = (object)"value";
                        return 1;
                } catch (RuntimeBinderException e) {
-                       if (e.Message != "Cannot implicitly convert type `object' to `string'. An explicit conversion exists (are you missing a cast?)")
+                       if (e.Message != "Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)")
                                return 2;
                }
                
diff --git a/mcs/tests/gtest-644.cs b/mcs/tests/gtest-644.cs
new file mode 100644 (file)
index 0000000..609f879
--- /dev/null
@@ -0,0 +1,29 @@
+using System;
+
+public struct MoneyValue
+{
+       private readonly decimal _amount;
+
+       public MoneyValue (decimal amount)
+       {
+               _amount = amount;
+       }
+
+       public static implicit operator decimal (MoneyValue moneyValue)
+       {
+               return moneyValue._amount;
+       }
+}
+
+public class Program
+{
+       static void Main ()
+       {
+               var nullMoneyValue = (MoneyValue?) null;
+               var moneyValue = new MoneyValue (123);
+
+               var crashApplication = nullMoneyValue < moneyValue; 
+
+               Console.WriteLine("All OK");
+       }
+}
diff --git a/mcs/tests/gtest-645-lib.cs b/mcs/tests/gtest-645-lib.cs
new file mode 100644 (file)
index 0000000..24c31d7
--- /dev/null
@@ -0,0 +1,10 @@
+// Compiler options: -target:library
+
+namespace SeparateAssembly
+{
+       public interface IGenericAction<T1, T2>
+       {
+               void AddAction(IGenericAction<T1, T2> action);
+               void AddAction(IGenericAction<T2, T1> action);
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/gtest-645.cs b/mcs/tests/gtest-645.cs
new file mode 100644 (file)
index 0000000..5ed87ba
--- /dev/null
@@ -0,0 +1,17 @@
+// Compiler options: -r:gtest-645-lib.dll
+
+using System;
+using SeparateAssembly;
+
+class Program
+{
+       public static void Main()
+       {
+       }
+
+       public static void AddChildButton<T1, T2>(IGenericAction<T1, T2> action)
+       {
+               IGenericAction<T2, T1> childAction = null;
+               action.AddAction (childAction);
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-anon-178.cs b/mcs/tests/test-anon-178.cs
new file mode 100644 (file)
index 0000000..278bdbe
--- /dev/null
@@ -0,0 +1,31 @@
+using System;
+
+public abstract class BaseClass<T>
+{
+}
+
+public class DerivedClass : BaseClass<int>
+{
+}
+
+public abstract class CA
+{
+       [Obsolete]
+       public virtual void Foo<T, U> (U args) where T : BaseClass<U>, new()
+       {
+       }
+}
+
+public class CB : CA
+{
+       public CB ()
+       {
+               int x = 4;
+               Action<int> pp = r => base.Foo<DerivedClass, int> (x);
+       }
+
+       public static void Main ()
+       {
+               new CB ();
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-async-90.cs b/mcs/tests/test-async-90.cs
new file mode 100644 (file)
index 0000000..8b1adc6
--- /dev/null
@@ -0,0 +1,35 @@
+using System.Threading.Tasks;
+
+static class Y
+{
+    public static string ExCall (this X x)
+    {
+        return null;
+    }
+}
+
+class X
+{
+    static X Test (object o)
+    {
+        return null;
+    }
+
+    X Prop { get; set;}
+
+    X Call ()
+    {
+        return null;
+    }
+
+    public static void Main ()
+    {
+        var x = new X ();
+        x.Test ().Wait ();
+    }
+
+    async Task Test ()
+    {
+        var x = X.Test (await Task.FromResult (1))?.Prop?.ExCall ();
+    }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-async-91.cs b/mcs/tests/test-async-91.cs
new file mode 100644 (file)
index 0000000..405da3c
--- /dev/null
@@ -0,0 +1,38 @@
+using System;
+using System.Threading.Tasks;
+
+class C : IDisposable
+{
+       public void Dispose ()
+       {
+               Console.WriteLine ("Disposed");
+               TestClass.Passed++;
+       }
+}
+
+public class TestClass
+{
+       public static int Passed;
+
+       public static async Task Test ()
+       {
+               using (var device_resource = new C ()) {
+                       try {
+                               Console.WriteLine ("aa");
+                               return;
+                       } finally {
+                               await Task.Delay (0);
+                       }
+               }
+       }
+
+       public static int Main()
+       {
+               Test ().Wait ();
+               if (Passed != 1)
+                       return 1;
+
+               Console.WriteLine ("PASSED");
+               return 0;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-null-operator-24.cs b/mcs/tests/test-null-operator-24.cs
new file mode 100644 (file)
index 0000000..77ce5d9
--- /dev/null
@@ -0,0 +1,19 @@
+using System;
+class X
+{
+       public int Field { get; set; }
+
+       public int F3 { get; set; }
+}
+
+class App
+{
+       static void Main()
+       {
+               string s = null;
+               var x = new X {
+                       Field = s?.ToString () == null ? 1 : 2
+               }.F3;
+       }
+}
\ No newline at end of file
index 0cec93cb80a1aa8d524cde9a05381e968d548462..661f426ec6adcfa6daa8dc88c1f6c96edbb2f634 100644 (file)
         <size>99</size>
       </method>
       <method name="Void AssertArgument(System.Runtime.CompilerServices.CallSiteBinder, Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo[], System.String)" attrs="145">
-        <size>172</size>
+        <size>206</size>
       </method>
       <method name="Void BinaryAdd_1(System.Object, DynamicObjectMock)" attrs="129">
         <size>124</size>
         <size>235</size>
       </method>
       <method name="Boolean UsingTest()" attrs="129">
-        <size>619</size>
+        <size>222</size>
       </method>
       <method name="Int32 Main()" attrs="150">
         <size>99</size>
         <size>2</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>3609</size>
+        <size>3273</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>39</size>
       </method>
     </type>
   </test>
+  <test name="gtest-644.cs">
+    <type name="MoneyValue">
+      <method name="System.Decimal op_Implicit(MoneyValue)" attrs="2198">
+        <size>16</size>
+      </method>
+      <method name="Void .ctor(Decimal)" attrs="6278">
+        <size>9</size>
+      </method>
+    </type>
+    <type name="Program">
+      <method name="Void Main()" attrs="145">
+        <size>75</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
+  <test name="gtest-645.cs">
+    <type name="Program">
+      <method name="Void Main()" attrs="150">
+        <size>2</size>
+      </method>
+      <method name="Void AddChildButton[T1,T2](SeparateAssembly.IGenericAction`2[T1,T2])" attrs="150">
+        <size>11</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">
       </method>
     </type>
   </test>
+  <test name="test-anon-178.cs">
+    <type name="BaseClass`1[T]">
+      <method name="Void .ctor()" attrs="6276">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="DerivedClass">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="CA">
+      <method name="Void Foo[T,U](U)" attrs="454">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6276">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="CB">
+      <method name="Void Main()" attrs="150">
+        <size>8</size>
+      </method>
+      <method name="Void &lt;Foo&gt;__BaseCallProxy0[T,U](U)" attrs="129">
+        <size>8</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>41</size>
+      </method>
+    </type>
+    <type name="CB+&lt;CB&gt;c__AnonStorey0">
+      <method name="Void &lt;&gt;m__0(Int32)" attrs="131">
+        <size>18</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-anon-18.cs">
     <type name="A">
       <method name="Void Invoke()" attrs="454">
     </type>
     <type name="Test+&lt;TestFinallyWithReturn&gt;c__async1">
       <method name="Void MoveNext()" attrs="486">
-        <size>377</size>
+        <size>382</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;TestFinallyWithReturnNoValue&gt;c__async2">
       <method name="Void MoveNext()" attrs="486">
-        <size>347</size>
+        <size>352</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;TestFinallyWithGoto&gt;c__async3">
       <method name="Void MoveNext()" attrs="486">
-        <size>370</size>
+        <size>375</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;TestFinallyWithGotoAndReturn&gt;c__async4">
       <method name="Void MoveNext()" attrs="486">
-        <size>407</size>
+        <size>417</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;TestNestedReturn&gt;c__async1">
       <method name="Void MoveNext()" attrs="486">
-        <size>845</size>
+        <size>855</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;TestNestedGoto&gt;c__async2">
       <method name="Void MoveNext()" attrs="486">
-        <size>848</size>
+        <size>858</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;BreakTest&gt;c__async1">
       <method name="Void MoveNext()" attrs="486">
-        <size>898</size>
+        <size>903</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="Test+&lt;ContinueTest&gt;c__async2">
       <method name="Void MoveNext()" attrs="486">
-        <size>898</size>
+        <size>903</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
     </type>
     <type name="X+&lt;Test&gt;c__async0">
       <method name="Void MoveNext()" attrs="486">
-        <size>269</size>
+        <size>274</size>
       </method>
       <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
         <size>13</size>
       </method>
     </type>
   </test>
+  <test name="test-async-90.cs">
+    <type name="Y">
+      <method name="System.String ExCall(X)" attrs="150">
+        <size>10</size>
+      </method>
+    </type>
+    <type name="X">
+      <method name="X Test(System.Object)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="X get_Prop()" attrs="2177">
+        <size>14</size>
+      </method>
+      <method name="Void set_Prop(X)" attrs="2177">
+        <size>8</size>
+      </method>
+      <method name="X Call()" attrs="129">
+        <size>10</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>19</size>
+      </method>
+      <method name="System.Threading.Tasks.Task Test()" attrs="129">
+        <size>33</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="X+&lt;Test&gt;c__async0">
+      <method name="Void MoveNext()" attrs="486">
+        <size>290</size>
+      </method>
+      <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
+        <size>13</size>
+      </method>
+    </type>
+  </test>
+  <test name="test-async-91.cs">
+    <type name="C">
+      <method name="Void Dispose()" attrs="486">
+        <size>24</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="TestClass">
+      <method name="System.Threading.Tasks.Task Test()" attrs="150">
+        <size>33</size>
+      </method>
+      <method name="Int32 Main()" attrs="150">
+        <size>48</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="TestClass+&lt;Test&gt;c__async0">
+      <method name="Void MoveNext()" attrs="486">
+        <size>309</size>
+      </method>
+      <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
+        <size>13</size>
+      </method>
+    </type>
+  </test>
   <test name="test-cls-00.cs">
     <type name="CLSCLass_6">
       <method name="Void add_Disposed(Delegate)" attrs="2182">
       </method>
     </type>
   </test>
+  <test name="test-null-operator-24.cs">
+    <type name="X">
+      <method name="Int32 get_Field()" attrs="2182">
+        <size>14</size>
+      </method>
+      <method name="Void set_Field(Int32)" attrs="2182">
+        <size>8</size>
+      </method>
+      <method name="Int32 get_F3()" attrs="2182">
+        <size>14</size>
+      </method>
+      <method name="Void set_F3(Int32)" attrs="2182">
+        <size>8</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="App">
+      <method name="Void Main()" attrs="145">
+        <size>50</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-partial-01.cs">
     <type name="Foo.Hello">
       <method name="Void .ctor()" attrs="6278">
index a6708e2d371e1245bcce89b70772e3ff57ebf7ae..aad8dad1b09486403dbd338ac9b968e89b6f6bab 100644 (file)
@@ -7,4 +7,8 @@ NO_INSTALL = yes
 
 LIB_REFS = System Mono.Cecil
 
+ifdef MCS_MODE
+LIB_REFS += Mono.Cecil.Mdb
+endif
+
 include ../../build/executable.make
index 81da9380e8a6ce2ed8c2f8041af20d460c97833c..3226b3911d9b291093cc8d100a871014dc7f016a 100644 (file)
@@ -100,17 +100,12 @@ public class Program
 
        static void RewriteAssembly (string assemblyLocation, Dictionary<string, string> resourcesStrings, CmdOptions options)
        {
-               var debugSymbols = Path.ChangeExtension (assemblyLocation, "pdb");
-               var useDebugSymbols = File.Exists (debugSymbols);
-
                var readerParameters = new ReaderParameters {
+                       ReadSymbols = true,
                        ReadWrite = true,
+                       SymbolReaderProvider = new DefaultSymbolReaderProvider (false)
                };
 
-               if (useDebugSymbols) {
-                       readerParameters.SymbolReaderProvider = new PortablePdbReaderProvider ();
-               }
-
                using (var assembly = AssemblyDefinition.ReadAssembly (assemblyLocation, readerParameters)) {
                        foreach (var module in assembly.Modules) {
                                foreach (var type in module.GetTypes ()) {
@@ -135,11 +130,9 @@ public class Program
                                }
                        }
 
-                       var writerParameters = new WriterParameters ();
-
-                       if (useDebugSymbols) {
-                               writerParameters.SymbolWriterProvider = new PortablePdbWriterProvider ();
-                       }
+                       var writerParameters = new WriterParameters () {
+                               WriteSymbols = assembly.MainModule.HasSymbols
+                       };
 
                        assembly.Write (writerParameters);
                }
index 31764d0efac7e6113a3689c233918c2aed052786..a92e407162ad6077daff692cbe4323b33ee4a675 100644 (file)
 
                <type fullname="System.Collections.Generic.ICollection`1" />
                <type fullname="System.Collections.Generic.IEnumerable`1" />
+               <type fullname="System.Collections.Generic.IEnumerator`1" />
+               <type fullname="System.Collections.Generic.IReadOnlyList`1" />
+               <type fullname="System.Collections.Generic.IReadOnlyCollection`1" />
+
                <type fullname="System.Collections.Generic.IList`1" />
                <type fullname="System.Collections.Generic.GenericEqualityComparer`1">
                        <method name=".ctor" />
index 95441c17b621db63c163c7824c2cdb934330d6ff..44e49261a6ce85926b61641d19ac55a4a5929f21 100644 (file)
     <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbWriter.cs" />\r
     <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\*.cs" />\r
     <Compile Include="..\..\..\external\cecil\symbols\pdb\Microsoft.Cci.Pdb\*.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\ISymUnmanagedDocumentWriter.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\ISymUnmanagedWriter2.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\ModuleMetadata.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\PdbHelper.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\PdbReader.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\PdbWriter.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\SymDocumentWriter.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\SymWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\*.cs" />\r
     <Compile Include="..\..\..\external\cecil\System.Security.Cryptography\*.cs" />\r
     <Compile Include="..\..\class\Mono.Options\Mono.Options\Options.cs" />\r
     <Compile Include="LocationProvider.cs" />\r
index da336168f902e41e14155acdcacc879b9043d180..8e08e43950dd8ae2420e6e93d4fee0b1422eddd4 100644 (file)
@@ -100,11 +100,4 @@ Logger.cs
 ../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs
 ../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/*.cs
 ../../../external/cecil/symbols/pdb/Microsoft.Cci.Pdb/*.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedDocumentWriter.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedWriter2.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/ModuleMetadata.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/PdbHelper.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/PdbReader.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/PdbWriter.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs
-../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/*.cs
index e4bfbb4d315122fddfa2005af3bfcc6458b5a0d5..be162957fa8c89c05a1fbde7648dae543f5cb1f2 100644 (file)
@@ -40,6 +40,7 @@ install-local: $(SECURITY_TARGETS)
        for p in $(SECURITY_TARGETS) ; do \
            $(INSTALL_BIN) $$p $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
            test ! -f $$p.mdb || $(INSTALL_BIN) $$p.mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
+           test ! -f $${p%.exe}.pdb || $(INSTALL_BIN) $${p%.exe}.pdb $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
        done
 
 uninstall-local:
index e34909337b00f2c6a4448f1d29fc5d8084d52af0..3fe5475097d1c05a094dc63ac97b30a1becf3fa4 100644 (file)
@@ -55,16 +55,8 @@ namespace Mono.XBuild.CommandLine {
                // this does nothing but adds strong reference to Microsoft.Build.Tasks*.dll that we need to load consistently.
                Microsoft.Build.Tasks.Copy dummy;
 #pragma warning restore
-
                public static void Main (string[] args)
                {
-                       Console.ForegroundColor = ConsoleColor.DarkRed;
-                       Console.WriteLine ();
-                       Console.WriteLine (">>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<");
-                       Console.WriteLine ();
-                       Console.ResetColor ();
-
-
                        MainClass mc = new MainClass ();
                        mc.args = args;
                        mc.Execute ();
@@ -83,12 +75,20 @@ namespace Mono.XBuild.CommandLine {
                        bool show_stacktrace = false;
                        
                        try {
-                               parameters.ParseArguments (args);
+                               try {
+                                       parameters.ParseArguments (args);
+                               } catch {
+                                       ShowDeprecationNotice ();
+                                       throw;
+                               }
+
                                show_stacktrace = (parameters.LoggerVerbosity == LoggerVerbosity.Detailed ||
                                        parameters.LoggerVerbosity == LoggerVerbosity.Diagnostic);
                                
-                               if (!parameters.NoLogo)
+                               if (!parameters.NoLogo) {
+                                       ShowDeprecationNotice ();
                                        ErrorUtilities.ShowVersion (false);
+                               }
                                
                                engine  = Engine.GlobalEngine;
                                if (!String.IsNullOrEmpty (parameters.ToolsVersion)) {
@@ -173,6 +173,15 @@ namespace Mono.XBuild.CommandLine {
                        }
 
                }
+
+               void ShowDeprecationNotice ()
+               {
+                       Console.ForegroundColor = ConsoleColor.DarkRed;
+                       Console.WriteLine ();
+                       Console.WriteLine (">>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<");
+                       Console.WriteLine ();
+                       Console.ResetColor ();
+               }
        }
 
        // code from mcs/report.cs
index 819ce65616e9a93d8628e0b5a39c55ce0b0a06de..312c66a115669aaeee76b7b2e89e36a648c2b07b 100644 (file)
@@ -268,7 +268,7 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT
        MonoAppDomain *ad;
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_portability_helpers_init ();
        
@@ -393,7 +393,7 @@ mono_context_init_checked (MonoDomain *domain, MonoError *error)
        MonoClass *klass;
        MonoAppContext *context;
 
-       mono_error_init (error);
+       error_init (error);
 
        klass = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
        context = (MonoAppContext *) mono_object_new_pinned (domain, klass, error);
@@ -478,7 +478,7 @@ MonoDomain *
 mono_domain_create_appdomain_checked (char *friendly_name, char *configuration_file, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *result = NULL;
 
        MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
@@ -531,7 +531,7 @@ copy_app_domain_setup (MonoDomain *domain, MonoAppDomainSetupHandle setup, MonoE
        MonoClass *ads_class;
        MonoAppDomainSetupHandle result = MONO_HANDLE_NEW (MonoAppDomainSetup, NULL);
 
-       mono_error_init (error);
+       error_init (error);
 
        caller_domain = mono_domain_get ();
        ads_class = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
@@ -595,7 +595,7 @@ mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetupHa
        MonoClass *adclass;
        MonoDomain *data;
 
-       mono_error_init (error);
+       error_init (error);
 
        adclass = mono_class_get_appdomain_class ();
 
@@ -717,7 +717,7 @@ mono_domain_try_type_resolve_checked (MonoDomain *domain, char *name, MonoObject
        MonoReflectionAssembly *ret;
        void *params [1];
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (domain != NULL && ((name != NULL) || (tb != NULL)));
 
@@ -782,7 +782,7 @@ mono_domain_set (MonoDomain *domain, gboolean force)
 MonoObjectHandle
 ves_icall_System_AppDomain_GetData (MonoAppDomainHandle ad, MonoStringHandle name, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        if (MONO_HANDLE_IS_NULL (name)) {
                mono_error_set_argument_null (error, "name", "");
@@ -830,7 +830,7 @@ ves_icall_System_AppDomain_GetData (MonoAppDomainHandle ad, MonoStringHandle nam
 void
 ves_icall_System_AppDomain_SetData (MonoAppDomainHandle ad, MonoStringHandle name, MonoObjectHandle data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        if (MONO_HANDLE_IS_NULL (name)) {
                mono_error_set_argument_null (error, "name", "");
@@ -851,7 +851,7 @@ ves_icall_System_AppDomain_SetData (MonoAppDomainHandle ad, MonoStringHandle nam
 MonoAppDomainSetupHandle
 ves_icall_System_AppDomain_getSetup (MonoAppDomainHandle ad, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        g_assert (!MONO_HANDLE_IS_NULL (ad));
        MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data);
        g_assert (domain);
@@ -862,7 +862,7 @@ ves_icall_System_AppDomain_getSetup (MonoAppDomainHandle ad, MonoError *error)
 MonoStringHandle
 ves_icall_System_AppDomain_getFriendlyName (MonoAppDomainHandle ad, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        g_assert (!MONO_HANDLE_IS_NULL (ad));
        MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data);
        g_assert (domain);
@@ -873,7 +873,7 @@ ves_icall_System_AppDomain_getFriendlyName (MonoAppDomainHandle ad, MonoError *e
 MonoAppDomainHandle
 ves_icall_System_AppDomain_getCurDomain (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *add = mono_domain_get ();
 
        return MONO_HANDLE_NEW (MonoAppDomain, add->domain);
@@ -882,7 +882,7 @@ ves_icall_System_AppDomain_getCurDomain (MonoError *error)
 MonoAppDomainHandle
 ves_icall_System_AppDomain_getRootDomain (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *root = mono_get_root_domain ();
 
        return MONO_HANDLE_NEW (MonoAppDomain, root->domain);
@@ -1038,7 +1038,7 @@ mono_domain_set_options_from_config (MonoDomain *domain)
 MonoAppDomainHandle
 ves_icall_System_AppDomain_createDomain (MonoStringHandle friendly_name, MonoAppDomainSetupHandle setup, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoAppDomainHandle ad = MONO_HANDLE_NEW (MonoAppDomain, NULL);
 
 #ifdef DISABLE_APPDOMAINS
@@ -1058,7 +1058,7 @@ static gboolean
 add_assembly_to_array (MonoDomain *domain, MonoArrayHandle dest, int dest_idx, MonoAssembly* assm, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionAssemblyHandle assm_obj = mono_assembly_get_object_handle (domain, assm, error);
        if (!is_ok (error))
                goto leave;
@@ -1070,7 +1070,7 @@ leave:
 MonoArrayHandle
 ves_icall_System_AppDomain_GetAssemblies (MonoAppDomainHandle ad, MonoBoolean refonly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data);
        MonoAssembly* ass;
        GSList *tmp;
@@ -1111,7 +1111,7 @@ MonoAssembly*
 mono_try_assembly_resolve (MonoDomain *domain, const char *fname_raw, MonoAssembly *requesting, gboolean refonly, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoAssembly *result = NULL;
        MonoStringHandle fname = mono_string_new_handle (domain, fname_raw, error);
        if (!is_ok (error))
@@ -1129,7 +1129,7 @@ mono_try_assembly_resolve_handle (MonoDomain *domain, MonoStringHandle fname, Mo
        MonoBoolean isrefonly;
        gpointer params [3];
 
-       mono_error_init (error);
+       error_init (error);
 
        if (mono_runtime_get_no_exec ())
                return ret;
@@ -1455,7 +1455,7 @@ mono_is_shadow_copy_enabled (MonoDomain *domain, const gchar *dir_name)
 char *
 mono_make_shadow_copy (const char *filename, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return (char *) filename;
 }
 #else
@@ -1530,7 +1530,7 @@ get_shadow_assembly_location_base (MonoDomain *domain, MonoError *error)
        char *userdir;
        char *location;
 
-       mono_error_init (error);
+       error_init (error);
        
        setup = domain->setup;
        if (setup->cache_path != NULL && setup->application_name != NULL) {
@@ -1574,7 +1574,7 @@ get_shadow_assembly_location (const char *filename, MonoError *error)
        char *location, *tmploc;
        MonoDomain *domain = mono_domain_get ();
 
-       mono_error_init (error);
+       error_init (error);
        
        hash = get_cstring_hash (bname);
        hash2 = get_cstring_hash (dirname);
@@ -1759,7 +1759,7 @@ mono_make_shadow_copy (const char *filename, MonoError *oerror)
        char *shadow_dir;
        gint32 copy_error;
 
-       mono_error_init (oerror);
+       error_init (oerror);
 
        set_domain_search_path (domain);
 
@@ -2036,7 +2036,7 @@ mono_domain_assembly_search (MonoAssemblyName *aname,
 MonoReflectionAssemblyHandle
 ves_icall_System_Reflection_Assembly_LoadFrom (MonoStringHandle fname, MonoBoolean refOnly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get ();
        char *name, *filename;
        MonoImageOpenStatus status = MONO_IMAGE_OK;
@@ -2078,7 +2078,7 @@ ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomainHandle ad,
                                            MonoBoolean refonly,
                                            MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoAssembly *ass;
        MonoReflectionAssemblyHandle refass = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE);
        MonoDomain *domain = MONO_HANDLE_GETVAL(ad, data);
@@ -2130,7 +2130,7 @@ ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomainHandle ad,
 MonoReflectionAssemblyHandle
 ves_icall_System_AppDomain_LoadAssembly (MonoAppDomainHandle ad, MonoStringHandle assRef, MonoObjectHandle evidence, MonoBoolean refOnly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data);
        MonoImageOpenStatus status = MONO_IMAGE_OK;
        MonoAssembly *ass;
@@ -2191,7 +2191,7 @@ fail:
 void
 ves_icall_System_AppDomain_InternalUnload (gint32 domain_id, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain * domain = mono_domain_get_by_id (domain_id);
 
        if (NULL == domain) {
@@ -2223,7 +2223,7 @@ ves_icall_System_AppDomain_InternalUnload (gint32 domain_id, MonoError *error)
 gboolean
 ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get_by_id (domain_id);
 
        if (!domain)
@@ -2243,7 +2243,7 @@ ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomainHandle ad,
                                            MonoReflectionAssemblyHandle refass, MonoArrayHandle args,
                                            MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoImage *image;
        MonoMethod *method;
 
@@ -2276,7 +2276,7 @@ ves_icall_System_AppDomain_GetIDFromDomain (MonoAppDomain * ad)
 MonoAppDomainHandle
 ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomainHandle ad, MonoError* error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *old_domain = mono_domain_get ();
 
        if (!mono_domain_set (MONO_HANDLE_GETVAL (ad, data), FALSE)) {
@@ -2304,14 +2304,14 @@ ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid, MonoError *er
 void
 ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomainHandle ad, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        mono_thread_push_appdomain_ref (MONO_HANDLE_GETVAL (ad, data));
 }
 
 void
 ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get_by_id (domain_id);
 
        if (!domain) {
@@ -2329,7 +2329,7 @@ ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id, MonoErro
 void
 ves_icall_System_AppDomain_InternalPopDomainRef (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        mono_thread_pop_appdomain_ref ();
 }
 
@@ -2358,7 +2358,7 @@ ves_icall_System_AppDomain_InternalSetContext (MonoAppContext *mc)
 MonoStringHandle
 ves_icall_System_AppDomain_InternalGetProcessGuid (MonoStringHandle newguid, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain* mono_root_domain = mono_get_root_domain ();
        mono_domain_lock (mono_root_domain);
        if (process_guid_set) {
index 33300ffe884fa100278bc414205957f47bf19dbb..18ce6c4510a75f21a4762411ff7f387c823c2b03 100644 (file)
@@ -1889,7 +1889,7 @@ has_reference_assembly_attribute_iterator (MonoImage *image, guint32 typeref_sco
 gboolean
 mono_assembly_has_reference_assembly_attribute (MonoAssembly *assembly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        /*
         * This might be called during assembly loading, so do everything using the low-level
@@ -3261,7 +3261,7 @@ static MonoAssembly*
 prevent_reference_assembly_from_running (MonoAssembly* candidate, gboolean refonly)
 {
        MonoError refasm_error;
-       mono_error_init (&refasm_error);
+       error_init (&refasm_error);
        if (candidate && !refonly && mono_assembly_has_reference_assembly_attribute (candidate, &refasm_error)) {
                candidate = NULL;
        }
index c1ebbbb3a96c82970b89eb96caead2ba7e0b46f7..973bfc4ce6431d74176165c4c3e5d0d2a27594ae 100644 (file)
@@ -204,7 +204,7 @@ mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError
        MonoClass *res = NULL;
        MonoImage *module;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_verifier_verify_typeref_row (image, (type_token & 0xffffff) - 1, error))
                return NULL;
@@ -693,7 +693,7 @@ is_valid_generic_argument (MonoType *type)
 static MonoType*
 inflate_generic_type (MonoImage *image, MonoType *type, MonoGenericContext *context, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        switch (type->type) {
        case MONO_TYPE_MVAR: {
@@ -849,7 +849,7 @@ MonoType*
 mono_class_inflate_generic_type_with_mempool (MonoImage *image, MonoType *type, MonoGenericContext *context, MonoError *error)
 {
        MonoType *inflated = NULL;
-       mono_error_init (error);
+       error_init (error);
 
        if (context)
                inflated = inflate_generic_type (image, type, context, error);
@@ -921,7 +921,7 @@ mono_class_inflate_generic_type_no_copy (MonoImage *image, MonoType *type, MonoG
 {
        MonoType *inflated = NULL; 
 
-       mono_error_init (error);
+       error_init (error);
        if (context) {
                inflated = inflate_generic_type (image, type, context, error);
                return_val_if_nok (error, NULL);
@@ -961,7 +961,7 @@ inflate_generic_context (MonoGenericContext *context, MonoGenericContext *inflat
        MonoGenericInst *method_inst = NULL;
        MonoGenericContext res = { NULL, NULL };
 
-       mono_error_init (error);
+       error_init (error);
 
        if (context->class_inst) {
                class_inst = mono_metadata_inflate_generic_inst (context->class_inst, inflate_with, error);
@@ -1033,7 +1033,7 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k
        MonoMethodSignature *sig;
        MonoGenericContext tmp_context;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* The `method' has already been instantiated before => we need to peel out the instantiation and create a new context */
        while (method->is_inflated) {
@@ -1285,7 +1285,7 @@ mono_class_find_enum_basetype (MonoClass *klass, MonoError *error)
 
        g_assert (klass->enumtype);
 
-       mono_error_init (error);
+       error_init (error);
 
        container = mono_class_try_get_generic_container (klass);
        if (mono_class_is_ginst (klass)) {
@@ -1494,7 +1494,7 @@ mono_class_set_type_load_failure_causedby_class (MonoClass *klass, const MonoCla
 {
        if (mono_class_has_failure (caused_by)) {
                MonoError cause_error;
-               mono_error_init (&cause_error);
+               error_init (&cause_error);
                mono_error_set_for_class_failure (&cause_error, caused_by);
                mono_class_set_type_load_failure (klass, "%s, due to: %s", msg, mono_error_get_message (&cause_error));
                mono_error_cleanup (&cause_error);
@@ -1860,7 +1860,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
                                        mono_class_setup_fields (field_class);
                                        if (mono_class_has_failure (field_class)) {
                                                MonoError field_error;
-                                               mono_error_init (&field_error);
+                                               error_init (&field_error);
                                                mono_error_set_for_class_failure (&field_error, field_class);
                                                mono_class_set_type_load_failure (klass, "Could not set up field '%s' due to: %s", field->name, mono_error_get_message (&field_error));
                                                mono_error_cleanup (&field_error);
@@ -2700,7 +2700,7 @@ mono_class_setup_events (MonoClass *klass)
                        MonoEvent *event = &events [i];
                        MonoEvent *gevent = &ginfo->events [i];
 
-                       mono_error_init (&error); //since we do conditional calls, we must ensure the default value is ok
+                       error_init (&error); //since we do conditional calls, we must ensure the default value is ok
 
                        event->parent = klass;
                        event->name = gevent->name;
@@ -5466,7 +5466,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        guint32 field_last, method_last;
        guint32 nesting_tokeen;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (mono_metadata_token_table (type_token) != MONO_TABLE_TYPEDEF || tidx > tt->rows) {
                mono_error_set_bad_image (error, image, "Invalid typedef token %x", type_token);
@@ -6514,7 +6514,7 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
        if (eclass->byval_arg.type == MONO_TYPE_TYPEDBYREF || eclass->byval_arg.type == MONO_TYPE_VOID) {
                /*Arrays of those two types are invalid.*/
                MonoError prepared_error;
-               mono_error_init (&prepared_error);
+               error_init (&prepared_error);
                mono_error_set_invalid_program (&prepared_error, "Arrays of void or System.TypedReference types are invalid.");
                mono_class_set_failure (klass, mono_error_box (&prepared_error, klass->image));
                mono_error_cleanup (&prepared_error);
@@ -7200,7 +7200,7 @@ mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_toke
 {
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
        klass = mono_class_get_checked (image, type_token, error);
 
        if (klass && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
@@ -7221,7 +7221,7 @@ mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error)
 {
        MonoClass *klass = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (image)) {
                int table = mono_metadata_token_table (type_token);
@@ -7277,7 +7277,7 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
        MonoType *type = NULL;
        gboolean inflated = FALSE;
 
-       mono_error_init (error);
+       error_init (error);
 
        //FIXME: this will not fix the very issue for which mono_type_get_full exists -but how to do it then?
        if (image_is_dynamic (image)) {
@@ -7520,7 +7520,7 @@ mono_class_from_name_case_checked (MonoImage *image, const char *name_space, con
        const char *nspace;
        guint32 i, visib;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (image)) {
                guint32 token = 0;
@@ -7602,7 +7602,7 @@ search_modules (MonoImage *image, const char *name_space, const char *name, Mono
        MonoClass *klass;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* 
         * The EXPORTEDTYPES table only contains public types, so have to search the
@@ -7638,7 +7638,7 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
        char *nested;
        char buf [1024];
 
-       mono_error_init (error);
+       error_init (error);
 
        // Checking visited images avoids stack overflows when cyclic references exist.
        if (g_hash_table_lookup (visited_images, image))
@@ -8572,7 +8572,7 @@ gpointer
 mono_ldtoken_checked (MonoImage *image, guint32 token, MonoClass **handle_class,
              MonoGenericContext *context, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (image)) {
                MonoClass *tmp_handle_class;
@@ -8662,7 +8662,7 @@ gpointer
 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context, MonoError *error)
 {
        MonoClass *handle_class;
-       mono_error_init (error);
+       error_init (error);
        return mono_reflection_lookup_dynamic_token (image, token, TRUE, &handle_class, context, error);
 }
 
@@ -9375,7 +9375,7 @@ mono_field_get_type (MonoClassField *field)
 MonoType*
 mono_field_get_type_checked (MonoClassField *field, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (!field->type)
                mono_field_resolve_type (field, error);
        return field->type;
@@ -9784,7 +9784,7 @@ mono_class_set_type_load_failure (MonoClass *klass, const char * fmt, ...)
        if (mono_class_has_failure (klass))
                return FALSE;
        
-       mono_error_init (&prepare_error);
+       error_init (&prepare_error);
        
        va_start (args, fmt);
        mono_error_vset_type_load_class (&prepare_error, klass, fmt, args);
@@ -9859,7 +9859,7 @@ mono_class_get_exception_for_failure (MonoClass *klass)
        if (!mono_class_has_failure (klass))
                return NULL;
        MonoError unboxed_error;
-       mono_error_init (&unboxed_error);
+       error_init (&unboxed_error);
        mono_error_set_for_class_failure (&unboxed_error, klass);
        return mono_error_convert_to_exception (&unboxed_error);
 }
@@ -10407,7 +10407,7 @@ mono_class_setup_interfaces (MonoClass *klass, MonoError *error)
        int i, interface_count;
        MonoClass **interfaces;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (klass->interfaces_inited)
                return;
@@ -10468,7 +10468,7 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
        MonoType *ftype;
        int field_idx = field - klass->fields;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (gtd) {
                MonoClassField *gfield = &gtd->fields [field_idx];
index b587e25fa41615ac04ba133c6c1a74047d200567..b830214e8838eea0f63b3ea4125a41fe65b53a8e 100644 (file)
@@ -517,7 +517,7 @@ cominterop_get_interface_checked (MonoComObject* obj, MonoClass* ic, MonoError *
        g_assert (ic);
        g_assert (MONO_CLASS_IS_INTERFACE (ic));
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_cominterop_lock ();
        if (obj->itf_hash)
@@ -1522,7 +1522,7 @@ static gboolean cominterop_can_support_dispatch (MonoClass* klass)
 static void*
 cominterop_get_idispatch_for_object (MonoObject* object, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (!object)
                return NULL;
 
@@ -1942,7 +1942,7 @@ cominterop_get_ccw_checked (MonoObject* object, MonoClass* itf, MonoError *error
        GList *ccw_list, *ccw_list_item;
        MonoCustomAttrInfo *cinfo = NULL;
 
-       mono_error_init (error);
+       error_init (error);
        
        if (!object)
                return NULL;
@@ -2446,7 +2446,7 @@ static const IID MONO_IID_IMarshal = {0x3, 0x0, 0x0, {0xC0, 0x0, 0x0, 0x0, 0x0,
 static int
 cominterop_ccw_getfreethreadedmarshaler (MonoCCW* ccw, MonoObject* object, gpointer* ppv, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 #ifdef HOST_WIN32
        if (!ccw->free_marshaler) {
                int ret = 0;
@@ -2817,7 +2817,7 @@ mono_string_from_bstr_checked (gpointer bstr, MonoError *error)
 {
        MonoString * res = NULL;
        
-       mono_error_init (error);
+       error_init (error);
 
        if (!bstr)
                return NULL;
@@ -3586,7 +3586,7 @@ MonoString *
 mono_string_from_bstr_checked (gpointer bstr, MonoError *error)
 {
        MonoString *res = NULL;
-       mono_error_init (error);
+       error_init (error);
        if (!bstr)
                return NULL;
 #ifdef HOST_WIN32
index 938ef80b171f844072f7f031150e9fcb2c9d2a72..542bc95ed22e0364b89531c0b705d63dd23b151e 100644 (file)
@@ -16,7 +16,7 @@ MonoBoolean
 ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("Console");
 
@@ -32,7 +32,7 @@ MonoBoolean
 ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean want_echo)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("Console");
 
@@ -48,7 +48,7 @@ MonoBoolean
 ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("Console");
 
@@ -64,7 +64,7 @@ gint32
 ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("Console");
 
@@ -80,7 +80,7 @@ MonoBoolean
 ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardown, MonoArray **control_chars, int **size)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("Console");
 
index 864b846303935d16e0f081507b3ab58052e564ec..889315f06531e409d02ea705a7726a96a9de430e 100644 (file)
@@ -187,7 +187,7 @@ load_cattr_enum_type (MonoImage *image, const char *p, const char **end, MonoErr
        MonoType *t;
        int slen = mono_metadata_decode_value (p, &p);
 
-       mono_error_init (error);
+       error_init (error);
 
        n = (char *)g_memdup (p, slen + 1);
        n [slen] = 0;
@@ -205,7 +205,7 @@ load_cattr_value (MonoImage *image, MonoType *t, const char *p, const char **end
        int slen, type = t->type;
        MonoClass *tklass = t->data.klass;
 
-       mono_error_init (error);
+       error_init (error);
 
 handle_enum:
        switch (type) {
@@ -447,7 +447,7 @@ handle_type:
 static MonoObject*
 load_cattr_value_boxed (MonoDomain *domain, MonoImage *image, MonoType *t, const char* p, const char** end, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        gboolean is_ref = type_is_reference (t);
 
@@ -473,7 +473,7 @@ create_cattr_typed_arg (MonoType *t, MonoObject *val, MonoError *error)
        MonoObject *retval;
        void *params [2], *unboxed;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!ctor)
                ctor = mono_class_get_method_from_name (mono_class_get_custom_attribute_typed_argument_class (), ".ctor", 2);
@@ -499,7 +499,7 @@ create_cattr_named_arg (void *minfo, MonoObject *typedarg, MonoError *error)
        MonoObject *retval;
        void *unboxed, *params [2];
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!ctor)
                ctor = mono_class_get_method_from_name (mono_class_get_custom_attribute_named_argument_class (), ".ctor", 2);
@@ -578,7 +578,7 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu
        void **params = NULL;
        MonoMethodSignature *sig;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_class_init (method->klass);
 
@@ -759,7 +759,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth
        *named_args = NULL;
        *named_arg_info = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL)) {
                mono_error_set_generic_error (error, "System.Reflection", "CustomAttributeFormatException", "Binary format of the specified custom attribute was invalid.");
@@ -888,7 +888,7 @@ reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method, Mono
        CattrNamedArg *arginfo = NULL;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        *ctor_args = NULL;
        *named_args = NULL;
@@ -970,7 +970,7 @@ create_custom_attr_data_handle (MonoImage *image, MonoCustomAttrEntry *cattr, Mo
        MonoDomain *domain;
        void *params [4];
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (image->assembly);
 
@@ -1015,7 +1015,7 @@ mono_custom_attrs_construct_by_type (MonoCustomAttrInfo *cinfo, MonoClass *attr_
        MonoObject *attr;
        int i, n;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (i = 0; i < cinfo->num_attrs; ++i) {
                MonoCustomAttrEntry *centry = &cinfo->attrs[i];
@@ -1072,7 +1072,7 @@ mono_custom_attrs_data_construct (MonoCustomAttrInfo *cinfo, MonoError *error)
        MonoObject *attr;
        int i;
        
-       mono_error_init (error);
+       error_init (error);
        result = mono_array_new_checked (mono_domain_get (), mono_defaults.customattribute_data_class, cinfo->num_attrs, error);
        return_val_if_nok (error, NULL);
        for (i = 0; i < cinfo->num_attrs; ++i) {
@@ -1112,7 +1112,7 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
        const char *data;
        MonoCustomAttrEntry* attr;
 
-       mono_error_init (error);
+       error_init (error);
 
        ca = &image->tables [MONO_TABLE_CUSTOMATTRIBUTE];
 
@@ -1152,7 +1152,7 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ig
                        g_warning ("Can't find custom attr constructor image: %s mtoken: 0x%08x due to: %s", image->name, mtoken, mono_error_get_message (error));
                        if (ignore_missing) {
                                mono_error_cleanup (error);
-                               mono_error_init (error);
+                               error_init (error);
                        } else {
                                g_list_free (list);
                                g_free (ainfo);
@@ -1190,7 +1190,7 @@ mono_custom_attrs_from_method_checked (MonoMethod *method, MonoError *error)
 {
        guint32 idx;
 
-       mono_error_init (error);
+       error_init (error);
 
        /*
         * An instantiated method has the same cattrs as the generic method definition.
@@ -1228,7 +1228,7 @@ mono_custom_attrs_from_class_checked (MonoClass *klass, MonoError *error)
 {
        guint32 idx;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (mono_class_is_ginst (klass))
                klass = mono_class_get_generic_class (klass)->container_class;
@@ -1262,7 +1262,7 @@ mono_custom_attrs_from_assembly_checked (MonoAssembly *assembly, gboolean ignore
 {
        guint32 idx;
        
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (assembly->image))
                return lookup_custom_attr (assembly->image, assembly);
@@ -1346,7 +1346,7 @@ MonoCustomAttrInfo*
 mono_custom_attrs_from_field_checked (MonoClass *klass, MonoClassField *field, MonoError *error)
 {
        guint32 idx;
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (klass->image)) {
                field = mono_metadata_get_corresponding_field_from_generic_type_definition (field);
@@ -1395,7 +1395,7 @@ mono_custom_attrs_from_param_checked (MonoMethod *method, guint32 param, MonoErr
        MonoImage *image;
        MonoReflectionMethodAux *aux;
 
-       mono_error_init (error);
+       error_init (error);
 
        /*
         * An instantiated method has the same cattrs as the generic method definition.
@@ -1486,7 +1486,7 @@ mono_custom_attrs_get_attr_checked (MonoCustomAttrInfo *ainfo, MonoClass *attr_k
 
        g_assert (attr_klass != NULL);
 
-       mono_error_init (error);
+       error_init (error);
 
        for (i = 0; i < ainfo->num_attrs; ++i) {
                centry = &ainfo->attrs[i];
@@ -1538,7 +1538,7 @@ mono_reflection_get_custom_attrs_info_checked (MonoObject *obj, MonoError *error
        MonoClass *klass;
        MonoCustomAttrInfo *cinfo = NULL;
        
-       mono_error_init (error);
+       error_init (error);
 
        klass = obj->vtable->klass;
        if (klass == mono_defaults.runtimetype_class) {
@@ -1650,7 +1650,7 @@ mono_reflection_get_custom_attrs_by_type (MonoObject *obj, MonoClass *attr_klass
        MonoArray *result;
        MonoCustomAttrInfo *cinfo;
 
-       mono_error_init (error);
+       error_init (error);
 
        cinfo = mono_reflection_get_custom_attrs_info_checked (obj, error);
        return_val_if_nok (error, NULL);
@@ -1716,7 +1716,7 @@ mono_reflection_get_custom_attrs_data_checked (MonoObject *obj, MonoError *error
        MonoArray *result;
        MonoCustomAttrInfo *cinfo;
 
-       mono_error_init (error);
+       error_init (error);
 
        cinfo = mono_reflection_get_custom_attrs_info_checked (obj, error);
        return_val_if_nok (error, NULL);
index 8ee2e59993af58efa2418fd11722c19cf5aee2b2..eb91e637d4bac6204368cd8f332c8fe1aaab2c36 100644 (file)
@@ -256,7 +256,7 @@ mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean
        MonoObject *obj;
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
        
        obj = lookup_dyn_token (assembly, token);
        if (!obj) {
@@ -277,7 +277,7 @@ mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean
 gpointer
 mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return NULL;
 }
 #endif /* DISABLE_REFLECTION_EMIT */
index 6cf6370e0401f23a04f1d96ab331ac8f3014a49d..3b62211ef3ed2524ad1e6785e2ca9fdbb399959c 100644 (file)
@@ -76,7 +76,7 @@ mono_dynstream_insert_mstring (MonoDynamicStream *sh, MonoString *str, MonoError
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        char *name = mono_string_to_utf8_checked (str, error);
        return_val_if_nok (error, -1);
        guint32 idx;
index baaa2af993a468c4cc8eed506c3d82e3c419bb79..e6158463a5ae59c2378745bbcd645bf4ccce698d 100644 (file)
@@ -208,7 +208,7 @@ mono_exception_from_name_two_strings_checked (MonoImage *image, const char *name
 {
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
        klass = mono_class_load_from_name (image, name_space, name);
 
        return create_exception_two_strings (klass, a1, a2, error);
@@ -269,7 +269,7 @@ mono_exception_from_token_two_strings_checked (MonoImage *image, guint32 token,
 {
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
 
        klass = mono_class_get_checked (image, token, error);
        mono_error_assert_ok (error); /* FIXME handle the error. */
@@ -867,7 +867,7 @@ mono_get_exception_reflection_type_load_checked (MonoArrayHandle types, MonoArra
        MonoMethod *method;
        gpointer iter;
 
-       mono_error_init (error);
+       error_init (error);
 
        klass = mono_class_load_from_name (mono_get_corlib (), "System.Reflection", "ReflectionTypeLoadException");
 
@@ -1017,7 +1017,7 @@ ves_icall_Mono_Runtime_GetNativeStackTrace (MonoExceptionHandle exc, MonoError *
 {
        char *trace;
        MonoStringHandle res;
-       mono_error_init (error);
+       error_init (error);
 
        if (!exc) {
                mono_error_set_argument_null (error, "exception", "");
index 38aa44de6caf0297dd75eb7ecc4432458312ce4c..f71f0bc9f4a667052760a35b79296e6047badfd1 100644 (file)
@@ -168,8 +168,6 @@ void mono_gc_wbarrier_set_root (gpointer ptr, MonoObject *value);
        mono_gc_wbarrier_set_root (&((s)->fieldname), (MonoObject*)value); \
 } while (0)
 
-void  mono_gc_finalize_threadpool_threads (void);
-
 /* fast allocation support */
 
 typedef enum {
index ffe0fd3a5cfd4eb6b53a43b2c388b1a2d44bd796..7402096d704dfd5bf71ba5d1ac5d7b8801152365 100644 (file)
@@ -68,7 +68,6 @@ static MonoCoopMutex finalizer_mutex;
 static MonoCoopMutex reference_queue_mutex;
 
 static GSList *domains_to_finalize;
-static MonoMList *threads_to_finalize;
 
 static gboolean finalizer_thread_exited;
 /* Uses finalizer_mutex */
@@ -157,18 +156,6 @@ coop_cond_timedwait_alertable (MonoCoopCond *cond, MonoCoopMutex *mutex, guint32
        return res;
 }
 
-static gboolean
-add_thread_to_finalize (MonoInternalThread *thread, MonoError *error)
-{
-       mono_error_init (error);
-       mono_finalizer_lock ();
-       if (!threads_to_finalize)
-               MONO_GC_REGISTER_ROOT_SINGLE (threads_to_finalize, MONO_ROOT_SOURCE_FINALIZER_QUEUE, "finalizable threads list");
-       threads_to_finalize = mono_mlist_append_checked (threads_to_finalize, (MonoObject*)thread, error);
-       mono_finalizer_unlock ();
-       return is_ok (error);
-}
-
 /* 
  * actually, we might want to queue the finalize requests in a separate thread,
  * but we need to be careful about the execution domain of the thread...
@@ -241,15 +228,6 @@ mono_gc_run_finalize (void *obj, void *data)
                if (mono_gc_is_finalizer_internal_thread (t))
                        /* Avoid finalizing ourselves */
                        return;
-
-               if (t->threadpool_thread && finalizing_root_domain) {
-                       /* Don't finalize threadpool threads when
-                          shutting down - they're finalized when the
-                          threadpool shuts down. */
-                       if (!add_thread_to_finalize (t, &error))
-                               goto unhandled_error;
-                       return;
-               }
        }
 
        if (o->vtable->klass->image == mono_defaults.corlib && !strcmp (o->vtable->klass->name, "DynamicMethod") && finalizing_root_domain) {
@@ -344,22 +322,6 @@ unhandled_error:
        mono_domain_set_internal (caller_domain);
 }
 
-void
-mono_gc_finalize_threadpool_threads (void)
-{
-       while (threads_to_finalize) {
-               MonoInternalThread *thread = (MonoInternalThread*) mono_mlist_get_data (threads_to_finalize);
-
-               /* Force finalization of the thread. */
-               thread->threadpool_thread = FALSE;
-               mono_object_register_finalizer ((MonoObject*)thread);
-
-               mono_gc_run_finalize (thread, NULL);
-
-               threads_to_finalize = mono_mlist_next (threads_to_finalize);
-       }
-}
-
 gpointer
 mono_gc_out_of_memory (size_t size)
 {
@@ -555,11 +517,6 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout)
                goto done;
        }
 
-       if (domain == mono_get_root_domain ()) {
-               mono_threadpool_cleanup ();
-               mono_gc_finalize_threadpool_threads ();
-       }
-
 done:
        if (InterlockedDecrement (&req->ref) == 0) {
                mono_coop_sem_destroy (&req->done);
@@ -1017,57 +974,59 @@ mono_gc_cleanup (void)
                finished = TRUE;
                if (mono_thread_internal_current () != gc_thread) {
                        int ret;
-                       gint64 start_ticks = mono_msec_ticks ();
-                       gint64 end_ticks = start_ticks + 40000;
+                       gint64 start;
+                       const gint64 timeout = 40 * 1000;
 
                        mono_gc_finalize_notify ();
+
+                       start = mono_msec_ticks ();
+
                        /* Finishing the finalizer thread, so wait a little bit... */
                        /* MS seems to wait for about 2 seconds per finalizer thread */
                        /* and 40 seconds for all finalizers to finish */
-                       while (!finalizer_thread_exited) {
-                               gint64 current_ticks = mono_msec_ticks ();
-                               guint32 timeout;
+                       for (;;) {
+                               gint64 elapsed;
 
-                               if (current_ticks >= end_ticks)
-                                       break;
-                               else
-                                       timeout = end_ticks - current_ticks;
-                               mono_finalizer_lock ();
-                               if (!finalizer_thread_exited)
-                                       mono_coop_cond_timedwait (&exited_cond, &finalizer_mutex, timeout);
-                               mono_finalizer_unlock ();
-                       }
+                               if (finalizer_thread_exited) {
+                                       /* Wait for the thread to actually exit. We don't want the wait
+                                        * to be alertable, because we assert on the result to be SUCCESS_0 */
+                                       ret = guarded_wait (gc_thread->handle, MONO_INFINITE_WAIT, FALSE);
+                                       g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
 
-                       if (!finalizer_thread_exited) {
-                               /* Set a flag which the finalizer thread can check */
-                               suspend_finalizers = TRUE;
-                               mono_gc_suspend_finalizers ();
-
-                               /* Try to abort the thread, in the hope that it is running managed code */
-                               mono_thread_internal_abort (gc_thread);
-
-                               /* Wait for it to stop */
-                               ret = guarded_wait (gc_thread->handle, 100, TRUE);
-
-                               if (ret == MONO_THREAD_INFO_WAIT_RET_TIMEOUT) {
-                                       /*
-                                        * The finalizer thread refused to exit. Make it stop.
-                                        */
-                                       mono_thread_internal_stop (gc_thread);
-                                       ret = guarded_wait (gc_thread->handle, 100, TRUE);
-                                       g_assert (ret != MONO_THREAD_INFO_WAIT_RET_TIMEOUT);
-                                       /* The thread can't set this flag */
-                                       finalizer_thread_exited = TRUE;
+                                       mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));
+                                       break;
                                }
-                       }
 
+                               elapsed = mono_msec_ticks () - start;
+                               if (elapsed >= timeout) {
+                                       /* timeout */
+
+                                       /* Set a flag which the finalizer thread can check */
+                                       suspend_finalizers = TRUE;
+                                       mono_gc_suspend_finalizers ();
 
-                       /* Wait for the thread to actually exit */
-                       ret = guarded_wait (gc_thread->handle, MONO_INFINITE_WAIT, TRUE);
-                       g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
+                                       /* Try to abort the thread, in the hope that it is running managed code */
+                                       mono_thread_internal_abort (gc_thread);
 
-                       mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));
-                       g_assert (finalizer_thread_exited);
+                                       /* Wait for it to stop */
+                                       ret = guarded_wait (gc_thread->handle, 100, FALSE);
+                                       if (ret == MONO_THREAD_INFO_WAIT_RET_TIMEOUT) {
+                                               /* The finalizer thread refused to exit, suspend it forever. */
+                                               mono_thread_internal_suspend_for_shutdown (gc_thread);
+                                               break;
+                                       }
+
+                                       g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
+
+                                       mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));
+                                       break;
+                               }
+
+                               mono_finalizer_lock ();
+                               if (!finalizer_thread_exited)
+                                       mono_coop_cond_timedwait (&exited_cond, &finalizer_mutex, timeout - elapsed);
+                               mono_finalizer_unlock ();
+                       }
                }
                gc_thread = NULL;
                mono_gc_base_cleanup ();
index f43e22f5d39ff47fc302bcafec9d7d9be1c04c1b..7867984e28ff8dc29723a44b21c84eae71df31d9 100644 (file)
@@ -30,7 +30,7 @@ MonoArray *
 mono_icall_get_logical_drives (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetLogicalDriveStrings");
 
@@ -46,7 +46,7 @@ void
 mono_icall_broadcast_setting_change (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("SendMessageTimeout");
 
@@ -62,7 +62,7 @@ guint32
 mono_icall_drive_info_get_drive_type (MonoString *root_path_name)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetDriveType");
 
@@ -76,7 +76,7 @@ gint32
 mono_icall_wait_for_input_idle (gpointer handle, gint32 milliseconds)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("WaitForInputIdle");
 
index d21033f353b834cddebbc2e13efc6675414195d2..6f76a3250a9e96b5cd2bb5664d5885cf0e4aa80b 100644 (file)
@@ -130,7 +130,7 @@ is_generic_parameter (MonoType *type)
 static void
 mono_class_init_checked (MonoClass *klass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_class_init (klass))
                mono_error_set_for_class_failure (error, klass);
@@ -232,7 +232,7 @@ ves_icall_System_Array_SetValueImpl (MonoArray *arr, MonoObject *value, guint32
        gint64 i64 = 0;
        gdouble r64 = 0;
 
-       mono_error_init (&error);
+       error_init (&error);
 
        if (value)
                vc = value->vtable->klass;
@@ -844,7 +844,7 @@ ves_icall_System_Array_SetGenericValueImpl (MonoArray *arr, guint32 pos, gpointe
 ICALL_EXPORT void
 ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray (MonoArrayHandle array, MonoClassField *field_handle, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoClass *klass = mono_handle_class (array);
        guint32 size = mono_array_element_size (klass);
@@ -1216,7 +1216,7 @@ ves_icall_System_ValueType_Equals (MonoObject *this_obj, MonoObject *that, MonoA
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_System_Object_GetType (MonoObjectHandle obj, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (obj);
        MonoClass *klass = mono_handle_class (obj);
 #ifndef DISABLE_REMOTING
@@ -1313,7 +1313,7 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoAsse
        gboolean type_resolve = FALSE;
        MonoImage *rootimage = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        /*
         * We must compute the calling assembly as type loading must happen under a metadata context.
@@ -1402,7 +1402,7 @@ ves_icall_System_Type_internal_from_name (MonoStringHandle name,
                                          MonoBoolean ignoreCase,
                                          MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoTypeNameParse info;
        gboolean parsedOk;
        MonoAssembly *caller_assembly;
@@ -1460,7 +1460,7 @@ leave:
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_System_Type_internal_from_handle (MonoType *handle, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get (); 
 
        return mono_type_get_object_handle (domain, handle, error);
@@ -1518,7 +1518,7 @@ typedef enum {
 ICALL_EXPORT guint32
 ves_icall_type_GetTypeCodeInternal (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        int t = type->type;
 
@@ -1612,7 +1612,7 @@ mono_type_get_underlying_type_ignore_byref (MonoType *type)
 ICALL_EXPORT guint32
 ves_icall_RuntimeTypeHandle_type_is_assignable_from (MonoReflectionTypeHandle ref_type, MonoReflectionTypeHandle ref_c, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (!MONO_HANDLE_IS_NULL (ref_type));
        
@@ -1652,7 +1652,7 @@ ves_icall_RuntimeTypeHandle_type_is_assignable_from (MonoReflectionTypeHandle re
 ICALL_EXPORT guint32
 ves_icall_RuntimeTypeHandle_IsInstanceOfType (MonoReflectionTypeHandle ref_type, MonoObjectHandle obj, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
        mono_class_init_checked (klass, error);
@@ -1665,7 +1665,7 @@ ves_icall_RuntimeTypeHandle_IsInstanceOfType (MonoReflectionTypeHandle ref_type,
 ICALL_EXPORT guint32
 ves_icall_RuntimeTypeHandle_GetAttributes (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
        return mono_class_get_flags (klass);
@@ -1674,7 +1674,7 @@ ves_icall_RuntimeTypeHandle_GetAttributes (MonoReflectionTypeHandle ref_type, Mo
 ICALL_EXPORT MonoReflectionMarshalAsAttributeHandle
 ves_icall_System_Reflection_FieldInfo_get_marshal_info (MonoReflectionFieldHandle field_h, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (field_h);
        MonoClassField *field = MONO_HANDLE_GETVAL (field_h, field);
        MonoClass *klass = field->parent;
@@ -1710,7 +1710,7 @@ ves_icall_System_Reflection_FieldInfo_internal_from_handle_type (MonoClassField
 
        g_assert (handle);
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!type) {
                klass = handle->parent;
@@ -1734,7 +1734,7 @@ ves_icall_System_Reflection_EventInfo_internal_from_handle_type (MonoEvent *hand
 
        g_assert (handle);
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!type) {
                klass = handle->parent;
@@ -1754,7 +1754,7 @@ ves_icall_System_Reflection_EventInfo_internal_from_handle_type (MonoEvent *hand
 ICALL_EXPORT MonoReflectionPropertyHandle
 ves_icall_System_Reflection_PropertyInfo_internal_from_handle_type (MonoProperty *handle, MonoType *type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass;
 
        g_assert (handle);
@@ -1776,7 +1776,7 @@ ves_icall_System_Reflection_PropertyInfo_internal_from_handle_type (MonoProperty
 ICALL_EXPORT MonoArrayHandle
 ves_icall_System_Reflection_FieldInfo_GetTypeModifiers (MonoReflectionFieldHandle field_h, MonoBoolean optional, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClassField *field = MONO_HANDLE_GETVAL (field_h, field);
 
        MonoType *type = mono_field_get_type_checked (field, error);
@@ -1838,7 +1838,7 @@ ves_icall_get_method_info (MonoMethod *method, MonoMethodInfo *info)
 ICALL_EXPORT MonoArrayHandle
 ves_icall_System_Reflection_MonoMethodInfo_get_parameter_info (MonoMethod *method, MonoReflectionMethodHandle member, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get (); 
 
        MonoReflectionTypeHandle reftype = MONO_HANDLE_NEW (MonoReflectionType, NULL);
@@ -1852,7 +1852,7 @@ ves_icall_System_Reflection_MonoMethodInfo_get_parameter_info (MonoMethod *metho
 ICALL_EXPORT MonoReflectionMarshalAsAttributeHandle
 ves_icall_System_MonoMethodInfo_get_retval_marshal (MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get (); 
        MonoReflectionMarshalAsAttributeHandle res = MONO_HANDLE_NEW (MonoReflectionMarshalAsAttribute, NULL);
 
@@ -1886,7 +1886,7 @@ ves_icall_MonoField_GetFieldOffset (MonoReflectionField *field)
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_MonoField_GetParentType (MonoReflectionFieldHandle field, MonoBoolean declaring, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (field);
        MonoClass *parent;
 
@@ -2152,7 +2152,7 @@ ves_icall_MonoField_GetRawConstantValue (MonoReflectionField *rfield)
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_MonoField_ResolveType (MonoReflectionFieldHandle ref_field, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_field);
        MonoClassField *field = MONO_HANDLE_GETVAL (ref_field, field);
        MonoType *type = mono_field_get_type_checked (field, error);
@@ -2377,7 +2377,7 @@ get_interfaces_hash (gconstpointer v1)
 ICALL_EXPORT MonoArrayHandle
 ves_icall_RuntimeType_GetInterfaces (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
 
@@ -2437,7 +2437,7 @@ static gboolean
 set_interface_map_data_method_object (MonoDomain *domain, MonoMethod *method, MonoClass *iclass, int ioffset, MonoClass *klass, MonoArrayHandle targets, MonoArrayHandle methods, int i, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionMethodHandle member = mono_method_get_object_handle (domain, method, iclass, error);
        if (!is_ok (error))
                goto leave;
@@ -2457,7 +2457,7 @@ leave:
 ICALL_EXPORT void
 ves_icall_RuntimeType_GetInterfaceMapData (MonoReflectionTypeHandle ref_type, MonoReflectionTypeHandle ref_iface, MonoArrayHandleOut targets, MonoArrayHandleOut methods, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
        MonoType *iface = MONO_HANDLE_GETVAL (ref_iface, type);
@@ -2498,7 +2498,7 @@ ves_icall_RuntimeType_GetInterfaceMapData (MonoReflectionTypeHandle ref_type, Mo
 ICALL_EXPORT void
 ves_icall_RuntimeType_GetPacking (MonoReflectionTypeHandle ref_type, guint32 *packing, guint32 *size, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
 
@@ -2518,7 +2518,7 @@ ves_icall_RuntimeType_GetPacking (MonoReflectionTypeHandle ref_type, guint32 *pa
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeTypeHandle_GetElementType (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
@@ -2547,7 +2547,7 @@ ves_icall_RuntimeTypeHandle_GetElementType (MonoReflectionTypeHandle ref_type, M
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeTypeHandle_GetBaseType (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
@@ -2565,7 +2565,7 @@ ves_icall_RuntimeTypeHandle_GetBaseType (MonoReflectionTypeHandle ref_type, Mono
 ICALL_EXPORT MonoBoolean
 ves_icall_RuntimeTypeHandle_IsPointer (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        return type->type == MONO_TYPE_PTR;
 }
@@ -2573,7 +2573,7 @@ ves_icall_RuntimeTypeHandle_IsPointer (MonoReflectionTypeHandle ref_type, MonoEr
 ICALL_EXPORT MonoBoolean
 ves_icall_RuntimeTypeHandle_IsPrimitive (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        return (!type->byref && (((type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8)) || (type->type == MONO_TYPE_I) || (type->type == MONO_TYPE_U)));
 }
@@ -2581,7 +2581,7 @@ ves_icall_RuntimeTypeHandle_IsPrimitive (MonoReflectionTypeHandle ref_type, Mono
 ICALL_EXPORT MonoBoolean
 ves_icall_RuntimeTypeHandle_IsByRef (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        return type->byref;
 }
@@ -2589,7 +2589,7 @@ ves_icall_RuntimeTypeHandle_IsByRef (MonoReflectionTypeHandle ref_type, MonoErro
 ICALL_EXPORT MonoBoolean
 ves_icall_RuntimeTypeHandle_IsComObject (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
        mono_class_init_checked (klass, error);
@@ -2602,14 +2602,14 @@ ves_icall_RuntimeTypeHandle_IsComObject (MonoReflectionTypeHandle ref_type, Mono
 ICALL_EXPORT guint32
 ves_icall_reflection_get_token (MonoObjectHandle obj, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return mono_reflection_get_token_checked (obj, error);
 }
 
 ICALL_EXPORT MonoReflectionModuleHandle
 ves_icall_RuntimeTypeHandle_GetModule (MonoReflectionTypeHandle type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (type);
        MonoType *t = MONO_HANDLE_GETVAL (type, type);
        MonoClass *klass = mono_class_from_mono_type (t);
@@ -2619,7 +2619,7 @@ ves_icall_RuntimeTypeHandle_GetModule (MonoReflectionTypeHandle type, MonoError
 ICALL_EXPORT MonoReflectionAssemblyHandle
 ves_icall_RuntimeTypeHandle_GetAssembly (MonoReflectionTypeHandle type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get (); 
        MonoType *t = MONO_HANDLE_GETVAL (type, type);
        MonoClass *klass = mono_class_from_mono_type (t);
@@ -2629,7 +2629,7 @@ ves_icall_RuntimeTypeHandle_GetAssembly (MonoReflectionTypeHandle type, MonoErro
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeType_get_DeclaringType (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get ();
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass;
@@ -2689,7 +2689,7 @@ ves_icall_RuntimeType_get_Namespace (MonoReflectionTypeHandle type, MonoError *e
 ICALL_EXPORT gint32
 ves_icall_RuntimeTypeHandle_GetArrayRank (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        if (type->type != MONO_TYPE_ARRAY && type->type != MONO_TYPE_SZARRAY) {
@@ -2712,7 +2712,7 @@ static gboolean
 set_type_object_in_array (MonoDomain *domain, MonoType *type, MonoArrayHandle dest, int i, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionTypeHandle rt = mono_type_get_object_handle (domain, type, error);
        if (!is_ok (error))
                goto leave;
@@ -2726,7 +2726,7 @@ leave:
 ICALL_EXPORT MonoArrayHandle
 ves_icall_RuntimeType_GetGenericArguments (MonoReflectionTypeHandle ref_type, MonoBoolean runtimeTypeArray, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
 
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
@@ -2763,7 +2763,7 @@ leave:
 ICALL_EXPORT gboolean
 ves_icall_RuntimeTypeHandle_IsGenericTypeDefinition (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        if (!IS_MONOTYPE (MONO_HANDLE_RAW(ref_type)))
                return FALSE;
@@ -2779,7 +2779,7 @@ ves_icall_RuntimeTypeHandle_IsGenericTypeDefinition (MonoReflectionTypeHandle re
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        MonoReflectionTypeHandle ret = MONO_HANDLE_NEW (MonoReflectionType, NULL);
@@ -2815,7 +2815,7 @@ leave:
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeType_MakeGenericType (MonoReflectionTypeHandle reftype, MonoArrayHandle type_array, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (reftype);
 
        g_assert (IS_MONOTYPE_HANDLE (reftype));
@@ -2853,7 +2853,7 @@ ves_icall_RuntimeType_MakeGenericType (MonoReflectionTypeHandle reftype, MonoArr
 ICALL_EXPORT gboolean
 ves_icall_RuntimeTypeHandle_HasInstantiation (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass;
 
        if (!IS_MONOTYPE (MONO_HANDLE_RAW (ref_type)))
@@ -2870,7 +2870,7 @@ ves_icall_RuntimeTypeHandle_HasInstantiation (MonoReflectionTypeHandle ref_type,
 ICALL_EXPORT gint32
 ves_icall_RuntimeType_GetGenericParameterPosition (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (!IS_MONOTYPE_HANDLE (ref_type))
                return -1;
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
@@ -2883,7 +2883,7 @@ ves_icall_RuntimeType_GetGenericParameterPosition (MonoReflectionTypeHandle ref_
 ICALL_EXPORT MonoGenericParamInfo *
 ves_icall_RuntimeTypeHandle_GetGenericParameterInfo (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        return mono_generic_param_info (type->data.generic_param);
 }
@@ -2900,7 +2900,7 @@ ves_icall_RuntimeType_GetCorrespondingInflatedMethod (MonoReflectionTypeHandle r
                                                      MonoReflectionMethodHandle generic,
                                                      MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
@@ -2928,7 +2928,7 @@ ves_icall_RuntimeType_GetCorrespondingInflatedMethod (MonoReflectionTypeHandle r
 ICALL_EXPORT MonoReflectionMethodHandle
 ves_icall_RuntimeType_get_DeclaringMethod (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoReflectionMethodHandle ret = MONO_HANDLE_NEW (MonoReflectionMethod, NULL);
 
@@ -2952,7 +2952,7 @@ leave:
 ICALL_EXPORT MonoBoolean
 ves_icall_System_RuntimeType_IsTypeExportedToWindowsRuntime (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        mono_error_set_not_implemented (error, "%s", "");
        return FALSE;
 }
@@ -2960,7 +2960,7 @@ ves_icall_System_RuntimeType_IsTypeExportedToWindowsRuntime (MonoError *error)
 ICALL_EXPORT MonoBoolean
 ves_icall_System_RuntimeType_IsWindowsRuntimeObjectType (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        mono_error_set_not_implemented (error, "%s", "");
        return FALSE;
 }
@@ -2980,7 +2980,7 @@ ves_icall_MonoMethod_GetPInvoke (MonoReflectionMethodHandle ref_method, int* fla
        const char *import = NULL;
        const char *scope = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (image)) {
                MonoReflectionMethodAux *method_aux = 
@@ -3015,7 +3015,7 @@ ves_icall_MonoMethod_GetPInvoke (MonoReflectionMethodHandle ref_method, int* fla
 ICALL_EXPORT MonoReflectionMethodHandle
 ves_icall_MonoMethod_GetGenericMethodDefinition (MonoReflectionMethodHandle ref_method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *method = MONO_HANDLE_GETVAL (ref_method, method);
 
        if (method->is_generic)
@@ -3076,7 +3076,7 @@ static gboolean
 set_array_generic_argument_handle_inflated (MonoDomain *domain, MonoGenericInst *inst, int i, MonoArrayHandle arr, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionTypeHandle rt = mono_type_get_object_handle (domain, inst->type_argv [i], error);
        if (!is_ok (error))
                goto leave;
@@ -3089,7 +3089,7 @@ static gboolean
 set_array_generic_argument_handle_gparam (MonoDomain *domain, MonoGenericContainer *container, int i, MonoArrayHandle arr, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoGenericParam *param = mono_generic_container_get_param (container, i);
        MonoClass *pklass = mono_class_from_generic_parameter_internal (param);
        MonoReflectionTypeHandle rt = mono_type_get_object_handle (domain, &pklass->byval_arg, error);
@@ -3103,7 +3103,7 @@ leave:
 ICALL_EXPORT MonoArrayHandle
 ves_icall_MonoMethod_GetGenericArguments (MonoReflectionMethodHandle ref_method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_method);
        MonoMethod *method = MONO_HANDLE_GETVAL (ref_method, method);
 
@@ -3665,7 +3665,7 @@ ves_icall_System_Enum_get_hashcode (MonoObject *eobj)
 static void
 get_enum_field (MonoDomain *domain, MonoArrayHandle names, MonoArrayHandle values, int base_type, MonoClassField *field, guint* j, guint64 *previous_value, gboolean *sorted, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        HANDLE_FUNCTION_ENTER();
        guint64 field_value;
        const char *p;
@@ -3709,7 +3709,7 @@ ves_icall_System_Enum_GetEnumValuesAndNames (MonoReflectionTypeHandle type, Mono
        guint64 previous_value = 0;
        gboolean sorted = TRUE;
 
-       mono_error_init (error);
+       error_init (error);
        mono_class_init_checked (enumc, error);
        return_val_if_nok (error, FALSE);
 
@@ -3759,7 +3759,7 @@ enum {
 ICALL_EXPORT GPtrArray*
 ves_icall_RuntimeType_GetFields_native (MonoReflectionTypeHandle ref_type, char *utf8_name, guint32 bflags, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        if (type->byref) {
@@ -3855,7 +3855,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla
 
        array = g_ptr_array_new ();
        startklass = klass;
-       mono_error_init (error);
+       error_init (error);
 
        if (name != NULL)
                compare_func = (ignore_case) ? mono_utf8_strcasecmp : strcmp;
@@ -3952,7 +3952,7 @@ loader_error:
 ICALL_EXPORT GPtrArray*
 ves_icall_RuntimeType_GetMethodsByName_native (MonoReflectionTypeHandle ref_type, const char *mname, guint32 bflags, MonoBoolean ignore_case, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        MonoClass *klass = mono_class_from_mono_type (type);
@@ -3966,7 +3966,7 @@ ves_icall_RuntimeType_GetMethodsByName_native (MonoReflectionTypeHandle ref_type
 ICALL_EXPORT GPtrArray*
 ves_icall_RuntimeType_GetConstructors_native (MonoReflectionTypeHandle ref_type, guint32 bflags, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        if (type->byref) {
                return g_ptr_array_new ();
@@ -4083,7 +4083,7 @@ property_accessor_nonpublic (MonoMethod* accessor, gboolean start_klass)
 ICALL_EXPORT GPtrArray*
 ves_icall_RuntimeType_GetPropertiesByName_native (MonoReflectionTypeHandle ref_type, gchar *propname, guint32 bflags, MonoBoolean ignore_case, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
 
@@ -4189,7 +4189,7 @@ event_equal (MonoEvent *event1, MonoEvent *event2)
 ICALL_EXPORT GPtrArray*
 ves_icall_RuntimeType_GetEvents_native (MonoReflectionTypeHandle ref_type, char *utf8_name, guint32 bflags, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        if (type->byref) {
@@ -4281,7 +4281,7 @@ failure:
 ICALL_EXPORT GPtrArray *
 ves_icall_RuntimeType_GetNestedTypes_native (MonoReflectionTypeHandle ref_type, char *str, guint32 bflags, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        if (type->byref) {
@@ -4331,7 +4331,7 @@ static MonoType*
 get_type_from_module_builder_module (MonoArrayHandle modules, int i, MonoTypeNameParse *info, MonoBoolean ignoreCase, gboolean *type_resolve, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = NULL;
        MonoReflectionModuleBuilderHandle mb = MONO_HANDLE_NEW (MonoReflectionModuleBuilder, NULL);
        MONO_HANDLE_ARRAY_GETREF (mb, modules, i);
@@ -4344,7 +4344,7 @@ static MonoType*
 get_type_from_module_builder_loaded_modules (MonoArrayHandle loaded_modules, int i, MonoTypeNameParse *info, MonoBoolean ignoreCase, gboolean *type_resolve, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = NULL;
        MonoReflectionModuleHandle mod = MONO_HANDLE_NEW (MonoReflectionModule, NULL);
        MONO_HANDLE_ARRAY_GETREF (mod, loaded_modules, i);
@@ -4356,7 +4356,7 @@ get_type_from_module_builder_loaded_modules (MonoArrayHandle loaded_modules, int
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssemblyHandle assembly_h, MonoReflectionModuleHandle module, MonoStringHandle name, MonoBoolean throwOnError, MonoBoolean ignoreCase, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoTypeNameParse info;
        gboolean type_resolve;
@@ -4522,7 +4522,7 @@ replace_shadow_path (MonoDomain *domain, gchar *dirname, gchar **filename)
 ICALL_EXPORT MonoStringHandle
 ves_icall_System_Reflection_Assembly_get_code_base (MonoReflectionAssemblyHandle assembly, MonoBoolean escaped, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly);
        MonoAssembly *mass = MONO_HANDLE_GETVAL (assembly, assembly);
        gchar *absolute;
@@ -4564,7 +4564,7 @@ ves_icall_System_Reflection_Assembly_get_code_base (MonoReflectionAssemblyHandle
 ICALL_EXPORT MonoBoolean
 ves_icall_System_Reflection_Assembly_get_global_assembly_cache (MonoReflectionAssemblyHandle assembly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoAssembly *mass = MONO_HANDLE_GETVAL (assembly,assembly);
 
        return mass->in_gac;
@@ -4602,7 +4602,7 @@ ves_icall_System_Reflection_Assembly_get_location (MonoReflectionAssemblyHandle
 ICALL_EXPORT MonoBoolean
 ves_icall_System_Reflection_Assembly_get_ReflectionOnly (MonoReflectionAssemblyHandle assembly_h, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        return assembly->ref_only;
 }
@@ -4619,7 +4619,7 @@ ves_icall_System_Reflection_Assembly_InternalImageRuntimeVersion (MonoReflection
 ICALL_EXPORT MonoReflectionMethodHandle
 ves_icall_System_Reflection_Assembly_get_EntryPoint (MonoReflectionAssemblyHandle assembly_h, MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly_h);
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        MonoMethod *method;
@@ -4641,7 +4641,7 @@ leave:
 ICALL_EXPORT MonoReflectionModuleHandle
 ves_icall_System_Reflection_Assembly_GetManifestModuleInternal (MonoReflectionAssemblyHandle assembly, MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly);
        MonoAssembly *a = MONO_HANDLE_GETVAL (assembly, assembly);
        return mono_module_get_object_handle (domain, a->image, error);
@@ -4651,7 +4651,7 @@ static gboolean
 add_manifest_resource_name_to_array (MonoDomain *domain, MonoImage *image, MonoTableInfo *table, int i, MonoArrayHandle dest, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        const char *val = mono_metadata_string_heap (image, mono_metadata_decode_row_col (table, i, MONO_MANIFEST_NAME));
        MonoStringHandle str = mono_string_new_handle (domain, val, error);
        if (!is_ok (error))
@@ -4664,7 +4664,7 @@ leave:
 ICALL_EXPORT MonoArrayHandle
 ves_icall_System_Reflection_Assembly_GetManifestResourceNames (MonoReflectionAssemblyHandle assembly_h, MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly_h);
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        MonoTableInfo *table = &assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE];
@@ -4696,7 +4696,7 @@ ves_icall_System_Reflection_Assembly_GetAotId (MonoError *error)
 static MonoAssemblyName*
 create_referenced_assembly_name (MonoDomain *domain, MonoImage *image, MonoTableInfo *t, int i, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoAssemblyName *aname = g_new0 (MonoAssemblyName, 1);
 
        mono_assembly_get_assemblyref (image, i, aname);
@@ -4719,7 +4719,7 @@ create_referenced_assembly_name (MonoDomain *domain, MonoImage *image, MonoTable
 ICALL_EXPORT GPtrArray*
 ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflectionAssemblyHandle assembly, MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly);
        MonoAssembly *ass = MONO_HANDLE_GETVAL(assembly, assembly);
        MonoImage *image = ass->image;
@@ -4758,7 +4758,7 @@ g_concat_dir_and_file (const char *dir, const char *file)
 ICALL_EXPORT void *
 ves_icall_System_Reflection_Assembly_GetManifestResourceInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, gint32 *size, MonoReflectionModuleHandleOut ref_module, MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly_h);
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        MonoTableInfo *table = &assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE];
@@ -4887,7 +4887,7 @@ leave:
 ICALL_EXPORT gboolean
 ves_icall_System_Reflection_Assembly_GetManifestResourceInfoInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, MonoManifestResourceInfoHandle info_h, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return get_manifest_resource_info_internal (assembly_h, name, info_h, error);
 }
 
@@ -4895,7 +4895,7 @@ static gboolean
 add_filename_to_files_array (MonoDomain *domain, MonoAssembly * assembly, MonoTableInfo *table, int i, MonoArrayHandle dest, int dest_idx, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER();
-       mono_error_init (error);
+       error_init (error);
        const char *val = mono_metadata_string_heap (assembly->image, mono_metadata_decode_row_col (table, i, MONO_FILE_NAME));
        char *n = g_concat_dir_and_file (assembly->basedir, val);
        MonoStringHandle str = mono_string_new_handle (domain, n, error);
@@ -4910,7 +4910,7 @@ leave:
 ICALL_EXPORT MonoObjectHandle
 ves_icall_System_Reflection_Assembly_GetFilesInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, MonoBoolean resource_modules, MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly_h);
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        MonoTableInfo *table = &assembly->image->tables [MONO_TABLE_FILE];
@@ -4965,7 +4965,7 @@ static gboolean
 add_module_to_modules_array (MonoDomain *domain, MonoArrayHandle dest, int *dest_idx, MonoImage* module, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        if (module) {
                MonoReflectionModuleHandle rm = mono_module_get_object_handle (domain, module, error);
                if (!is_ok (error))
@@ -4983,7 +4983,7 @@ static gboolean
 add_file_to_modules_array (MonoDomain *domain, MonoArrayHandle dest, int dest_idx, MonoImage *image, MonoTableInfo *table, int table_idx,  MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
 
        guint32 cols [MONO_FILE_SIZE];
        mono_metadata_decode_row (table, table_idx, cols, MONO_FILE_SIZE);
@@ -5014,7 +5014,7 @@ leave:
 ICALL_EXPORT MonoArrayHandle
 ves_icall_System_Reflection_Assembly_GetModulesInternal (MonoReflectionAssemblyHandle assembly_h, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get();
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        MonoClass *klass;
@@ -5067,7 +5067,7 @@ fail:
 ICALL_EXPORT MonoReflectionMethodHandle
 ves_icall_GetCurrentMethod (MonoError *error) 
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoMethod *m = mono_method_get_last_managed ();
 
@@ -5124,7 +5124,7 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass)
 ICALL_EXPORT MonoReflectionMethodHandle
 ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native (MonoMethod *method, MonoType *type, MonoBoolean generic_check, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass;
        if (type && generic_check) {
                klass = mono_class_from_mono_type (type);
@@ -5146,14 +5146,14 @@ ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType_native (M
 ICALL_EXPORT MonoReflectionMethodBodyHandle
 ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal (MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return mono_method_body_get_object_handle (mono_domain_get (), method, error);
 }
 
 ICALL_EXPORT MonoReflectionAssemblyHandle
 ves_icall_System_Reflection_Assembly_GetExecutingAssembly (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoMethod *dest = NULL;
        mono_stack_walk_no_il (get_executing, &dest);
@@ -5165,7 +5165,7 @@ ves_icall_System_Reflection_Assembly_GetExecutingAssembly (MonoError *error)
 ICALL_EXPORT MonoReflectionAssemblyHandle
 ves_icall_System_Reflection_Assembly_GetEntryAssembly (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain* domain = mono_domain_get ();
 
@@ -5178,7 +5178,7 @@ ves_icall_System_Reflection_Assembly_GetEntryAssembly (MonoError *error)
 ICALL_EXPORT MonoReflectionAssemblyHandle
 ves_icall_System_Reflection_Assembly_GetCallingAssembly (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *m;
        MonoMethod *dest;
 
@@ -5230,7 +5230,7 @@ ves_icall_System_RuntimeType_getFullName (MonoReflectionTypeHandle object, gbool
 ICALL_EXPORT int
 vell_icall_RuntimeType_get_core_clr_security_level (MonoReflectionTypeHandle rfield, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (rfield, type);
        MonoClass *klass = mono_class_from_mono_type (type);
 
@@ -5250,7 +5250,7 @@ ves_icall_MonoField_get_core_clr_security_level (MonoReflectionField *rfield)
 ICALL_EXPORT int
 ves_icall_MonoMethod_get_core_clr_security_level (MonoReflectionMethodHandle rfield, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *method = MONO_HANDLE_GETVAL (rfield, method);
        return mono_security_core_clr_method_level (method, TRUE);
 }
@@ -5258,7 +5258,7 @@ ves_icall_MonoMethod_get_core_clr_security_level (MonoReflectionMethodHandle rfi
 ICALL_EXPORT MonoStringHandle
 ves_icall_System_Reflection_Assembly_get_fullName (MonoReflectionAssemblyHandle assembly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (assembly);
        MonoAssembly *mass = MONO_HANDLE_GETVAL (assembly, assembly);
        gchar *name;
@@ -5285,7 +5285,7 @@ ves_icall_System_Reflection_Assembly_InternalGetAssemblyName (MonoStringHandle f
        MonoImage *image;
        char *dirname;
 
-       mono_error_init (error);
+       error_init (error);
 
        filename = mono_string_handle_to_utf8 (fname, error);
        return_if_nok (error);
@@ -5337,7 +5337,7 @@ ICALL_EXPORT MonoBoolean
 ves_icall_System_Reflection_Assembly_LoadPermissions (MonoReflectionAssemblyHandle assembly_h,
                                                      char **minimum, guint32 *minLength, char **optional, guint32 *optLength, char **refused, guint32 *refLength, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly);
        MonoBoolean result = FALSE;
        MonoDeclSecurityEntry entry;
@@ -5382,7 +5382,7 @@ mono_module_type_is_visible (MonoTableInfo *tdef, MonoImage *image, int type)
 static void
 image_get_type (MonoDomain *domain, MonoImage *image, MonoTableInfo *tdef, int table_idx, int count, MonoArrayHandle res, MonoArrayHandle exceptions, MonoBoolean exportedOnly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        HANDLE_FUNCTION_ENTER ();
        MonoError klass_error;
        MonoClass *klass = mono_class_get_checked (image, table_idx | MONO_TOKEN_TYPE_DEF, &klass_error);
@@ -5405,7 +5405,7 @@ mono_module_get_types (MonoDomain *domain, MonoImage *image, MonoArrayHandleOut
        MonoTableInfo *tdef = &image->tables [MONO_TABLE_TYPEDEF];
        int i, count;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* we start the count from 1 because we skip the special type <Module> */
        if (exportedOnly) {
@@ -5437,7 +5437,7 @@ static void
 append_module_types (MonoDomain *domain, MonoArrayHandleOut res, MonoArrayHandleOut exceptions, MonoImage *image, MonoBoolean exportedOnly, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoArrayHandle ex2 = MONO_HANDLE_NEW (MonoArray, NULL);
        MonoArrayHandle res2 = mono_module_get_types (domain, image, ex2, exportedOnly, error);
        if (!is_ok (error))
@@ -5475,7 +5475,7 @@ set_class_failure_in_array (MonoArrayHandle exl, int i, MonoClass *klass)
 {
        HANDLE_FUNCTION_ENTER ();
        MonoError unboxed_error;
-       mono_error_init (&unboxed_error);
+       error_init (&unboxed_error);
        mono_error_set_for_class_failure (&unboxed_error, klass);
 
        MonoExceptionHandle exc = MONO_HANDLE_NEW (MonoException, mono_error_convert_to_exception (&unboxed_error));
@@ -5668,7 +5668,7 @@ ves_icall_System_Reflection_Module_GetMDStreamVersion (MonoImage *image, MonoErr
 ICALL_EXPORT MonoArrayHandle
 ves_icall_System_Reflection_Module_InternalGetTypes (MonoReflectionModuleHandle module, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoImage *image = MONO_HANDLE_GETVAL (module, image);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (module);
@@ -5760,7 +5760,7 @@ static MonoType*
 module_resolve_type_token (MonoImage *image, guint32 token, MonoArrayHandle type_args, MonoArrayHandle method_args, MonoResolveTokenError *resolve_error, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoType *result = NULL;
        MonoClass *klass;
        int table = mono_metadata_token_table (token);
@@ -5821,7 +5821,7 @@ static MonoMethod*
 module_resolve_method_token (MonoImage *image, guint32 token, MonoArrayHandle type_args, MonoArrayHandle method_args, MonoResolveTokenError *resolve_error, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *method = NULL;
        int table = mono_metadata_token_table (token);
        int index = mono_metadata_token_index (token);
@@ -5920,7 +5920,7 @@ module_resolve_field_token (MonoImage *image, guint32 token, MonoArrayHandle typ
        MonoGenericContext context;
        MonoClassField *field = NULL;
 
-       mono_error_init (error);
+       error_init (error);
        *resolve_error = ResolveTokenError_Other;
 
        /* Validate token */
@@ -5976,7 +5976,7 @@ ves_icall_System_Reflection_Module_ResolveMemberToken (MonoImage *image, guint32
 {
        int table = mono_metadata_token_table (token);
 
-       mono_error_init (merror);
+       error_init (merror);
        *error = ResolveTokenError_Other;
 
        switch (table) {
@@ -6034,7 +6034,7 @@ ves_icall_System_Reflection_Module_ResolveMemberToken (MonoImage *image, guint32
 ICALL_EXPORT MonoArrayHandle
 ves_icall_System_Reflection_Module_ResolveSignature (MonoImage *image, guint32 token, MonoResolveTokenError *resolve_error, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        int table = mono_metadata_token_table (token);
        int idx = mono_metadata_token_index (token);
        MonoTableInfo *tables = image->tables;
@@ -6071,7 +6071,7 @@ ves_icall_System_Reflection_Module_ResolveSignature (MonoImage *image, guint32 t
 ICALL_EXPORT MonoBoolean
 ves_icall_RuntimeTypeHandle_IsArray (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        MonoBoolean res = !type->byref && (type->type == MONO_TYPE_ARRAY || type->type == MONO_TYPE_SZARRAY);
@@ -6084,7 +6084,7 @@ check_for_invalid_type (MonoClass *klass, MonoError *error)
 {
        char *name;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (klass->byval_arg.type != MONO_TYPE_TYPEDBYREF)
                return;
@@ -6095,7 +6095,7 @@ check_for_invalid_type (MonoClass *klass, MonoError *error)
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeType_make_array_type (MonoReflectionTypeHandle ref_type, int rank, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        MonoClass *klass = mono_class_from_mono_type (type);
@@ -6116,7 +6116,7 @@ ves_icall_RuntimeType_make_array_type (MonoReflectionTypeHandle ref_type, int ra
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeType_make_byref_type (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
 
        MonoClass *klass = mono_class_from_mono_type (type);
@@ -6135,7 +6135,7 @@ ves_icall_RuntimeType_make_byref_type (MonoReflectionTypeHandle ref_type, MonoEr
 ICALL_EXPORT MonoReflectionTypeHandle
 ves_icall_RuntimeType_MakePointerType (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
@@ -6344,7 +6344,7 @@ ves_icall_System_Buffer_BlockCopyInternal (MonoArray *src, gint32 src_offset, Mo
 ICALL_EXPORT MonoObjectHandle
 ves_icall_Remoting_RealProxy_GetTransparentProxy (MonoObjectHandle this_obj, MonoStringHandle class_name, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (this_obj);
        MonoRealProxyHandle rp = MONO_HANDLE_CAST (MonoRealProxy, this_obj);
 
@@ -6649,10 +6649,6 @@ ves_icall_System_Environment_Exit (int result)
        /* Suspend all managed threads since the runtime is going away */
        mono_thread_suspend_all_other_threads ();
 
-       //FIXME shutdown is, weirdly enough, abortible in gc.c so we add this hack for now, see https://bugzilla.xamarin.com/show_bug.cgi?id=51653
-       mono_threads_begin_abort_protected_block ();
-       mono_thread_info_clear_self_interrupt ();
-
        mono_runtime_quit ();
 #endif
 
@@ -7184,7 +7180,7 @@ ves_icall_System_Web_Util_ICalls_get_machine_install_dir (void)
 ICALL_EXPORT gboolean
 ves_icall_get_resources_ptr (MonoReflectionAssemblyHandle assembly, gpointer *result, gint32 *size, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoPEResourceDataEntry *entry;
        MonoImage *image;
 
@@ -7249,7 +7245,7 @@ ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString (MonoS
 ICALL_EXPORT MonoObjectHandle
 ves_icall_System_Activator_CreateInstanceInternal (MonoReflectionTypeHandle ref_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
        MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
        MonoClass *klass = mono_class_from_mono_type (type);
@@ -7268,7 +7264,7 @@ ves_icall_System_Activator_CreateInstanceInternal (MonoReflectionTypeHandle ref_
 ICALL_EXPORT MonoReflectionMethodHandle
 ves_icall_MonoMethod_get_base_method (MonoReflectionMethodHandle m, gboolean definition, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *method = MONO_HANDLE_GETVAL (m, method);
 
        MonoMethod *base = mono_method_get_base_method (method, definition, error);
@@ -7282,7 +7278,7 @@ ves_icall_MonoMethod_get_base_method (MonoReflectionMethodHandle m, gboolean def
 ICALL_EXPORT MonoStringHandle
 ves_icall_MonoMethod_get_name (MonoReflectionMethodHandle m, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *method = MONO_HANDLE_GETVAL (m, method);
 
        MonoStringHandle s = mono_string_new_handle (MONO_HANDLE_DOMAIN (m), method->name, error);
@@ -7460,7 +7456,7 @@ prelink_method (MonoMethod *method, MonoError *error)
 {
        const char *exc_class, *exc_arg;
 
-       mono_error_init (error);
+       error_init (error);
        if (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
                return;
        mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
@@ -7521,7 +7517,7 @@ static gboolean
 add_modifier_to_array (MonoDomain *domain, MonoImage *image, MonoCustomMod *modifier, MonoArrayHandle dest, int dest_idx, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass = mono_class_get_checked (image, modifier->token, error);
        if (!is_ok (error))
                goto leave;
@@ -7545,7 +7541,7 @@ type_array_from_modifiers (MonoImage *image, MonoType *type, int optional, MonoE
        int i, count = 0;
        MonoDomain *domain = mono_domain_get ();
 
-       mono_error_init (error);
+       error_init (error);
        for (i = 0; i < type->num_mods; ++i) {
                if ((optional && !type->modifiers [i].required) || (!optional && type->modifiers [i].required))
                        count++;
@@ -7572,7 +7568,7 @@ fail:
 ICALL_EXPORT MonoArrayHandle
 ves_icall_ParameterInfo_GetTypeModifiers (MonoReflectionParameterHandle param, MonoBoolean optional, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionTypeHandle rt = MONO_HANDLE_NEW (MonoReflectionType, NULL);
        MONO_HANDLE_GET (rt, param, ClassImpl);
        MonoType *type = MONO_HANDLE_GETVAL (rt, type);
@@ -7626,7 +7622,7 @@ get_property_type (MonoProperty *prop)
 ICALL_EXPORT MonoArrayHandle
 ves_icall_MonoPropertyInfo_GetTypeModifiers (MonoReflectionPropertyHandle property, MonoBoolean optional, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoProperty *prop = MONO_HANDLE_GETVAL (property, property);
        MonoClass *klass = MONO_HANDLE_GETVAL (property, klass);
        MonoType *type = get_property_type (prop);
@@ -7751,7 +7747,7 @@ ves_icall_Mono_Runtime_GetDisplayName (MonoError *error)
        char *info;
        MonoStringHandle display_name;
 
-       mono_error_init (error);
+       error_init (error);
        info = mono_get_runtime_callbacks ()->get_runtime_build_info ();
        display_name = mono_string_new_handle (mono_domain_get (), info, error);
        g_free (info);
@@ -8546,7 +8542,7 @@ mono_create_icall_signature (const char *sigstr)
        res = mono_metadata_signature_alloc (corlib, len - 1);
        res->pinvoke = 1;
 
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        /* 
         * Under windows, the default pinvoke calling convention is STDCALL but
         * we need CDECL.
index c9b9081966c9182897420a3c508a90d92b3458e1..f494a57f1471849533476a95b434211e00746ea7 100644 (file)
@@ -691,7 +691,7 @@ mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error)
        GList *list_iter, *valid_modules = NULL;
        MonoImageOpenStatus status;
 
-       mono_error_init (error);
+       error_init (error);
 
        if ((image->module_count == 0) || (idx > image->module_count || idx <= 0))
                return NULL;
@@ -2347,7 +2347,7 @@ mono_image_load_file_for_image_checked (MonoImage *image, int fileidx, MonoError
        const char *fname;
        guint32 fname_id;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (fileidx < 1 || fileidx > t->rows)
                return NULL;
index 0309ce8404e1593cd2f88e5b84af17ac0a61c4f7..a2d671c6839bb359f7af9aafc8c98b9a8bfea4db 100644 (file)
@@ -185,7 +185,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
        const char *ptr;
        guint32 idx = mono_metadata_token_index (token);
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE);
        nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
@@ -274,7 +274,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
        guint32 type;
        MonoClassField *field;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (image)) {
                MonoClassField *result;
@@ -360,7 +360,7 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con
        int i;
 
        /* Search directly in the metadata to avoid calling setup_methods () */
-       mono_error_init (error);
+       error_init (error);
 
        /* FIXME: !mono_class_is_ginst (from_class) condition causes test failures. */
        if (klass->type_token && !image_is_dynamic (klass->image) && !klass->methods && !klass->rank && klass == from_class && !mono_class_is_ginst (from_class)) {
@@ -448,7 +448,7 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig
        MonoMethod *result = NULL;
        MonoClass *initial_class = in_class;
 
-       mono_error_init (error);
+       error_init (error);
        is_interface = MONO_CLASS_IS_INTERFACE (in_class);
 
        if (ic) {
@@ -530,7 +530,7 @@ inflate_generic_signature_checked (MonoImage *image, MonoMethodSignature *sig, M
        gboolean is_open;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        if (!context)
                return sig;
 
@@ -608,7 +608,7 @@ inflate_generic_header (MonoMethodHeader *header, MonoGenericContext *context, M
 
        res->is_transient = TRUE;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (int i = 0; i < header->num_locals; ++i) {
                res->locals [i] = mono_class_inflate_generic_type_checked (header->locals [i], context, error);
@@ -655,7 +655,7 @@ mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32
        MonoMethodSignature *sig;
        const char *ptr;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* !table is for wrappers: we should really assign their own token to them */
        if (!table || table == MONO_TABLE_METHOD)
@@ -776,7 +776,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
        MonoMethodSignature *sig;
        const char *ptr;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, 3);
        nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
@@ -905,7 +905,7 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i
        guint32 cols [MONO_METHODSPEC_SIZE];
        guint32 token, nindex, param_count;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_metadata_decode_row (&tables [MONO_TABLE_METHODSPEC], idx - 1, cols, MONO_METHODSPEC_SIZE);
        token = cols [MONO_METHODSPEC_METHOD];
@@ -1594,7 +1594,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
        const char *sig = NULL;
        guint32 cols [MONO_TYPEDEF_SIZE];
 
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (image)) {
                MonoClass *handle_class;
@@ -1735,7 +1735,7 @@ mono_get_method_checked (MonoImage *image, guint32 token, MonoClass *klass, Mono
 
        /* We do everything inside the lock to prevent creation races */
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_image_lock (image);
 
@@ -1791,7 +1791,7 @@ get_method_constrained (MonoImage *image, MonoMethod *method, MonoClass *constra
        MonoGenericContext *method_context = NULL;
        MonoMethodSignature *sig, *original_sig;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_class_init (constrained_class);
        original_sig = sig = mono_method_signature_checked (method, error);
@@ -1873,7 +1873,7 @@ mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constra
 MonoMethod *
 mono_get_method_constrained_checked (MonoImage *image, guint32 token, MonoClass *constrained_class, MonoGenericContext *context, MonoMethod **cil_method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        *cil_method = mono_get_method_from_token (image, token, NULL, context, NULL, error);
        if (!*cil_method)
@@ -2345,7 +2345,7 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error)
 
        /* We need memory barriers below because of the double-checked locking pattern */ 
 
-       mono_error_init (error);
+       error_init (error);
 
        if (m->signature)
                return m->signature;
@@ -2436,7 +2436,7 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error)
        }
        if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
                signature->pinvoke = 1;
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
                /*
                 * On Windows the default pinvoke calling convention is STDCALL but
                 * we need CDECL since this is actually an icall.
@@ -2534,7 +2534,7 @@ mono_method_get_header_checked (MonoMethod *method, MonoError *error)
        gpointer loc;
        MonoGenericContainer *container;
 
-       mono_error_init (error);
+       error_init (error);
        img = method->klass->image;
 
        if ((method->flags & METHOD_ATTRIBUTE_ABSTRACT) || (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) || (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
index 2adb0d606506d3fa505533a18d21067d8cb0e45e..113fe1f2136b731aaf260dcff8c54a5492e9e02d 100644 (file)
@@ -97,7 +97,7 @@ create_group_sizes_array (const gint *gs, gint ml, MonoError *error)
        MonoArray *ret;
        int i, len = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (i = 0; i < ml; i++) {
                if (gs [i] == -1)
@@ -122,7 +122,7 @@ create_names_array_idx (const guint16 *names, int ml, MonoError *error)
        MonoDomain *domain;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (names == NULL)
                return NULL;
@@ -145,7 +145,7 @@ create_names_array_idx_dynamic (const guint16 *names, int ml, MonoError *error)
        MonoDomain *domain;
        int i, len = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (names == NULL)
                return NULL;
@@ -329,7 +329,7 @@ construct_culture (MonoCultureInfo *this_obj, const CultureInfoEntry *ci, MonoEr
 {
        MonoDomain *domain = mono_domain_get ();
 
-       mono_error_init (error);
+       error_init (error);
 
        this_obj->lcid = ci->lcid;
        MONO_OBJECT_SETREF (this_obj, name, mono_string_new (domain, idx2string (ci->name)));
index 6020bf50eb45f2a18f5fe5295728ccbee8d9572d..1545e1e19ba69a31d6f7055a8f65920a7766b950 100644 (file)
@@ -242,6 +242,14 @@ register_icall (gpointer func, const char *name, const char *sigstr, gboolean no
        mono_register_jit_icall (func, name, sig, no_wrapper);
 }
 
+static void
+register_icall_no_wrapper (gpointer func, const char *name, const char *sigstr)
+{
+       MonoMethodSignature *sig = mono_create_icall_signature (sigstr);
+
+       mono_register_jit_icall (func, name, sig, TRUE);
+}
+
 MonoMethodSignature*
 mono_signature_no_pinvoke (MonoMethod *method)
 {
@@ -335,7 +343,7 @@ mono_marshal_init (void)
                register_icall (mono_string_to_byvalstr, "mono_string_to_byvalstr", "void ptr ptr int32", FALSE);
                register_icall (mono_string_to_byvalwstr, "mono_string_to_byvalwstr", "void ptr ptr int32", FALSE);
                register_icall (g_free, "g_free", "void ptr", FALSE);
-               register_icall (mono_object_isinst_icall, "mono_object_isinst_icall", "object object ptr", FALSE);
+               register_icall_no_wrapper (mono_object_isinst_icall, "mono_object_isinst_icall", "object object ptr");
                register_icall (mono_struct_delete_old, "mono_struct_delete_old", "void ptr ptr", FALSE);
                register_icall (mono_delegate_begin_invoke, "mono_delegate_begin_invoke", "object object ptr", FALSE);
                register_icall (mono_delegate_end_invoke, "mono_delegate_end_invoke", "object object ptr", FALSE);
@@ -426,7 +434,9 @@ mono_delegate_to_ftnptr (MonoDelegate *delegate)
                target_handle = mono_gchandle_new_weakref (delegate->target, FALSE);
        }
 
-       wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle);
+       wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle, &error);
+       if (!is_ok (&error))
+               goto fail;
 
        delegate->delegate_trampoline = mono_compile_method_checked (wrapper, &error);
        if (!is_ok (&error))
@@ -8659,9 +8669,8 @@ mono_marshal_set_callconv_from_modopt (MonoMethod *method, MonoMethodSignature *
  * If target_handle==0, the wrapper info will be a WrapperInfo structure.
  */
 MonoMethod *
-mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t target_handle)
+mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t target_handle, MonoError *error)
 {
-       MonoError error;
        MonoMethodSignature *sig, *csig, *invoke_sig;
        MonoMethodBuilder *mb;
        MonoMethod *res, *invoke;
@@ -8672,7 +8681,12 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
        EmitMarshalContext m;
 
        g_assert (method != NULL);
-       g_assert (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL));
+       error_init (error);
+
+       if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
+               mono_error_set_invalid_program (error, "Failed because method (%s) marked PInvokeCallback (managed method) and extern (unmanaged) simultaneously.", mono_method_full_name (method, TRUE));
+               return NULL;
+       }
 
        /* 
         * FIXME: Should cache the method+delegate type pair, since the same method
@@ -8726,8 +8740,8 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
                 * contents of the attribute without constructing it, as that might not be
                 * possible when running in cross-compiling mode.
                 */
-               cinfo = mono_custom_attrs_from_class_checked (delegate_klass, &error);
-               mono_error_assert_ok (&error);
+               cinfo = mono_custom_attrs_from_class_checked (delegate_klass, error);
+               mono_error_assert_ok (error);
                attr = NULL;
                if (cinfo) {
                        for (i = 0; i < cinfo->num_attrs; ++i) {
@@ -9696,7 +9710,8 @@ get_virtual_stelemref_wrapper (int kind)
                mono_mb_emit_byte (mb, CEE_RET);
                break;
 
-       case STELEMREF_COMPLEX:
+       case STELEMREF_COMPLEX: {
+               int b_fast;
                /*
                <ldelema (bound check)>
                if (!value)
@@ -9712,6 +9727,7 @@ get_virtual_stelemref_wrapper (int kind)
                */
 
                aklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+               vklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
                array_slot_addr = mono_mb_add_local (mb, &mono_defaults.object_class->this_arg);
 
 #if 0
@@ -9740,6 +9756,13 @@ get_virtual_stelemref_wrapper (int kind)
 
                /* aklass = array->vtable->klass->element_class */
                load_array_class (mb, aklass);
+               /* vklass = value->vtable->klass */
+               load_value_class (mb, vklass);
+
+               /* fastpath */
+               mono_mb_emit_ldloc (mb, vklass);
+               mono_mb_emit_ldloc (mb, aklass);
+               b_fast = mono_mb_emit_branch (mb, CEE_BEQ);
 
                /*if (mono_object_isinst (value, aklass)) */
                mono_mb_emit_ldarg (mb, 2);
@@ -9749,6 +9772,7 @@ get_virtual_stelemref_wrapper (int kind)
 
                /* do_store: */
                mono_mb_patch_branch (mb, b1);
+               mono_mb_patch_branch (mb, b_fast);
                mono_mb_emit_ldloc (mb, array_slot_addr);
                mono_mb_emit_ldarg (mb, 2);
                mono_mb_emit_byte (mb, CEE_STIND_REF);
@@ -9759,7 +9783,7 @@ get_virtual_stelemref_wrapper (int kind)
 
                mono_mb_emit_exception (mb, "ArrayTypeMismatchException", NULL);
                break;
-
+       }
        case STELEMREF_SEALED_CLASS:
                /*
                <ldelema (bound check)>
@@ -9782,7 +9806,6 @@ get_virtual_stelemref_wrapper (int kind)
                vklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
                array_slot_addr = mono_mb_add_local (mb, &mono_defaults.object_class->this_arg);
 
-
                /* ldelema (implicit bound check) */
                load_array_element_address (mb);
                mono_mb_emit_stloc (mb, array_slot_addr);
@@ -9814,7 +9837,9 @@ get_virtual_stelemref_wrapper (int kind)
                mono_mb_emit_exception (mb, "ArrayTypeMismatchException", NULL);
                break;
 
-       case STELEMREF_CLASS:
+       case STELEMREF_CLASS: {
+               int b_fast;
+
                /*
                the method:
                <ldelema (bound check)>
@@ -9855,6 +9880,11 @@ get_virtual_stelemref_wrapper (int kind)
                /* vklass = value->vtable->klass */
                load_value_class (mb, vklass);
 
+               /* fastpath */
+               mono_mb_emit_ldloc (mb, vklass);
+               mono_mb_emit_ldloc (mb, aklass);
+               b_fast = mono_mb_emit_branch (mb, CEE_BEQ);
+
                /*if (mono_object_isinst (value, aklass)) */
                mono_mb_emit_ldarg (mb, 2);
                mono_mb_emit_ldloc (mb, aklass);
@@ -9892,6 +9922,7 @@ get_virtual_stelemref_wrapper (int kind)
 
                /* do_store: */
                mono_mb_patch_branch (mb, b1);
+               mono_mb_patch_branch (mb, b_fast);
                mono_mb_emit_ldloc (mb, array_slot_addr);
                mono_mb_emit_ldarg (mb, 2);
                mono_mb_emit_byte (mb, CEE_STIND_REF);
@@ -9904,7 +9935,7 @@ get_virtual_stelemref_wrapper (int kind)
 
                mono_mb_emit_exception (mb, "ArrayTypeMismatchException", NULL);
                break;
-
+       }
        case STELEMREF_INTERFACE:
                /*Mono *klass;
                MonoVTable *vt;
@@ -10550,7 +10581,7 @@ mono_marshal_alloc (gulong size, MonoError *error)
 {
        gpointer res;
 
-       mono_error_init (error);
+       error_init (error);
 
        res = mono_marshal_alloc_co_task_mem (size);
        if (!res)
@@ -10733,7 +10764,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char *ptr,
 {
        MonoError error;
        MonoString *result = NULL;
-       mono_error_init (&error);
+       error_init (&error);
        if (ptr == NULL)
                mono_error_set_argument_null (&error, "ptr", "");
        else
@@ -10772,7 +10803,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni_len (guint16 *pt
        MonoString *res = NULL;
        MonoDomain *domain = mono_domain_get (); 
 
-       mono_error_init (&error);
+       error_init (&error);
 
        if (ptr == NULL) {
                res = NULL;
@@ -10853,7 +10884,7 @@ ptr_to_structure (gpointer src, MonoObject *dst, MonoError *error)
        MonoMethod *method;
        gpointer pa [2];
 
-       mono_error_init (error);
+       error_init (error);
 
        method = mono_marshal_get_ptr_to_struct (dst->vtable->klass);
 
@@ -12081,7 +12112,7 @@ mono_icall_start (HandleStackMark *stackmark, MonoError *error)
        MonoThreadInfo *info = mono_thread_info_current ();
 
        mono_stack_mark_init (info, stackmark);
-       mono_error_init (error);
+       error_init (error);
        return info;
 }
 
@@ -12089,5 +12120,6 @@ static void
 mono_icall_end (MonoThreadInfo *info, HandleStackMark *stackmark, MonoError *error)
 {
        mono_stack_mark_pop (info, stackmark);
-       mono_error_set_pending_exception (error);
+       if (G_UNLIKELY (!is_ok (error)))
+               mono_error_set_pending_exception (error);
 }
index e00661b1b593604f318b93cd47064c7fab2362fa..4b1c185f876011751b95773b1a031527dd3342ad 100644 (file)
@@ -330,7 +330,7 @@ MonoMethodSignature*
 mono_marshal_get_string_ctor_signature (MonoMethod *method);
 
 MonoMethod *
-mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t this_loc);
+mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t this_loc, MonoError *exernal_error);
 
 gpointer
 mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type);
index 9b4ca91bc753965ceaba0e55cf9b8f096af0ee08..554f5157d967a90980b8ce481548c0c3e9474736 100644 (file)
@@ -4055,7 +4055,7 @@ mono_verifier_verify_method_signature (MonoImage *image, guint32 offset, MonoErr
 {
        VerifyContext ctx;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_verifier_is_enabled_for_image (image))
                return TRUE;
@@ -4245,7 +4245,7 @@ mono_verifier_verify_typeref_row (MonoImage *image, guint32 row, MonoError *erro
        MonoTableInfo *table = &image->tables [MONO_TABLE_TYPEREF];
        guint32 data [MONO_TYPEREF_SIZE];
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_verifier_is_enabled_for_image (image))
                return TRUE;
@@ -4288,7 +4288,7 @@ mono_verifier_verify_methodimpl_row (MonoImage *image, guint32 row, MonoError *e
        MonoTableInfo *table = &image->tables [MONO_TABLE_METHODIMPL];
        guint32 data [MONO_METHODIMPL_SIZE];
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_verifier_is_enabled_for_image (image))
                return TRUE;
@@ -4371,7 +4371,7 @@ mono_verifier_verify_method_header (MonoImage *image, guint32 offset, GSList **e
 gboolean
 mono_verifier_verify_method_signature (MonoImage *image, guint32 offset, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return TRUE;
 }
 
@@ -4421,14 +4421,14 @@ mono_verifier_is_sig_compatible (MonoImage *image, MonoMethod *method, MonoMetho
 gboolean
 mono_verifier_verify_typeref_row (MonoImage *image, guint32 row, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return TRUE;
 }
 
 gboolean
 mono_verifier_verify_methodimpl_row (MonoImage *image, guint32 row, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return TRUE;
 }
 
index 3d76585b5cfbfac2be79b19cc743d94abd1b6d17..7ef3b74c5eb07bcab5f27c55df5877d91108ea6f 100644 (file)
@@ -1701,7 +1701,7 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container
        int count = 0; // Number of mod arguments
        gboolean found;
 
-       mono_error_init (error);
+       error_init (error);
 
        /*
         * According to the spec, custom modifiers should come before the byref
@@ -1944,7 +1944,7 @@ MonoMethodSignature*
 mono_metadata_parse_signature_checked (MonoImage *image, guint32 token, MonoError *error)
 {
 
-       mono_error_init (error);
+       error_init (error);
        MonoTableInfo *tables = image->tables;
        guint32 idx = mono_metadata_token_index (token);
        guint32 sig;
@@ -2121,7 +2121,7 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
        guint32 gen_param_count = 0;
        gboolean is_open = FALSE;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (*ptr & 0x10)
                gen_param_count = 1;
@@ -3135,7 +3135,7 @@ mono_metadata_inflate_generic_inst (MonoGenericInst *ginst, MonoGenericContext *
        MonoGenericInst *nginst = NULL;
        int i, count = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!ginst->is_open)
                return ginst;
@@ -3167,7 +3167,7 @@ mono_metadata_parse_generic_inst (MonoImage *m, MonoGenericContainer *container,
        MonoGenericInst *ginst;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        type_argv = g_new0 (MonoType*, count);
 
        for (i = 0; i < count; i++) {
@@ -3198,7 +3198,7 @@ do_mono_metadata_parse_generic_class (MonoType *type, MonoImage *m, MonoGenericC
        MonoType *gtype;
        int count;
 
-       mono_error_init (error);
+       error_init (error);
 
        // XXX how about transient?
        gtype = mono_metadata_parse_type_checked (m, NULL, 0, FALSE, ptr, &ptr, error);
@@ -3294,7 +3294,7 @@ mono_metadata_parse_generic_param (MonoImage *m, MonoGenericContainer *generic_c
        if (rptr)
                *rptr = ptr;
 
-       mono_error_init (error);
+       error_init (error);
 
        generic_container = select_container (generic_container, type);
        if (!generic_container) {
@@ -3368,7 +3368,7 @@ mono_metadata_get_shared_type (MonoType *type)
 static gboolean
 compare_type_literals (MonoImage *image, int class_type, int type_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        /* byval_arg.type can be zero if we're decoding a type that references a class been loading.
         * See mcs/test/gtest-440. and #650936.
@@ -3418,7 +3418,7 @@ compare_type_literals (MonoImage *image, int class_type, int type_type, MonoErro
 static gboolean
 verify_var_type_and_container (MonoImage *image, int var_type, MonoGenericContainer *container, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (var_type == MONO_TYPE_MVAR) {
                if (!container->is_method) { //MVAR and a method container
                        mono_error_set_bad_image (error, image, "MVAR parsed in a context without a method container");
@@ -3459,7 +3459,7 @@ static gboolean
 do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer *container,
                                                         gboolean transient, const char *ptr, const char **rptr, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        type->type = (MonoTypeEnum)mono_metadata_decode_value (ptr, &ptr);
        
@@ -3628,7 +3628,7 @@ parse_section_data (MonoImage *m, int *num_clauses, const unsigned char *ptr, Mo
        guint32 sect_data_len;
        MonoExceptionClause* clauses = NULL;
 
-       mono_error_init (error);
+       error_init (error);
        
        while (1) {
                /* align on 32-bit boundary */
@@ -3796,7 +3796,7 @@ mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *container, cons
        MonoTableInfo *t = &m->tables [MONO_TABLE_STANDALONESIG];
        guint32 cols [MONO_STAND_ALONE_SIGNATURE_SIZE];
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!ptr) {
                mono_error_set_bad_image (error, m, "Method header with null pointer");
@@ -4334,7 +4334,7 @@ mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, Mono
        *interfaces = NULL;
        *count = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!tdef->base)
                return TRUE;
@@ -5690,7 +5690,7 @@ mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, Mon
        const char *ptr;
        MonoType *type, *type2;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_image_lock (image);
        type = (MonoType *)g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
@@ -6068,7 +6068,7 @@ method_from_method_def_or_ref (MonoImage *m, guint32 tok, MonoGenericContext *co
        MonoMethod *result = NULL;
        guint32 idx = tok >> MONO_METHODDEFORREF_BITS;
 
-       mono_error_init (error);
+       error_init (error);
 
        switch (tok & MONO_METHODDEFORREF_MASK) {
        case MONO_METHODDEFORREF_METHODDEF:
@@ -6211,7 +6211,7 @@ get_constraints (MonoImage *image, int owner, MonoClass ***constraints, MonoGene
        GSList *cons = NULL, *tmp;
        MonoGenericContext *context = &container->context;
 
-       mono_error_init (error);
+       error_init (error);
 
        *constraints = NULL;
        found = 0;
@@ -6303,7 +6303,7 @@ mono_metadata_load_generic_param_constraints_checked (MonoImage *image, guint32
 {
 
        guint32 start_row, i, owner;
-       mono_error_init (error);
+       error_init (error);
 
        if (! (start_row = mono_metadata_get_generic_param_row (image, token, &owner)))
                return TRUE;
index 5ccb938df9b03a0f8dfb9a77c6a8accb80e9c2f0..1241ea2c134757c2306748754912bd7691cadd50 100644 (file)
@@ -240,7 +240,7 @@ bb_split (MonoSimpleBasicBlock *first, MonoSimpleBasicBlock *hint, MonoSimpleBas
 {
        MonoSimpleBasicBlock *res, *bb = first;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (bb_idx_is_contained (hint, target)) {
                first = hint;
@@ -338,7 +338,7 @@ bb_formation_il_pass (const unsigned char *start, const unsigned char *end, Mono
        MonoSimpleBasicBlock *branch, *next, *current;
        const MonoOpcode *opcode;
 
-       mono_error_init (error);
+       error_init (error);
 
        current = bb;
 
@@ -469,7 +469,7 @@ bb_formation_eh_pass (MonoMethodHeader *header, MonoSimpleBasicBlock *bb, MonoSi
        int i;
        int end = header->code_size;
 
-       mono_error_init (error);
+       error_init (error);
 
        /*We must split at all points to verify for targets in the middle of an instruction*/
        for (i = 0; i < header->num_clauses; ++i) {
@@ -527,7 +527,7 @@ mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader *
        MonoSimpleBasicBlock *bb, *root;
        const unsigned char *start, *end;
 
-       mono_error_init (error);
+       error_init (error);
 
        start = header->code;
        end = start + header->code_size;
index 42d646444b136658a5a5fc76a87ebf5a89d8828d..657a21348dc8829ec9fe6e635292728495b5f9a7 100644 (file)
@@ -65,7 +65,7 @@ mono_mlist_alloc (MonoObject *data)
 MonoMList*
 mono_mlist_alloc_checked (MonoObject *data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMList* res;
        if (!monolist_item_vtable) {
                MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoListItem");
@@ -197,7 +197,7 @@ mono_mlist_prepend (MonoMList* list, MonoObject *data)
 MonoMList*
 mono_mlist_prepend_checked (MonoMList* list, MonoObject *data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMList* res = mono_mlist_alloc_checked (data, error);
        return_val_if_nok (error, NULL);
 
@@ -238,7 +238,7 @@ mono_mlist_append (MonoMList* list, MonoObject *data)
 MonoMList*
 mono_mlist_append_checked (MonoMList* list, MonoObject *data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMList* res = mono_mlist_alloc_checked (data, error);
        return_val_if_nok (error, NULL);
 
index 57c01f411e33ffb0ec34c3f0b04b436de297680b..8c370a9bacfc4bdce4d68498f481ec23ab7c0434 100644 (file)
@@ -1295,7 +1295,7 @@ custom_get_impl (SharedCategory *cat, MonoString *counter, MonoString* instance,
        SharedInstance* inst;
        char *name;
 
-       mono_error_init (error);
+       error_init (error);
        scounter = find_custom_counter (cat, counter);
        if (!scounter)
                return NULL;
@@ -1689,7 +1689,7 @@ get_string_array (void **array, int count, gboolean is_process, MonoError *error
 {
        int i;
        MonoDomain *domain = mono_domain_get ();
-       mono_error_init (error);
+       error_init (error);
        MonoArray * res = mono_array_new_checked (mono_domain_get (), mono_get_string_class (), count, error);
        return_val_if_nok (error, NULL);
        for (i = 0; i < count; ++i) {
@@ -1714,7 +1714,7 @@ get_string_array_of_strings (void **array, int count, MonoError *error)
 {
        int i;
        MonoDomain *domain = mono_domain_get ();
-       mono_error_init (error);
+       error_init (error);
        MonoArray * res = mono_array_new_checked (mono_domain_get (), mono_get_string_class (), count, error);
        return_val_if_nok (error, NULL);
        for (i = 0; i < count; ++i) {
@@ -1732,7 +1732,7 @@ get_mono_instances (MonoError *error)
        int res;
        void **buf = NULL;
        MonoArray *array;
-       mono_error_init (error);
+       error_init (error);
        do {
                count *= 2;
                g_free (buf);
@@ -1750,7 +1750,7 @@ get_cpu_instances (MonoError *error)
        void **buf = NULL;
        int i, count;
        MonoArray *array;
-       mono_error_init (error);
+       error_init (error);
        count = mono_cpu_count () + 1; /* +1 for "_Total" */
        buf = g_new (void*, count);
        for (i = 0; i < count; ++i)
@@ -1767,7 +1767,7 @@ get_processes_instances (MonoError *error)
        MonoArray *array;
        int count = 0;
        void **buf = mono_process_list (&count);
-       mono_error_init (error);
+       error_init (error);
        if (!buf)
                return get_string_array (NULL, 0, FALSE, error);
        array = get_string_array (buf, count, TRUE, error);
@@ -1780,7 +1780,7 @@ get_networkinterface_instances (MonoError *error)
 {
        MonoArray *array;
        int count = 0;
-       mono_error_init (error);
+       error_init (error);
        void **buf = mono_networkinterface_list (&count);
        if (!buf)
                return get_string_array_of_strings (NULL, 0, error);
@@ -1793,7 +1793,7 @@ static MonoArray*
 get_custom_instances (MonoString *category, MonoError *error)
 {
        SharedCategory *scat;
-       mono_error_init (error);
+       error_init (error);
        scat = find_custom_category (category);
        if (scat) {
                GSList *list = get_custom_instances_list (scat);
index 01549b8d3fc91347f8070f9c15c87bb2f7be990b..bd1ebe9b3644e12c924ecf7fdf652e058e963ed8 100644 (file)
@@ -16,7 +16,7 @@ gpointer
 ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("OpenThreadToken, OpenProcessToken");
 
@@ -32,7 +32,7 @@ MonoArray*
 ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetTokenInformation");
 
@@ -48,7 +48,7 @@ gpointer
 ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("DuplicateToken");
 
@@ -64,7 +64,7 @@ gboolean
 ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("ImpersonateLoggedOnUser");
 
@@ -80,7 +80,7 @@ gboolean
 ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("RevertToSelf");
 
@@ -96,7 +96,7 @@ gint32
 mono_security_win_get_token_name (gpointer token, gunichar2 ** uniname)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetTokenInformation");
 
@@ -112,7 +112,7 @@ gboolean
 mono_security_win_is_machine_protected (gunichar2 *path)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetNamedSecurityInfo, LocalFree");
 
@@ -128,7 +128,7 @@ gboolean
 mono_security_win_is_user_protected (gunichar2 *path)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetNamedSecurityInfo, LocalFree");
 
@@ -144,7 +144,7 @@ gboolean
 mono_security_win_protect_machine (gunichar2 *path)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("BuildTrusteeWithSid, SetEntriesInAcl, SetNamedSecurityInfo, LocalFree, FreeSid");
 
@@ -160,7 +160,7 @@ gboolean
 mono_security_win_protect_user (gunichar2 *path)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("BuildTrusteeWithSid, SetEntriesInAcl, SetNamedSecurityInfo, LocalFree");
 
index f6d088dd0c7b11b50d6bc20bfc73bc6bfdc875fc..63807a5ac8fdd999be398a52975549a1ac43e5f2 100644 (file)
@@ -111,7 +111,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
        gunichar2 *uniname = NULL;
        gint32 size = 0;
 
-       mono_error_init (&error);
+       error_init (&error);
 
        size = mono_security_win_get_token_name (token, &uniname);
 
index a1d3c9d0e4fe22e880944a855475c09b7ad09a00..0d770f70cdc0906290840eeb398892843cfcdfb4 100644 (file)
@@ -226,7 +226,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
        gunichar2 *uniname = NULL;
        gint32 size = 0;
 
-       mono_error_init (&error);
+       error_init (&error);
 
        size = internal_get_token_name (token, &uniname);
 
@@ -551,7 +551,7 @@ ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString
 MonoBoolean
 ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent (MonoReflectionAssemblyHandle refass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (MONO_HANDLE_IS_NULL (refass))
                return FALSE;
        MonoAssembly *assembly = MONO_HANDLE_GETVAL (refass, assembly);
@@ -587,7 +587,7 @@ void invoke_protected_memory_method (MonoArray *data, MonoObject *scope, gboolea
        MonoMethod *method;
        void *params [2];
 
-       mono_error_init (error);
+       error_init (error);
        
        if (system_security_assembly == NULL) {
                system_security_assembly = mono_image_loaded ("System.Security");
index 52aefb176930d89ada4cb3e3b451f133f5cf4ad5..96d52815caf7b41997bb284023fbebf9248a9120 100644 (file)
@@ -113,7 +113,7 @@ mono_runtime_object_init_checked (MonoObject *this_obj, MonoError *error)
        MonoMethod *method = NULL;
        MonoClass *klass = this_obj->vtable->klass;
 
-       mono_error_init (error);
+       error_init (error);
        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));
@@ -358,7 +358,7 @@ mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error)
        MonoDomain *last_domain = NULL;
        MonoException * pending_tae = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (vtable->initialized)
                return TRUE;
@@ -430,9 +430,6 @@ mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error)
                lock->initializing_tid = tid;
                lock->waiting_count = 1;
                lock->done = FALSE;
-               /* grab the vtable lock while this thread still owns type_initialization_section */
-               /* This is why type_initialization_lock needs to enter blocking mode */
-               mono_type_init_lock (lock);
                g_hash_table_insert (type_initialization_hash, vtable, lock);
                do_initialization = 1;
        } else {
@@ -480,7 +477,7 @@ mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error)
                else
                        mono_error_cleanup (error);
 
-               mono_error_init (error);
+               error_init (error);
 
                /* If the initialization failed, mark the class as unusable. */
                /* Avoid infinite loops */
@@ -513,10 +510,11 @@ mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error)
 
                if (last_domain)
                        mono_domain_set (last_domain, TRUE);
+
                /* Signal to the other threads that we are done */
+               mono_type_init_lock (lock);
                lock->done = TRUE;
                mono_coop_cond_broadcast (&lock->cond);
-
                mono_type_init_unlock (lock);
 
                //This can happen if the cctor self-aborts
@@ -572,6 +570,7 @@ gboolean release_type_locks (gpointer key, gpointer value, gpointer user)
                 * mono_runtime_class_init (). In this case, the exception object is not stored,
                 * and get_type_init_exception_for_class () needs to be aware of this.
                 */
+               mono_type_init_lock (lock);
                vtable->init_failed = 1;
                mono_coop_cond_broadcast (&lock->cond);
                mono_type_init_unlock (lock);
@@ -666,7 +665,7 @@ mono_compile_method_checked (MonoMethod *method, MonoError *error)
 
        MONO_REQ_GC_NEUTRAL_MODE
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (callbacks.compile_method);
        res = callbacks.compile_method (method, error);
@@ -680,7 +679,7 @@ mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gbo
 
        MONO_REQ_GC_NEUTRAL_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        res = callbacks.create_jump_trampoline (domain, method, add_sync_wrapper, error);
        return res;
 }
@@ -1779,7 +1778,7 @@ mono_class_vtable_full (MonoDomain *domain, MonoClass *klass, MonoError *error)
 
        MonoClassRuntimeInfo *runtime_info;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (klass);
 
@@ -1857,7 +1856,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, MonoErro
        gpointer iter;
        gpointer *interface_offsets;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_loader_lock (); /*FIXME mono_class_init acquires it*/
        mono_domain_lock (domain);
@@ -2215,7 +2214,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        int bcsize;
 #endif
 
-       mono_error_init (error);
+       error_init (error);
 
        vt = mono_class_vtable (domain, klass);
        g_assert (vt); /*FIXME property handle failure*/
@@ -2524,7 +2523,7 @@ mono_remote_class (MonoDomain *domain, MonoStringHandle class_name, MonoClass *p
        gpointer* key, *mp_key;
        char *name;
        
-       mono_error_init (error);
+       error_init (error);
 
        key = create_remote_class_key (NULL, proxy_class);
        
@@ -2633,7 +2632,7 @@ mono_remote_class_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mon
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_loader_lock (); /*FIXME mono_class_from_mono_type and mono_class_proxy_vtable take it*/
        mono_domain_lock (domain);
@@ -2687,7 +2686,7 @@ mono_upgrade_remote_class (MonoDomain *domain, MonoObjectHandle proxy_object, Mo
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoTransparentProxyHandle tproxy = MONO_HANDLE_CAST (MonoTransparentProxy, proxy_object);
        MonoRemoteClass *remote_class = MONO_HANDLE_GETVAL (tproxy, remote_class);
@@ -2755,7 +2754,7 @@ mono_object_get_virtual_method (MonoObject *obj_raw, MonoMethod *method)
 MonoMethod*
 mono_object_handle_get_virtual_method (MonoObjectHandle obj, MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        gboolean is_proxy = FALSE;
        MonoClass *klass = mono_handle_class (obj);
@@ -2770,7 +2769,7 @@ mono_object_handle_get_virtual_method (MonoObjectHandle obj, MonoMethod *method,
 static MonoMethod*
 class_get_virtual_method (MonoClass *klass, MonoMethod *method, gboolean is_proxy, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
 
        if (!is_proxy && ((method->flags & METHOD_ATTRIBUTE_FINAL) || !(method->flags & METHOD_ATTRIBUTE_VIRTUAL)))
@@ -2843,7 +2842,7 @@ do_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **ex
 
        g_assert (callbacks.runtime_invoke);
 
-       mono_error_init (error);
+       error_init (error);
        
        if (mono_profiler_get_events () & MONO_PROFILE_METHOD_EVENTS)
                mono_profiler_method_start_invoke (method);
@@ -3344,7 +3343,7 @@ mono_field_get_value_object_checked (MonoDomain *domain, MonoClassField *field,
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoObject *o;
        MonoClass *klass;
@@ -3489,7 +3488,7 @@ mono_get_constant_value_from_blob (MonoDomain* domain, MonoTypeEnum type, const
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        int retval = 0;
        const char *p = blob;
        mono_metadata_decode_blob_size (p, &p);
@@ -3540,7 +3539,7 @@ get_default_field_value (MonoDomain* domain, MonoClassField *field, void *value,
        MonoTypeEnum def_type;
        const char* data;
 
-       mono_error_init (error);
+       error_init (error);
        
        data = mono_class_get_field_default_value (field, &def_type);
        mono_get_constant_value_from_blob (domain, def_type, data, value, error);
@@ -3553,7 +3552,7 @@ mono_field_static_get_value_for_thread (MonoInternalThread *thread, MonoVTable *
 
        void *src;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_return_if_fail (field->type->attrs & FIELD_ATTRIBUTE_STATIC);
        
@@ -3675,7 +3674,7 @@ mono_property_set_value_checked (MonoProperty *prop, void *obj, void **params, M
 
        MonoObject *exc;
 
-       mono_error_init (error);
+       error_init (error);
        do_runtime_invoke (prop->set, obj, params, &exc, error);
        if (exc != NULL && is_ok (error))
                mono_error_set_exception_instance (error, (MonoException*)exc);
@@ -3798,7 +3797,7 @@ mono_nullable_box (guint8 *buf, MonoClass *klass, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoClass *param_class = klass->cast_class;
 
        mono_class_setup_fields (klass);
@@ -3939,7 +3938,7 @@ mono_runtime_delegate_try_invoke (MonoObject *delegate, void **params, MonoObjec
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *im;
        MonoClass *klass = delegate->vtable->klass;
        MonoObject *o;
@@ -3971,7 +3970,7 @@ mono_runtime_delegate_try_invoke (MonoObject *delegate, void **params, MonoObjec
 MonoObject*
 mono_runtime_delegate_invoke_checked (MonoObject *delegate, void **params, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return mono_runtime_delegate_try_invoke (delegate, params, NULL, error);
 }
 
@@ -4007,7 +4006,7 @@ mono_runtime_get_main_args_checked (MonoError *error)
        int i;
        MonoDomain *domain = mono_domain_get ();
 
-       mono_error_init (error);
+       error_init (error);
 
        res = (MonoArray*)mono_array_new_checked (domain, mono_defaults.string_class, num_main_args, error);
        return_val_if_nok (error, NULL);
@@ -4216,7 +4215,7 @@ int
 mono_runtime_run_main_checked (MonoMethod *method, int argc, char* argv[],
                               MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoArray *args = prepare_run_main (method, argc, argv);
        return mono_runtime_exec_main_checked (method, args, error);
 }
@@ -4330,7 +4329,7 @@ make_transparent_proxy (MonoObject *obj, MonoError *error)
        MonoReflectionType *reflection_type;
        MonoTransparentProxy *transparent_proxy;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!get_proxy_method)
                get_proxy_method = mono_class_get_method_from_name (mono_defaults.real_proxy_class, "GetTransparentProxy", 0);
@@ -4374,7 +4373,7 @@ mono_object_xdomain_representation (MonoObject *obj, MonoDomain *target_domain,
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoObject *deserialized = NULL;
 
 #ifndef DISABLE_REMOTING
@@ -4409,7 +4408,7 @@ create_unhandled_exception_eventargs (MonoObject *exc, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass;
        gpointer args [2];
        MonoMethod *method = NULL;
@@ -4660,7 +4659,7 @@ do_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError *error)
        gpointer pa [1];
        int rval;
 
-       mono_error_init (error);
+       error_init (error);
        g_assert (args);
 
        pa [0] = args;
@@ -4767,7 +4766,7 @@ mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
 int
 mono_runtime_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        prepare_thread_to_exec_main (mono_object_domain (args), method);
        return do_exec_main_checked (method, args, error);
 }
@@ -4804,7 +4803,7 @@ invoke_array_extract_argument (MonoArray *params, int i, MonoType *t, gboolean*
 {
        MonoType *t_orig = t;
        gpointer result = NULL;
-       mono_error_init (error);
+       error_init (error);
                again:
                        switch (t->type) {
                        case MONO_TYPE_U1:
@@ -4985,7 +4984,7 @@ MonoObject*
 mono_runtime_invoke_array_checked (MonoMethod *method, void *obj, MonoArray *params,
                                   MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return mono_runtime_try_invoke_array (method, obj, params, NULL, error);
 }
 
@@ -5034,7 +5033,7 @@ mono_runtime_try_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoMethodSignature *sig = mono_method_signature (method);
        gpointer *pa = NULL;
@@ -5230,7 +5229,7 @@ mono_object_new_pinned (MonoDomain *domain, MonoClass *klass, MonoError *error)
 
        MonoVTable *vtable;
 
-       mono_error_init (error);
+       error_init (error);
 
        vtable = mono_class_vtable (domain, klass);
        g_assert (vtable); /* FIXME don't swallow the error */
@@ -5269,7 +5268,7 @@ mono_object_new_specific_checked (MonoVTable *vtable, MonoError *error)
 
        MonoObject *o;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* check for is_com_object for COM Interop */
        if (mono_vtable_is_remote (vtable) || mono_class_is_com_object (vtable->klass))
@@ -5363,7 +5362,7 @@ mono_object_new_alloc_specific_checked (MonoVTable *vtable, MonoError *error)
 
        MonoObject *o;
 
-       mono_error_init (error);
+       error_init (error);
 
        o = (MonoObject *)mono_gc_alloc_obj (vtable, vtable->klass->instance_size);
 
@@ -5424,7 +5423,7 @@ mono_object_new_fast_checked (MonoVTable *vtable, MonoError *error)
 
        MonoObject *o;
 
-       mono_error_init (error);
+       error_init (error);
 
        o = mono_gc_alloc_obj (vtable, vtable->klass->instance_size);
 
@@ -5451,7 +5450,7 @@ mono_object_new_mature (MonoVTable *vtable, MonoError *error)
 
        MonoObject *o;
 
-       mono_error_init (error);
+       error_init (error);
 
        o = mono_gc_alloc_mature (vtable, vtable->klass->instance_size);
 
@@ -5555,7 +5554,7 @@ mono_object_clone_checked (MonoObject *obj, MonoError *error)
        MonoObject *o;
        int size;
 
-       mono_error_init (error);
+       error_init (error);
 
        size = obj->vtable->klass->instance_size;
 
@@ -5636,7 +5635,7 @@ mono_array_clone_in_domain (MonoDomain *domain, MonoArrayHandle array_handle, Mo
        uintptr_t size = 0;
        MonoClass *klass = mono_handle_class (array_handle);
 
-       mono_error_init (error);
+       error_init (error);
 
        /* Pin source array here - if bounds is non-NULL, it's a pointer into the object data */
        uint32_t src_handle = mono_gchandle_from_handle (MONO_HANDLE_CAST (MonoObject, array_handle), TRUE);
@@ -5705,7 +5704,7 @@ mono_array_clone_checked (MonoArray *array_raw, MonoError *error)
        MONO_REQ_GC_UNSAFE_MODE;
        HANDLE_FUNCTION_ENTER ();
        /* FIXME: callers of mono_array_clone_checked should use handles */
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoArray, array);
        MonoArrayHandle result = mono_array_clone_in_domain (MONO_HANDLE_DOMAIN (array), array, error);
        HANDLE_FUNCTION_RETURN_OBJ (result);
@@ -5782,7 +5781,7 @@ mono_array_new_full_checked (MonoDomain *domain, MonoClass *array_class, uintptr
        MonoVTable *vtable;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!array_class->inited)
                mono_class_init (array_class);
@@ -5897,7 +5896,7 @@ mono_array_new_checked (MonoDomain *domain, MonoClass *eclass, uintptr_t n, Mono
 {
        MonoClass *ac;
 
-       mono_error_init (error);
+       error_init (error);
 
        ac = mono_array_class_get (eclass, 1);
        g_assert (ac);
@@ -5944,7 +5943,7 @@ mono_array_new_specific_checked (MonoVTable *vtable, uintptr_t n, MonoError *err
        MonoObject *o;
        uintptr_t byte_len;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (G_UNLIKELY (n > MONO_ARRAY_MAX_INDEX)) {
                mono_error_set_generic_error (error, "System", "OverflowException", "");
@@ -6036,7 +6035,7 @@ mono_string_new_utf16_checked (MonoDomain *domain, const guint16 *text, gint32 l
 
        MonoString *s;
        
-       mono_error_init (error);
+       error_init (error);
        
        s = mono_string_new_size_checked (domain, len, error);
        if (s != NULL)
@@ -6079,7 +6078,7 @@ mono_string_new_utf32_checked (MonoDomain *domain, const mono_unichar4 *text, gi
        GError *gerror = NULL;
        glong items_written;
        
-       mono_error_init (error);
+       error_init (error);
        utf16_output = g_ucs4_to_utf16 (text, len, NULL, &items_written, &gerror);
        
        if (gerror)
@@ -6139,7 +6138,7 @@ mono_string_new_size_checked (MonoDomain *domain, gint32 len, MonoError *error)
        MonoVTable *vtable;
        size_t size;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* check for overflow */
        if (len < 0 || len > ((SIZE_MAX - G_STRUCT_OFFSET (MonoString, chars) - 8) / 2)) {
@@ -6195,7 +6194,7 @@ mono_string_new_len_checked (MonoDomain *domain, const char *text, guint length,
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        GError *eg_error = NULL;
        MonoString *o = NULL;
@@ -6253,7 +6252,7 @@ mono_string_new_checked (MonoDomain *domain, const char *text, MonoError *error)
     glong items_written;
     int l;
 
-    mono_error_init (error);
+    error_init (error);
 
     l = strlen (text);
    
@@ -6347,7 +6346,7 @@ mono_value_box_checked (MonoDomain *domain, MonoClass *klass, gpointer value, Mo
        int size;
        MonoVTable *vtable;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (klass->valuetype);
        if (mono_class_is_nullable (klass))
@@ -6545,7 +6544,7 @@ mono_object_isinst_checked (MonoObject *obj_raw, MonoClass *klass, MonoError *er
        MONO_REQ_GC_UNSAFE_MODE;
 
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoObject, obj);
        MonoObjectHandle result = mono_object_handle_isinst (obj, klass, error);
        HANDLE_FUNCTION_RETURN_OBJ (result);
@@ -6563,7 +6562,7 @@ mono_object_isinst_checked (MonoObject *obj_raw, MonoClass *klass, MonoError *er
 MonoObjectHandle
 mono_object_handle_isinst (MonoObjectHandle obj, MonoClass *klass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        
        if (!klass->inited)
                mono_class_init (klass);
@@ -6595,7 +6594,7 @@ mono_object_isinst_mbyref (MonoObject *obj_raw, MonoClass *klass)
 MonoObjectHandle
 mono_object_handle_isinst_mbyref (MonoObjectHandle obj, MonoClass *klass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoObjectHandle result = MONO_HANDLE_NEW (MonoObject, NULL);
 
@@ -6727,7 +6726,7 @@ mono_string_get_pinned (MonoString *str, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* We only need to make a pinned version of a string if this is a moving GC */
        if (!mono_gc_is_moving ())
@@ -6754,7 +6753,7 @@ mono_string_is_interned_lookup (MonoString *str, int insert, MonoError *error)
        MonoString *s, *res;
        MonoDomain *domain;
        
-       mono_error_init (error);
+       error_init (error);
 
        domain = ((MonoObject *)str)->vtable->domain;
        ldstr_table = domain->ldstr_table;
@@ -6846,7 +6845,7 @@ mono_string_intern_checked (MonoString *str, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        return mono_string_is_interned_lookup (str, TRUE, error);
 }
@@ -6884,7 +6883,7 @@ MonoString*
 mono_ldstr_checked (MonoDomain *domain, MonoImage *image, guint32 idx, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
-       mono_error_init (error);
+       error_init (error);
 
        if (image->dynamic) {
                MonoString *str = (MonoString *)mono_lookup_dynamic_token (image, MONO_TOKEN_STRING | idx, NULL, error);
@@ -6911,7 +6910,7 @@ mono_ldstr_metadata_sig (MonoDomain *domain, const char* sig, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        const char *str = sig;
        MonoString *o, *interned;
        size_t len2;
@@ -6966,7 +6965,7 @@ mono_ldstr_utf8 (MonoImage *image, guint32 idx, MonoError *error)
        char *as;
        GError *gerror = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_verifier_verify_string_signature (image, idx, NULL))
                return NULL; /*FIXME we should probably be raising an exception here*/
@@ -7035,7 +7034,7 @@ mono_string_to_utf8_checked (MonoString *s, MonoError *error)
        char *as;
        GError *gerror = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (s == NULL)
                return NULL;
@@ -7223,7 +7222,7 @@ mono_string_from_utf16_checked (gunichar2 *data, MonoError *error)
 
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get ();
        int len = 0;
 
@@ -7266,7 +7265,7 @@ mono_string_from_utf32_checked (mono_unichar4 *data, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoString* result = NULL;
        mono_unichar2 *utf16_output = NULL;
        GError *gerror = NULL;
@@ -7410,7 +7409,7 @@ mono_wait_handle_new (MonoDomain *domain, HANDLE handle, MonoError *error)
        gpointer params [1];
        static MonoMethod *handle_set;
 
-       mono_error_init (error);
+       error_init (error);
        res = (MonoWaitHandle *)mono_object_new_checked (domain, mono_defaults.manualresetevent_class, error);
        return_val_if_nok (error, NULL);
 
@@ -7449,7 +7448,7 @@ mono_runtime_capture_context (MonoDomain *domain, MonoError *error)
 
        RuntimeInvokeFunction runtime_invoke;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!domain->capture_context_runtime_invoke || !domain->capture_context_method) {
                MonoMethod *method = mono_get_context_capture_method ();
@@ -7485,7 +7484,7 @@ mono_async_result_new (MonoDomain *domain, HANDLE handle, MonoObject *state, gpo
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoAsyncResult *res = (MonoAsyncResult *)mono_object_new_checked (domain, mono_defaults.asyncresult_class, error);
        return_val_if_nok (error, NULL);
        MonoObject *context = mono_runtime_capture_context (domain, error);
@@ -7555,7 +7554,7 @@ ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke (MonoAsyncResult
                if (wait_event != NULL)
                        mono_w32event_set (wait_event);
 
-               mono_error_init (&error); //the else branch would leave it in an undefined state
+               error_init (&error); //the else branch would leave it in an undefined state
                if (ac->cb_method)
                        mono_runtime_invoke_checked (ac->cb_method, ac->cb_target, (gpointer*) &ares, &error);
 
@@ -7584,7 +7583,7 @@ mono_message_init (MonoDomain *domain,
                g_assert (init_message_method != NULL);
        }
 
-       mono_error_init (error);
+       error_init (error);
        /* FIXME set domain instead? */
        g_assert (domain == mono_domain_get ());
        
@@ -7623,7 +7622,7 @@ mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg, MonoObject
 
        g_assert (exc);
 
-       mono_error_init (error);
+       error_init (error);
 
        /*static MonoObject *(*invoke) (gpointer, gpointer, MonoObject **, MonoArray **) = NULL;*/
 
@@ -7655,7 +7654,7 @@ mono_message_invoke (MonoObject *target, MonoMethodMessage *msg,
        MONO_REQ_GC_UNSAFE_MODE;
 
        static MonoClass *object_array_klass;
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain *domain; 
        MonoMethod *method;
@@ -7785,7 +7784,7 @@ mono_object_to_string (MonoObject *obj, MonoObject **exc)
 MonoString *
 mono_object_to_string_checked (MonoObject *obj, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        void *target;
        MonoMethod *method = prepare_to_string_method (obj, &target);
        return (MonoString*) mono_runtime_invoke_checked (method, target, NULL, error);
@@ -7805,7 +7804,7 @@ MonoString *
 mono_object_try_to_string (MonoObject *obj, MonoObject **exc, MonoError *error)
 {
        g_assert (exc);
-       mono_error_init (error);
+       error_init (error);
        void *target;
        MonoMethod *method = prepare_to_string_method (obj, &target);
        return (MonoString*) mono_runtime_try_invoke (method, target, NULL, exc, error);
@@ -7907,7 +7906,7 @@ mono_delegate_ctor_with_method (MonoObject *this_obj, MonoObject *target, gpoint
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoDelegate *delegate = (MonoDelegate *)this_obj;
 
        g_assert (this_obj);
@@ -7955,7 +7954,7 @@ mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr, Mon
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = mono_domain_get ();
        MonoJitInfo *ji;
        MonoMethod *method = NULL;
@@ -7992,7 +7991,7 @@ mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain *domain = mono_domain_get ();
        MonoMethodSignature *sig = mono_method_signature (method);
@@ -8056,7 +8055,7 @@ mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoAr
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoMethodSignature *sig = mono_method_signature (method);
        int i, j, type, size, out_len;
@@ -8150,7 +8149,7 @@ mono_load_remote_field_checked (MonoObject *this_obj, MonoClass *klass, MonoClas
 
        static MonoMethod *getter = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain *domain = mono_domain_get ();
        MonoTransparentProxy *tp = (MonoTransparentProxy *) this_obj;
@@ -8247,7 +8246,7 @@ mono_load_remote_field_new_checked (MonoObject *this_obj, MonoClass *klass, Mono
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        static MonoMethod *tp_load = NULL;
 
@@ -8309,7 +8308,7 @@ mono_store_remote_field_checked (MonoObject *this_obj, MonoClass *klass, MonoCla
        
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDomain *domain = mono_domain_get ();
        MonoClass *field_class;
@@ -8363,7 +8362,7 @@ mono_store_remote_field_new_checked (MonoObject *this_obj, MonoClass *klass, Mon
 
        static MonoMethod *tp_store = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (mono_object_is_transparent_proxy (this_obj));
 
@@ -8496,7 +8495,7 @@ mono_glist_to_array (GList *list, MonoClass *eclass, MonoError *error)
        MonoArray *res;
        int len, i;
 
-       mono_error_init (error);
+       error_init (error);
        if (!list)
                return NULL;
 
index e82a44353dc1936be2ecc2ef749112259006feba..cba372954533a1914c19525d476232028ff45e49 100644 (file)
@@ -109,7 +109,7 @@ typedef MonoObjectHandle (*ReflectionCacheConstructFunc_handle) (MonoDomain*, Mo
 static inline MonoObjectHandle
 check_or_construct_handle (MonoDomain *domain, MonoClass *klass, gpointer item, gpointer user_data, MonoError *error, ReflectionCacheConstructFunc_handle construct)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoObjectHandle obj = check_object_handle (domain, klass, item);
        if (!MONO_HANDLE_IS_NULL (obj))
                return obj;
index 1ddb08757a35cf6ad594485318d1edbe172b5bb9..fbcce02c18cb15aab9c083847680fe611bdc3d6f 100644 (file)
@@ -229,7 +229,7 @@ mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly)
 static MonoReflectionAssemblyHandle
 assembly_object_construct (MonoDomain *domain, MonoClass *unused_klass, MonoAssembly *assembly, gpointer user_data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionAssemblyHandle res = MONO_HANDLE_NEW (MonoReflectionAssembly, mono_object_new_checked (domain, mono_class_get_mono_assembly_class (), error));
        return_val_if_nok (error, MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE));
        MONO_HANDLE_SETVAL (res, assembly, MonoAssembly*, assembly);
@@ -246,7 +246,7 @@ assembly_object_construct (MonoDomain *domain, MonoClass *unused_klass, MonoAsse
 MonoReflectionAssemblyHandle
 mono_assembly_get_object_handle (MonoDomain *domain, MonoAssembly *assembly, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionAssemblyHandle, assembly, NULL, assembly_object_construct, NULL);
 }
 
@@ -265,7 +265,7 @@ module_object_construct (MonoDomain *domain, MonoClass *unused_klass, MonoImage
 {
        char* basename;
        
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionModuleHandle res = MONO_HANDLE_NEW (MonoReflectionModule, mono_object_new_checked (domain, mono_class_get_mono_module_class (), error));
        if (!is_ok (error))
                goto fail;
@@ -312,7 +312,7 @@ fail:
 MonoReflectionModuleHandle
 mono_module_get_object_handle (MonoDomain *domain, MonoImage *image, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionModuleHandle, image, NULL, module_object_construct, NULL);
 }
 
@@ -335,7 +335,7 @@ mono_module_file_get_object_handle (MonoDomain *domain, MonoImage *image, int ta
        guint32 i, name_idx;
        const char *val;
        
-       mono_error_init (error);
+       error_init (error);
 
        MonoReflectionModuleHandle res = MONO_HANDLE_NEW (MonoReflectionModule, mono_object_new_checked (domain, mono_class_get_mono_module_class (), error));
        if (!is_ok (error))
@@ -445,7 +445,7 @@ mono_type_get_object_checked (MonoDomain *domain, MonoType *type, MonoError *err
        MonoReflectionType *res;
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (type != NULL);
        klass = mono_class_from_mono_type (type);
@@ -579,7 +579,7 @@ mono_method_get_object (MonoDomain *domain, MonoMethod *method, MonoClass *refcl
 static MonoReflectionMethodHandle
 method_object_construct (MonoDomain *domain, MonoClass *refclass, MonoMethod *method, gpointer user_data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        g_assert (refclass != NULL);
        /*
         * We use the same C representation for methods and constructors, but the type 
@@ -587,7 +587,7 @@ method_object_construct (MonoDomain *domain, MonoClass *refclass, MonoMethod *me
         */
        MonoClass *klass;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (*method->name == '.' && (strcmp (method->name, ".ctor") == 0 || strcmp (method->name, ".cctor") == 0)) {
                klass = mono_class_get_mono_cmethod_class ();
@@ -625,7 +625,7 @@ fail:
 MonoReflectionMethodHandle
 mono_method_get_object_handle (MonoDomain *domain, MonoMethod *method, MonoClass *refclass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (!refclass)
                refclass = method->klass;
 
@@ -696,7 +696,7 @@ mono_field_get_object (MonoDomain *domain, MonoClass *klass, MonoClassField *fie
 static MonoReflectionFieldHandle
 field_object_construct (MonoDomain *domain, MonoClass *klass, MonoClassField *field, gpointer user_data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoReflectionFieldHandle res = MONO_HANDLE_NEW (MonoReflectionField, mono_object_new_checked (domain, mono_class_get_mono_field_class (), error));
        if (!is_ok (error))
@@ -734,7 +734,7 @@ fail:
 MonoReflectionFieldHandle
 mono_field_get_object_handle (MonoDomain *domain, MonoClass *klass, MonoClassField *field, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionFieldHandle, field, klass, field_object_construct, NULL);
 }
 
@@ -779,7 +779,7 @@ mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *pr
 static MonoReflectionPropertyHandle
 property_object_construct (MonoDomain *domain, MonoClass *klass, MonoProperty *property, gpointer user_data, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        MonoReflectionPropertyHandle res = MONO_HANDLE_NEW (MonoReflectionProperty, mono_object_new_checked (domain, mono_class_get_mono_property_class (), error));
        if (!is_ok (error))
@@ -848,7 +848,7 @@ static MonoReflectionEventHandle
 event_object_construct (MonoDomain *domain, MonoClass *klass, MonoEvent *event, gpointer user_data, MonoError *error)
 {
 
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionMonoEventHandle mono_event = MONO_HANDLE_NEW (MonoReflectionMonoEvent, mono_object_new_checked (domain, mono_class_get_mono_event_class (), error));
        if (!is_ok (error))
                return MONO_HANDLE_CAST (MonoReflectionEvent, NULL_HANDLE);
@@ -870,7 +870,7 @@ event_object_construct (MonoDomain *domain, MonoClass *klass, MonoEvent *event,
 MonoReflectionEventHandle
 mono_event_get_object_handle (MonoDomain *domain, MonoClass *klass, MonoEvent *event, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionEventHandle, event, klass, event_object_construct, NULL);
 }
 
@@ -909,7 +909,7 @@ get_dbnull_object (MonoDomain *domain, MonoError *error)
 {
        static MonoClassField *dbnull_value_field = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!dbnull_value_field) {
                MonoClass *dbnull_klass;
@@ -925,7 +925,7 @@ get_dbnull_object (MonoDomain *domain, MonoError *error)
 static MonoObjectHandle
 get_dbnull (MonoDomain *domain, MonoObjectHandle dbnull, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (MONO_HANDLE_IS_NULL (dbnull))
                MONO_HANDLE_ASSIGN (dbnull, get_dbnull_object (domain, error));
        return dbnull;
@@ -943,7 +943,7 @@ static gboolean
 add_parameter_object_to_array (MonoDomain *domain, MonoMethod *method, MonoObjectHandle member, int idx, const char *name, MonoType *sig_param, guint32 blob_type_enum, const char *blob, MonoMarshalSpec *mspec, MonoObjectHandle missing, MonoObjectHandle dbnull, MonoArrayHandle dest,  MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionParameterHandle param = MONO_HANDLE_NEW (MonoReflectionParameter, mono_object_new_checked (domain, mono_class_get_mono_parameter_info_class (), error));
        if (!is_ok (error))
                goto leave;
@@ -1030,7 +1030,7 @@ param_objects_construct (MonoDomain *domain, MonoClass *refclass, MonoMethodSign
        MonoMarshalSpec **mspecs = NULL;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        
        MonoReflectionMethodHandle member = mono_method_get_object_handle (domain, method, refclass, error);
        if (!is_ok (error))
@@ -1096,7 +1096,7 @@ leave:
 MonoArrayHandle
 mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoClass *refclass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        /* side-effect: sets method->signature non-NULL on success */
        MonoMethodSignature *sig = mono_method_signature_checked (method, error);
@@ -1133,7 +1133,7 @@ static gboolean
 add_local_var_info_to_array (MonoDomain *domain, MonoMethodHeader *header, int idx, MonoArrayHandle dest, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionLocalVariableInfoHandle info = MONO_HANDLE_NEW (MonoReflectionLocalVariableInfo, mono_object_new_checked (domain, mono_class_get_local_variable_info_class (), error));
        if (!is_ok (error))
                goto leave;
@@ -1157,7 +1157,7 @@ static gboolean
 add_exception_handling_clause_to_array (MonoDomain *domain, MonoMethodHeader *header, int idx, MonoArrayHandle dest, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionExceptionHandlingClauseHandle info = MONO_HANDLE_NEW (MonoReflectionExceptionHandlingClause, mono_object_new_checked (domain, mono_class_get_exception_handling_clause_class (), error));
        if (!is_ok (error))
                goto leave;
@@ -1210,7 +1210,7 @@ method_body_object_construct (MonoDomain *domain, MonoClass *unused_class, MonoM
        unsigned char format, flags;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* for compatibility with .net */
        if (method_is_dynamic (method)) {
@@ -1308,7 +1308,7 @@ fail:
 MonoReflectionMethodBodyHandle
 mono_method_body_get_object_handle (MonoDomain *domain, MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionMethodBodyHandle, method, NULL, method_body_object_construct, NULL);
 }
 
@@ -1406,7 +1406,7 @@ mono_get_object_from_blob (MonoDomain *domain, MonoType *type, const char *blob,
        MonoObject *object;
        MonoType *basetype = type;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!blob)
                return NULL;
@@ -1841,7 +1841,7 @@ _mono_reflection_get_type_from_info (MonoTypeNameParse *info, MonoImage *image,
        MonoType *type;
        MonoImage *rootimage = image;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (info->assembly.name) {
                MonoAssembly *assembly = mono_assembly_loaded (&info->assembly);
@@ -1866,7 +1866,7 @@ _mono_reflection_get_type_from_info (MonoTypeNameParse *info, MonoImage *image,
        if (type == NULL && !info->assembly.name && image != mono_defaults.corlib) {
                /* ignore the error and try again */
                mono_error_cleanup (error);
-               mono_error_init (error);
+               error_init (error);
                image = mono_defaults.corlib;
                type = mono_reflection_get_type_with_rootimage (rootimage, image, info, ignorecase, &type_resolve, error);
        }
@@ -1887,7 +1887,7 @@ mono_reflection_get_type_internal (MonoImage *rootimage, MonoImage* image, MonoT
        int modval;
        gboolean bounded = FALSE;
        
-       mono_error_init (error);
+       error_init (error);
        if (!image)
                image = mono_defaults.corlib;
 
@@ -2041,7 +2041,7 @@ mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ig
  */
 MonoType*
 mono_reflection_get_type_checked (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error) {
-       mono_error_init (error);
+       error_init (error);
        return mono_reflection_get_type_with_rootimage (rootimage, image, info, ignorecase, type_resolve, error);
 }
 
@@ -2050,7 +2050,7 @@ static MonoType*
 module_builder_array_get_type (MonoArrayHandle module_builders, int i, MonoImage *rootimage, MonoTypeNameParse *info, gboolean ignorecase, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = NULL;
        MonoReflectionModuleBuilderHandle mb = MONO_HANDLE_NEW (MonoReflectionModuleBuilder, NULL);
        MONO_HANDLE_ARRAY_GETREF (mb, module_builders, i);
@@ -2063,7 +2063,7 @@ static MonoType*
 module_array_get_type (MonoArrayHandle modules, int i, MonoImage *rootimage, MonoTypeNameParse *info, gboolean ignorecase, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoType *type = NULL;
        MonoReflectionModuleHandle mod = MONO_HANDLE_NEW (MonoReflectionModule, NULL);
        MONO_HANDLE_ARRAY_GETREF (mod, modules, i);
@@ -2079,7 +2079,7 @@ mono_reflection_get_type_internal_dynamic (MonoImage *rootimage, MonoAssembly *a
        MonoType *type = NULL;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        g_assert (assembly_is_dynamic (assembly));
        MonoReflectionAssemblyBuilderHandle abuilder = MONO_HANDLE_CAST (MonoReflectionAssemblyBuilder, mono_assembly_get_object_handle (((MonoDynamicAssembly*)assembly)->domain, assembly, error));
        if (!is_ok (error))
@@ -2125,7 +2125,7 @@ mono_reflection_get_type_with_rootimage (MonoImage *rootimage, MonoImage* image,
        GString *fullName;
        GList *mod;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (image && image_is_dynamic (image))
                type = mono_reflection_get_type_internal_dynamic (rootimage, image->assembly, info, ignorecase, error);
@@ -2232,7 +2232,7 @@ mono_reflection_type_from_name_checked (char *name, MonoImage *image, MonoError
        MonoTypeNameParse info;
        char *tmp;
 
-       mono_error_init (error);
+       error_init (error);
        /* Make a copy since parse_type modifies its argument */
        tmp = g_strdup (name);
        
@@ -2281,7 +2281,7 @@ mono_reflection_get_token_checked (MonoObjectHandle obj, MonoError *error)
 {
        guint32 token = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoClass *klass = mono_handle_class (obj);
 
@@ -2380,7 +2380,7 @@ mono_reflection_bind_generic_parameters (MonoReflectionTypeHandle reftype, int t
        gboolean is_dynamic = FALSE;
        MonoClass *geninst;
 
-       mono_error_init (error);
+       error_init (error);
        
        mono_loader_lock ();
 
@@ -2446,7 +2446,7 @@ static MonoGenericInst*
 generic_inst_from_type_array_handle (MonoArrayHandle types, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoGenericInst *ginst = NULL;
        int count = mono_array_handle_length (types);
        MonoType **type_argv = g_new0 (MonoType *, count);
@@ -2471,7 +2471,7 @@ reflection_bind_generic_method_parameters (MonoMethod *method, MonoArrayHandle t
        MonoMethod *inflated;
        MonoGenericContext tmp_context;
 
-       mono_error_init (error);
+       error_init (error);
 
        klass = method->klass;
 
@@ -2504,7 +2504,7 @@ reflection_bind_generic_method_parameters (MonoMethod *method, MonoArrayHandle t
 MonoReflectionMethodHandle
 ves_icall_MonoMethod_MakeGenericMethod_impl (MonoReflectionMethodHandle rmethod, MonoArrayHandle types, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        g_assert (0 != strcmp (mono_handle_class (rmethod)->name, "MethodBuilder"));
 
        MonoMethod *method = MONO_HANDLE_GETVAL (rmethod, method);
@@ -2959,7 +2959,7 @@ mono_reflection_call_is_assignable_to (MonoClass *klass, MonoClass *oklass, Mono
        void *params [1];
        static MonoMethod *method = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (method == NULL) {
                method = mono_class_get_method_from_name (mono_class_get_type_builder_class (), "IsAssignableTo", 1);
index b85e950ab55e18c39cb8361edc3edaeef7154cca..ecc5f94248485b893960e154aeda2b7b1d1a6d61 100644 (file)
@@ -413,7 +413,7 @@ mono_remoting_wrapper (MonoMethod *method, gpointer *params)
                goto fail;
 
        if (exc) {
-               mono_error_init (&error);
+               error_init (&error);
                mono_error_set_exception_instance (&error, (MonoException *)exc);
                goto fail;
        }
@@ -1917,7 +1917,7 @@ static gboolean
 xdomain_copy_array_element_inplace (MonoArrayHandle arr, int i, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoObjectHandle item = MONO_HANDLE_NEW (MonoObject, NULL);
        MONO_HANDLE_ARRAY_GETREF (item, arr, i);
        
@@ -1940,7 +1940,7 @@ leave:
 MonoObjectHandle
 mono_marshal_xdomain_copy_value_handle (MonoObjectHandle val, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoObjectHandle result = MONO_HANDLE_NEW (MonoObject, NULL);
        if (MONO_HANDLE_IS_NULL (val))
                goto leave;
index 4e6e08c2b3ec778a3842f87c84dc773d984bf343..df6643672e986ef898e953da9df44e256bcec00a 100644 (file)
@@ -109,9 +109,6 @@ mono_runtime_try_shutdown (void)
 
        mono_runtime_set_shutting_down ();
 
-       /* This will kill the tp threads which cannot be suspended */
-       mono_threadpool_cleanup ();
-
        /*TODO move the follow to here:
        mono_thread_suspend_all_other_threads (); OR  mono_thread_wait_all_other_threads
 
index fab9cb946b013e0441ed99896a543656a8b47b48..4c93932b868549c9ecd9c6921d571fbf15a3dc4d 100644 (file)
@@ -631,7 +631,7 @@ get_method_access_exception (const char *format, MonoMethod *caller, MonoMethod
 gboolean
 mono_security_core_clr_ensure_reflection_access_field (MonoClassField *field, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *caller = get_reflection_caller ();
        /* CoreCLR restrictions applies to Transparent code/caller */
        if (mono_security_core_clr_method_level (caller, TRUE) != MONO_SECURITY_CORE_CLR_TRANSPARENT)
@@ -672,7 +672,7 @@ mono_security_core_clr_ensure_reflection_access_field (MonoClassField *field, Mo
 gboolean
 mono_security_core_clr_ensure_reflection_access_method (MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoMethod *caller = get_reflection_caller ();
        /* CoreCLR restrictions applies to Transparent code/caller */
        if (mono_security_core_clr_method_level (caller, TRUE) != MONO_SECURITY_CORE_CLR_TRANSPARENT)
@@ -748,7 +748,7 @@ mono_security_core_clr_ensure_delegate_creation (MonoMethod *method, MonoError *
 {
        MonoMethod *caller;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* note: mscorlib creates delegates to avoid reflection (optimization), we ignore those cases */
        if (can_avoid_corlib_reflection_delegate_optimization (method))
@@ -1061,21 +1061,21 @@ mono_security_core_clr_require_elevated_permissions (void)
 gboolean
 mono_security_core_clr_ensure_reflection_access_field (MonoClassField *field, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return TRUE;
 }
 
 gboolean
 mono_security_core_clr_ensure_reflection_access_method (MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return TRUE;
 }
 
 gboolean
 mono_security_core_clr_ensure_delegate_creation (MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return TRUE;
 }
 
index fc82365a9336dee1c36930c1b2305d2e7e335b49..e8dd50b13d7be09050d60feaf0c89b399961beec 100644 (file)
@@ -1051,7 +1051,7 @@ create_allocator (int atype, ManagedAllocatorVariant variant)
 {
        int p_var, size_var, real_size_var, thread_var G_GNUC_UNUSED;
        gboolean slowpath = variant == MANAGED_ALLOCATOR_SLOW_PATH;
-       guint32 slowpath_branch, max_size_branch;
+       guint32 fastpath_branch, max_size_branch, no_oom_branch;
        MonoMethodBuilder *mb;
        MonoMethod *res;
        MonoMethodSignature *csig;
@@ -1318,7 +1318,7 @@ create_allocator (int atype, ManagedAllocatorVariant variant)
        /* if (G_LIKELY (new_next < tlab_temp_end)) */
        mono_mb_emit_ldloc (mb, new_next_var);
        EMIT_TLS_ACCESS_TEMP_END (mb, thread_var);
-       slowpath_branch = mono_mb_emit_short_branch (mb, MONO_CEE_BLT_UN_S);
+       fastpath_branch = mono_mb_emit_short_branch (mb, MONO_CEE_BLT_UN_S);
 
        /* Slowpath */
        if (atype != ATYPE_SMALL)
@@ -1353,10 +1353,17 @@ create_allocator (int atype, ManagedAllocatorVariant variant)
        } else {
                g_assert_not_reached ();
        }
+
+       /* if (ret == NULL) throw OOM; */
+       mono_mb_emit_byte (mb, CEE_DUP);
+       no_oom_branch = mono_mb_emit_branch (mb, CEE_BRTRUE);
+       mono_mb_emit_exception (mb, "OutOfMemoryException", NULL);
+
+       mono_mb_patch_branch (mb, no_oom_branch);
        mono_mb_emit_byte (mb, CEE_RET);
 
        /* Fastpath */
-       mono_mb_patch_short_branch (mb, slowpath_branch);
+       mono_mb_patch_short_branch (mb, fastpath_branch);
 
        /* FIXME: Memory barrier */
 
index 143ece00c1d110bd2facb8ba9a52e799dc1c37fb..97e6d57fa52156742e972a8de1b74820f7a6e43c 100644 (file)
@@ -236,7 +236,7 @@ encode_reflection_type (MonoDynamicImage *assembly, MonoReflectionTypeHandle typ
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!type) {
                sigbuffer_add_value (buf, MONO_TYPE_VOID);
@@ -252,7 +252,7 @@ static void
 encode_reflection_type_raw (MonoDynamicImage *assembly, MonoReflectionType* type_raw, SigBuffer *buf, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER (); /* FIXME callers of encode_reflection_type_raw should use handles */
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoReflectionType, type);
        encode_reflection_type (assembly, type, buf, error);
        HANDLE_FUNCTION_RETURN ();
@@ -267,7 +267,7 @@ encode_custom_modifiers (MonoDynamicImage *assembly, MonoArrayHandle modreq, Mon
 
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!MONO_HANDLE_IS_NULL (modreq)) {
                for (i = 0; i < mono_array_handle_length (modreq); ++i) {
@@ -295,7 +295,7 @@ static void
 encode_custom_modifiers_raw (MonoDynamicImage *assembly, MonoArray *modreq_raw, MonoArray *modopt_raw, SigBuffer *buf, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER (); /* FIXME callers of encode_custom_modifiers_raw should use handles */
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoArray, modreq);
        MONO_HANDLE_DCL (MonoArray, modopt);
        encode_custom_modifiers (assembly, modreq, modopt, buf, error);
@@ -354,7 +354,7 @@ mono_dynimage_encode_method_builder_signature (MonoDynamicImage *assembly, Refle
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        /*
         * FIXME: reuse code from method_encode_signature().
@@ -424,7 +424,7 @@ mono_dynimage_encode_locals (MonoDynamicImage *assembly, MonoReflectionILGen *il
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDynamicTable *table;
        guint32 *values;
@@ -623,7 +623,7 @@ mono_dynimage_encode_field_signature (MonoDynamicImage *assembly, MonoReflection
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        SigBuffer buf;
        guint32 idx;
@@ -858,7 +858,7 @@ static gboolean
 encode_sighelper_arg (MonoDynamicImage *assembly, int i, MonoArrayHandle helper_arguments, MonoArrayHandle helper_modreqs, MonoArrayHandle helper_modopts, SigBuffer* buf, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER();
-       mono_error_init (error);
+       error_init (error);
        MonoArrayHandle modreqs = MONO_HANDLE_NEW (MonoArray, NULL);
        MonoArrayHandle modopts = MONO_HANDLE_NEW (MonoArray, NULL);
 
@@ -886,7 +886,7 @@ mono_dynimage_encode_reflection_sighelper (MonoDynamicImage *assembly, MonoRefle
        guint32 nargs;
        guint32 i, idx;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!assembly->save)
                return 0;
@@ -957,7 +957,7 @@ reflection_sighelper_get_signature_local (MonoReflectionSigHelper *sig, MonoErro
        MonoArray *result;
        SigBuffer buf;
 
-       mono_error_init (error);
+       error_init (error);
 
        sigbuffer_init (&buf, 32);
 
@@ -991,7 +991,7 @@ reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig, MonoErro
        MonoArray *result;
        SigBuffer buf;
 
-       mono_error_init (error);
+       error_init (error);
 
        sigbuffer_init (&buf, 32);
 
@@ -1029,7 +1029,7 @@ mono_dynimage_save_encode_marshal_blob (MonoDynamicImage *assembly, MonoReflecti
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        char *str;
        SigBuffer buf;
@@ -1127,7 +1127,7 @@ mono_dynimage_save_encode_property_signature (MonoDynamicImage *assembly, MonoRe
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        SigBuffer buf;
        guint32 nparams = 0;
index 20d9e47a4a3945453e3fdd0d96653f273a3722c2..f1cddf7cac594ab95114ec4feeb3782b95b4b2d8 100644 (file)
@@ -180,7 +180,7 @@ static guint32
 image_create_token_raw  (MonoDynamicImage *assembly, MonoObject* obj_raw, gboolean create_methodspec, gboolean register_token, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER (); /* FIXME callers of image_create_token_raw should use handles */
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoObject, obj);
        guint32 result = mono_image_create_token (assembly, obj, create_methodspec, register_token, error);
        HANDLE_FUNCTION_RETURN_VAL (result);
@@ -203,7 +203,7 @@ mono_image_add_cattrs (MonoDynamicImage *assembly, guint32 idx, guint32 type, Mo
        char blob_size [6];
        char *p = blob_size;
        
-       mono_error_init (error);
+       error_init (error);
 
        /* it is legal to pass a NULL cattrs: we avoid to use the if in a lot of places */
        if (!cattrs)
@@ -329,7 +329,7 @@ method_encode_code (MonoDynamicImage *assembly, ReflectionMethodBuilder *mb, Mon
        guint32 header_size = 12;
        MonoArray *code;
 
-       mono_error_init (error);
+       error_init (error);
 
        if ((mb->attrs & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT)) ||
                        (mb->iattrs & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))
@@ -491,7 +491,7 @@ mono_image_basic_method (ReflectionMethodBuilder *mb, MonoDynamicImage *assembly
        guint32 *values;
        guint i, count;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* room in this table is already allocated */
        table = &assembly->tables [MONO_TABLE_METHOD];
@@ -579,7 +579,7 @@ mono_image_add_methodimpl (MonoDynamicImage *assembly, MonoReflectionMethodBuild
        MonoReflectionMethod *m;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mb->override_methods)
                return TRUE;
@@ -624,7 +624,7 @@ mono_image_get_method_info (MonoReflectionMethodBuilder *mb, MonoDynamicImage *a
        ReflectionMethodBuilder rmb;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_reflection_methodbuilder_from_method_builder (&rmb, mb, error) ||
            !mono_image_basic_method (&rmb, assembly, error))
@@ -701,7 +701,7 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicImage *ass
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDynamicTable *table;
        guint32 *values;
@@ -772,7 +772,7 @@ mono_image_get_property_info (MonoReflectionPropertyBuilder *pb, MonoDynamicImag
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDynamicTable *table;
        guint32 *values;
@@ -898,7 +898,7 @@ encode_constraints (MonoReflectionGenericParam *gparam, guint32 owner, MonoDynam
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoDynamicTable *table;
        guint32 num_constraints, i;
@@ -971,7 +971,7 @@ write_generic_param_entry (MonoDynamicImage *assembly, GenericParamTableEntry *e
        guint32 *values;
        guint32 table_idx;
 
-       mono_error_init (error);
+       error_init (error);
 
        table = &assembly->tables [MONO_TABLE_GENERICPARAM];
        table_idx = table->next_idx ++;
@@ -1028,7 +1028,7 @@ static gboolean
 params_add_cattrs (MonoDynamicImage *assembly, MonoArray *pinfo, MonoError *error) {
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        if (!pinfo)
                return TRUE;
        for (i = 0; i < mono_array_length (pinfo); ++i) {
@@ -1047,7 +1047,7 @@ static gboolean
 type_add_cattrs (MonoDynamicImage *assembly, MonoReflectionTypeBuilder *tb, MonoError *error) {
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        
        if (!mono_image_add_cattrs (assembly, tb->table_idx, MONO_CUSTOM_ATTR_TYPEDEF, tb->cattrs, error))
                return FALSE;
@@ -1110,7 +1110,7 @@ module_add_cattrs (MonoDynamicImage *assembly, MonoReflectionModuleBuilder *modu
 {
        int i;
        
-       mono_error_init (error);
+       error_init (error);
 
        if (!mono_image_add_cattrs (assembly, moduleb->table_idx, MONO_CUSTOM_ATTR_MODULE, moduleb->cattrs, error))
                return FALSE;
@@ -1152,7 +1152,7 @@ mono_image_fill_file_table (MonoDomain *domain, MonoReflectionModule *module, Mo
        char *b = blob_size;
        char *dir, *path;
 
-       mono_error_init (error);
+       error_init (error);
 
        table = &assembly->tables [MONO_TABLE_FILE];
        table->rows++;
@@ -1185,7 +1185,7 @@ mono_image_fill_module_table (MonoDomain *domain, MonoReflectionModuleBuilder *m
        MonoDynamicTable *table;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        table = &assembly->tables [MONO_TABLE_MODULE];
        mb->table_idx = table->next_idx ++;
@@ -1247,7 +1247,7 @@ mono_image_fill_export_table (MonoDomain *domain, MonoReflectionTypeBuilder *tb,
        MonoClass *klass;
        guint32 idx, i;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoType *t = mono_reflection_type_get_handle ((MonoReflectionType*)tb, error);
        return_if_nok (error);
@@ -1479,7 +1479,7 @@ build_compressed_metadata (MonoDynamicImage *assembly, MonoError *error)
        unsigned char *p;
        struct StreamDesc stream_desc [5];
 
-       mono_error_init (error);
+       error_init (error);
 
        qsort (assembly->gen_params->pdata, assembly->gen_params->len, sizeof (gpointer), compare_genericparam);
        for (i = 0; i < assembly->gen_params->len; i++) {
@@ -1855,7 +1855,7 @@ assembly_add_resource_manifest (MonoReflectionModuleBuilder *mb, MonoDynamicImag
        MonoDynamicTable *table;
        guint32 *values;
 
-       mono_error_init (error);
+       error_init (error);
 
        table = &assembly->tables [MONO_TABLE_MANIFESTRESOURCE];
        table->rows++;
@@ -1881,7 +1881,7 @@ assembly_add_resource (MonoReflectionModuleBuilder *mb, MonoDynamicImage *assemb
        char *name, *sname;
        guint32 idx, offset;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (rsrc->filename) {
                name = mono_string_to_utf8_checked (rsrc->filename, error);
@@ -1941,7 +1941,7 @@ set_version_from_string (MonoString *version, guint32 *values, MonoError *error)
        gchar *ver, *p, *str;
        guint32 i;
        
-       mono_error_init (error);
+       error_init (error);
 
        values [MONO_ASSEMBLY_MAJOR_VERSION] = 0;
        values [MONO_ASSEMBLY_MINOR_VERSION] = 0;
@@ -2015,7 +2015,7 @@ mono_image_emit_manifest (MonoReflectionModuleBuilder *moduleb, MonoError *error
        int i;
        guint32 module_index;
 
-       mono_error_init (error);
+       error_init (error);
 
        assemblyb = moduleb->assemblyb;
        assembly = moduleb->dynamic_image;
@@ -2107,7 +2107,7 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
        int i, is_object = 0, is_system = 0;
        char *n;
 
-       mono_error_init (error);
+       error_init (error);
 
        table = &assembly->tables [MONO_TABLE_TYPEDEF];
        values = table->values + tb->table_idx * MONO_TYPEDEF_SIZE;
@@ -2298,7 +2298,7 @@ mono_image_build_metadata (MonoReflectionModuleBuilder *moduleb, MonoError *erro
        guint32 *values;
        int i, j;
 
-       mono_error_init (error);
+       error_init (error);
 
        assemblyb = moduleb->assemblyb;
        assembly = moduleb->dynamic_image;
@@ -2776,7 +2776,7 @@ mono_image_create_pefile (MonoReflectionModuleBuilder *mb, HANDLE file, MonoErro
                0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x0d, 0x0d, 0x0a,  0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
        };
 
-       mono_error_init (error);
+       error_init (error);
 
        assemblyb = mb->assemblyb;
 
index fbde1f1cc0fd3e00e6281d61ab0b514512a03609..67800081470c54d52c447db3a41b6474c09dda64 100644 (file)
@@ -90,7 +90,7 @@ string_to_utf8_image_raw (MonoImage *image, MonoString *s_raw, MonoError *error)
        /* FIXME all callers to string_to_utf8_image_raw should use handles */
        HANDLE_FUNCTION_ENTER ();
        char* result = NULL;
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoString, s);
        result = mono_string_to_utf8_image (image, s, error);
        HANDLE_FUNCTION_RETURN_VAL (result);
@@ -296,7 +296,7 @@ method_encode_clauses (MonoImage *image, MonoDynamicImage *assembly, MonoReflect
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoExceptionClause *clauses;
        MonoExceptionClause *clause;
@@ -454,7 +454,7 @@ mono_reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb,
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       mono_error_init (error);
+       error_init (error);
        memset (rmb, 0, sizeof (ReflectionMethodBuilder));
 
        rmb->ilgen = mb->ilgen;
@@ -501,7 +501,7 @@ mono_reflection_methodbuilder_from_ctor_builder (ReflectionMethodBuilder *rmb, M
 
        const char *name = mb->attrs & METHOD_ATTRIBUTE_STATIC ? ".cctor": ".ctor";
 
-       mono_error_init (error);
+       error_init (error);
 
        memset (rmb, 0, sizeof (ReflectionMethodBuilder));
 
@@ -848,7 +848,7 @@ mono_image_get_sighelper_token (MonoDynamicImage *assembly, MonoReflectionSigHel
        MonoDynamicTable *table;
        guint32 *values;
 
-       mono_error_init (error);
+       error_init (error);
 
        table = &assembly->tables [MONO_TABLE_STANDALONESIG];
        idx = table->next_idx ++;
@@ -898,7 +898,7 @@ mono_image_get_array_token (MonoDynamicImage *assembly, MonoReflectionArrayMetho
        MonoMethodSignature *sig = NULL;
        char *name = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoArrayHandle parameters = MONO_HANDLE_NEW_GET (MonoArray, m, parameters);
        guint32 nparams = mono_array_handle_length (parameters);
@@ -1066,7 +1066,7 @@ mono_image_create_method_token (MonoDynamicImage *assembly, MonoObjectHandle obj
 {
        guint32 token = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoClass *klass = mono_handle_class (obj);
        if (strcmp (klass->name, "MonoMethod") == 0 || strcmp (klass->name, "MonoCMethod") == 0) {
@@ -1107,7 +1107,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
 {
        guint32 token = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        MonoClass *klass = mono_handle_class (obj);
 
@@ -1303,7 +1303,7 @@ register_module (MonoDomain *domain, MonoReflectionModuleBuilderHandle res, Mono
 static gboolean
 image_module_basic_init (MonoReflectionModuleBuilderHandle moduleb, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoDomain *domain = MONO_HANDLE_DOMAIN (moduleb);
        MonoDynamicImage *image = MONO_HANDLE_GETVAL (moduleb, dynamic_image);
        MonoReflectionAssemblyBuilderHandle ab = MONO_HANDLE_NEW (MonoReflectionAssemblyBuilder, NULL);
@@ -1351,7 +1351,7 @@ image_module_basic_init (MonoReflectionModuleBuilderHandle moduleb, MonoError *e
 static gboolean
 mono_image_module_basic_init (MonoReflectionModuleBuilderHandle moduleb, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return image_module_basic_init (moduleb, error);
 }
 
@@ -1379,7 +1379,7 @@ MonoType*
 mono_type_array_get_and_resolve (MonoArrayHandle array, int idx, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER();
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionTypeHandle t = MONO_HANDLE_NEW (MonoReflectionType, NULL);
        MONO_HANDLE_ARRAY_GETREF (t, array, idx);
        MonoType *result = mono_reflection_type_handle_mono_type (t, error);
@@ -1466,7 +1466,7 @@ mono_reflection_type_get_underlying_system_type (MonoReflectionTypeHandle t, Mon
        static MonoMethod *method_get_underlying_system_type = NULL;
        HANDLE_FUNCTION_ENTER ();
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!method_get_underlying_system_type)
                method_get_underlying_system_type = mono_class_get_method_from_name (mono_defaults.systemtype_class, "get_UnderlyingSystemType", 0);
@@ -1487,7 +1487,7 @@ MonoType*
 mono_reflection_type_get_handle (MonoReflectionType* ref_raw, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoReflectionType, ref);
        MonoType *result = mono_reflection_type_handle_mono_type (ref, error);
        HANDLE_FUNCTION_RETURN_VAL (result);
@@ -1539,7 +1539,7 @@ static MonoType*
 reflection_param_handle_mono_type (MonoReflectionGenericParamHandle ref_gparam, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoType *result = NULL;
 
 
@@ -1596,7 +1596,7 @@ static MonoType*
 mono_type_array_get_and_resolve_raw (MonoArray* array_raw, int idx, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER(); /* FIXME callers of mono_type_array_get_and_resolve_raw should use handles */
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoArray, array);
        MonoType *result = mono_type_array_get_and_resolve (array, idx, error);
        HANDLE_FUNCTION_RETURN_VAL (result);
@@ -1606,7 +1606,7 @@ MonoType*
 mono_reflection_type_handle_mono_type (MonoReflectionTypeHandle ref, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
 
        MonoType* result = NULL;
 
@@ -1694,7 +1694,7 @@ parameters_to_signature (MonoImage *image, MonoArrayHandle parameters, MonoError
        MonoMethodSignature *sig;
        int count, i;
 
-       mono_error_init (error);
+       error_init (error);
 
        count = MONO_HANDLE_IS_NULL (parameters) ? 0 : mono_array_handle_length (parameters);
 
@@ -1718,7 +1718,7 @@ static MonoMethodSignature*
 ctor_builder_to_signature (MonoImage *image, MonoReflectionCtorBuilderHandle ctor, MonoError *error) {
        MonoMethodSignature *sig;
 
-       mono_error_init (error);
+       error_init (error);
 
        sig = parameters_to_signature (image, MONO_HANDLE_NEW_GET (MonoArray, ctor, parameters), error);
        return_val_if_nok (error, NULL);
@@ -1741,7 +1741,7 @@ static MonoMethodSignature*
 method_builder_to_signature (MonoImage *image, MonoReflectionMethodBuilderHandle method, MonoError *error) {
        MonoMethodSignature *sig;
 
-       mono_error_init (error);
+       error_init (error);
 
        sig = parameters_to_signature (image, MONO_HANDLE_NEW_GET(MonoArray, method, parameters), error);
        return_val_if_nok (error, NULL);
@@ -1766,7 +1766,7 @@ dynamic_method_to_signature (MonoReflectionDynamicMethodHandle method, MonoError
        HANDLE_FUNCTION_ENTER ();
        MonoMethodSignature *sig = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        sig = parameters_to_signature (NULL, MONO_HANDLE_NEW_GET (MonoArray, method, parameters), error);
        if (!is_ok (error))
@@ -1791,7 +1791,7 @@ leave:
 static void
 get_prop_name_and_type (MonoObject *prop, char **name, MonoType **type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass = mono_object_class (prop);
        if (strcmp (klass->name, "PropertyBuilder") == 0) {
                MonoReflectionPropertyBuilder *pb = (MonoReflectionPropertyBuilder *)prop;
@@ -1811,7 +1811,7 @@ get_prop_name_and_type (MonoObject *prop, char **name, MonoType **type, MonoErro
 static void
 get_field_name_and_type (MonoObject *field, char **name, MonoType **type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass = mono_object_class (field);
        if (strcmp (klass->name, "FieldBuilder") == 0) {
                MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder *)field;
@@ -1923,7 +1923,7 @@ encode_cattr_value (MonoAssembly *assembly, char *buffer, char *p, char **retbuf
 {
        MonoTypeEnum simple_type;
        
-       mono_error_init (error);
+       error_init (error);
        if ((p-buffer) + 10 >= *buflen) {
                char *newbuf;
                *buflen *= 2;
@@ -2177,7 +2177,7 @@ encode_named_val (MonoReflectionAssembly *assembly, char *buffer, char *p, char
 {
        int len;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* Preallocate a large enough buffer */
        if (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype) {
@@ -2259,7 +2259,7 @@ mono_reflection_get_custom_attrs_blob_checked (MonoReflectionAssembly *assembly,
        char *buffer, *p;
        guint32 buflen, i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (strcmp (ctor->vtable->klass->name, "MonoCMethod")) {
                /* sig is freed later so allocate it in the heap */
@@ -2351,7 +2351,7 @@ static gboolean
 reflection_setup_internal_class (MonoReflectionTypeBuilderHandle ref_tb, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
 
        mono_loader_lock ();
 
@@ -2493,7 +2493,7 @@ reflection_create_generic_class (MonoReflectionTypeBuilderHandle ref_tb, MonoErr
 {
        HANDLE_FUNCTION_ENTER ();
 
-       mono_error_init (error);
+       error_init (error);
 
        reflection_setup_internal_class (ref_tb, error);
        if (!is_ok (error))
@@ -2548,7 +2548,7 @@ mono_marshal_spec_from_builder (MonoImage *image, MonoAssembly *assembly,
 {
        MonoMarshalSpec *res;
 
-       mono_error_init (error);
+       error_init (error);
 
        res = image_g_new0 (image, MonoMarshalSpec, 1);
        res->native = (MonoMarshalNative)minfo->type;
@@ -2604,7 +2604,7 @@ MonoReflectionMarshalAsAttributeHandle
 mono_reflection_marshal_as_attribute_from_marshal_spec (MonoDomain *domain, MonoClass *klass,
                                                        MonoMarshalSpec *spec, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        
        MonoReflectionMarshalAsAttributeHandle minfo = MONO_HANDLE_NEW (MonoReflectionMarshalAsAttribute, mono_object_new_checked (domain, mono_class_get_marshal_as_attribute_class (), error));
        if (!is_ok (error))
@@ -2676,7 +2676,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
        gboolean dynamic;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
        /*
         * Methods created using a MethodBuilder should have their memory allocated
         * inside the image mempool, while dynamic methods should have their memory
@@ -2976,7 +2976,7 @@ methodbuilder_to_mono_method (MonoClass *klass, MonoReflectionMethodBuilderHandl
        ReflectionMethodBuilder rmb;
        MonoMethodSignature *sig;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_loader_lock ();
 
@@ -3004,7 +3004,7 @@ static MonoMethod*
 methodbuilder_to_mono_method_raw (MonoClass *klass, MonoReflectionMethodBuilder* mb_raw, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER (); /* FIXME change callers of methodbuilder_to_mono_method_raw to use handles */
-       mono_error_init (error);
+       error_init (error);
        MONO_HANDLE_DCL (MonoReflectionMethodBuilder, mb);
        MonoMethod *result = methodbuilder_to_mono_method (klass, mb, error);
        HANDLE_FUNCTION_RETURN_VAL (result);
@@ -3032,7 +3032,7 @@ fix_partial_generic_class (MonoClass *klass, MonoError *error)
        MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (klass->wastypebuilder)
                return TRUE;
@@ -3121,7 +3121,7 @@ ensure_generic_class_runtime_vtable (MonoClass *klass, MonoError *error)
 {
        MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!ensure_runtime_vtable (gklass, error))
                return FALSE;
@@ -3143,7 +3143,7 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error)
        MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info_raw (klass); /* FIXME use handles */
        int i, num, j;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!image_is_dynamic (klass->image) || (!tb && !mono_class_is_ginst (klass)) || klass->wastypebuilder)
                return TRUE;
@@ -3222,7 +3222,7 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error)
 static MonoMethod*
 mono_reflection_method_get_handle (MonoObject *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        MonoClass *klass = mono_object_class (method);
        if (is_sr_mono_method (klass)) {
                MonoReflectionMethod *sr_method = (MonoReflectionMethod*)method;
@@ -3252,7 +3252,7 @@ mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides
        int i, j, onum;
        MonoReflectionMethod *m;
 
-       mono_error_init (error);
+       error_init (error);
        *overrides = NULL;
        *num_overrides = 0;
 
@@ -3324,7 +3324,7 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error)
        int fcount = tb->num_fields;
        mono_class_set_field_count (klass, fcount);
 
-       mono_error_init (error);
+       error_init (error);
 
        if (tb->class_size) {
                packing_size = tb->packing_size;
@@ -3399,7 +3399,7 @@ typebuilder_setup_properties (MonoClass *klass, MonoError *error)
        MonoClassPropertyInfo *info;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        info = mono_class_get_property_info (klass);
        if (!info) {
@@ -3453,7 +3453,7 @@ typebuilder_setup_events (MonoClass *klass, MonoError *error)
        MonoClassEventInfo *info;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        info = mono_class_alloc0 (klass, sizeof (MonoClassEventInfo));
        mono_class_set_event_info (klass, info);
@@ -3529,7 +3529,7 @@ remove_instantiations_of_and_ensure_contents (gpointer key,
 MonoReflectionTypeHandle
 ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilderHandle ref_tb, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        reflection_create_generic_class (ref_tb, error);
        mono_error_assert_ok (error);
@@ -3704,7 +3704,7 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono
        GSList *l;
        int i;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (mono_runtime_is_shutting_down ()) {
                mono_error_set_generic_error (error, "System", "InvalidOperationException", "");
@@ -3843,7 +3843,7 @@ mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32
        MonoMethodSignature *sig;
        g_assert (image_is_dynamic (image));
 
-       mono_error_init (error);
+       error_init (error);
 
        sig = (MonoMethodSignature *)g_hash_table_lookup (((MonoDynamicImage*)image)->vararg_aux_hash, GUINT_TO_POINTER (token));
        if (sig)
@@ -3863,7 +3863,7 @@ mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32
 static void
 ensure_complete_type (MonoClass *klass, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        if (image_is_dynamic (klass->image) && !klass->wastypebuilder && mono_class_has_ref_info (klass)) {
                MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info_raw (klass); /* FIXME use handles */
@@ -3892,7 +3892,7 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
        MonoClass *oklass = obj->vtable->klass;
        gpointer result = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (strcmp (oklass->name, "String") == 0) {
                result = mono_string_intern_checked ((MonoString*)obj, error);
@@ -4120,7 +4120,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
 void
 mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides, int *num_overrides, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        *overrides = NULL;
        *num_overrides = 0;
 }
@@ -4135,13 +4135,13 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilderHandle tb,
 void 
 ves_icall_DynamicMethod_create_dynamic_method (MonoReflectionDynamicMethodHandle mb, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 }
 
 MonoType*
 mono_reflection_type_get_handle (MonoReflectionType* ref, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (!ref)
                return NULL;
        return ref->type;
@@ -4150,7 +4150,7 @@ mono_reflection_type_get_handle (MonoReflectionType* ref, MonoError *error)
 MonoType*
 mono_reflection_type_handle_mono_type (MonoReflectionTypeHandle ref, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (MONO_HANDLE_IS_NULL (ref))
                return NULL;
        return MONO_HANDLE_GETVAL (ref, type);
@@ -4169,7 +4169,7 @@ mono_sre_generic_param_table_entry_free (GenericParamTableEntry *entry)
 gint32
 ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, gboolean create_open_instance, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (MONO_HANDLE_IS_NULL (obj)) {
                mono_error_set_argument_null (error, "obj", "");
                return 0;
@@ -4183,7 +4183,7 @@ ves_icall_ModuleBuilder_getMethodToken (MonoReflectionModuleBuilderHandle mb,
                                        MonoArrayHandle opt_param_types,
                                        MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        if (MONO_HANDLE_IS_NULL (method)) {
                mono_error_set_argument_null (error, "method", "");
                return 0;
@@ -4211,7 +4211,7 @@ ves_icall_ModuleBuilder_build_metadata (MonoReflectionModuleBuilder *mb)
 void
 ves_icall_ModuleBuilder_RegisterToken (MonoReflectionModuleBuilderHandle mb, MonoObjectHandle obj, guint32 token, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        mono_dynamic_image_register_token (MONO_HANDLE_GETVAL (mb, dynamic_image), token, obj);
 }
 
@@ -4254,7 +4254,7 @@ ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
 void
 ves_icall_ModuleBuilder_basic_init (MonoReflectionModuleBuilderHandle moduleb, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        mono_image_module_basic_init (moduleb, error);
 }
 
index ace9a00bf6a8adb9bd83bcf6944f01bf84cfb882..618d995dceb7db96eccc7cccbdc98e1852f4cd56 100644 (file)
@@ -306,6 +306,12 @@ wait_callback (gint fd, gint events, gpointer user_data)
        }
 }
 
+static void
+selector_thread_interrupt (gpointer unused)
+{
+       selector_thread_wakeup ();
+}
+
 static gsize WINAPI
 selector_thread (gpointer data)
 {
@@ -321,9 +327,13 @@ selector_thread (gpointer data)
 
        states = mono_g_hash_table_new_type (g_direct_hash, g_direct_equal, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_THREAD_POOL, "i/o thread pool states table");
 
-       for (;;) {
+       while (!mono_runtime_is_shutting_down ()) {
                gint i, j;
                gint res;
+               gboolean interrupted = FALSE;
+
+               if (mono_thread_interruption_checkpoint ())
+                       continue;
 
                mono_coop_mutex_lock (&threadpool_io->updates_lock);
 
@@ -422,10 +432,15 @@ selector_thread (gpointer data)
 
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: wai");
 
-               res = threadpool_io->backend.event_wait (wait_callback, states);
+               mono_thread_info_install_interrupt (selector_thread_interrupt, NULL, &interrupted);
+               if (interrupted)
+                       continue;
 
-               if (res == -1 || mono_runtime_is_shutting_down ())
+               res = threadpool_io->backend.event_wait (wait_callback, states);
+               if (res == -1)
                        break;
+
+               mono_thread_info_uninstall_interrupt (&interrupted);
        }
 
        mono_g_hash_table_destroy (states);
@@ -548,13 +563,7 @@ initialize (void)
 static void
 cleanup (void)
 {
-       /* we make the assumption along the code that we are
-        * cleaning up only if the runtime is shutting down */
-       g_assert (mono_runtime_is_shutting_down ());
-
-       selector_thread_wakeup ();
-       while (io_selector_running)
-               mono_thread_info_usleep (1000);
+       // FIXME destroy everything
 }
 
 void
index 6e3a4b52130246a4f2a1d63fe02b3f443e51bca6..5fc716a74e73e87999bc0e124fdb9a19b64f1c9f 100644 (file)
@@ -25,7 +25,6 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-complex.h>
-#include <mono/utils/mono-lazy-init.h>
 #include <mono/utils/mono-logger.h>
 #include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-proclib.h>
@@ -125,18 +124,14 @@ typedef union {
        gint64 as_gint64;
 } ThreadPoolWorkerCounter;
 
-typedef MonoInternalThread ThreadPoolWorkerThread;
-
-struct MonoThreadPoolWorker {
+typedef struct {
        MonoRefCount ref;
 
        ThreadPoolWorkerCounter counters;
 
-       GPtrArray *threads; // ThreadPoolWorkerThread* []
-       MonoCoopMutex threads_lock; /* protect access to working_threads and parked_threads */
+       MonoCoopMutex parked_threads_lock;
        gint32 parked_threads_count;
        MonoCoopCond parked_threads_cond;
-       MonoCoopCond threads_exit_cond;
 
        ThreadPoolWorkItem *work_items; // ThreadPoolWorkItem []
        gint32 work_items_count;
@@ -165,7 +160,7 @@ struct MonoThreadPoolWorker {
        gboolean suspended;
 
        gint32 monitor_status;
-};
+} ThreadPoolWorker;
 
 enum {
        MONITOR_STATUS_REQUESTED,
@@ -173,6 +168,8 @@ enum {
        MONITOR_STATUS_NOT_RUNNING,
 };
 
+static ThreadPoolWorker worker;
+
 #define COUNTER_CHECK(counter) \
        do { \
                g_assert (counter._.max_working > 0); \
@@ -180,23 +177,22 @@ enum {
                g_assert (counter._.working >= 0); \
        } while (0)
 
-#define COUNTER_ATOMIC(worker,var,block) \
+#define COUNTER_ATOMIC(var,block) \
        do { \
                ThreadPoolWorkerCounter __old; \
                do { \
-                       g_assert (worker); \
-                       __old = COUNTER_READ (worker); \
+                       __old = COUNTER_READ (); \
                        (var) = __old; \
                        { block; } \
                        COUNTER_CHECK (var); \
-               } while (InterlockedCompareExchange64 (&worker->counters.as_gint64, (var).as_gint64, __old.as_gint64) != __old.as_gint64); \
+               } while (InterlockedCompareExchange64 (&worker.counters.as_gint64, (var).as_gint64, __old.as_gint64) != __old.as_gint64); \
        } while (0)
 
 static inline ThreadPoolWorkerCounter
-COUNTER_READ (MonoThreadPoolWorker *worker)
+COUNTER_READ (void)
 {
        ThreadPoolWorkerCounter counter;
-       counter.as_gint64 = InterlockedRead64 (&worker->counters.as_gint64);
+       counter.as_gint64 = InterlockedRead64 (&worker.counters.as_gint64);
        return counter;
 }
 
@@ -221,49 +217,44 @@ rand_next (gpointer *handle, guint32 min, guint32 max)
 static void
 destroy (gpointer data)
 {
-       MonoThreadPoolWorker *worker;
+       mono_coop_mutex_destroy (&worker.parked_threads_lock);
+       mono_coop_cond_destroy (&worker.parked_threads_cond);
 
-       worker = (MonoThreadPoolWorker*) data;
-       g_assert (worker);
+       mono_coop_mutex_destroy (&worker.work_items_lock);
 
-       // FIXME destroy everything
+       mono_coop_mutex_destroy (&worker.worker_creation_lock);
 
-       g_free (worker);
+       mono_coop_mutex_destroy (&worker.heuristic_lock);
+
+       g_free (worker.cpu_usage_state);
 }
 
 void
-mono_threadpool_worker_init (MonoThreadPoolWorker **worker)
+mono_threadpool_worker_init (void)
 {
-       MonoThreadPoolWorker *wk;
        ThreadPoolHillClimbing *hc;
        const char *threads_per_cpu_env;
        gint threads_per_cpu;
        gint threads_count;
 
-       g_assert (worker);
-
-       wk = *worker = g_new0 (MonoThreadPoolWorker, 1);
+       mono_refcount_init (&worker, destroy);
 
-       mono_refcount_init (wk, destroy);
+       mono_coop_mutex_init (&worker.parked_threads_lock);
+       worker.parked_threads_count = 0;
+       mono_coop_cond_init (&worker.parked_threads_cond);
 
-       wk->threads = g_ptr_array_new ();
-       mono_coop_mutex_init (&wk->threads_lock);
-       wk->parked_threads_count = 0;
-       mono_coop_cond_init (&wk->parked_threads_cond);
-       mono_coop_cond_init (&wk->threads_exit_cond);
+       /* worker.work_items_size is inited to 0 */
+       mono_coop_mutex_init (&worker.work_items_lock);
 
-       /* wk->work_items_size is inited to 0 */
-       mono_coop_mutex_init (&wk->work_items_lock);
+       worker.worker_creation_current_second = -1;
+       mono_coop_mutex_init (&worker.worker_creation_lock);
 
-       wk->worker_creation_current_second = -1;
-       mono_coop_mutex_init (&wk->worker_creation_lock);
-
-       wk->heuristic_adjustment_interval = 10;
-       mono_coop_mutex_init (&wk->heuristic_lock);
+       worker.heuristic_adjustment_interval = 10;
+       mono_coop_mutex_init (&worker.heuristic_lock);
 
        mono_rand_open ();
 
-       hc = &wk->heuristic_hill_climbing;
+       hc = &worker.heuristic_hill_climbing;
 
        hc->wave_period = HILL_CLIMBING_WAVE_PERIOD;
        hc->max_thread_wave_magnitude = HILL_CLIMBING_MAX_WAVE_MAGNITUDE;
@@ -297,187 +288,159 @@ mono_threadpool_worker_init (MonoThreadPoolWorker **worker)
 
        threads_count = mono_cpu_count () * threads_per_cpu;
 
-       wk->limit_worker_min = threads_count;
+       worker.limit_worker_min = threads_count;
 
 #if defined (PLATFORM_ANDROID) || defined (HOST_IOS)
-       wk->limit_worker_max = CLAMP (threads_count * 100, MIN (threads_count, 200), MAX (threads_count, 200));
+       worker.limit_worker_max = CLAMP (threads_count * 100, MIN (threads_count, 200), MAX (threads_count, 200));
 #else
-       wk->limit_worker_max = threads_count * 100;
+       worker.limit_worker_max = threads_count * 100;
 #endif
 
-       wk->counters._.max_working = wk->limit_worker_min;
+       worker.counters._.max_working = worker.limit_worker_min;
 
-       wk->cpu_usage_state = g_new0 (MonoCpuUsageState, 1);
+       worker.cpu_usage_state = g_new0 (MonoCpuUsageState, 1);
 
-       wk->suspended = FALSE;
+       worker.suspended = FALSE;
 
-       wk->monitor_status = MONITOR_STATUS_NOT_RUNNING;
+       worker.monitor_status = MONITOR_STATUS_NOT_RUNNING;
 }
 
 void
-mono_threadpool_worker_cleanup (MonoThreadPoolWorker *worker)
+mono_threadpool_worker_cleanup (void)
 {
-       MonoInternalThread *current;
-
-       /* we make the assumption along the code that we are
-        * cleaning up only if the runtime is shutting down */
-       g_assert (mono_runtime_is_shutting_down ());
-
-       current = mono_thread_internal_current ();
-
-       while (worker->monitor_status != MONITOR_STATUS_NOT_RUNNING)
-               mono_thread_info_sleep (1, NULL);
-
-       mono_coop_mutex_lock (&worker->threads_lock);
-
-       /* unpark all worker->parked_threads */
-       mono_coop_cond_broadcast (&worker->parked_threads_cond);
-
-#if 0
-       for (;;) {
-               ThreadPoolWorkerCounter counter;
-
-               counter = COUNTER_READ (worker);
-               if (counter._.starting + counter._.working + counter._.parked == 0)
-                       break;
-
-               if (counter._.starting + counter._.working + counter._.parked == 1) {
-                       if (worker->threads->len == 1 && g_ptr_array_index (worker->threads, 0) == current) {
-                               /* We are waiting on ourselves */
-                               break;
-                       }
-               }
-
-               mono_coop_cond_wait (&worker->threads_exit_cond, &worker->threads_lock);
-       }
-#endif
-
-       mono_coop_mutex_unlock (&worker->threads_lock);
-
-       mono_refcount_dec (worker);
+       mono_refcount_dec (&worker);
 }
 
 static void
-work_item_lock (MonoThreadPoolWorker *worker)
+work_item_lock (void)
 {
-       mono_coop_mutex_lock (&worker->work_items_lock);
+       mono_coop_mutex_lock (&worker.work_items_lock);
 }
 
 static void
-work_item_unlock (MonoThreadPoolWorker *worker)
+work_item_unlock (void)
 {
-       mono_coop_mutex_unlock (&worker->work_items_lock);
+       mono_coop_mutex_unlock (&worker.work_items_lock);
 }
 
 static void
-work_item_push (MonoThreadPoolWorker *worker, MonoThreadPoolWorkerCallback callback, gpointer data)
+work_item_push (MonoThreadPoolWorkerCallback callback, gpointer data)
 {
        ThreadPoolWorkItem work_item;
 
-       g_assert (worker);
        g_assert (callback);
 
        work_item.callback = callback;
        work_item.data = data;
 
-       work_item_lock (worker);
+       work_item_lock ();
 
-       g_assert (worker->work_items_count <= worker->work_items_size);
+       g_assert (worker.work_items_count <= worker.work_items_size);
 
-       if (G_UNLIKELY (worker->work_items_count == worker->work_items_size)) {
-               worker->work_items_size += 64;
-               worker->work_items = g_renew (ThreadPoolWorkItem, worker->work_items, worker->work_items_size);
+       if (G_UNLIKELY (worker.work_items_count == worker.work_items_size)) {
+               worker.work_items_size += 64;
+               worker.work_items = g_renew (ThreadPoolWorkItem, worker.work_items, worker.work_items_size);
        }
 
-       g_assert (worker->work_items);
+       g_assert (worker.work_items);
 
-       worker->work_items [worker->work_items_count ++] = work_item;
+       worker.work_items [worker.work_items_count ++] = work_item;
 
-       // printf ("[push] worker->work_items = %p, worker->work_items_count = %d, worker->work_items_size = %d\n",
-       //      worker->work_items, worker->work_items_count, worker->work_items_size);
+       // printf ("[push] worker.work_items = %p, worker.work_items_count = %d, worker.work_items_size = %d\n",
+       //      worker.work_items, worker.work_items_count, worker.work_items_size);
 
-       work_item_unlock (worker);
+       work_item_unlock ();
 }
 
 static gboolean
-work_item_try_pop (MonoThreadPoolWorker *worker, ThreadPoolWorkItem *work_item)
+work_item_try_pop (ThreadPoolWorkItem *work_item)
 {
-       g_assert (worker);
        g_assert (work_item);
 
-       work_item_lock (worker);
+       work_item_lock ();
 
-       // printf ("[pop]  worker->work_items = %p, worker->work_items_count = %d, worker->work_items_size = %d\n",
-       //      worker->work_items, worker->work_items_count, worker->work_items_size);
+       // printf ("[pop]  worker.work_items = %p, worker.work_items_count = %d, worker.work_items_size = %d\n",
+       //      worker.work_items, worker.work_items_count, worker.work_items_size);
 
-       if (worker->work_items_count == 0) {
-               work_item_unlock (worker);
+       if (worker.work_items_count == 0) {
+               work_item_unlock ();
                return FALSE;
        }
 
-       *work_item = worker->work_items [-- worker->work_items_count];
+       *work_item = worker.work_items [-- worker.work_items_count];
 
-       if (G_UNLIKELY (worker->work_items_count >= 64 * 3 && worker->work_items_count < worker->work_items_size / 2)) {
-               worker->work_items_size -= 64;
-               worker->work_items = g_renew (ThreadPoolWorkItem, worker->work_items, worker->work_items_size);
+       if (G_UNLIKELY (worker.work_items_count >= 64 * 3 && worker.work_items_count < worker.work_items_size / 2)) {
+               worker.work_items_size -= 64;
+               worker.work_items = g_renew (ThreadPoolWorkItem, worker.work_items, worker.work_items_size);
        }
 
-       work_item_unlock (worker);
+       work_item_unlock ();
 
        return TRUE;
 }
 
 static gint32
-work_item_count (MonoThreadPoolWorker *worker)
+work_item_count (void)
 {
        gint32 count;
 
-       work_item_lock (worker);
-       count = worker->work_items_count;
-       work_item_unlock (worker);
+       work_item_lock ();
+       count = worker.work_items_count;
+       work_item_unlock ();
 
        return count;
 }
 
-static void worker_request (MonoThreadPoolWorker *worker);
+static void worker_request (void);
 
 void
-mono_threadpool_worker_enqueue (MonoThreadPoolWorker *worker, MonoThreadPoolWorkerCallback callback, gpointer data)
+mono_threadpool_worker_enqueue (MonoThreadPoolWorkerCallback callback, gpointer data)
 {
-       work_item_push (worker, callback, data);
+       if (!mono_refcount_tryinc (&worker))
+               return;
+
+       work_item_push (callback, data);
+
+       worker_request ();
 
-       worker_request (worker);
+       mono_refcount_dec (&worker);
 }
 
 static void
-worker_wait_interrupt (gpointer data)
+worker_wait_interrupt (gpointer unused)
 {
-       MonoThreadPoolWorker *worker;
+       /* If the runtime is not shutting down, we are not using this mechanism to wake up a unparked thread, and if the
+        * runtime is shutting down, then we need to wake up ALL the threads.
+        * It might be a bit wasteful, but I witnessed shutdown hang where the main thread would abort and then wait for all
+        * background threads to exit (see mono_thread_manage). This would go wrong because not all threadpool threads would
+        * be unparked. It would end up getting unstucked because of the timeout, but that would delay shutdown by 5-60s. */
+       if (!mono_runtime_is_shutting_down ())
+               return;
 
-       worker = (MonoThreadPoolWorker*) data;
-       g_assert (worker);
+       if (!mono_refcount_tryinc (&worker))
+               return;
 
-       mono_coop_mutex_lock (&worker->threads_lock);
-       mono_coop_cond_signal (&worker->parked_threads_cond);
-       mono_coop_mutex_unlock (&worker->threads_lock);
+       mono_coop_mutex_lock (&worker.parked_threads_lock);
+       mono_coop_cond_broadcast (&worker.parked_threads_cond);
+       mono_coop_mutex_unlock (&worker.parked_threads_lock);
 
-       mono_refcount_dec (worker);
+       mono_refcount_dec (&worker);
 }
 
 /* return TRUE if timeout, FALSE otherwise (worker unpark or interrupt) */
 static gboolean
-worker_park (MonoThreadPoolWorker *worker)
+worker_park (void)
 {
        gboolean timeout = FALSE;
+       gboolean interrupted = FALSE;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker parking", mono_native_thread_id_get ());
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker parking", mono_native_thread_id_get ());
 
-       mono_coop_mutex_lock (&worker->threads_lock);
+       mono_coop_mutex_lock (&worker.parked_threads_lock);
 
        if (!mono_runtime_is_shutting_down ()) {
                static gpointer rand_handle = NULL;
                MonoInternalThread *thread;
-               gboolean interrupted = FALSE;
                ThreadPoolWorkerCounter counter;
 
                if (!rand_handle)
@@ -487,55 +450,52 @@ worker_park (MonoThreadPoolWorker *worker)
                thread = mono_thread_internal_current ();
                g_assert (thread);
 
-               COUNTER_ATOMIC (worker, counter, {
+               COUNTER_ATOMIC (counter, {
                        counter._.working --;
                        counter._.parked ++;
                });
 
-               worker->parked_threads_count += 1;
+               worker.parked_threads_count += 1;
 
-               mono_thread_info_install_interrupt (worker_wait_interrupt, mono_refcount_inc (worker), &interrupted);
-               if (interrupted) {
-                       mono_refcount_dec (worker);
+               mono_thread_info_install_interrupt (worker_wait_interrupt, NULL, &interrupted);
+               if (interrupted)
                        goto done;
-               }
 
-               if (mono_coop_cond_timedwait (&worker->parked_threads_cond, &worker->threads_lock, rand_next (&rand_handle, 5 * 1000, 60 * 1000)) != 0)
+               if (mono_coop_cond_timedwait (&worker.parked_threads_cond, &worker.parked_threads_lock, rand_next (&rand_handle, 5 * 1000, 60 * 1000)) != 0)
                        timeout = TRUE;
 
                mono_thread_info_uninstall_interrupt (&interrupted);
-               if (!interrupted)
-                       mono_refcount_dec (worker);
 
 done:
-               worker->parked_threads_count -= 1;
+               worker.parked_threads_count -= 1;
 
-               COUNTER_ATOMIC (worker, counter, {
+               COUNTER_ATOMIC (counter, {
                        counter._.working ++;
                        counter._.parked --;
                });
        }
 
-       mono_coop_mutex_unlock (&worker->threads_lock);
+       mono_coop_mutex_unlock (&worker.parked_threads_lock);
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s", mono_native_thread_id_get (), timeout ? "yes" : "no");
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker unparking, timeout? %s interrupted? %s",
+               mono_native_thread_id_get (), timeout ? "yes" : "no", interrupted ? "yes" : "no");
 
        return timeout;
 }
 
 static gboolean
-worker_try_unpark (MonoThreadPoolWorker *worker)
+worker_try_unpark (void)
 {
        gboolean res = FALSE;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker", mono_native_thread_id_get ());
 
-       mono_coop_mutex_lock (&worker->threads_lock);
-       if (worker->parked_threads_count > 0) {
-               mono_coop_cond_signal (&worker->parked_threads_cond);
+       mono_coop_mutex_lock (&worker.parked_threads_lock);
+       if (worker.parked_threads_count > 0) {
+               mono_coop_cond_signal (&worker.parked_threads_cond);
                res = TRUE;
        }
-       mono_coop_mutex_unlock (&worker->threads_lock);
+       mono_coop_mutex_unlock (&worker.parked_threads_lock);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker, success? %s", mono_native_thread_id_get (), res ? "yes" : "no");
 
@@ -543,18 +503,17 @@ worker_try_unpark (MonoThreadPoolWorker *worker)
 }
 
 static gsize WINAPI
-worker_thread (gpointer data)
+worker_thread (gpointer unused)
 {
-       MonoThreadPoolWorker *worker;
        MonoInternalThread *thread;
        ThreadPoolWorkerCounter counter;
 
        mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker starting", mono_native_thread_id_get ());
 
-       worker = (MonoThreadPoolWorker*) data;
-       g_assert (worker);
+       if (!mono_refcount_tryinc (&worker))
+               return 0;
 
-       COUNTER_ATOMIC (worker, counter, {
+       COUNTER_ATOMIC (counter, {
                counter._.starting --;
                counter._.working ++;
        });
@@ -562,20 +521,16 @@ worker_thread (gpointer data)
        thread = mono_thread_internal_current ();
        g_assert (thread);
 
-       mono_coop_mutex_lock (&worker->threads_lock);
-       g_ptr_array_add (worker->threads, thread);
-       mono_coop_mutex_unlock (&worker->threads_lock);
-
        while (!mono_runtime_is_shutting_down ()) {
                ThreadPoolWorkItem work_item;
 
                if (mono_thread_interruption_checkpoint ())
                        continue;
 
-               if (!work_item_try_pop (worker, &work_item)) {
+               if (!work_item_try_pop (&work_item)) {
                        gboolean timeout;
 
-                       timeout = worker_park (worker);
+                       timeout = worker_park ();
                        if (timeout)
                                break;
 
@@ -588,27 +543,19 @@ worker_thread (gpointer data)
                work_item.callback (work_item.data);
        }
 
-       mono_coop_mutex_lock (&worker->threads_lock);
-
-       COUNTER_ATOMIC (worker, counter, {
+       COUNTER_ATOMIC (counter, {
                counter._.working --;
        });
 
-       g_ptr_array_remove (worker->threads, thread);
-
-       mono_coop_cond_signal (&worker->threads_exit_cond);
-
-       mono_coop_mutex_unlock (&worker->threads_lock);
-
        mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] worker finishing", mono_native_thread_id_get ());
 
-       mono_refcount_dec (worker);
+       mono_refcount_dec (&worker);
 
        return 0;
 }
 
 static gboolean
-worker_try_create (MonoThreadPoolWorker *worker)
+worker_try_create (void)
 {
        MonoError error;
        MonoInternalThread *thread;
@@ -619,7 +566,7 @@ worker_try_create (MonoThreadPoolWorker *worker)
        if (mono_runtime_is_shutting_down ())
                return FALSE;
 
-       mono_coop_mutex_lock (&worker->worker_creation_lock);
+       mono_coop_mutex_lock (&worker.worker_creation_lock);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker", mono_native_thread_id_get ());
 
@@ -628,73 +575,69 @@ worker_try_create (MonoThreadPoolWorker *worker)
                g_warning ("failed to get 100ns ticks");
        } else {
                now = current_ticks / (10 * 1000 * 1000);
-               if (worker->worker_creation_current_second != now) {
-                       worker->worker_creation_current_second = now;
-                       worker->worker_creation_current_count = 0;
+               if (worker.worker_creation_current_second != now) {
+                       worker.worker_creation_current_second = now;
+                       worker.worker_creation_current_count = 0;
                } else {
-                       g_assert (worker->worker_creation_current_count <= WORKER_CREATION_MAX_PER_SEC);
-                       if (worker->worker_creation_current_count == WORKER_CREATION_MAX_PER_SEC) {
+                       g_assert (worker.worker_creation_current_count <= WORKER_CREATION_MAX_PER_SEC);
+                       if (worker.worker_creation_current_count == WORKER_CREATION_MAX_PER_SEC) {
                                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of worker created per second reached, current count = %d",
-                                       mono_native_thread_id_get (), worker->worker_creation_current_count);
-                               mono_coop_mutex_unlock (&worker->worker_creation_lock);
+                                       mono_native_thread_id_get (), worker.worker_creation_current_count);
+                               mono_coop_mutex_unlock (&worker.worker_creation_lock);
                                return FALSE;
                        }
                }
        }
 
-       COUNTER_ATOMIC (worker, counter, {
+       COUNTER_ATOMIC (counter, {
                if (counter._.working >= counter._.max_working) {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of working threads reached",
                                mono_native_thread_id_get ());
-                       mono_coop_mutex_unlock (&worker->worker_creation_lock);
+                       mono_coop_mutex_unlock (&worker.worker_creation_lock);
                        return FALSE;
                }
                counter._.starting ++;
        });
 
-       thread = mono_thread_create_internal (mono_get_root_domain (), worker_thread, mono_refcount_inc (worker), TRUE, 0, &error);
+       thread = mono_thread_create_internal (mono_get_root_domain (), worker_thread, NULL, TRUE, 0, &error);
        if (!thread) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: could not create thread due to %s", mono_native_thread_id_get (), mono_error_get_message (&error));
                mono_error_cleanup (&error);
 
-               COUNTER_ATOMIC (worker, counter, {
+               COUNTER_ATOMIC (counter, {
                        counter._.starting --;
                });
 
-               mono_coop_mutex_unlock (&worker->worker_creation_lock);
-
-               mono_refcount_dec (worker);
+               mono_coop_mutex_unlock (&worker.worker_creation_lock);
 
                return FALSE;
        }
 
-       worker->worker_creation_current_count += 1;
+       worker.worker_creation_current_count += 1;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d",
-               mono_native_thread_id_get (), (gpointer) thread->tid, now, worker->worker_creation_current_count);
+               mono_native_thread_id_get (), (gpointer) thread->tid, now, worker.worker_creation_current_count);
 
-       mono_coop_mutex_unlock (&worker->worker_creation_lock);
+       mono_coop_mutex_unlock (&worker.worker_creation_lock);
        return TRUE;
 }
 
-static void monitor_ensure_running (MonoThreadPoolWorker *worker);
+static void monitor_ensure_running (void);
 
 static void
-worker_request (MonoThreadPoolWorker *worker)
+worker_request (void)
 {
-       g_assert (worker);
-
-       if (worker->suspended)
+       if (worker.suspended)
                return;
 
-       monitor_ensure_running (worker);
+       monitor_ensure_running ();
 
-       if (worker_try_unpark (worker)) {
+       if (worker_try_unpark ()) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, unparked", mono_native_thread_id_get ());
                return;
        }
 
-       if (worker_try_create (worker)) {
+       if (worker_try_create ()) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, created", mono_native_thread_id_get ());
                return;
        }
@@ -703,19 +646,19 @@ worker_request (MonoThreadPoolWorker *worker)
 }
 
 static gboolean
-monitor_should_keep_running (MonoThreadPoolWorker *worker)
+monitor_should_keep_running (void)
 {
        static gint64 last_should_keep_running = -1;
 
-       g_assert (worker->monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || worker->monitor_status == MONITOR_STATUS_REQUESTED);
+       g_assert (worker.monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || worker.monitor_status == MONITOR_STATUS_REQUESTED);
 
-       if (InterlockedExchange (&worker->monitor_status, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST) {
+       if (InterlockedExchange (&worker.monitor_status, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST) {
                gboolean should_keep_running = TRUE, force_should_keep_running = FALSE;
 
                if (mono_runtime_is_shutting_down ()) {
                        should_keep_running = FALSE;
                } else {
-                       if (work_item_count (worker) == 0)
+                       if (work_item_count () == 0)
                                should_keep_running = FALSE;
 
                        if (!should_keep_running) {
@@ -730,50 +673,47 @@ monitor_should_keep_running (MonoThreadPoolWorker *worker)
                                last_should_keep_running = mono_100ns_ticks ();
                } else {
                        last_should_keep_running = -1;
-                       if (InterlockedCompareExchange (&worker->monitor_status, MONITOR_STATUS_NOT_RUNNING, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST)
+                       if (InterlockedCompareExchange (&worker.monitor_status, MONITOR_STATUS_NOT_RUNNING, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST)
                                return FALSE;
                }
        }
 
-       g_assert (worker->monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || worker->monitor_status == MONITOR_STATUS_REQUESTED);
+       g_assert (worker.monitor_status == MONITOR_STATUS_WAITING_FOR_REQUEST || worker.monitor_status == MONITOR_STATUS_REQUESTED);
 
        return TRUE;
 }
 
 static gboolean
-monitor_sufficient_delay_since_last_dequeue (MonoThreadPoolWorker *worker)
+monitor_sufficient_delay_since_last_dequeue (void)
 {
        gint64 threshold;
 
-       g_assert (worker);
-
-       if (worker->cpu_usage < CPU_USAGE_LOW) {
+       if (worker.cpu_usage < CPU_USAGE_LOW) {
                threshold = MONITOR_INTERVAL;
        } else {
                ThreadPoolWorkerCounter counter;
-               counter = COUNTER_READ (worker);
+               counter = COUNTER_READ ();
                threshold = counter._.max_working * MONITOR_INTERVAL * 2;
        }
 
-       return mono_msec_ticks () >= worker->heuristic_last_dequeue + threshold;
+       return mono_msec_ticks () >= worker.heuristic_last_dequeue + threshold;
 }
 
-static void hill_climbing_force_change (MonoThreadPoolWorker *worker, gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition);
+static void hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition);
 
 static gsize WINAPI
-monitor_thread (gpointer data)
+monitor_thread (gpointer unused)
 {
-       MonoThreadPoolWorker *worker;
        MonoInternalThread *internal;
        guint i;
 
-       worker = (MonoThreadPoolWorker*) data;
-       g_assert (worker);
+       if (!mono_refcount_tryinc (&worker))
+               return 0;
 
        internal = mono_thread_internal_current ();
        g_assert (internal);
 
-       mono_cpu_usage (worker->cpu_usage_state);
+       mono_cpu_usage (worker.cpu_usage_state);
 
        // printf ("monitor_thread: start\n");
 
@@ -785,9 +725,9 @@ monitor_thread (gpointer data)
                gint32 interval_left = MONITOR_INTERVAL;
                gint32 awake = 0; /* number of spurious awakes we tolerate before doing a round of rebalancing */
 
-               g_assert (worker->monitor_status != MONITOR_STATUS_NOT_RUNNING);
+               g_assert (worker.monitor_status != MONITOR_STATUS_NOT_RUNNING);
 
-               // counter = COUNTER_READ (worker);
+               // counter = COUNTER_READ ();
                // printf ("monitor_thread: starting = %d working = %d parked = %d max_working = %d\n",
                //      counter._.starting, counter._.working, counter._.parked, counter._.max_working);
 
@@ -810,21 +750,21 @@ monitor_thread (gpointer data)
                if (mono_runtime_is_shutting_down ())
                        continue;
 
-               if (worker->suspended)
+               if (worker.suspended)
                        continue;
 
-               if (work_item_count (worker) == 0)
+               if (work_item_count () == 0)
                        continue;
 
-               worker->cpu_usage = mono_cpu_usage (worker->cpu_usage_state);
+               worker.cpu_usage = mono_cpu_usage (worker.cpu_usage_state);
 
-               if (!monitor_sufficient_delay_since_last_dequeue (worker))
+               if (!monitor_sufficient_delay_since_last_dequeue ())
                        continue;
 
                limit_worker_max_reached = FALSE;
 
-               COUNTER_ATOMIC (worker, counter, {
-                       if (counter._.max_working >= worker->limit_worker_max) {
+               COUNTER_ATOMIC (counter, {
+                       if (counter._.max_working >= worker.limit_worker_max) {
                                limit_worker_max_reached = TRUE;
                                break;
                        }
@@ -834,54 +774,56 @@ monitor_thread (gpointer data)
                if (limit_worker_max_reached)
                        continue;
 
-               hill_climbing_force_change (worker, counter._.max_working, TRANSITION_STARVATION);
+               hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION);
 
                for (i = 0; i < 5; ++i) {
                        if (mono_runtime_is_shutting_down ())
                                break;
 
-                       if (worker_try_unpark (worker)) {
+                       if (worker_try_unpark ()) {
                                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, unparked", mono_native_thread_id_get ());
                                break;
                        }
 
-                       if (worker_try_create (worker)) {
+                       if (worker_try_create ()) {
                                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, created", mono_native_thread_id_get ());
                                break;
                        }
                }
-       } while (monitor_should_keep_running (worker));
+       } while (monitor_should_keep_running ());
 
        // printf ("monitor_thread: stop\n");
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] monitor thread, finished", mono_native_thread_id_get ());
 
+       mono_refcount_dec (&worker);
        return 0;
 }
 
 static void
-monitor_ensure_running (MonoThreadPoolWorker *worker)
+monitor_ensure_running (void)
 {
        MonoError error;
        for (;;) {
-               switch (worker->monitor_status) {
+               switch (worker.monitor_status) {
                case MONITOR_STATUS_REQUESTED:
                        // printf ("monitor_thread: requested\n");
                        return;
                case MONITOR_STATUS_WAITING_FOR_REQUEST:
                        // printf ("monitor_thread: waiting for request\n");
-                       InterlockedCompareExchange (&worker->monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_WAITING_FOR_REQUEST);
+                       InterlockedCompareExchange (&worker.monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_WAITING_FOR_REQUEST);
                        break;
                case MONITOR_STATUS_NOT_RUNNING:
                        // printf ("monitor_thread: not running\n");
                        if (mono_runtime_is_shutting_down ())
                                return;
-                       if (InterlockedCompareExchange (&worker->monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_NOT_RUNNING) == MONITOR_STATUS_NOT_RUNNING) {
+                       if (InterlockedCompareExchange (&worker.monitor_status, MONITOR_STATUS_REQUESTED, MONITOR_STATUS_NOT_RUNNING) == MONITOR_STATUS_NOT_RUNNING) {
                                // printf ("monitor_thread: creating\n");
-                               if (!mono_thread_create_internal (mono_get_root_domain (), monitor_thread, worker, TRUE, SMALL_STACK, &error)) {
+                               if (!mono_thread_create_internal (mono_get_root_domain (), monitor_thread, NULL, TRUE, SMALL_STACK, &error)) {
                                        // printf ("monitor_thread: creating failed\n");
-                                       worker->monitor_status = MONITOR_STATUS_NOT_RUNNING;
+                                       worker.monitor_status = MONITOR_STATUS_NOT_RUNNING;
                                        mono_error_cleanup (&error);
+                                       mono_refcount_dec (&worker);
                                }
                                return;
                        }
@@ -892,15 +834,13 @@ monitor_ensure_running (MonoThreadPoolWorker *worker)
 }
 
 static void
-hill_climbing_change_thread_count (MonoThreadPoolWorker *worker, gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
+hill_climbing_change_thread_count (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
 {
        ThreadPoolHillClimbing *hc;
 
-       g_assert (worker);
-
-       hc = &worker->heuristic_hill_climbing;
+       hc = &worker.heuristic_hill_climbing;
 
-       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] hill climbing, change max number of threads %d", mono_native_thread_id_get (), new_thread_count);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] hill climbing, change max number of threads %d", mono_native_thread_id_get (), new_thread_count);
 
        hc->last_thread_count = new_thread_count;
        hc->current_sample_interval = rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high);
@@ -909,32 +849,29 @@ hill_climbing_change_thread_count (MonoThreadPoolWorker *worker, gint16 new_thre
 }
 
 static void
-hill_climbing_force_change (MonoThreadPoolWorker *worker, gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
+hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition)
 {
        ThreadPoolHillClimbing *hc;
 
-       g_assert (worker);
-
-       hc = &worker->heuristic_hill_climbing;
+       hc = &worker.heuristic_hill_climbing;
 
        if (new_thread_count != hc->last_thread_count) {
                hc->current_control_setting += new_thread_count - hc->last_thread_count;
-               hill_climbing_change_thread_count (worker, new_thread_count, transition);
+               hill_climbing_change_thread_count (new_thread_count, transition);
        }
 }
 
 static double_complex
-hill_climbing_get_wave_component (MonoThreadPoolWorker *worker, gdouble *samples, guint sample_count, gdouble period)
+hill_climbing_get_wave_component (gdouble *samples, guint sample_count, gdouble period)
 {
        ThreadPoolHillClimbing *hc;
        gdouble w, cosine, sine, coeff, q0, q1, q2;
        guint i;
 
-       g_assert (worker);
        g_assert (sample_count >= period);
        g_assert (period >= 2);
 
-       hc = &worker->heuristic_hill_climbing;
+       hc = &worker.heuristic_hill_climbing;
 
        w = 2.0 * M_PI / period;
        cosine = cos (w);
@@ -952,7 +889,7 @@ hill_climbing_get_wave_component (MonoThreadPoolWorker *worker, gdouble *samples
 }
 
 static gint16
-hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count, guint32 sample_duration, gint32 completions, gint64 *adjustment_interval)
+hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint32 completions, gint64 *adjustment_interval)
 {
        ThreadPoolHillClimbing *hc;
        ThreadPoolHeuristicStateTransition transition;
@@ -969,14 +906,13 @@ hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count,
        double_complex throughput_wave_component;
        double_complex ratio;
 
-       g_assert (worker);
        g_assert (adjustment_interval);
 
-       hc = &worker->heuristic_hill_climbing;
+       hc = &worker.heuristic_hill_climbing;
 
        /* If someone changed the thread count without telling us, update our records accordingly. */
        if (current_thread_count != hc->last_thread_count)
-               hill_climbing_force_change (worker, current_thread_count, TRANSITION_INITIALIZING);
+               hill_climbing_force_change (current_thread_count, TRANSITION_INITIALIZING);
 
        /* Update the cumulative stats for this thread count */
        hc->elapsed_since_last_change += sample_duration;
@@ -1007,7 +943,7 @@ hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count,
         * range we're targeting, which will not be filtered by the frequency-domain translation. */
        if (hc->total_samples > 0 && ((current_thread_count - 1.0) / completions) >= hc->max_sample_error) {
                /* Not accurate enough yet. Let's accumulate the data so
-                * far, and tell the MonoThreadPoolWorker to collect a little more. */
+                * far, and tell the ThreadPoolWorker to collect a little more. */
                hc->accumulated_sample_duration = sample_duration;
                hc->accumulated_completion_count = completions;
                *adjustment_interval = 10;
@@ -1068,17 +1004,17 @@ hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count,
                        /* Get the the three different frequency components of the throughput (scaled by average
                         * throughput). Our "error" estimate (the amount of noise that might be present in the
                         * frequency band we're really interested in) is the average of the adjacent bands. */
-                       throughput_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (worker, hc->samples, sample_count, hc->wave_period), average_throughput);
-                       throughput_error_estimate = cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (worker, hc->samples, sample_count, adjacent_period_1), average_throughput));
+                       throughput_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period), average_throughput);
+                       throughput_error_estimate = cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1), average_throughput));
 
                        if (adjacent_period_2 <= sample_count) {
                                throughput_error_estimate = MAX (throughput_error_estimate, cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (
-                                       worker, hc->samples, sample_count, adjacent_period_2), average_throughput)));
+                                       hc->samples, sample_count, adjacent_period_2), average_throughput)));
                        }
 
                        /* Do the same for the thread counts, so we have something to compare to. We don't
                         * measure thread count noise, because there is none; these are exact measurements. */
-                       thread_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (worker, hc->thread_counts, sample_count, hc->wave_period), average_thread_count);
+                       thread_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period), average_thread_count);
 
                        /* Update our moving average of the throughput noise. We'll use this
                         * later as feedback to determine the new size of the thread wave. */
@@ -1129,7 +1065,7 @@ hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count,
        move = MIN (move, hc->max_change_per_sample);
 
        /* If the result was positive, and CPU is > 95%, refuse the move. */
-       if (move > 0.0 && worker->cpu_usage > CPU_USAGE_HIGH)
+       if (move > 0.0 && worker.cpu_usage > CPU_USAGE_HIGH)
                move = 0.0;
 
        /* Apply the move to our control setting. */
@@ -1141,19 +1077,19 @@ hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count,
                * hc->target_signal_to_noise_ratio * hc->thread_magnitude_multiplier * 2.0));
        new_thread_wave_magnitude = CLAMP (new_thread_wave_magnitude, 1, hc->max_thread_wave_magnitude);
 
-       /* Make sure our control setting is within the MonoThreadPoolWorker's limits. */
-       hc->current_control_setting = CLAMP (hc->current_control_setting, worker->limit_worker_min, worker->limit_worker_max - new_thread_wave_magnitude);
+       /* Make sure our control setting is within the ThreadPoolWorker's limits. */
+       hc->current_control_setting = CLAMP (hc->current_control_setting, worker.limit_worker_min, worker.limit_worker_max - new_thread_wave_magnitude);
 
        /* Calculate the new thread count (control setting + square wave). */
        new_thread_count = (gint)(hc->current_control_setting + new_thread_wave_magnitude * ((hc->total_samples / (hc->wave_period / 2)) % 2));
 
-       /* Make sure the new thread count doesn't exceed the MonoThreadPoolWorker's limits. */
-       new_thread_count = CLAMP (new_thread_count, worker->limit_worker_min, worker->limit_worker_max);
+       /* Make sure the new thread count doesn't exceed the ThreadPoolWorker's limits. */
+       new_thread_count = CLAMP (new_thread_count, worker.limit_worker_min, worker.limit_worker_max);
 
        if (new_thread_count != current_thread_count)
-               hill_climbing_change_thread_count (worker, new_thread_count, transition);
+               hill_climbing_change_thread_count (new_thread_count, transition);
 
-       if (creal (ratio) < 0.0 && new_thread_count == worker->limit_worker_min)
+       if (creal (ratio) < 0.0 && new_thread_count == worker.limit_worker_min)
                *adjustment_interval = (gint)(0.5 + hc->current_sample_interval * (10.0 * MAX (-1.0 * creal (ratio), 1.0)));
        else
                *adjustment_interval = hc->current_sample_interval;
@@ -1162,11 +1098,11 @@ hill_climbing_update (MonoThreadPoolWorker *worker, gint16 current_thread_count,
 }
 
 static gboolean
-heuristic_should_adjust (MonoThreadPoolWorker *worker)
+heuristic_should_adjust (void)
 {
-       if (worker->heuristic_last_dequeue > worker->heuristic_last_adjustment + worker->heuristic_adjustment_interval) {
+       if (worker.heuristic_last_dequeue > worker.heuristic_last_adjustment + worker.heuristic_adjustment_interval) {
                ThreadPoolWorkerCounter counter;
-               counter = COUNTER_READ (worker);
+               counter = COUNTER_READ ();
                if (counter._.working <= counter._.max_working)
                        return TRUE;
        }
@@ -1175,96 +1111,126 @@ heuristic_should_adjust (MonoThreadPoolWorker *worker)
 }
 
 static void
-heuristic_adjust (MonoThreadPoolWorker *worker)
+heuristic_adjust (void)
 {
-       if (mono_coop_mutex_trylock (&worker->heuristic_lock) == 0) {
-               gint32 completions = InterlockedExchange (&worker->heuristic_completions, 0);
+       if (mono_coop_mutex_trylock (&worker.heuristic_lock) == 0) {
+               gint32 completions = InterlockedExchange (&worker.heuristic_completions, 0);
                gint64 sample_end = mono_msec_ticks ();
-               gint64 sample_duration = sample_end - worker->heuristic_sample_start;
+               gint64 sample_duration = sample_end - worker.heuristic_sample_start;
 
-               if (sample_duration >= worker->heuristic_adjustment_interval / 2) {
+               if (sample_duration >= worker.heuristic_adjustment_interval / 2) {
                        ThreadPoolWorkerCounter counter;
                        gint16 new_thread_count;
 
-                       counter = COUNTER_READ (worker);
-                       new_thread_count = hill_climbing_update (worker, counter._.max_working, sample_duration, completions, &worker->heuristic_adjustment_interval);
+                       counter = COUNTER_READ ();
+                       new_thread_count = hill_climbing_update (counter._.max_working, sample_duration, completions, &worker.heuristic_adjustment_interval);
 
-                       COUNTER_ATOMIC (worker, counter, {
+                       COUNTER_ATOMIC (counter, {
                                counter._.max_working = new_thread_count;
                        });
 
                        if (new_thread_count > counter._.max_working)
-                               worker_request (worker);
+                               worker_request ();
 
-                       worker->heuristic_sample_start = sample_end;
-                       worker->heuristic_last_adjustment = mono_msec_ticks ();
+                       worker.heuristic_sample_start = sample_end;
+                       worker.heuristic_last_adjustment = mono_msec_ticks ();
                }
 
-               mono_coop_mutex_unlock (&worker->heuristic_lock);
+               mono_coop_mutex_unlock (&worker.heuristic_lock);
        }
 }
 
 static void
-heuristic_notify_work_completed (MonoThreadPoolWorker *worker)
+heuristic_notify_work_completed (void)
 {
-       g_assert (worker);
-
-       InterlockedIncrement (&worker->heuristic_completions);
-       worker->heuristic_last_dequeue = mono_msec_ticks ();
+       InterlockedIncrement (&worker.heuristic_completions);
+       worker.heuristic_last_dequeue = mono_msec_ticks ();
 
-       if (heuristic_should_adjust (worker))
-               heuristic_adjust (worker);
+       if (heuristic_should_adjust ())
+               heuristic_adjust ();
 }
 
 gboolean
-mono_threadpool_worker_notify_completed (MonoThreadPoolWorker *worker)
+mono_threadpool_worker_notify_completed (void)
 {
        ThreadPoolWorkerCounter counter;
 
-       heuristic_notify_work_completed (worker);
+       heuristic_notify_work_completed ();
 
-       counter = COUNTER_READ (worker);
+       counter = COUNTER_READ ();
        return counter._.working <= counter._.max_working;
 }
 
 gint32
-mono_threadpool_worker_get_min (MonoThreadPoolWorker *worker)
+mono_threadpool_worker_get_min (void)
 {
-       return worker->limit_worker_min;
+       gint32 ret;
+
+       if (!mono_refcount_tryinc (&worker))
+               return 0;
+
+       ret = worker.limit_worker_min;
+
+       mono_refcount_dec (&worker);
+       return ret;
 }
 
 gboolean
-mono_threadpool_worker_set_min (MonoThreadPoolWorker *worker, gint32 value)
+mono_threadpool_worker_set_min (gint32 value)
 {
-       if (value <= 0 || value > worker->limit_worker_max)
+       if (value <= 0 || value > worker.limit_worker_max)
+               return FALSE;
+
+       if (!mono_refcount_tryinc (&worker))
                return FALSE;
 
-       worker->limit_worker_min = value;
+       worker.limit_worker_min = value;
+
+       mono_refcount_dec (&worker);
        return TRUE;
 }
 
 gint32
-mono_threadpool_worker_get_max (MonoThreadPoolWorker *worker)
+mono_threadpool_worker_get_max (void)
 {
-       return worker->limit_worker_max;
+       gint32 ret;
+
+       if (!mono_refcount_tryinc (&worker))
+               return 0;
+
+       ret = worker.limit_worker_max;
+
+       mono_refcount_dec (&worker);
+       return ret;
 }
 
 gboolean
-mono_threadpool_worker_set_max (MonoThreadPoolWorker *worker, gint32 value)
+mono_threadpool_worker_set_max (gint32 value)
 {
-       gint32 cpu_count = mono_cpu_count ();
+       gint32 cpu_count;
+
+       cpu_count = mono_cpu_count ();
+       if (value < worker.limit_worker_min || value < cpu_count)
+               return FALSE;
 
-       if (value < worker->limit_worker_min || value < cpu_count)
+       if (!mono_refcount_tryinc (&worker))
                return FALSE;
 
-       worker->limit_worker_max = value;
+       worker.limit_worker_max = value;
+
+       mono_refcount_dec (&worker);
        return TRUE;
 }
 
 void
-mono_threadpool_worker_set_suspended (MonoThreadPoolWorker *worker, gboolean suspended)
+mono_threadpool_worker_set_suspended (gboolean suspended)
 {
-       worker->suspended = suspended;
+       if (!mono_refcount_tryinc (&worker))
+               return;
+
+       worker.suspended = suspended;
        if (!suspended)
-               worker_request (worker);
+               worker_request ();
+
+       mono_refcount_dec (&worker);
 }
index b63df60c915cb58defd2111979f0442805c79ea0..00cf11d64d09132ed4f7e120ea7bd9f0c95c69a4 100644 (file)
@@ -2,33 +2,33 @@
 #ifndef _MONO_METADATA_THREADPOOL_WORKER_H
 #define _MONO_METADATA_THREADPOOL_WORKER_H
 
-typedef struct MonoThreadPoolWorker MonoThreadPoolWorker;
+#include <glib.h>
 
 typedef void (*MonoThreadPoolWorkerCallback)(gpointer);
 
 void
-mono_threadpool_worker_init (MonoThreadPoolWorker **worker);
+mono_threadpool_worker_init (void);
 
 void
-mono_threadpool_worker_cleanup (MonoThreadPoolWorker *worker);
+mono_threadpool_worker_cleanup (void);
 
 void
-mono_threadpool_worker_enqueue (MonoThreadPoolWorker *worker, MonoThreadPoolWorkerCallback callback, gpointer data);
+mono_threadpool_worker_enqueue (MonoThreadPoolWorkerCallback callback, gpointer data);
 
 gboolean
-mono_threadpool_worker_notify_completed (MonoThreadPoolWorker *worker);
+mono_threadpool_worker_notify_completed (void);
 
 gint32
-mono_threadpool_worker_get_min (MonoThreadPoolWorker *worker);
+mono_threadpool_worker_get_min (void);
 gboolean
-mono_threadpool_worker_set_min (MonoThreadPoolWorker *worker, gint32 value);
+mono_threadpool_worker_set_min (gint32 value);
 
 gint32
-mono_threadpool_worker_get_max (MonoThreadPoolWorker *worker);
+mono_threadpool_worker_get_max (void);
 gboolean
-mono_threadpool_worker_set_max (MonoThreadPoolWorker *worker, gint32 value);
+mono_threadpool_worker_set_max (gint32 value);
 
 void
-mono_threadpool_worker_set_suspended (MonoThreadPoolWorker *worker, gboolean suspended);
+mono_threadpool_worker_set_suspended (gboolean suspended);
 
 #endif /* _MONO_METADATA_THREADPOOL_WORKER_H */
index c1f0c1a12a9f233f0dc41f902b60d7d2c6570abf..0b36a37cee925f982d5d36686cbfecfb4e31e881 100644 (file)
@@ -53,7 +53,7 @@ typedef struct {
        /* Number of currently executing jobs */
        gint32 threadpool_jobs;
        /* Signalled when threadpool_jobs + outstanding_request is 0 */
-       /* Protected by threadpool->domains_lock */
+       /* Protected by threadpool.domains_lock */
        MonoCoopCond cleanup_cond;
 } ThreadPoolDomain;
 
@@ -71,146 +71,78 @@ typedef struct {
        GPtrArray *domains; // ThreadPoolDomain* []
        MonoCoopMutex domains_lock;
 
-       GPtrArray *threads; // MonoInternalThread* []
-       MonoCoopMutex threads_lock;
-       MonoCoopCond threads_exit_cond;
-
        ThreadPoolCounter counters;
 
        gint32 limit_io_min;
        gint32 limit_io_max;
-
-       MonoThreadPoolWorker *worker;
 } ThreadPool;
 
 static mono_lazy_init_t status = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
 
-static ThreadPool* threadpool;
+static ThreadPool threadpool;
 
-#define COUNTER_ATOMIC(threadpool,var,block) \
+#define COUNTER_ATOMIC(var,block) \
        do { \
                ThreadPoolCounter __old; \
                do { \
-                       g_assert (threadpool); \
-                       (var) = __old = COUNTER_READ (threadpool); \
+                       (var) = __old = COUNTER_READ (); \
                        { block; } \
                        if (!(counter._.starting >= 0)) \
                                g_error ("%s: counter._.starting = %d, but should be >= 0", __func__, counter._.starting); \
                        if (!(counter._.working >= 0)) \
                                g_error ("%s: counter._.working = %d, but should be >= 0", __func__, counter._.working); \
-               } while (InterlockedCompareExchange (&threadpool->counters.as_gint32, (var).as_gint32, __old.as_gint32) != __old.as_gint32); \
+               } while (InterlockedCompareExchange (&threadpool.counters.as_gint32, (var).as_gint32, __old.as_gint32) != __old.as_gint32); \
        } while (0)
 
 static inline ThreadPoolCounter
-COUNTER_READ (ThreadPool *threadpool)
+COUNTER_READ (void)
 {
        ThreadPoolCounter counter;
-       counter.as_gint32 = InterlockedRead (&threadpool->counters.as_gint32);
+       counter.as_gint32 = InterlockedRead (&threadpool.counters.as_gint32);
        return counter;
 }
 
 static inline void
 domains_lock (void)
 {
-       mono_coop_mutex_lock (&threadpool->domains_lock);
+       mono_coop_mutex_lock (&threadpool.domains_lock);
 }
 
 static inline void
 domains_unlock (void)
 {
-       mono_coop_mutex_unlock (&threadpool->domains_lock);
+       mono_coop_mutex_unlock (&threadpool.domains_lock);
 }
 
 static void
 destroy (gpointer unused)
 {
-       g_ptr_array_free (threadpool->domains, TRUE);
-       mono_coop_mutex_destroy (&threadpool->domains_lock);
-
-       g_ptr_array_free (threadpool->threads, TRUE);
-       mono_coop_mutex_destroy (&threadpool->threads_lock);
-       mono_coop_cond_destroy (&threadpool->threads_exit_cond);
-
-       /* We cannot free the threadpool, because there is a race
-        * on shutdown where a managed thread may request a new
-        * threadpool thread, but we already destroyed the
-        * threadpool. So to avoid a use-after-free, we simply do
-        * not free the threadpool, as we won't be able to access
-        * the threadpool anyway because the ref count will be 0 */
-       // g_free (threadpool);
+       g_ptr_array_free (threadpool.domains, TRUE);
+       mono_coop_mutex_destroy (&threadpool.domains_lock);
 }
 
 static void
 initialize (void)
 {
-       g_assert (!threadpool);
-       threadpool = g_new0 (ThreadPool, 1);
-       g_assert (threadpool);
-
        g_assert (sizeof (ThreadPoolCounter) == sizeof (gint32));
 
-       mono_refcount_init (threadpool, destroy);
+       mono_refcount_init (&threadpool, destroy);
 
-       threadpool->domains = g_ptr_array_new ();
-       mono_coop_mutex_init (&threadpool->domains_lock);
+       threadpool.domains = g_ptr_array_new ();
+       mono_coop_mutex_init (&threadpool.domains_lock);
 
-       threadpool->threads = g_ptr_array_new ();
-       mono_coop_mutex_init (&threadpool->threads_lock);
-       mono_coop_cond_init (&threadpool->threads_exit_cond);
+       threadpool.limit_io_min = mono_cpu_count ();
+       threadpool.limit_io_max = CLAMP (threadpool.limit_io_min * 100, MIN (threadpool.limit_io_min, 200), MAX (threadpool.limit_io_min, 200));
 
-       threadpool->limit_io_min = mono_cpu_count ();
-       threadpool->limit_io_max = CLAMP (threadpool->limit_io_min * 100, MIN (threadpool->limit_io_min, 200), MAX (threadpool->limit_io_min, 200));
-
-       mono_threadpool_worker_init (&threadpool->worker);
+       mono_threadpool_worker_init ();
 }
 
 static void
 cleanup (void)
 {
-       guint i;
-       MonoInternalThread *current;
-
-       /* we make the assumption along the code that we are
-        * cleaning up only if the runtime is shutting down */
-       g_assert (mono_runtime_is_shutting_down ());
-
-       current = mono_thread_internal_current ();
-
-       mono_coop_mutex_lock (&threadpool->threads_lock);
-
-       /* stop all threadpool->threads */
-       for (i = 0; i < threadpool->threads->len; ++i) {
-               MonoInternalThread *thread = (MonoInternalThread*) g_ptr_array_index (threadpool->threads, i);
-               if (thread != current)
-                       mono_thread_internal_abort (thread);
-       }
-
-       mono_coop_mutex_unlock (&threadpool->threads_lock);
-
-#if 0
-       /* give a chance to the other threads to exit */
-       mono_thread_info_yield ();
-
-       mono_coop_mutex_lock (&threadpool->threads_lock);
-
-       for (;;) {
-               if (threadpool->threads->len == 0)
-                       break;
-
-               if (threadpool->threads->len == 1 && g_ptr_array_index (threadpool->threads, 0) == current) {
-                       /* We are waiting on ourselves */
-                       break;
-               }
-
-               mono_coop_cond_wait (&threadpool->threads_exit_cond, &threadpool->threads_lock);
-       }
-
-       mono_coop_mutex_unlock (&threadpool->threads_lock);
-#endif
+       mono_threadpool_worker_cleanup ();
 
-       mono_threadpool_worker_cleanup (threadpool->worker);
-
-       mono_refcount_dec (threadpool);
+       mono_refcount_dec (&threadpool);
 }
 
 gboolean
@@ -222,7 +154,7 @@ mono_threadpool_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, Mo
        MonoBoolean f;
        gpointer args [2];
 
-       mono_error_init (error);
+       error_init (error);
        g_assert (work_item);
 
        if (!threadpool_class)
@@ -256,22 +188,19 @@ mono_threadpool_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, Mo
        return TRUE;
 }
 
-/* LOCKING: domains_lock must be held */
-static void
-tpdomain_add (ThreadPoolDomain *tpdomain)
+/* LOCKING: domains_lock must be held. */
+static ThreadPoolDomain *
+tpdomain_create (MonoDomain *domain)
 {
-       guint i, len;
+       ThreadPoolDomain *tpdomain;
 
-       g_assert (tpdomain);
+       tpdomain = g_new0 (ThreadPoolDomain, 1);
+       tpdomain->domain = domain;
+       mono_coop_cond_init (&tpdomain->cleanup_cond);
 
-       len = threadpool->domains->len;
-       for (i = 0; i < len; ++i) {
-               if (g_ptr_array_index (threadpool->domains, i) == tpdomain)
-                       break;
-       }
+       g_ptr_array_add (threadpool.domains, tpdomain);
 
-       if (i == len)
-               g_ptr_array_add (threadpool->domains, tpdomain);
+       return tpdomain;
 }
 
 /* LOCKING: domains_lock must be held. */
@@ -279,36 +208,26 @@ static gboolean
 tpdomain_remove (ThreadPoolDomain *tpdomain)
 {
        g_assert (tpdomain);
-       return g_ptr_array_remove (threadpool->domains, tpdomain);
+       return g_ptr_array_remove (threadpool.domains, tpdomain);
 }
 
 /* LOCKING: domains_lock must be held */
 static ThreadPoolDomain *
-tpdomain_get (MonoDomain *domain, gboolean create)
+tpdomain_get (MonoDomain *domain)
 {
-       guint i;
-       ThreadPoolDomain *tpdomain;
+       gint i;
 
        g_assert (domain);
 
-       for (i = 0; i < threadpool->domains->len; ++i) {
+       for (i = 0; i < threadpool.domains->len; ++i) {
                ThreadPoolDomain *tpdomain;
 
-               tpdomain = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i);
+               tpdomain = (ThreadPoolDomain *)g_ptr_array_index (threadpool.domains, i);
                if (tpdomain->domain == domain)
                        return tpdomain;
        }
 
-       if (!create)
-               return NULL;
-
-       tpdomain = g_new0 (ThreadPoolDomain, 1);
-       tpdomain->domain = domain;
-       mono_coop_cond_init (&tpdomain->cleanup_cond);
-
-       tpdomain_add (tpdomain);
-
-       return tpdomain;
+       return NULL;
 }
 
 static void
@@ -322,22 +241,21 @@ static ThreadPoolDomain *
 tpdomain_get_next (ThreadPoolDomain *current)
 {
        ThreadPoolDomain *tpdomain = NULL;
-       guint len;
+       gint len;
 
-       len = threadpool->domains->len;
+       len = threadpool.domains->len;
        if (len > 0) {
-               guint i, current_idx = -1;
+               gint i, current_idx = -1;
                if (current) {
                        for (i = 0; i < len; ++i) {
-                               if (current == g_ptr_array_index (threadpool->domains, i)) {
+                               if (current == g_ptr_array_index (threadpool.domains, i)) {
                                        current_idx = i;
                                        break;
                                }
                        }
-                       g_assert (current_idx != (guint)-1);
                }
                for (i = current_idx + 1; i < len + current_idx + 1; ++i) {
-                       ThreadPoolDomain *tmp = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i % len);
+                       ThreadPoolDomain *tmp = (ThreadPoolDomain *)g_ptr_array_index (threadpool.domains, i % len);
                        if (tmp->outstanding_request > 0) {
                                tpdomain = tmp;
                                break;
@@ -352,7 +270,7 @@ static MonoObject*
 try_invoke_perform_wait_callback (MonoObject** exc, MonoError *error)
 {
        HANDLE_FUNCTION_ENTER ();
-       mono_error_init (error);
+       error_init (error);
        MonoObject *res = mono_runtime_try_invoke (mono_defaults.threadpool_perform_wait_callback_method, NULL, NULL, exc, error);
        HANDLE_FUNCTION_RETURN_VAL (res);
 }
@@ -365,9 +283,12 @@ worker_callback (gpointer unused)
        ThreadPoolCounter counter;
        MonoInternalThread *thread;
 
+       if (!mono_refcount_tryinc (&threadpool))
+               return;
+
        thread = mono_thread_internal_current ();
 
-       COUNTER_ATOMIC (threadpool, counter, {
+       COUNTER_ATOMIC (counter, {
                if (!(counter._.working < 32767 /* G_MAXINT16 */))
                        g_error ("%s: counter._.working = %d, but should be < 32767", __func__, counter._.working);
 
@@ -376,18 +297,14 @@ worker_callback (gpointer unused)
        });
 
        if (mono_runtime_is_shutting_down ()) {
-               COUNTER_ATOMIC (threadpool, counter, {
+               COUNTER_ATOMIC (counter, {
                        counter._.working --;
                });
 
-               mono_refcount_dec (threadpool);
+               mono_refcount_dec (&threadpool);
                return;
        }
 
-       mono_coop_mutex_lock (&threadpool->threads_lock);
-       g_ptr_array_add (threadpool->threads, thread);
-       mono_coop_mutex_unlock (&threadpool->threads_lock);
-
        /*
         * This is needed so there is always an lmf frame in the runtime invoke call below,
         * so ThreadAbortExceptions are caught even if the thread is in native code.
@@ -401,9 +318,12 @@ worker_callback (gpointer unused)
        while (!mono_runtime_is_shutting_down ()) {
                gboolean retire = FALSE;
 
-               if ((thread->state & (ThreadState_AbortRequested | ThreadState_SuspendRequested)) != 0) {
+               if (thread->state & (ThreadState_AbortRequested | ThreadState_SuspendRequested)) {
                        domains_unlock ();
-                       mono_thread_interruption_checkpoint ();
+                       if (mono_thread_interruption_checkpoint ()) {
+                               domains_lock ();
+                               continue;
+                       }
                        domains_lock ();
                }
 
@@ -471,19 +391,11 @@ worker_callback (gpointer unused)
 
        domains_unlock ();
 
-       mono_coop_mutex_lock (&threadpool->threads_lock);
-
-       g_ptr_array_remove_fast (threadpool->threads, thread);
-
-       mono_coop_cond_signal (&threadpool->threads_exit_cond);
-
-       mono_coop_mutex_unlock (&threadpool->threads_lock);
-
-       COUNTER_ATOMIC (threadpool, counter, {
+       COUNTER_ATOMIC (counter, {
                counter._.working --;
        });
 
-       mono_refcount_dec (threadpool);
+       mono_refcount_dec (&threadpool);
 }
 
 void
@@ -508,9 +420,7 @@ mono_threadpool_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod
        if (!async_call_klass)
                async_call_klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
 
-       mono_lazy_initialize (&status, initialize);
-
-       mono_error_init (error);
+       error_init (error);
 
        message = mono_method_call_message_new (method, params, mono_get_delegate_invoke (method->klass), (params != NULL) ? (&async_callback) : NULL, (params != NULL) ? (&state) : NULL, error);
        return_val_if_nok (error, NULL);
@@ -541,7 +451,7 @@ mono_threadpool_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObj
 {
        MonoAsyncCall *ac;
 
-       mono_error_init (error);
+       error_init (error);
        g_assert (exc);
        g_assert (out_args);
 
@@ -626,14 +536,14 @@ mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout)
        if (!mono_lazy_is_initialized (&status))
                return TRUE;
 
-       mono_refcount_inc (threadpool);
+       mono_refcount_inc (&threadpool);
 
        domains_lock ();
 
-       tpdomain = tpdomain_get (domain, FALSE);
+       tpdomain = tpdomain_get (domain);
        if (!tpdomain) {
                domains_unlock ();
-               mono_refcount_dec (threadpool);
+               mono_refcount_dec (&threadpool);
                return TRUE;
        }
 
@@ -641,7 +551,7 @@ mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout)
 
        while (tpdomain->outstanding_request + tpdomain->threadpool_jobs > 0) {
                if (timeout == -1) {
-                       mono_coop_cond_wait (&tpdomain->cleanup_cond, &threadpool->domains_lock);
+                       mono_coop_cond_wait (&tpdomain->cleanup_cond, &threadpool.domains_lock);
                } else {
                        gint64 now;
                        gint res;
@@ -652,7 +562,7 @@ mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout)
                                break;
                        }
 
-                       res = mono_coop_cond_timedwait (&tpdomain->cleanup_cond, &threadpool->domains_lock, end - now);
+                       res = mono_coop_cond_timedwait (&tpdomain->cleanup_cond, &threadpool.domains_lock, end - now);
                        if (res != 0) {
                                ret = FALSE;
                                break;
@@ -668,7 +578,7 @@ mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout)
        mono_coop_cond_destroy (&tpdomain->cleanup_cond);
        tpdomain_free (tpdomain);
 
-       mono_refcount_dec (threadpool);
+       mono_refcount_dec (&threadpool);
 
        return ret;
 }
@@ -676,15 +586,15 @@ mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout)
 void
 mono_threadpool_suspend (void)
 {
-       if (threadpool)
-               mono_threadpool_worker_set_suspended (threadpool->worker, TRUE);
+       if (mono_lazy_is_initialized (&status))
+               mono_threadpool_worker_set_suspended (TRUE);
 }
 
 void
 mono_threadpool_resume (void)
 {
-       if (threadpool)
-               mono_threadpool_worker_set_suspended (threadpool->worker, FALSE);
+       if (mono_lazy_is_initialized (&status))
+               mono_threadpool_worker_set_suspended (FALSE);
 }
 
 void
@@ -695,12 +605,18 @@ ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_
        if (!worker_threads || !completion_port_threads)
                return;
 
-       mono_lazy_initialize (&status, initialize);
+       if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) {
+               *worker_threads = 0;
+               *completion_port_threads = 0;
+               return;
+       }
 
-       counter = COUNTER_READ (threadpool);
+       counter = COUNTER_READ ();
 
-       *worker_threads = MAX (0, mono_threadpool_worker_get_max (threadpool->worker) - counter._.working);
-       *completion_port_threads = threadpool->limit_io_max;
+       *worker_threads = MAX (0, mono_threadpool_worker_get_max () - counter._.working);
+       *completion_port_threads = threadpool.limit_io_max;
+
+       mono_refcount_dec (&threadpool);
 }
 
 void
@@ -709,10 +625,16 @@ ves_icall_System_Threading_ThreadPool_GetMinThreadsNative (gint32 *worker_thread
        if (!worker_threads || !completion_port_threads)
                return;
 
-       mono_lazy_initialize (&status, initialize);
+       if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) {
+               *worker_threads = 0;
+               *completion_port_threads = 0;
+               return;
+       }
+
+       *worker_threads = mono_threadpool_worker_get_min ();
+       *completion_port_threads = threadpool.limit_io_min;
 
-       *worker_threads = mono_threadpool_worker_get_min (threadpool->worker);
-       *completion_port_threads = threadpool->limit_io_min;
+       mono_refcount_dec (&threadpool);
 }
 
 void
@@ -721,25 +643,35 @@ ves_icall_System_Threading_ThreadPool_GetMaxThreadsNative (gint32 *worker_thread
        if (!worker_threads || !completion_port_threads)
                return;
 
-       mono_lazy_initialize (&status, initialize);
+       if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) {
+               *worker_threads = 0;
+               *completion_port_threads = 0;
+               return;
+       }
+
+       *worker_threads = mono_threadpool_worker_get_max ();
+       *completion_port_threads = threadpool.limit_io_max;
 
-       *worker_threads = mono_threadpool_worker_get_max (threadpool->worker);
-       *completion_port_threads = threadpool->limit_io_max;
+       mono_refcount_dec (&threadpool);
 }
 
 MonoBoolean
 ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads, gint32 completion_port_threads)
 {
-       mono_lazy_initialize (&status, initialize);
+       if (completion_port_threads <= 0 || completion_port_threads > threadpool.limit_io_max)
+               return FALSE;
 
-       if (completion_port_threads <= 0 || completion_port_threads > threadpool->limit_io_max)
+       if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool))
                return FALSE;
 
-       if (!mono_threadpool_worker_set_min (threadpool->worker, worker_threads))
+       if (!mono_threadpool_worker_set_min (worker_threads)) {
+               mono_refcount_dec (&threadpool);
                return FALSE;
+       }
 
-       threadpool->limit_io_min = completion_port_threads;
+       threadpool.limit_io_min = completion_port_threads;
 
+       mono_refcount_dec (&threadpool);
        return TRUE;
 }
 
@@ -748,16 +680,20 @@ ves_icall_System_Threading_ThreadPool_SetMaxThreadsNative (gint32 worker_threads
 {
        gint cpu_count = mono_cpu_count ();
 
-       mono_lazy_initialize (&status, initialize);
+       if (completion_port_threads < threadpool.limit_io_min || completion_port_threads < cpu_count)
+               return FALSE;
 
-       if (completion_port_threads < threadpool->limit_io_min || completion_port_threads < cpu_count)
+       if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool))
                return FALSE;
 
-       if (!mono_threadpool_worker_set_max (threadpool->worker, worker_threads))
+       if (!mono_threadpool_worker_set_max (worker_threads)) {
+               mono_refcount_dec (&threadpool);
                return FALSE;
+       }
 
-       threadpool->limit_io_max = completion_port_threads;
+       threadpool.limit_io_max = completion_port_threads;
 
+       mono_refcount_dec (&threadpool);
        return TRUE;
 }
 
@@ -778,13 +714,13 @@ ves_icall_System_Threading_ThreadPool_NotifyWorkItemComplete (void)
        if (mono_domain_is_unloading (mono_domain_get ()) || mono_runtime_is_shutting_down ())
                return FALSE;
 
-       return mono_threadpool_worker_notify_completed (threadpool->worker);
+       return mono_threadpool_worker_notify_completed ();
 }
 
 void
 ves_icall_System_Threading_ThreadPool_NotifyWorkItemProgressNative (void)
 {
-       mono_threadpool_worker_notify_completed (threadpool->worker);
+       mono_threadpool_worker_notify_completed ();
 }
 
 void
@@ -807,21 +743,25 @@ ves_icall_System_Threading_ThreadPool_RequestWorkerThread (void)
        if (mono_domain_is_unloading (domain))
                return FALSE;
 
-       if (!mono_refcount_tryinc (threadpool)) {
+       if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) {
                /* threadpool has been destroyed, we are shutting down */
                return FALSE;
        }
 
        domains_lock ();
 
-       /* synchronize with mono_threadpool_remove_domain_jobs */
-       if (mono_domain_is_unloading (domain)) {
-               domains_unlock ();
-               mono_refcount_dec (threadpool);
-               return FALSE;
+       tpdomain = tpdomain_get (domain);
+       if (!tpdomain) {
+               /* synchronize with mono_threadpool_remove_domain_jobs */
+               if (mono_domain_is_unloading (domain)) {
+                       domains_unlock ();
+                       mono_refcount_dec (&threadpool);
+                       return FALSE;
+               }
+
+               tpdomain = tpdomain_create (domain);
        }
 
-       tpdomain = tpdomain_get (domain, TRUE);
        g_assert (tpdomain);
 
        tpdomain->outstanding_request ++;
@@ -829,17 +769,18 @@ ves_icall_System_Threading_ThreadPool_RequestWorkerThread (void)
 
        domains_unlock ();
 
-       COUNTER_ATOMIC (threadpool, counter, {
+       COUNTER_ATOMIC (counter, {
                if (counter._.starting == 16) {
-                       mono_refcount_dec (threadpool);
+                       mono_refcount_dec (&threadpool);
                        return TRUE;
                }
 
                counter._.starting ++;
        });
 
-       mono_threadpool_worker_enqueue (threadpool->worker, worker_callback, NULL);
+       mono_threadpool_worker_enqueue (worker_callback, NULL);
 
+       mono_refcount_dec (&threadpool);
        return TRUE;
 }
 
index b562d2c850502b9edc67cd390d1978b5f32c59a7..e6a1011d201d5c9c17216573840aca7760b24b17 100644 (file)
@@ -178,6 +178,7 @@ void mono_thread_internal_check_for_interruption_critical (MonoInternalThread *t
 
 void mono_thread_internal_stop (MonoInternalThread *thread);
 void mono_thread_internal_abort (MonoInternalThread *thread);
+void mono_thread_internal_suspend_for_shutdown (MonoInternalThread *thread);
 
 gboolean mono_thread_internal_has_appdomain_ref (MonoInternalThread *thread, MonoDomain *domain);
 
index 27aa6e4c95e663158a565ad3c0f18d33e0d7e7fc..3461f81e325c6dde6063bb487799a5d24b4baf02 100644 (file)
@@ -695,6 +695,7 @@ mono_thread_attach_internal (MonoThread *thread, gboolean force_attach, gboolean
 
        if (shutting_down && !force_attach) {
                mono_threads_unlock ();
+               mono_thread_pop_appdomain_ref ();
                return FALSE;
        }
 
@@ -914,7 +915,7 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, MonoObject *sta
         */
        mono_threads_join_threads ();
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_threads_lock ();
        if (shutting_down) {
@@ -1017,7 +1018,7 @@ mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer arg, gb
        MonoInternalThread *internal;
        gboolean res;
 
-       mono_error_init (error);
+       error_init (error);
 
        internal = create_internal_thread_object ();
 
@@ -1549,7 +1550,7 @@ ves_icall_System_Threading_Thread_GetName_internal (MonoInternalThread *this_obj
        MonoError error;
        MonoString* str;
 
-       mono_error_init (&error);
+       error_init (&error);
 
        LOCK_THREAD (this_obj);
        
@@ -1571,7 +1572,7 @@ mono_thread_set_name_internal (MonoInternalThread *this_obj, MonoString *name, g
 {
        LOCK_THREAD (this_obj);
 
-       mono_error_init (error);
+       error_init (error);
 
        if (reset) {
                this_obj->flags &= ~MONO_THREAD_FLAG_NAME_SET;
@@ -1661,7 +1662,7 @@ byte_array_to_domain (MonoArray *arr, MonoDomain *domain, MonoError *error)
 {
        MonoArray *copy;
 
-       mono_error_init (error);
+       error_init (error);
        if (!arr)
                return NULL;
 
@@ -1742,7 +1743,7 @@ mono_join_uninterrupted (MonoThreadHandle* thread_to_join, gint32 ms, MonoError
        gint32 diff_ms;
        gint32 wait = ms;
 
-       mono_error_init (error);
+       error_init (error);
 
        start = (ms == -1) ? 0 : mono_msec_ticks ();
        for (;;) {
@@ -1851,7 +1852,7 @@ mono_wait_uninterrupted (MonoInternalThread *thread, guint32 numhandles, gpointe
        gint32 diff_ms;
        gint32 wait = ms;
 
-       mono_error_init (error);
+       error_init (error);
 
        start = (ms == -1) ? 0 : mono_100ns_ticks ();
        do {
@@ -3208,22 +3209,21 @@ remove_and_abort_threads (gpointer key, gpointer value, gpointer user)
        if (wait->num >= MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS)
                return FALSE;
 
-       /* The finalizer thread is not a background thread */
-       if (!mono_native_thread_id_equals (thread_get_tid (thread), self)
-            && (thread->state & ThreadState_Background) != 0
-            && (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) == 0
-       ) {
+       if (mono_native_thread_id_equals (thread_get_tid (thread), self))
+               return FALSE;
+       if (mono_gc_is_finalizer_internal_thread (thread))
+               return FALSE;
+
+       if ((thread->state & ThreadState_Background) && !(thread->flags & MONO_THREAD_FLAG_DONT_MANAGE)) {
                wait->handles[wait->num] = mono_threads_open_thread_handle (thread->handle);
                wait->threads[wait->num] = thread;
                wait->num++;
 
                THREAD_DEBUG (g_print ("%s: Aborting id: %"G_GSIZE_FORMAT"\n", __func__, (gsize)thread->tid));
                mono_thread_internal_abort (thread);
-               return TRUE;
        }
 
-       return !mono_native_thread_id_equals (thread_get_tid (thread), self)
-               && !mono_gc_is_finalizer_internal_thread (thread);
+       return TRUE;
 }
 
 /** 
@@ -3661,7 +3661,7 @@ mono_threads_get_thread_dump (MonoArray **out_threads, MonoArray **out_stack_fra
        MonoDebugSourceLocation *location;
        int tindex, nthreads;
 
-       mono_error_init (error);
+       error_init (error);
        
        *out_threads = NULL;
        *out_stack_frames = NULL;
@@ -4844,13 +4844,6 @@ async_abort_critical (MonoThreadInfo *info, gpointer ud)
        if (mono_get_eh_callbacks ()->mono_install_handler_block_guard (mono_thread_info_get_suspend_state (info)))
                return MonoResumeThread;
 
-       /*
-       The target thread is running at least one protected block, which must not be interrupted, so we give up.
-       The protected block code will give them a chance when appropriate.
-       */
-       if (mono_thread_get_abort_prot_block_count (thread) > 0)
-               return MonoResumeThread;
-
        /*someone is already interrupting it*/
        if (!mono_thread_set_interruption_requested (thread))
                return MonoResumeThread;
@@ -4903,7 +4896,7 @@ self_abort_internal (MonoError *error)
 {
        MonoException *exc;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* FIXME this is insanely broken, it doesn't cause interruption to happen synchronously
         * since passing FALSE to mono_thread_request_interruption makes sure it returns NULL */
@@ -5001,11 +4994,33 @@ self_suspend_internal (void)
        event = thread->suspended;
 
        MONO_ENTER_GC_SAFE;
-       res = mono_os_event_wait_one (event, MONO_INFINITE_WAIT);
+       res = mono_os_event_wait_one (event, MONO_INFINITE_WAIT, TRUE);
        g_assert (res == MONO_OS_EVENT_WAIT_RET_SUCCESS_0 || res == MONO_OS_EVENT_WAIT_RET_ALERTED);
        MONO_EXIT_GC_SAFE;
 }
 
+static void
+suspend_for_shutdown_async_call (gpointer unused)
+{
+       for (;;)
+               mono_thread_info_yield ();
+}
+
+static SuspendThreadResult
+suspend_for_shutdown_critical (MonoThreadInfo *info, gpointer unused)
+{
+       mono_thread_info_setup_async_call (info, suspend_for_shutdown_async_call, NULL);
+       return MonoResumeThread;
+}
+
+void
+mono_thread_internal_suspend_for_shutdown (MonoInternalThread *thread)
+{
+       g_assert (thread != mono_thread_internal_current ());
+
+       mono_thread_info_safe_suspend_and_run (thread_get_tid (thread), FALSE, suspend_for_shutdown_critical, NULL);
+}
+
 /*
  * mono_thread_is_foreign:
  * @thread: the thread to query
index f826b7965e77f86719fd45b5d15f4545286801b0..e2cec88115b46804b96d1ec856b029954428da35 100644 (file)
@@ -5945,7 +5945,7 @@ mono_method_verify (MonoMethod *method, int level)
        for (i = 0; i < ctx.code_size && i < ip_offset; ++i) {
                if (ctx.code [i].flags & IL_CODE_FLAG_WAS_TARGET) {
                        if (!(ctx.code [i].flags & IL_CODE_FLAG_SEEN))
-                               ADD_VERIFY_ERROR (&ctx, g_strdup_printf ("Branch or exception block target middle of intruction at 0x%04x", i));
+                               ADD_VERIFY_ERROR (&ctx, g_strdup_printf ("Branch or exception block target middle of instruction at 0x%04x", i));
 
                        if (ctx.code [i].flags & IL_CODE_DELEGATE_SEQUENCE)
                                CODE_NOT_VERIFIABLE (&ctx, g_strdup_printf ("Branch to delegate code sequence at 0x%04x", i));
index 990ba3b3894cd9f9bb7245a60e6b7a30fcff29ed..b02f814fdbfcc5709a2be77b2f879d7cd92e861d 100644 (file)
@@ -52,6 +52,7 @@
 #define WSAENOTSOCK                10038
 #define WSAEDESTADDRREQ            10039
 #define WSAEMSGSIZE                10040
+#define WSAEPROTOTYPE              10041
 #define WSAENOPROTOOPT             10042
 #define WSAEPROTONOSUPPORT         10043
 #define WSAESOCKTNOSUPPORT         10044
index be8b5f70502c4777e5e428c943e711ad8856c64d..9666cb67d9d0cbda59c938c69f4c77e864c375ea 100644 (file)
@@ -78,7 +78,7 @@ typedef struct {
  * 4MB array.
  */
 static GHashTable *file_share_table;
-static mono_mutex_t file_share_mutex;
+static MonoCoopMutex file_share_mutex;
 
 static void
 time_t_to_filetime (time_t timeval, FILETIME *filetime)
@@ -94,7 +94,7 @@ static void
 file_share_release (FileShare *share_info)
 {
        /* Prevent new entries racing with us */
-       mono_os_mutex_lock (&file_share_mutex);
+       mono_coop_mutex_lock (&file_share_mutex);
 
        g_assert (share_info->handle_refs > 0);
        share_info->handle_refs -= 1;
@@ -102,7 +102,7 @@ file_share_release (FileShare *share_info)
        if (share_info->handle_refs == 0)
                g_hash_table_remove (file_share_table, share_info);
 
-       mono_os_mutex_unlock (&file_share_mutex);
+       mono_coop_mutex_unlock (&file_share_mutex);
 }
 
 static gint
@@ -130,7 +130,7 @@ file_share_get (guint64 device, guint64 inode, guint32 new_sharemode, guint32 ne
        gboolean exists = FALSE;
 
        /* Prevent new entries racing with us */
-       mono_os_mutex_lock (&file_share_mutex);
+       mono_coop_mutex_lock (&file_share_mutex);
 
        FileShare tmp;
 
@@ -168,7 +168,7 @@ file_share_get (guint64 device, guint64 inode, guint32 new_sharemode, guint32 ne
                g_hash_table_insert (file_share_table, file_share, file_share);
        }
 
-       mono_os_mutex_unlock (&file_share_mutex);
+       mono_coop_mutex_unlock (&file_share_mutex);
 
        return(exists);
 }
@@ -182,13 +182,19 @@ _wapi_open (const gchar *pathname, gint flags, mode_t mode)
        if (flags & O_CREAT) {
                located_filename = mono_portability_find_file (pathname, FALSE);
                if (located_filename == NULL) {
+                       MONO_ENTER_GC_SAFE;
                        fd = open (pathname, flags, mode);
+                       MONO_EXIT_GC_SAFE;
                } else {
+                       MONO_ENTER_GC_SAFE;
                        fd = open (located_filename, flags, mode);
+                       MONO_EXIT_GC_SAFE;
                        g_free (located_filename);
                }
        } else {
+               MONO_ENTER_GC_SAFE;
                fd = open (pathname, flags, mode);
+               MONO_EXIT_GC_SAFE;
                if (fd == -1 && (errno == ENOENT || errno == ENOTDIR) && IS_PORTABILITY_SET) {
                        gint saved_errno = errno;
                        located_filename = mono_portability_find_file (pathname, TRUE);
@@ -198,7 +204,9 @@ _wapi_open (const gchar *pathname, gint flags, mode_t mode)
                                return -1;
                        }
 
+                       MONO_ENTER_GC_SAFE;
                        fd = open (located_filename, flags, mode);
+                       MONO_EXIT_GC_SAFE;
                        g_free (located_filename);
                }
        }
@@ -211,7 +219,9 @@ _wapi_access (const gchar *pathname, gint mode)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = access (pathname, mode);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (pathname, TRUE);
@@ -221,7 +231,9 @@ _wapi_access (const gchar *pathname, gint mode)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = access (located_filename, mode);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -233,7 +245,9 @@ _wapi_chmod (const gchar *pathname, mode_t mode)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = chmod (pathname, mode);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (pathname, TRUE);
@@ -243,7 +257,9 @@ _wapi_chmod (const gchar *pathname, mode_t mode)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = chmod (located_filename, mode);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -255,7 +271,9 @@ _wapi_utime (const gchar *filename, const struct utimbuf *buf)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = utime (filename, buf);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && errno == ENOENT && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (filename, TRUE);
@@ -265,7 +283,9 @@ _wapi_utime (const gchar *filename, const struct utimbuf *buf)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = utime (located_filename, buf);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -277,7 +297,9 @@ _wapi_unlink (const gchar *pathname)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = unlink (pathname);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR || errno == EISDIR) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (pathname, TRUE);
@@ -287,7 +309,9 @@ _wapi_unlink (const gchar *pathname)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = unlink (located_filename);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -301,9 +325,13 @@ _wapi_rename (const gchar *oldpath, const gchar *newpath)
        gchar *located_newpath = mono_portability_find_file (newpath, FALSE);
 
        if (located_newpath == NULL) {
+               MONO_ENTER_GC_SAFE;
                ret = rename (oldpath, newpath);
+               MONO_EXIT_GC_SAFE;
        } else {
+               MONO_ENTER_GC_SAFE;
                ret = rename (oldpath, located_newpath);
+               MONO_EXIT_GC_SAFE;
 
                if (ret == -1 && (errno == EISDIR || errno == ENAMETOOLONG || errno == ENOENT || errno == ENOTDIR || errno == EXDEV) && IS_PORTABILITY_SET) {
                        gint saved_errno = errno;
@@ -317,7 +345,9 @@ _wapi_rename (const gchar *oldpath, const gchar *newpath)
                                return -1;
                        }
 
+                       MONO_ENTER_GC_SAFE;
                        ret = rename (located_oldpath, located_newpath);
+                       MONO_EXIT_GC_SAFE;
                        g_free (located_oldpath);
                }
                g_free (located_newpath);
@@ -331,7 +361,9 @@ _wapi_stat (const gchar *path, struct stat *buf)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = stat (path, buf);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (path, TRUE);
@@ -341,7 +373,9 @@ _wapi_stat (const gchar *path, struct stat *buf)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = stat (located_filename, buf);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -353,7 +387,9 @@ _wapi_lstat (const gchar *path, struct stat *buf)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = lstat (path, buf);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (path, TRUE);
@@ -377,9 +413,13 @@ _wapi_mkdir (const gchar *pathname, mode_t mode)
        gchar *located_filename = mono_portability_find_file (pathname, FALSE);
 
        if (located_filename == NULL) {
+               MONO_ENTER_GC_SAFE;
                ret = mkdir (pathname, mode);
+               MONO_EXIT_GC_SAFE;
        } else {
+               MONO_ENTER_GC_SAFE;
                ret = mkdir (located_filename, mode);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -391,7 +431,9 @@ _wapi_rmdir (const gchar *pathname)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = rmdir (pathname);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (pathname, TRUE);
@@ -401,7 +443,9 @@ _wapi_rmdir (const gchar *pathname)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = rmdir (located_filename);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -413,7 +457,9 @@ _wapi_chdir (const gchar *path)
 {
        gint ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = chdir (path);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1 && (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG) && IS_PORTABILITY_SET) {
                gint saved_errno = errno;
                gchar *located_filename = mono_portability_find_file (path, TRUE);
@@ -423,7 +469,9 @@ _wapi_chdir (const gchar *path)
                        return -1;
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = chdir (located_filename);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
        }
 
@@ -479,7 +527,9 @@ _wapi_g_dir_open (const gchar *path, guint flags, GError **error)
 {
        GDir *ret;
 
+       MONO_ENTER_GC_SAFE;
        ret = g_dir_open (path, flags, error);
+       MONO_EXIT_GC_SAFE;
        if (ret == NULL && ((*error)->code == G_FILE_ERROR_NOENT || (*error)->code == G_FILE_ERROR_NOTDIR || (*error)->code == G_FILE_ERROR_NAMETOOLONG) && IS_PORTABILITY_SET) {
                gchar *located_filename = mono_portability_find_file (path, TRUE);
                GError *tmp_error = NULL;
@@ -488,7 +538,9 @@ _wapi_g_dir_open (const gchar *path, guint flags, GError **error)
                        return(NULL);
                }
 
+               MONO_ENTER_GC_SAFE;
                ret = g_dir_open (located_filename, flags, &tmp_error);
+               MONO_EXIT_GC_SAFE;
                g_free (located_filename);
                if (tmp_error == NULL) {
                        g_clear_error (error);
@@ -622,7 +674,9 @@ _wapi_io_scandir (const gchar *dirname, const gchar *pattern, gchar ***namelist)
                gchar *pattern2 = g_strndup (pattern, strlen (pattern) - 2);
                gint result2;
 
+               MONO_ENTER_GC_SAFE;
                g_dir_rewind (dir);
+               MONO_EXIT_GC_SAFE;
                result2 = mono_w32file_unix_glob (dir, pattern2, flags | W32FILE_UNIX_GLOB_APPEND | W32FILE_UNIX_GLOB_UNIQUE, &glob_buf);
 
                g_free (pattern2);
@@ -632,7 +686,9 @@ _wapi_io_scandir (const gchar *dirname, const gchar *pattern, gchar ***namelist)
                }
        }
 
+       MONO_ENTER_GC_SAFE;
        g_dir_close (dir);
+       MONO_EXIT_GC_SAFE;
        if (glob_buf.gl_pathc == 0) {
                return(0);
        } else if (result != 0) {
@@ -1043,6 +1099,8 @@ static void _wapi_set_last_path_error_from_errno (const gchar *dir,
  */
 static void file_close (gpointer handle, gpointer data)
 {
+       /* FIXME: after mono_w32handle_close is coop-aware, change this to MONO_REQ_GC_UNSAFE_MODE and leave just the switch to SAFE around close() below */
+       MONO_ENTER_GC_UNSAFE;
        MonoW32HandleFile *file_handle = (MonoW32HandleFile *)data;
        gint fd = file_handle->fd;
        
@@ -1057,7 +1115,10 @@ static void file_close (gpointer handle, gpointer data)
        if (file_handle->share_info)
                file_share_release (file_handle->share_info);
        
+       MONO_ENTER_GC_SAFE;
        close (fd);
+       MONO_EXIT_GC_SAFE;
+       MONO_EXIT_GC_UNSAFE;
 }
 
 static void file_details (gpointer data)
@@ -1122,7 +1183,9 @@ file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread
        }
 
        do {
+               MONO_ENTER_GC_SAFE;
                ret = read (fd, buffer, numbytes);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
                        
@@ -1179,7 +1242,9 @@ file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                 * because we only do advisory locking on POSIX
                 * systems
                 */
+               MONO_ENTER_GC_SAFE;
                current_pos = lseek (fd, (off_t)0, SEEK_CUR);
+               MONO_EXIT_GC_SAFE;
                if (current_pos == -1) {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p lseek failed: %s", __func__,
                                   handle, strerror (errno));
@@ -1195,7 +1260,9 @@ file_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
        }
                
        do {
+               MONO_ENTER_GC_SAFE;
                ret = write (fd, buffer, numbytes);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
        
@@ -1246,7 +1313,9 @@ static gboolean file_flush(gpointer handle)
                return(FALSE);
        }
 
+       MONO_ENTER_GC_SAFE;
        ret=fsync(fd);
+       MONO_EXIT_GC_SAFE;
        if (ret==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fsync of handle %p error: %s", __func__, handle,
                          strerror(errno));
@@ -1323,9 +1392,13 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
 
 #ifdef PLATFORM_ANDROID
        /* bionic doesn't support -D_FILE_OFFSET_BITS=64 */
+       MONO_ENTER_GC_SAFE;
        newpos=lseek64(fd, offset, whence);
+       MONO_EXIT_GC_SAFE;
 #else
+       MONO_ENTER_GC_SAFE;
        newpos=lseek(fd, offset, whence);
+       MONO_EXIT_GC_SAFE;
 #endif
        if(newpos==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: lseek on handle %p returned error %s",
@@ -1389,7 +1462,9 @@ static gboolean file_setendoffile(gpointer handle)
         * than the length, truncate the file.
         */
        
+       MONO_ENTER_GC_SAFE;
        ret=fstat(fd, &statbuf);
+       MONO_EXIT_GC_SAFE;
        if(ret==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__,
                           handle, strerror(errno));
@@ -1398,7 +1473,9 @@ static gboolean file_setendoffile(gpointer handle)
                return(FALSE);
        }
 
+       MONO_ENTER_GC_SAFE;
        pos=lseek(fd, (off_t)0, SEEK_CUR);
+       MONO_EXIT_GC_SAFE;
        if(pos==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p lseek failed: %s", __func__,
                          handle, strerror(errno));
@@ -1422,7 +1499,9 @@ static gboolean file_setendoffile(gpointer handle)
                 * drop this write.
                 */
                do {
+                       MONO_ENTER_GC_SAFE;
                        ret = write (fd, "", 1);
+                       MONO_EXIT_GC_SAFE;
                } while (ret == -1 && errno == EINTR &&
                         !mono_thread_info_is_interrupt_state (info));
 
@@ -1434,7 +1513,9 @@ static gboolean file_setendoffile(gpointer handle)
                }
 
                /* And put the file position back after the write */
+               MONO_ENTER_GC_SAFE;
                ret = lseek (fd, pos, SEEK_SET);
+               MONO_EXIT_GC_SAFE;
                if (ret == -1) {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p second lseek failed: %s",
                                   __func__, handle, strerror(errno));
@@ -1451,7 +1532,9 @@ static gboolean file_setendoffile(gpointer handle)
         * byte to the end of the file
         */
        do {
+               MONO_ENTER_GC_SAFE;
                ret=ftruncate(fd, pos);
+               MONO_EXIT_GC_SAFE;
        }
        while (ret==-1 && errno==EINTR && !mono_thread_info_is_interrupt_state (info)); 
        if(ret==-1) {
@@ -1500,7 +1583,9 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
         */
        mono_w32error_set_last (ERROR_SUCCESS);
        
+       MONO_ENTER_GC_SAFE;
        ret = fstat(fd, &statbuf);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__,
                           handle, strerror(errno));
@@ -1513,7 +1598,11 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
 #ifdef BLKGETSIZE64
        if (S_ISBLK(statbuf.st_mode)) {
                guint64 bigsize;
-               if (ioctl(fd, BLKGETSIZE64, &bigsize) < 0) {
+               gint res;
+               MONO_ENTER_GC_SAFE;
+               res = ioctl (fd, BLKGETSIZE64, &bigsize);
+               MONO_EXIT_GC_SAFE;
+               if (res < 0) {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p ioctl BLKGETSIZE64 failed: %s",
                                   __func__, handle, strerror(errno));
 
@@ -1580,7 +1669,9 @@ static gboolean file_getfiletime(gpointer handle, FILETIME *create_time,
                return(FALSE);
        }
        
+       MONO_ENTER_GC_SAFE;
        ret=fstat(fd, &statbuf);
+       MONO_EXIT_GC_SAFE;
        if(ret==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__, handle,
                          strerror(errno));
@@ -1671,7 +1762,9 @@ static gboolean file_setfiletime(gpointer handle,
        /* Get the current times, so we can put the same times back in
         * the event that one of the FileTime structs is NULL
         */
+       MONO_ENTER_GC_SAFE;
        ret=fstat (fd, &statbuf);
+       MONO_EXIT_GC_SAFE;
        if(ret==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p fstat failed: %s", __func__, handle,
                          strerror(errno));
@@ -1746,6 +1839,8 @@ static gboolean file_setfiletime(gpointer handle,
 
 static void console_close (gpointer handle, gpointer data)
 {
+       /* FIXME: after mono_w32handle_close is coop-aware, change this to MONO_REQ_GC_UNSAFE_MODE and leave just the switch to SAFE around close() below */
+       MONO_ENTER_GC_UNSAFE;
        MonoW32HandleFile *console_handle = (MonoW32HandleFile *)data;
        gint fd = console_handle->fd;
        
@@ -1756,8 +1851,11 @@ static void console_close (gpointer handle, gpointer data)
        if (fd > 2) {
                if (console_handle->share_info)
                        file_share_release (console_handle->share_info);
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
        }
+       MONO_EXIT_GC_UNSAFE;
 }
 
 static void console_details (gpointer data)
@@ -1812,7 +1910,9 @@ console_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesr
        }
        
        do {
+               MONO_ENTER_GC_SAFE;
                ret=read(fd, buffer, numbytes);
+               MONO_EXIT_GC_SAFE;
        } while (ret==-1 && errno==EINTR && !mono_thread_info_is_interrupt_state (info));
 
        if(ret==-1) {
@@ -1861,7 +1961,9 @@ console_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *
        }
        
        do {
+               MONO_ENTER_GC_SAFE;
                ret = write(fd, buffer, numbytes);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
 
@@ -1896,6 +1998,8 @@ static gsize find_typesize (void)
 
 static void pipe_close (gpointer handle, gpointer data)
 {
+       /* FIXME: after mono_w32handle_close is coop-aware, change this to MONO_REQ_GC_UNSAFE_MODE and leave just the switch to SAFE around close() below */
+       MONO_ENTER_GC_UNSAFE;
        MonoW32HandleFile *pipe_handle = (MonoW32HandleFile*)data;
        gint fd = pipe_handle->fd;
 
@@ -1906,7 +2010,10 @@ static void pipe_close (gpointer handle, gpointer data)
        if (pipe_handle->share_info)
                file_share_release (pipe_handle->share_info);
 
+       MONO_ENTER_GC_SAFE;
        close (fd);
+       MONO_EXIT_GC_SAFE;
+       MONO_EXIT_GC_UNSAFE;
 }
 
 static void pipe_details (gpointer data)
@@ -1964,7 +2071,9 @@ pipe_read (gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesrea
                   numbytes, handle);
 
        do {
+               MONO_ENTER_GC_SAFE;
                ret=read(fd, buffer, numbytes);
+               MONO_EXIT_GC_SAFE;
        } while (ret==-1 && errno==EINTR && !mono_thread_info_is_interrupt_state (info));
                
        if (ret == -1) {
@@ -2023,7 +2132,9 @@ pipe_write(gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byt
                   handle);
 
        do {
+               MONO_ENTER_GC_SAFE;
                ret = write (fd, buffer, numbytes);
+               MONO_EXIT_GC_SAFE;
        } while (ret == -1 && errno == EINTR &&
                 !mono_thread_info_is_interrupt_state (info));
 
@@ -2271,19 +2382,25 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
 
                mono_w32error_set_last (ERROR_TOO_MANY_OPEN_FILES);
                
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
                g_free (filename);
                
                return(INVALID_HANDLE_VALUE);
        }
 
+       MONO_ENTER_GC_SAFE;
        ret = fstat (fd, &statbuf);
+       MONO_EXIT_GC_SAFE;
        if (ret == -1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fstat error of file %s: %s", __func__,
                           filename, strerror (errno));
                _wapi_set_last_error_from_errno ();
                g_free (filename);
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
                
                return(INVALID_HANDLE_VALUE);
        }
@@ -2299,7 +2416,9 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
                         &file_handle.share_info) == FALSE) {
                mono_w32error_set_last (ERROR_SHARING_VIOLATION);
                g_free (filename);
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
                
                return (INVALID_HANDLE_VALUE);
        }
@@ -2308,7 +2427,9 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: No space in the share table", __func__);
 
                mono_w32error_set_last (ERROR_TOO_MANY_OPEN_FILES);
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
                g_free (filename);
                
                return(INVALID_HANDLE_VALUE);
@@ -2322,15 +2443,24 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
        file_handle.attrs=attrs;
 
 #ifdef HAVE_POSIX_FADVISE
-       if (attrs & FILE_FLAG_SEQUENTIAL_SCAN)
+       if (attrs & FILE_FLAG_SEQUENTIAL_SCAN) {
+               MONO_ENTER_GC_SAFE;
                posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
-       if (attrs & FILE_FLAG_RANDOM_ACCESS)
+               MONO_EXIT_GC_SAFE;
+       }
+       if (attrs & FILE_FLAG_RANDOM_ACCESS) {
+               MONO_ENTER_GC_SAFE;
                posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM);
+               MONO_EXIT_GC_SAFE;
+       }
 #endif
 
 #ifdef F_RDAHEAD
-       if (attrs & FILE_FLAG_SEQUENTIAL_SCAN)
+       if (attrs & FILE_FLAG_SEQUENTIAL_SCAN) {
+               MONO_ENTER_GC_SAFE;
                fcntl(fd, F_RDAHEAD, 1);
+               MONO_EXIT_GC_SAFE;
+       }
 #endif
 
 #ifndef S_ISFIFO
@@ -2348,11 +2478,15 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
                handle_type = MONO_W32HANDLE_FILE;
        }
 
+       MONO_ENTER_GC_SAFE; /* FIXME: mono_w32handle_new_fd should be updated with coop transitions */
        handle = mono_w32handle_new_fd (handle_type, fd, &file_handle);
+       MONO_EXIT_GC_SAFE;
        if (handle == INVALID_HANDLE_VALUE) {
                g_warning ("%s: error creating file handle", __func__);
                g_free (filename);
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
                
                mono_w32error_set_last (ERROR_GEN_FAILURE);
                return(INVALID_HANDLE_VALUE);
@@ -2366,7 +2500,14 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode
 gboolean
 mono_w32file_close (gpointer handle)
 {
-       return mono_w32handle_close (handle);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       /* FIXME: we transition here and not in file_close, pipe_close,
+        * console_close because w32handle_close is not coop aware yet, but it
+        * calls back into w32file. */
+       res = mono_w32handle_close (handle);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean mono_w32file_delete(const gunichar2 *name)
@@ -2580,7 +2721,9 @@ write_file (gint src_fd, gint dest_fd, struct stat *st_src, gboolean report_erro
        buf = (gchar *) g_malloc (buf_size);
 
        for (;;) {
+               MONO_ENTER_GC_SAFE;
                remain = read (src_fd, buf, buf_size);
+               MONO_EXIT_GC_SAFE;
                if (remain < 0) {
                        if (errno == EINTR && !mono_thread_info_is_interrupt_state (info))
                                continue;
@@ -2597,7 +2740,10 @@ write_file (gint src_fd, gint dest_fd, struct stat *st_src, gboolean report_erro
 
                wbuf = buf;
                while (remain > 0) {
-                       if ((n = write (dest_fd, wbuf, remain)) < 0) {
+                       MONO_ENTER_GC_SAFE;
+                       n = write (dest_fd, wbuf, remain);
+                       MONO_EXIT_GC_SAFE;
+                       if (n < 0) {
                                if (errno == EINTR && !mono_thread_info_is_interrupt_state (info))
                                        continue;
 
@@ -2626,6 +2772,7 @@ CopyFile (const gunichar2 *name, const gunichar2 *dest_name, gboolean fail_if_ex
        struct utimbuf dest_time;
        gboolean ret = TRUE;
        gint ret_utime;
+       gint syscall_res;
        
        if(name==NULL) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: name is NULL", __func__);
@@ -2673,12 +2820,17 @@ CopyFile (const gunichar2 *name, const gunichar2 *dest_name, gboolean fail_if_ex
                return(FALSE);
        }
 
-       if (fstat (src_fd, &st) < 0) {
+       MONO_ENTER_GC_SAFE;
+       syscall_res = fstat (src_fd, &st);
+       MONO_EXIT_GC_SAFE;
+       if (syscall_res < 0) {
                _wapi_set_last_error_from_errno ();
 
                g_free (utf8_src);
                g_free (utf8_dest);
+               MONO_ENTER_GC_SAFE;
                close (src_fd);
+               MONO_EXIT_GC_SAFE;
                
                return(FALSE);
        }
@@ -2691,7 +2843,9 @@ CopyFile (const gunichar2 *name, const gunichar2 *dest_name, gboolean fail_if_ex
 
                g_free (utf8_src);
                g_free (utf8_dest);
+               MONO_ENTER_GC_SAFE;
                close (src_fd);
+               MONO_EXIT_GC_SAFE;
 
                mono_w32error_set_last (ERROR_SHARING_VIOLATION);
                return (FALSE);
@@ -2719,7 +2873,9 @@ CopyFile (const gunichar2 *name, const gunichar2 *dest_name, gboolean fail_if_ex
 
                g_free (utf8_src);
                g_free (utf8_dest);
+               MONO_ENTER_GC_SAFE;
                close (src_fd);
+               MONO_EXIT_GC_SAFE;
 
                return(FALSE);
        }
@@ -2732,7 +2888,9 @@ CopyFile (const gunichar2 *name, const gunichar2 *dest_name, gboolean fail_if_ex
        
        dest_time.modtime = st.st_mtime;
        dest_time.actime = st.st_atime;
+       MONO_ENTER_GC_SAFE;
        ret_utime = utime (utf8_dest, &dest_time);
+       MONO_EXIT_GC_SAFE;
        if (ret_utime == -1)
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: file [%s] utime failed: %s", __func__, utf8_dest, strerror(errno));
        
@@ -2812,14 +2970,20 @@ replace_cleanup:
        g_free (utf8_replacedFileName);
        g_free (utf8_replacementFileName);
        g_free (utf8_backupFileName);
-       if (backup_fd != -1)
+       if (backup_fd != -1) {
+               MONO_ENTER_GC_SAFE;
                close (backup_fd);
-       if (replaced_fd != -1)
+               MONO_EXIT_GC_SAFE;
+       }
+       if (replaced_fd != -1) {
+               MONO_ENTER_GC_SAFE;
                close (replaced_fd);
+               MONO_EXIT_GC_SAFE;
+       }
        return ret;
 }
 
-static mono_mutex_t stdhandle_mutex;
+static MonoCoopMutex stdhandle_mutex;
 
 static gpointer
 _wapi_stdhandle_create (gint fd, const gchar *name)
@@ -2932,7 +3096,7 @@ mono_w32file_get_std_handle (gint stdhandle)
 
        handle = GINT_TO_POINTER (fd);
 
-       mono_os_mutex_lock (&stdhandle_mutex);
+       mono_coop_mutex_lock (&stdhandle_mutex);
 
        ok = mono_w32handle_lookup (handle, MONO_W32HANDLE_CONSOLE,
                                  (gpointer *)&file_handle);
@@ -2950,8 +3114,8 @@ mono_w32file_get_std_handle (gint stdhandle)
        }
        
   done:
-       mono_os_mutex_unlock (&stdhandle_mutex);
-       
+       mono_coop_mutex_unlock (&stdhandle_mutex);
+
        return(handle);
 }
 
@@ -3487,7 +3651,9 @@ mono_w32file_find_close (gpointer handle)
 
        mono_w32handle_unlock_handle (handle);
        
+       MONO_ENTER_GC_SAFE;
        mono_w32handle_unref (handle);
+       MONO_EXIT_GC_SAFE;
        
        return(TRUE);
 }
@@ -3731,7 +3897,9 @@ mono_w32file_set_attributes (const gunichar2 *name, guint32 attrs)
                if ((buf.st_mode & S_IROTH) != 0)
                        exec_mask |= S_IXOTH;
 
+               MONO_ENTER_GC_SAFE;
                result = chmod (utf8_name, buf.st_mode | exec_mask);
+               MONO_EXIT_GC_SAFE;
        }
        /* Don't bother to reset executable (might need to change this
         * policy)
@@ -3818,7 +3986,9 @@ mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
        
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Creating pipe", __func__);
 
+       MONO_ENTER_GC_SAFE;
        ret=pipe (filedes);
+       MONO_EXIT_GC_SAFE;
        if(ret==-1) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Error creating pipe: %s", __func__,
                           strerror (errno));
@@ -3833,8 +4003,10 @@ mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
 
                mono_w32error_set_last (ERROR_TOO_MANY_OPEN_FILES);
                
+               MONO_ENTER_GC_SAFE;
                close (filedes[0]);
                close (filedes[1]);
+               MONO_EXIT_GC_SAFE;
                
                return(FALSE);
        }
@@ -3847,8 +4019,10 @@ mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
                                           &pipe_read_handle);
        if (read_handle == INVALID_HANDLE_VALUE) {
                g_warning ("%s: error creating pipe read handle", __func__);
+               MONO_ENTER_GC_SAFE;
                close (filedes[0]);
                close (filedes[1]);
+               MONO_EXIT_GC_SAFE;
                mono_w32error_set_last (ERROR_GEN_FAILURE);
                
                return(FALSE);
@@ -3860,10 +4034,13 @@ mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
                                            &pipe_write_handle);
        if (write_handle == INVALID_HANDLE_VALUE) {
                g_warning ("%s: error creating pipe write handle", __func__);
+
+               MONO_ENTER_GC_SAFE;
                mono_w32handle_unref (read_handle);
                
                close (filedes[0]);
                close (filedes[1]);
+               MONO_EXIT_GC_SAFE;
                mono_w32error_set_last (ERROR_GEN_FAILURE);
                
                return(FALSE);
@@ -3887,15 +4064,21 @@ mono_w32file_get_logical_drive (guint32 len, gunichar2 *buf)
        gint size, n, i;
        gunichar2 *dir;
        glong length, total = 0;
-       
+       gint syscall_res;
+
+       MONO_ENTER_GC_SAFE;
        n = getfsstat (NULL, 0, MNT_NOWAIT);
+       MONO_EXIT_GC_SAFE;
        if (n == -1)
                return 0;
        size = n * sizeof (struct statfs);
        stats = (struct statfs *) g_malloc (size);
        if (stats == NULL)
                return 0;
-       if (getfsstat (stats, size, MNT_NOWAIT) == -1){
+       MONO_ENTER_GC_SAFE;
+       syscall_res = getfsstat (stats, size, MNT_NOWAIT);
+       MONO_EXIT_GC_SAFE;
+       if (syscall_res == -1){
                g_free (stats);
                return 0;
        }
@@ -3982,11 +4165,15 @@ mono_w32file_get_logical_drive (guint32 len, gunichar2 *buf)
        gboolean (*parser)(guint32, gunichar2*, LinuxMountInfoParseState*) = NULL;
 
        memset (buf, 0, len * sizeof (gunichar2));
+       MONO_ENTER_GC_SAFE;
        fd = open ("/proc/self/mountinfo", O_RDONLY);
+       MONO_EXIT_GC_SAFE;
        if (fd != -1)
                parser = GetLogicalDriveStrings_MountInfo;
        else {
+               MONO_ENTER_GC_SAFE;
                fd = open ("/proc/mounts", O_RDONLY);
+               MONO_EXIT_GC_SAFE;
                if (fd != -1)
                        parser = GetLogicalDriveStrings_Mounts;
        }
@@ -4000,7 +4187,12 @@ mono_w32file_get_logical_drive (guint32 len, gunichar2 *buf)
        state.field_number = 1;
        state.delimiter = ' ';
 
-       while ((state.nbytes = read (fd, state.buffer, GET_LOGICAL_DRIVE_STRINGS_BUFFER)) > 0) {
+       while (1) {
+               MONO_ENTER_GC_SAFE;
+               state.nbytes = read (fd, state.buffer, GET_LOGICAL_DRIVE_STRINGS_BUFFER);
+               MONO_EXIT_GC_SAFE;
+               if (!(state.nbytes > 0))
+                       break;
                state.buffer_index = 0;
 
                while ((*parser)(len, buf, &state)) {
@@ -4022,8 +4214,11 @@ mono_w32file_get_logical_drive (guint32 len, gunichar2 *buf)
        ret = state.total;
 
   done_and_out:
-       if (fd != -1)
+       if (fd != -1) {
+               MONO_ENTER_GC_SAFE;
                close (fd);
+               MONO_EXIT_GC_SAFE;
+       }
        return ret;
 }
 
@@ -4256,15 +4451,25 @@ GetLogicalDriveStrings_Mtab (guint32 len, gunichar2 *buf)
        /* Sigh, mntent and friends don't work well.
         * It stops on the first line that doesn't begin with a '/'.
         * (linux 2.6.5, libc 2.3.2.ds1-12) - Gonz */
+       MONO_ENTER_GC_SAFE;
        fp = fopen ("/etc/mtab", "rt");
+       MONO_EXIT_GC_SAFE;
        if (fp == NULL) {
+               MONO_ENTER_GC_SAFE;
                fp = fopen ("/etc/mnttab", "rt");
+               MONO_EXIT_GC_SAFE;
                if (fp == NULL)
                        return 1;
        }
 
        ptr = buf;
-       while (fgets (buffer, 512, fp) != NULL) {
+       while (1) {
+               gchar *fgets_res;
+               MONO_ENTER_GC_SAFE;
+               fgets_res = fgets (buffer, 512, fp);
+               MONO_EXIT_GC_SAFE;
+               if (!fgets_res)
+                       break;
                if (*buffer != '/')
                        continue;
 
@@ -4278,7 +4483,9 @@ GetLogicalDriveStrings_Mtab (guint32 len, gunichar2 *buf)
                dir = g_utf8_to_utf16 (*(splitted + 1), -1, NULL, &length, NULL);
                g_strfreev (splitted);
                if (total + length + 1 > len) {
+                       MONO_ENTER_GC_SAFE;
                        fclose (fp);
+                       MONO_EXIT_GC_SAFE;
                        g_free (dir);
                        return len * 2; /* guess */
                }
@@ -4288,7 +4495,9 @@ GetLogicalDriveStrings_Mtab (guint32 len, gunichar2 *buf)
                total += length + 1;
        }
 
+       MONO_ENTER_GC_SAFE;
        fclose (fp);
+       MONO_EXIT_GC_SAFE;
        return total;
 /* Commented out, does not work with my mtab!!! - Gonz */
 #ifdef NOTENABLED /* HAVE_MNTENT_H */
@@ -4299,18 +4508,30 @@ GetLogicalDriveStrings_Mtab (guint32 len, gunichar2 *buf)
        glong len, total = 0;
        
 
+       MONO_ENTER_GC_SAFE;
        fp = setmntent ("/etc/mtab", "rt");
+       MONO_EXIT_GC_SAFE;
        if (fp == NULL) {
+               MONO_ENTER_GC_SAFE;
                fp = setmntent ("/etc/mnttab", "rt");
+               MONO_EXIT_GC_SAFE;
                if (fp == NULL)
                        return;
        }
 
        ptr = buf;
-       while ((mnt = getmntent (fp)) != NULL) {
+       while (1) {
+               MONO_ENTER_GC_SAFE;
+               mnt = getmntent (fp);
+               MONO_EXIT_GC_SAFE;
+               if (mnt == NULL)
+                       break;
                g_print ("GOT %s\n", mnt->mnt_dir);
                dir = g_utf8_to_utf16 (mnt->mnt_dir, &len, NULL, NULL, NULL);
                if (total + len + 1 > len) {
+                       MONO_ENTER_GC_SAFE;
+                       endmntent (fp);
+                       MONO_EXIT_GC_SAFE;
                        return len * 2; /* guess */
                }
 
@@ -4319,7 +4540,9 @@ GetLogicalDriveStrings_Mtab (guint32 len, gunichar2 *buf)
                total += len + 1;
        }
 
+       MONO_ENTER_GC_SAFE;
        endmntent (fp);
+       MONO_EXIT_GC_SAFE;
        return total;
 }
 #endif
@@ -4359,11 +4582,15 @@ mono_w32file_get_disk_free_space (const gunichar2 *path_name, guint64 *free_byte
 
        do {
 #ifdef HAVE_STATVFS
+               MONO_ENTER_GC_SAFE;
                ret = statvfs (utf8_path_name, &fsstat);
+               MONO_EXIT_GC_SAFE;
                isreadonly = ((fsstat.f_flag & ST_RDONLY) == ST_RDONLY);
                block_size = fsstat.f_frsize;
 #elif defined(HAVE_STATFS)
+               MONO_ENTER_GC_SAFE;
                ret = statfs (utf8_path_name, &fsstat);
+               MONO_EXIT_GC_SAFE;
 #if defined (MNT_RDONLY)
                isreadonly = ((fsstat.f_flags & MNT_RDONLY) == MNT_RDONLY);
 #elif defined (MS_RDONLY)
@@ -4601,8 +4828,12 @@ static guint32
 GetDriveTypeFromPath (const gchar *utf8_root_path_name)
 {
        struct statfs buf;
-       
-       if (statfs (utf8_root_path_name, &buf) == -1)
+       gint res;
+
+       MONO_ENTER_GC_SAFE;
+       res = statfs (utf8_root_path_name, &buf);
+       MONO_EXIT_GC_SAFE;
+       if (res == -1)
                return DRIVE_UNKNOWN;
 #if PLATFORM_MACOSX
        return _wapi_get_drive_type (buf.f_fstypename);
@@ -4619,15 +4850,25 @@ GetDriveTypeFromPath (const gchar *utf8_root_path_name)
        gchar buffer [512];
        gchar **splitted;
 
+       MONO_ENTER_GC_SAFE;
        fp = fopen ("/etc/mtab", "rt");
+       MONO_EXIT_GC_SAFE;
        if (fp == NULL) {
+               MONO_ENTER_GC_SAFE;
                fp = fopen ("/etc/mnttab", "rt");
+               MONO_EXIT_GC_SAFE;
                if (fp == NULL) 
                        return(DRIVE_UNKNOWN);
        }
 
        drive_type = DRIVE_NO_ROOT_DIR;
-       while (fgets (buffer, 512, fp) != NULL) {
+       while (1) {
+               gchar *fgets_res;
+               MONO_ENTER_GC_SAFE;
+               fgets_res = fgets (buffer, 512, fp);
+               MONO_EXIT_GC_SAFE;
+               if (fgets_res == NULL)
+                       break;
                splitted = g_strsplit (buffer, " ", 0);
                if (!*splitted || !*(splitted + 1) || !*(splitted + 2)) {
                        g_strfreev (splitted);
@@ -4650,7 +4891,9 @@ GetDriveTypeFromPath (const gchar *utf8_root_path_name)
                g_strfreev (splitted);
        }
 
+       MONO_ENTER_GC_SAFE;
        fclose (fp);
+       MONO_EXIT_GC_SAFE;
        return drive_type;
 }
 #endif
@@ -4694,7 +4937,11 @@ get_fstypename (gchar *utfpath)
 #if __linux__
        _wapi_drive_type *current;
 #endif
-       if (statfs (utfpath, &stat) == -1)
+       gint statfs_res;
+       MONO_ENTER_GC_SAFE;
+       statfs_res = statfs (utfpath, &stat);
+       MONO_EXIT_GC_SAFE;
+       if (statfs_res == -1)
                return NULL;
 #if PLATFORM_MACOSX
        return g_strdup (stat.f_fstypename);
@@ -4815,8 +5062,8 @@ UnlockFile (gpointer handle, guint32 offset_low, guint32 offset_high, guint32 le
 void
 mono_w32file_init (void)
 {
-       mono_os_mutex_init (&stdhandle_mutex);
-       mono_os_mutex_init (&file_share_mutex);
+       mono_coop_mutex_init (&stdhandle_mutex);
+       mono_coop_mutex_init (&file_share_mutex);
 
        mono_w32handle_register_ops (MONO_W32HANDLE_FILE,    &_wapi_file_ops);
        mono_w32handle_register_ops (MONO_W32HANDLE_CONSOLE, &_wapi_console_ops);
@@ -4835,7 +5082,7 @@ mono_w32file_init (void)
 void
 mono_w32file_cleanup (void)
 {
-       mono_os_mutex_destroy (&file_share_mutex);
+       mono_coop_mutex_destroy (&file_share_mutex);
 
        if (file_share_table)
                g_hash_table_destroy (file_share_table);
@@ -4846,14 +5093,9 @@ mono_w32file_move (gunichar2 *path, gunichar2 *dest, gint32 *error)
 {
        gboolean result;
 
-       MONO_ENTER_GC_SAFE;
-
        result = MoveFile (path, dest);
        if (!result)
                *error = mono_w32error_get_last ();
-
-       MONO_EXIT_GC_SAFE;
-
        return result;
 }
 
@@ -4862,14 +5104,10 @@ mono_w32file_copy (gunichar2 *path, gunichar2 *dest, gboolean overwrite, gint32
 {
        gboolean result;
 
-       MONO_ENTER_GC_SAFE;
-
        result = CopyFile (path, dest, !overwrite);
        if (!result)
                *error = mono_w32error_get_last ();
 
-       MONO_EXIT_GC_SAFE;
-
        return result;
 }
 
@@ -4878,14 +5116,9 @@ mono_w32file_replace (gunichar2 *destinationFileName, gunichar2 *sourceFileName,
 {
        gboolean result;
 
-       MONO_ENTER_GC_SAFE;
-
        result = ReplaceFile (destinationFileName, sourceFileName, destinationBackupFileName, flags, NULL, NULL);
        if (!result)
                *error = mono_w32error_get_last ();
-
-       MONO_EXIT_GC_SAFE;
-
        return result;
 }
 
@@ -4895,15 +5128,11 @@ mono_w32file_get_file_size (gpointer handle, gint32 *error)
        gint64 length;
        guint32 length_hi;
 
-       MONO_ENTER_GC_SAFE;
-
        length = GetFileSize (handle, &length_hi);
        if(length==INVALID_FILE_SIZE) {
                *error=mono_w32error_get_last ();
        }
 
-       MONO_EXIT_GC_SAFE;
-
        return length | ((gint64)length_hi << 32);
 }
 
@@ -4912,14 +5141,9 @@ mono_w32file_lock (gpointer handle, gint64 position, gint64 length, gint32 *erro
 {
        gboolean result;
 
-       MONO_ENTER_GC_SAFE;
-
        result = LockFile (handle, position & 0xFFFFFFFF, position >> 32, length & 0xFFFFFFFF, length >> 32);
        if (!result)
                *error = mono_w32error_get_last ();
-
-       MONO_EXIT_GC_SAFE;
-
        return result;
 }
 
@@ -4928,49 +5152,26 @@ mono_w32file_unlock (gpointer handle, gint64 position, gint64 length, gint32 *er
 {
        gboolean result;
 
-       MONO_ENTER_GC_SAFE;
-
        result = UnlockFile (handle, position & 0xFFFFFFFF, position >> 32, length & 0xFFFFFFFF, length >> 32);
        if (!result)
                *error = mono_w32error_get_last ();
-
-       MONO_EXIT_GC_SAFE;
-
        return result;
 }
 
 gpointer
 mono_w32file_get_console_input (void)
 {
-       gpointer handle;
-
-       MONO_ENTER_GC_SAFE;
-       handle = mono_w32file_get_std_handle (STD_INPUT_HANDLE);
-       MONO_EXIT_GC_SAFE;
-
-       return handle;
+       return mono_w32file_get_std_handle (STD_INPUT_HANDLE);
 }
 
 gpointer
 mono_w32file_get_console_output (void)
 {
-       gpointer handle;
-
-       MONO_ENTER_GC_SAFE;
-       handle = mono_w32file_get_std_handle (STD_OUTPUT_HANDLE);
-       MONO_EXIT_GC_SAFE;
-
-       return handle;
+       return mono_w32file_get_std_handle (STD_OUTPUT_HANDLE);
 }
 
 gpointer
 mono_w32file_get_console_error (void)
 {
-       gpointer handle;
-
-       MONO_ENTER_GC_SAFE;
-       handle = mono_w32file_get_std_handle (STD_ERROR_HANDLE);
-       MONO_EXIT_GC_SAFE;
-
-       return handle;
+       return mono_w32file_get_std_handle (STD_ERROR_HANDLE);
 }
index 15062f029489d68f0f758c2d38028e17e1fe8610..c0ab592f6078316c1dd3736bb75a3d9dc46147b1 100644 (file)
@@ -117,7 +117,7 @@ HANDLE
 mono_w32file_get_console_output (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetStdHandle (STD_OUTPUT_HANDLE)");
 
@@ -133,7 +133,7 @@ HANDLE
 mono_w32file_get_console_input (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetStdHandle (STD_INPUT_HANDLE)");
 
@@ -149,7 +149,7 @@ HANDLE
 mono_w32file_get_console_error (void)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetStdHandle (STD_ERROR_HANDLE)");
 
index 953f7926c76a72175b3fef48d6eee9f0efbb344a..df96ee154476d9e9bef3fcc681eee2c772b22a90 100644 (file)
@@ -53,109 +53,181 @@ void ves_icall_System_IO_MonoIO_DumpHandles (void)
 gpointer
 mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode, guint32 createmode, guint32 attrs)
 {
-       return CreateFile (name, fileaccess, sharemode, NULL, createmode, attrs, NULL);
+       gpointer res;
+       MONO_ENTER_GC_SAFE;
+       res = CreateFile (name, fileaccess, sharemode, NULL, createmode, attrs, NULL);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_close (gpointer handle)
 {
-       return CloseHandle (handle);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = CloseHandle (handle);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_delete (const gunichar2 *name)
 {
-       return DeleteFile (name);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = DeleteFile (name);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_read(gpointer handle, gpointer buffer, guint32 numbytes, guint32 *bytesread)
 {
-       return ReadFile (handle, buffer, numbytes, bytesread, NULL);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = ReadFile (handle, buffer, numbytes, bytesread, NULL);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_write (gpointer handle, gconstpointer buffer, guint32 numbytes, guint32 *byteswritten)
 {
-       return WriteFile (handle, buffer, numbytes, byteswritten, NULL);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = WriteFile (handle, buffer, numbytes, byteswritten, NULL);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_flush (gpointer handle)
 {
-       return FlushFileBuffers (handle);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = FlushFileBuffers (handle);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_truncate (gpointer handle)
 {
-       return SetEndOfFile (handle);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = SetEndOfFile (handle);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 guint32
 mono_w32file_seek (gpointer handle, gint32 movedistance, gint32 *highmovedistance, guint32 method)
 {
-       return SetFilePointer (handle, movedistance, highmovedistance, method);
+       guint32 res;
+       MONO_ENTER_GC_SAFE;
+       res = SetFilePointer (handle, movedistance, highmovedistance, method);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gint
 mono_w32file_get_type (gpointer handle)
 {
-       return GetFileType (handle);
+       gint res;
+       MONO_ENTER_GC_SAFE;
+       res = GetFileType (handle);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_get_times (gpointer handle, FILETIME *create_time, FILETIME *access_time, FILETIME *write_time)
 {
-       return GetFileTime (handle, create_time, access_time, write_time);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = GetFileTime (handle, create_time, access_time, write_time);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_set_times (gpointer handle, const FILETIME *create_time, const FILETIME *access_time, const FILETIME *write_time)
 {
-       return SetFileTime (handle, create_time, access_time, write_time);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = SetFileTime (handle, create_time, access_time, write_time);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_filetime_to_systemtime (const FILETIME *file_time, SYSTEMTIME *system_time)
 {
-       return FileTimeToSystemTime (file_time, system_time);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = FileTimeToSystemTime (file_time, system_time);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gpointer
 mono_w32file_find_first (const gunichar2 *pattern, WIN32_FIND_DATA *find_data)
 {
-       return FindFirstFile (pattern, find_data);
+       gpointer res;
+       MONO_ENTER_GC_SAFE;
+       res = FindFirstFile (pattern, find_data);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_find_next (gpointer handle, WIN32_FIND_DATA *find_data)
 {
-       return FindNextFile (handle, find_data);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = FindNextFile (handle, find_data);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_find_close (gpointer handle)
 {
-       return FindClose (handle);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = FindClose (handle);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_create_directory (const gunichar2 *name)
 {
-       return CreateDirectory (name, NULL);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = CreateDirectory (name, NULL);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_remove_directory (const gunichar2 *name)
 {
-       return RemoveDirectory (name);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = RemoveDirectory (name);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 guint32
 mono_w32file_get_attributes (const gunichar2 *name)
 {
-       return GetFileAttributes (name);
+       guint32 res;
+       MONO_ENTER_GC_SAFE;
+       res = GetFileAttributes (name);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
@@ -164,7 +236,9 @@ mono_w32file_get_attributes_ex (const gunichar2 *name, MonoIOStat *stat)
        gboolean result;
        WIN32_FILE_ATTRIBUTE_DATA data;
 
+       MONO_ENTER_GC_SAFE;
        result = GetFileAttributesEx (name, GetFileExInfoStandard, &data);
+       MONO_EXIT_GC_SAFE;
        if (result) {
                stat->attributes = data.dwFileAttributes;
                stat->creation_time = (gint64) ((((guint64) data.ftCreationTime.dwHighDateTime) << 32) + data.ftCreationTime.dwLowDateTime);
@@ -179,29 +253,45 @@ mono_w32file_get_attributes_ex (const gunichar2 *name, MonoIOStat *stat)
 gboolean
 mono_w32file_set_attributes (const gunichar2 *name, guint32 attrs)
 {
-       return SetFileAttributes (name, attrs);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = SetFileAttributes (name, attrs);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 guint32
 mono_w32file_get_cwd (guint32 length, gunichar2 *buffer)
 {
-       return GetCurrentDirectory (length, buffer);
+       guint32 res;
+       MONO_ENTER_GC_SAFE;
+       res = GetCurrentDirectory (length, buffer);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_set_cwd (const gunichar2 *path)
 {
-       return SetCurrentDirectory (path);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = SetCurrentDirectory (path);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
 mono_w32file_create_pipe (gpointer *readpipe, gpointer *writepipe, guint32 size)
 {
+       gboolean res;
        SECURITY_ATTRIBUTES attr;
        attr.nLength = sizeof(SECURITY_ATTRIBUTES);
        attr.bInheritHandle = TRUE;
        attr.lpSecurityDescriptor = NULL;
-       return CreatePipe (readpipe, writepipe, &attr, size);
+       MONO_ENTER_GC_SAFE;
+       res = CreatePipe (readpipe, writepipe, &attr, size);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gboolean
@@ -212,7 +302,9 @@ mono_w32file_get_disk_free_space (const gunichar2 *path_name, guint64 *free_byte
        ULARGE_INTEGER *wapi_total_number_of_bytes;
        ULARGE_INTEGER *wapi_total_number_of_free_bytes;
 
+       MONO_ENTER_GC_SAFE;
        result = GetDiskFreeSpaceEx (path_name, wapi_free_bytes_avail, wapi_total_number_of_bytes, wapi_total_number_of_free_bytes);
+       MONO_EXIT_GC_SAFE;
        if (result) {
                if (free_bytes_avail)
                        *free_bytes_avail = wapi_free_bytes_avail->QuadPart;
@@ -228,7 +320,11 @@ mono_w32file_get_disk_free_space (const gunichar2 *path_name, guint64 *free_byte
 gboolean
 mono_w32file_get_volume_information (const gunichar2 *path, gunichar2 *volumename, gint volumesize, gint *outserial, gint *maxcomp, gint *fsflags, gunichar2 *fsbuffer, gint fsbuffersize)
 {
-       return GetVolumeInformation (path, volumename, volumesize, outserial, maxcomp, fsflags, fsbuffer, fsbuffersize);
+       gboolean res;
+       MONO_ENTER_GC_SAFE;
+       res = GetVolumeInformation (path, volumename, volumesize, outserial, maxcomp, fsflags, fsbuffer, fsbuffersize);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
@@ -316,19 +412,31 @@ mono_w32file_unlock (gpointer handle, gint64 position, gint64 length, gint32 *er
 HANDLE
 mono_w32file_get_console_input (void)
 {
-       return GetStdHandle (STD_INPUT_HANDLE);
+       HANDLE res;
+       MONO_ENTER_GC_SAFE;
+       res = GetStdHandle (STD_INPUT_HANDLE);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 HANDLE
 mono_w32file_get_console_output (void)
 {
-       return GetStdHandle (STD_OUTPUT_HANDLE);
+       HANDLE res;
+       MONO_ENTER_GC_SAFE;
+       res = GetStdHandle (STD_OUTPUT_HANDLE);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 HANDLE
 mono_w32file_get_console_error (void)
 {
-       return GetStdHandle (STD_ERROR_HANDLE);
+       HANDLE res;
+       MONO_ENTER_GC_SAFE;
+       res = GetStdHandle (STD_ERROR_HANDLE);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gint64
@@ -352,13 +460,21 @@ mono_w32file_get_file_size (gpointer handle, gint32 *error)
 guint32
 mono_w32file_get_drive_type (const gunichar2 *root_path_name)
 {
-       return GetDriveType (root_path_name);
+       guint32 res;
+       MONO_ENTER_GC_SAFE;
+       res = GetDriveType (root_path_name);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 gint32
 mono_w32file_get_logical_drive (guint32 len, gunichar2 *buf)
 {
-       return GetLogicalDriveStrings (len, buf);
+       gint32 res;
+       MONO_ENTER_GC_SAFE;
+       res = GetLogicalDriveStrings (len, buf);
+       MONO_EXIT_GC_SAFE;
+       return res;
 }
 
 #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
index d24506afd4ee1a71b1a8096c1f6f790e466d9412..5086bc442ef339c8a0fd77e530d81fe173e86199 100644 (file)
@@ -258,7 +258,6 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
        
        *error=ERROR_SUCCESS;
        
@@ -267,7 +266,6 @@ ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error)
                *error=mono_w32error_get_last ();
        }
 
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -275,7 +273,6 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
        
        *error=ERROR_SUCCESS;
        
@@ -284,7 +281,6 @@ ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error)
                *error=mono_w32error_get_last ();
        }
 
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -392,9 +388,7 @@ ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
        
        *ioerror = ERROR_SUCCESS;
 
-       MONO_ENTER_GC_SAFE;
        names = get_filesystem_entries (mono_string_chars (path), mono_string_chars (path_with_pattern), attrs, mask, ioerror);
-       MONO_EXIT_GC_SAFE;
 
        if (!names) {
                // If there's no array and no error, then return an empty array.
@@ -533,9 +527,7 @@ ves_icall_System_IO_MonoIO_FindFirst (MonoString *path,
        ifh->find_handle = find_handle;
        ifh->utf8_path = mono_string_to_utf8_checked (path, &error);
        if (mono_error_set_pending_exception (&error)) {
-               MONO_ENTER_GC_SAFE;
                mono_w32file_find_close (find_handle);
-               MONO_EXIT_GC_SAFE;
                g_free (ifh);
                return NULL;
        }
@@ -583,14 +575,12 @@ ves_icall_System_IO_MonoIO_FindClose (gpointer handle)
        IncrementalFind *ifh = (IncrementalFind *)handle;
        gint32 error;
 
-       MONO_ENTER_GC_SAFE;
        if (mono_w32file_find_close (ifh->find_handle) == FALSE){
                error = mono_w32error_get_last ();
        } else
                error = ERROR_SUCCESS;
        g_free (ifh->utf8_path);
        g_free (ifh);
-       MONO_EXIT_GC_SAFE;
 
        return error;
 }
@@ -606,7 +596,7 @@ ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *io_error)
        len = MAX_PATH + 1; /*FIXME this is too smal under most unix systems.*/
        buf = g_new (gunichar2, len);
        
-       mono_error_init (&error);
+       error_init (&error);
        *io_error=ERROR_SUCCESS;
        result = NULL;
 
@@ -692,7 +682,6 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
        
        *error=ERROR_SUCCESS;
        
@@ -701,7 +690,6 @@ ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error)
                *error=mono_w32error_get_last ();
        }
        
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -709,8 +697,6 @@ gint32
 ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error)
 {
        gint32 ret;
-       MONO_ENTER_GC_SAFE;
-
        *error=ERROR_SUCCESS;
        
        ret=get_file_attributes (mono_string_chars (path));
@@ -725,8 +711,6 @@ ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error)
          /* if(ret==INVALID_FILE_ATTRIBUTES) { */
                *error=mono_w32error_get_last ();
        }
-       
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -735,8 +719,6 @@ ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
                                              gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
-       
        *error=ERROR_SUCCESS;
        
        ret=mono_w32file_set_attributes (mono_string_chars (path),
@@ -744,8 +726,6 @@ ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
        if(ret==FALSE) {
                *error=mono_w32error_get_last ();
        }
-
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -753,7 +733,6 @@ gint32
 ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
 
        *error=ERROR_SUCCESS;
        
@@ -765,7 +744,6 @@ ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error)
                *error=mono_w32error_get_last ();
        }
        
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -773,7 +751,6 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat, gint32 *error)
 {
        gboolean result;
-       MONO_ENTER_GC_SAFE;
 
        *error=ERROR_SUCCESS;
        
@@ -784,7 +761,6 @@ ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat, gint
                memset (stat, 0, sizeof (MonoIOStat));
        }
 
-       MONO_EXIT_GC_SAFE;
        return result;
 }
 
@@ -796,7 +772,6 @@ ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
        HANDLE ret;
        int attributes, attrs;
        gunichar2 *chars;
-       MONO_ENTER_GC_SAFE;
 
        chars = mono_string_chars (filename);   
        *error=ERROR_SUCCESS;
@@ -835,7 +810,6 @@ ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
                *error=mono_w32error_get_last ();
        } 
        
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -843,16 +817,12 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
-
        *error=ERROR_SUCCESS;
        
        ret=mono_w32file_close (handle);
        if(ret==FALSE) {
                *error=mono_w32error_get_last ();
        }
-       
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -876,9 +846,7 @@ ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
 
        buffer = mono_array_addr (dest, guchar, dest_offset);
 
-       MONO_ENTER_GC_SAFE;
        result = mono_w32file_read (handle, buffer, count, &n);
-       MONO_EXIT_GC_SAFE;
 
        if (!result) {
                *error=mono_w32error_get_last ();
@@ -907,9 +875,7 @@ ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
        }
        
        buffer = mono_array_addr (src, guchar, src_offset);
-       MONO_ENTER_GC_SAFE;
        result = mono_w32file_write (handle, buffer, count, &n);
-       MONO_EXIT_GC_SAFE;
 
        if (!result) {
                *error=mono_w32error_get_last ();
@@ -924,7 +890,6 @@ ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
                                 gint32 *error)
 {
        gint32 offset_hi;
-       MONO_ENTER_GC_SAFE;
 
        *error=ERROR_SUCCESS;
        
@@ -936,7 +901,6 @@ ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
                *error=mono_w32error_get_last ();
        }
 
-       MONO_EXIT_GC_SAFE;
        return offset | ((gint64)offset_hi << 32);
 }
 
@@ -944,7 +908,6 @@ MonoBoolean
 ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error)
 {
        gboolean ret;
-       MONO_ENTER_GC_SAFE;
 
        *error=ERROR_SUCCESS;
        
@@ -953,7 +916,6 @@ ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error)
                *error=mono_w32error_get_last ();
        }
        
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -1022,7 +984,6 @@ ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
        const FILETIME *creation_filetime;
        const FILETIME *access_filetime;
        const FILETIME *write_filetime;
-       MONO_ENTER_GC_SAFE;
 
        *error=ERROR_SUCCESS;
        
@@ -1046,7 +1007,6 @@ ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
                *error=mono_w32error_get_last ();
        }
 
-       MONO_EXIT_GC_SAFE;
        return(ret);
 }
 
@@ -1073,9 +1033,7 @@ ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle, HANDLE *write_handle
 {
        gboolean ret;
 
-       MONO_ENTER_GC_SAFE;
        ret=mono_w32file_create_pipe (read_handle, write_handle, 0);
-       MONO_EXIT_GC_SAFE;
 
        if(ret==FALSE) {
                *error = mono_w32error_get_last ();
@@ -1093,15 +1051,15 @@ ves_icall_System_IO_MonoIO_DuplicateHandle (HANDLE source_process_handle, HANDLE
        /* This is only used on Windows */
        gboolean ret;
        
-       MONO_ENTER_GC_SAFE;
 #ifdef HOST_WIN32
+       MONO_ENTER_GC_SAFE;
        ret=DuplicateHandle (source_process_handle, source_handle, target_process_handle, target_handle, access, inherit, options);
+       MONO_EXIT_GC_SAFE;
 #else
        mono_w32handle_ref (source_handle);
        *target_handle = source_handle;
        ret = TRUE;
 #endif
-       MONO_EXIT_GC_SAFE;
 
        if(ret==FALSE) {
                *error = mono_w32error_get_last ();
@@ -1209,15 +1167,17 @@ mono_filesize_from_path (MonoString *string)
        char *path = mono_string_to_utf8_checked (string, &error);
        mono_error_raise_exception (&error); /* OK to throw, external only without a good alternative */
 
+       gint stat_res;
        MONO_ENTER_GC_SAFE;
-       if (stat (path, &buf) == -1)
+       stat_res = stat (path, &buf);
+       MONO_EXIT_GC_SAFE;
+       if (stat_res == -1)
                res = -1;
        else
                res = (gint64)buf.st_size;
 
        g_free (path);
 
-       MONO_EXIT_GC_SAFE;
        return res;
 }
 
index 4b463886f7b067b6e9df464932cdb0e6ff41d766..45d45a87452ed209cf6d46e6d6021657031e55b7 100644 (file)
@@ -98,18 +98,6 @@ static char *mono_environ[1] = { NULL };
 extern char **environ;
 #endif
 
-/*
- * Handles > _WAPI_PROCESS_UNHANDLED are pseudo handles which represent processes
- * not started by the runtime.
- */
-/* This marks a system process that we don't have a handle on */
-/* FIXME: Cope with PIDs > sizeof guint */
-#define _WAPI_PROCESS_UNHANDLED (1 << (8*sizeof(pid_t)-1))
-
-#define WAPI_IS_PSEUDO_PROCESS_HANDLE(handle) ((GPOINTER_TO_UINT(handle) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED)
-#define WAPI_PID_TO_HANDLE(pid) GINT_TO_POINTER (_WAPI_PROCESS_UNHANDLED + (pid))
-#define WAPI_HANDLE_TO_PID(handle) (GPOINTER_TO_UINT ((handle)) - _WAPI_PROCESS_UNHANDLED)
-
 typedef enum {
        STARTF_USESHOWWINDOW=0x001,
        STARTF_USESIZE=0x002,
@@ -162,6 +150,7 @@ typedef struct _Process {
 /* MonoW32HandleProcess is a structure containing all the required information for process handling. */
 typedef struct {
        pid_t pid;
+       gboolean child;
        guint32 exitstatus;
        gpointer main_thread;
        guint64 create_time;
@@ -563,6 +552,33 @@ static const gunichar2 *utf16_space = utf16_space_bytes;
 static const gunichar2 utf16_quote_bytes [2] = { 0x22, 0 };
 static const gunichar2 *utf16_quote = utf16_quote_bytes;
 
+/* Check if a pid is valid - i.e. if a process exists with this pid. */
+static gboolean
+process_is_alive (pid_t pid)
+{
+#if defined(HOST_WATCHOS)
+       return TRUE; // TODO: Rewrite using sysctl
+#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
+       if (pid == 0)
+               return FALSE;
+       if (kill (pid, 0) == 0)
+               return TRUE;
+       if (errno == EPERM)
+               return TRUE;
+       return FALSE;
+#elif defined(__HAIKU__)
+       team_info teamInfo;
+       if (get_team_info ((team_id)pid, &teamInfo) == B_OK)
+               return TRUE;
+       return FALSE;
+#else
+       gchar *dir = g_strdup_printf ("/proc/%d", pid);
+       gboolean result = access (dir, F_OK) == 0;
+       g_free (dir);
+       return result;
+#endif
+}
+
 static void
 process_details (gpointer data)
 {
@@ -593,10 +609,6 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
        Process *process;
        gboolean res;
 
-       /* FIXME: We can now easily wait on processes that aren't our own children,
-        * but WaitFor*Object won't call us for pseudo handles. */
-       g_assert (!WAPI_IS_PSEUDO_PROCESS_HANDLE (handle));
-
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u)", __func__, handle, timeout);
 
        if (alerted)
@@ -616,33 +628,23 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
 
        pid = process_handle->pid;
 
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): PID: %d", __func__, handle, timeout, pid);
-
-       /* We don't need to lock processes here, the entry
-        * has a handle_count > 0 which means it will not be freed. */
-       process = process_handle->process;
-       if (!process) {
-               pid_t res;
-
-               if (pid == mono_process_current_pid ()) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on current process", __func__, handle, timeout);
-                       return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-               }
+       if (pid == mono_process_current_pid ()) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on current process", __func__, handle, timeout);
+               return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+       }
 
-               /* This path is used when calling Process.HasExited, so
-                * it is only used to poll the state of the process, not
-                * to actually wait on it to exit */
-               g_assert (timeout == 0);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): PID: %d", __func__, handle, timeout, pid);
 
+       if (!process_handle->child) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on non-child process", __func__, handle, timeout);
 
-               res = waitpid (pid, &status, WNOHANG);
-               if (res == 0) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process wait timeout", __func__, handle, timeout);
-                       return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-               }
-               if (res > 0) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process waited successfully", __func__, handle, timeout);
+               if (!process_is_alive (pid)) {
+                       /* assume the process has exited */
+                       process_handle->exited = TRUE;
+                       process_handle->exitstatus = -1;
+                       mono_w32handle_set_signal_state (handle, TRUE, TRUE);
+
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process is not alive anymore (2)", __func__, handle, timeout);
                        return MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
                }
 
@@ -650,6 +652,11 @@ process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
                return MONO_W32HANDLE_WAIT_RET_FAILED;
        }
 
+       /* We don't need to lock processes here, the entry
+        * has a handle_count > 0 which means it will not be freed. */
+       process = process_handle->process;
+       g_assert (process);
+
        start = mono_msec_ticks ();
        now = start;
 
@@ -865,31 +872,6 @@ mono_w32process_cleanup (void)
        g_free (cli_launcher);
 }
 
-/* Check if a pid is valid - i.e. if a process exists with this pid. */
-static gboolean
-is_pid_valid (pid_t pid)
-{
-       gboolean result = FALSE;
-
-#if defined(HOST_WATCHOS)
-       result = TRUE; // TODO: Rewrite using sysctl
-#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
-       if (((kill(pid, 0) == 0) || (errno == EPERM)) && pid != 0)
-               result = TRUE;
-#elif defined(__HAIKU__)
-       team_info teamInfo;
-       if (get_team_info ((team_id)pid, &teamInfo) == B_OK)
-               result = TRUE;
-#else
-       char *dir = g_strdup_printf ("/proc/%d", pid);
-       if (!access (dir, F_OK))
-               result = TRUE;
-       g_free (dir);
-#endif
-
-       return result;
-}
-
 static int
 len16 (const gunichar2 *str)
 {
@@ -940,11 +922,6 @@ mono_w32process_get_pid (gpointer handle)
        MonoW32HandleProcess *process_handle;
        gboolean res;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle)) {
-               /* This is a pseudo handle */
-               return WAPI_HANDLE_TO_PID (handle);
-       }
-
        res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
        if (!res) {
                mono_w32error_set_last (ERROR_INVALID_HANDLE);
@@ -971,8 +948,6 @@ get_process_foreach_callback (gpointer handle, gpointer handle_specific, gpointe
        if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_PROCESS)
                return FALSE;
 
-       g_assert (!WAPI_IS_PSEUDO_PROCESS_HANDLE (handle));
-
        process_handle = (MonoW32HandleProcess*) handle_specific;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: looking at process %d", __func__, process_handle->pid);
@@ -1011,9 +986,23 @@ ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
                return handle;
        }
 
-       if (is_pid_valid (pid)) {
-               /* Return a pseudo handle for processes we don't have handles for */
-               return WAPI_PID_TO_HANDLE (pid);
+       if (process_is_alive (pid)) {
+               /* non-child process */
+               MonoW32HandleProcess process_handle;
+
+               memset (&process_handle, 0, sizeof (process_handle));
+               process_handle.pid = pid;
+               process_handle.pname = mono_w32process_get_name (pid);
+
+               handle = mono_w32handle_new (MONO_W32HANDLE_PROCESS, &process_handle);
+               if (handle == INVALID_HANDLE_VALUE) {
+                       g_warning ("%s: error creating process handle", __func__);
+
+                       mono_w32error_set_last (ERROR_OUTOFMEMORY);
+                       return NULL;
+               }
+
+               return handle;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find pid %d", __func__, pid);
@@ -1091,20 +1080,15 @@ mono_w32process_try_get_modules (gpointer process, gpointer *modules, guint32 si
        if (size < sizeof(gpointer))
                return FALSE;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               pid = WAPI_HANDLE_TO_PID (process);
-               pname = mono_w32process_get_name (pid);
-       } else {
-               res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-               if (!res) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-                       return FALSE;
-               }
-
-               pid = process_handle->pid;
-               pname = g_strdup (process_handle->pname);
+       res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
+               return FALSE;
        }
 
+       pid = process_handle->pid;
+       pname = g_strdup (process_handle->pname);
+
        if (!pname) {
                modules[0] = NULL;
                *needed = sizeof(gpointer);
@@ -1220,21 +1204,15 @@ mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *b
        if (basename == NULL || size == 0)
                return 0;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-               pname = mono_w32process_get_name (pid);
-       } else {
-               res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-               if (!res) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-                       return 0;
-               }
-
-               pid = process_handle->pid;
-               pname = g_strdup (process_handle->pname);
+       res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
+               return 0;
        }
 
+       pid = process_handle->pid;
+       pname = g_strdup (process_handle->pname);
+
        mods = mono_w32process_get_modules (pid);
        if (!mods) {
                g_free (pname);
@@ -1320,20 +1298,15 @@ mono_w32process_module_get_information (gpointer process, gpointer module, MODUL
        if (modinfo == NULL || size < sizeof (MODULEINFO))
                return FALSE;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-               pname = mono_w32process_get_name (pid);
-       } else {
-               res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-               if (!res) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-                       return FALSE;
-               }
-
-               pid = process_handle->pid;
-               pname = g_strdup (process_handle->pname);
+       res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
+               return FALSE;
        }
 
+       pid = process_handle->pid;
+       pname = g_strdup (process_handle->pname);
+
        mods = mono_w32process_get_modules (pid);
        if (!mods) {
                g_free (pname);
@@ -2013,6 +1986,7 @@ process_create (const gunichar2 *appname, const gunichar2 *cmdline,
 
                memset (&process_handle, 0, sizeof (process_handle));
                process_handle.pid = pid;
+               process_handle.child = TRUE;
                process_handle.pname = g_strdup (prog);
                process_set_defaults (&process_handle);
 
@@ -2347,25 +2321,11 @@ MonoBoolean
 ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode)
 {
        MonoW32HandleProcess *process_handle;
-       guint32 pid;
        gboolean res;
 
        if (!exitcode)
                return FALSE;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle)) {
-               pid = WAPI_HANDLE_TO_PID (handle);
-               /* This is a pseudo handle, so we don't know what the exit
-                * code was, but we can check whether it's alive or not */
-               if (is_pid_valid (pid)) {
-                       *exitcode = STILL_ACTIVE;
-                       return TRUE;
-               } else {
-                       *exitcode = -1;
-                       return TRUE;
-               }
-       }
-
        res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
        if (!res) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
@@ -2390,8 +2350,6 @@ ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gin
 MonoBoolean
 ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle)
 {
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle))
-               return TRUE;
        return mono_w32handle_close (handle);
 }
 
@@ -2402,23 +2360,17 @@ ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint3
        MonoW32HandleProcess *process_handle;
        int ret;
        pid_t pid;
+       gboolean res;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (handle);
-       } else {
-               gboolean res;
-
-               res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-               if (!res) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
-                       mono_w32error_set_last (ERROR_INVALID_HANDLE);
-                       return FALSE;
-               }
-
-               pid = process_handle->pid;
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
        }
 
+       pid = process_handle->pid;
+
        ret = kill (pid, exitcode == -1 ? SIGKILL : SIGTERM);
        if (ret == 0)
                return TRUE;
@@ -2445,15 +2397,15 @@ ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handl
        if (!min || !max)
                return FALSE;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle))
-               return FALSE;
-
        res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
        if (!res) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
                return FALSE;
        }
 
+       if (!process_handle->child)
+               return FALSE;
+
        *min = process_handle->min_working_set;
        *max = process_handle->max_working_set;
        return TRUE;
@@ -2465,15 +2417,15 @@ ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handl
        MonoW32HandleProcess *process_handle;
        gboolean res;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle))
-               return FALSE;
-
        res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
        if (!res) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
                return FALSE;
        }
 
+       if (!process_handle->child)
+               return FALSE;
+
        process_handle->min_working_set = min;
        process_handle->max_working_set = max;
        return TRUE;
@@ -2486,22 +2438,16 @@ ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle)
        MonoW32HandleProcess *process_handle;
        gint ret;
        pid_t pid;
+       gboolean res;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (handle);
-       } else {
-               gboolean res;
-
-               res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-               if (!res) {
-                       mono_w32error_set_last (ERROR_INVALID_HANDLE);
-                       return 0;
-               }
-
-               pid = process_handle->pid;
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return 0;
        }
 
+       pid = process_handle->pid;
+
        errno = 0;
        ret = getpriority (PRIO_PROCESS, pid);
        if (ret == -1 && errno != 0) {
@@ -2547,22 +2493,16 @@ ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint3
        int ret;
        int prio;
        pid_t pid;
+       gboolean res;
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (handle);
-       } else {
-               gboolean res;
-
-               res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-               if (!res) {
-                       mono_w32error_set_last (ERROR_INVALID_HANDLE);
-                       return FALSE;
-               }
-
-               pid = process_handle->pid;
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_w32error_set_last (ERROR_INVALID_HANDLE);
+               return FALSE;
        }
 
+       pid = process_handle->pid;
+
        switch (priorityClass) {
        case MONO_W32PROCESS_PRIORITY_CLASS_IDLE:
                prio = 19;
@@ -2638,10 +2578,16 @@ ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64
        memset (kernel_processtime, 0, sizeof (ProcessTime));
        memset (user_processtime, 0, sizeof (ProcessTime));
 
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle)) {
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               return FALSE;
+       }
+
+       if (!process_handle->child) {
                gint64 start_ticks, user_ticks, kernel_ticks;
 
-               mono_process_get_times (GINT_TO_POINTER (WAPI_HANDLE_TO_PID (handle)),
+               mono_process_get_times (GINT_TO_POINTER (process_handle->pid),
                        &start_ticks, &user_ticks, &kernel_ticks);
 
                ticks_to_processtime (start_ticks, creation_processtime);
@@ -2650,12 +2596,6 @@ ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64
                return TRUE;
        }
 
-       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
-       if (!res) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
-               return FALSE;
-       }
-
        ticks_to_processtime (process_handle->create_time, creation_processtime);
 
        /* A process handle is only signalled if the process has
index cd1b81f373689222deeec7f7114a36e9c79e6588..8c6b93d819ebe810d996cfee61ea3c3fdedea095 100644 (file)
@@ -29,7 +29,7 @@ HANDLE
 ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("OpenProcess");
 
@@ -46,7 +46,7 @@ mono_w32process_get_fileversion (MonoObject *filever, gunichar2 *filename, MonoE
 {
        g_unsupported_api ("GetFileVersionInfoSize, GetFileVersionInfo, VerQueryValue, VerLanguageName");
 
-       mono_error_init (error);
+       error_init (error);
        mono_error_set_not_supported (error, G_UNSUPPORTED_API, "GetFileVersionInfoSize, GetFileVersionInfo, VerQueryValue, VerLanguageName");
 
        SetLastError (ERROR_NOT_SUPPORTED);
@@ -57,7 +57,7 @@ process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2
 {
        g_unsupported_api ("GetModuleInformation");
 
-       mono_error_init (error);
+       error_init (error);
        mono_error_set_not_supported (error, G_UNSUPPORTED_API, "GetModuleInformation");
 
        SetLastError (ERROR_NOT_SUPPORTED);
@@ -69,7 +69,7 @@ MonoArray *
 ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, HANDLE process)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("EnumProcessModules, GetModuleBaseName, GetModuleFileNameEx");
 
@@ -85,7 +85,7 @@ MonoBoolean
 ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStartInfo *proc_start_info, MonoW32ProcessInfo *process_info)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("ShellExecuteEx");
 
@@ -144,7 +144,7 @@ mono_process_create_process (MonoW32ProcessInfo *mono_process_info, MonoString *
        memset (&process_info, 0, sizeof (PROCESS_INFORMATION));
        g_unsupported_api (api_name);
 
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
        mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, api_name);
        mono_error_set_pending_exception (&mono_error);
 
@@ -157,7 +157,7 @@ MonoBoolean
 mono_icall_get_process_working_set_size (gpointer handle, gsize *min, gsize *max)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetProcessWorkingSetSize");
 
@@ -173,7 +173,7 @@ MonoBoolean
 mono_icall_set_process_working_set_size (gpointer handle, gsize min, gsize max)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("SetProcessWorkingSetSize");
 
@@ -189,7 +189,7 @@ gint32
 mono_icall_get_priority_class (gpointer handle)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("GetPriorityClass");
 
@@ -205,7 +205,7 @@ MonoBoolean
 mono_icall_set_priority_class (gpointer handle, gint32 priorityClass)
 {
        MonoError mono_error;
-       mono_error_init (&mono_error);
+       error_init (&mono_error);
 
        g_unsupported_api ("SetPriorityClass");
 
index affa016604dae8b8162ae0b86452a1e3ed513c83..960ad07697374077b14c8fcc75348e80c056b1fc 100644 (file)
@@ -143,7 +143,7 @@ process_set_field_string (MonoObject *obj, const gchar *fieldname, const gunicha
        MonoClassField *field;
        MonoString *string;
 
-       mono_error_init (error);
+       error_init (error);
 
        LOGDEBUG (g_message ("%s: Setting field %s to [%s]", __func__, fieldname, g_utf16_to_utf8 (val, len, NULL, NULL, NULL)));
 
@@ -281,7 +281,7 @@ process_module_string_read (MonoObject *filever, gpointer data, const gchar *fie
        gunichar2 *lang_key, *buffer;
        UINT chars;
 
-       mono_error_init (error);
+       error_init (error);
 
        lang_key_utf8 = g_strdup_printf (key, lang_lo, lang_hi, 0x04, 0xb0);
 
@@ -325,7 +325,7 @@ mono_w32process_get_fileversion (MonoObject *filever, gunichar2 *filename, MonoE
        gunichar2 lang_buf[128];
        guint32 lang, lang_count;
 
-       mono_error_init (error);
+       error_init (error);
 
        datalen = mono_w32process_get_fileversion_info_size (filename, &verinfohandle);
        if (datalen) {
@@ -464,7 +464,7 @@ process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2
        MODULEINFO modinfo;
        BOOL ok;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* Build a System.Diagnostics.ProcessModule with the data. */
        item = mono_object_new_checked (domain, proc_class, error);
@@ -513,7 +513,7 @@ process_get_module (MonoAssembly *assembly, MonoClass *proc_class, MonoError *er
        gchar *filename;
        const gchar *modulename;
 
-       mono_error_init (error);
+       error_init (error);
 
        domain = mono_domain_get ();
 
index b4e3069d6400ea315c6073912a9b6e426e92d175..c10b210036825595d708b2b77a814abe1b855c84 100644 (file)
@@ -1318,6 +1318,9 @@ mono_w32socket_convert_error (gint error)
        case ENETDOWN: return WSAENETDOWN;
 #endif
        case ENODEV: return WSAENETDOWN;
+#ifdef EPROTOTYPE
+       case EPROTOTYPE: return WSAEPROTOTYPE;
+#endif
        default:
                g_error ("%s: no translation into winsock error for (%d) \"%s\"", __func__, error, g_strerror (error));
        }
index e39863e0dd11278239be184d80e208f6c9acb23e..5312790ad644b21b43d518ab238c73ab15ea2458 100644 (file)
@@ -825,7 +825,7 @@ create_object_from_sockaddr (struct sockaddr *saddr, int sa_size, gint32 *werror
        MonoArray *data;
        MonoAddressFamily family;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* Build a System.Net.SocketAddress object instance */
        if (!domain->sockaddr_class)
@@ -1058,7 +1058,7 @@ create_sockaddr_from_object (MonoObject *saddr_obj, socklen_t *sa_size, gint32 *
        gint32 family;
        int len;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!domain->sockaddr_class)
                domain->sockaddr_class = mono_class_load_from_name (get_socket_assembly (), "System.Net", "SocketAddress");
@@ -2406,7 +2406,7 @@ addrinfo_to_IPHostEntry (MonoAddressInfo *info, MonoString **h_name, MonoArray *
        int addr_index;
        MonoDomain *domain = mono_domain_get ();
 
-       mono_error_init (error);
+       error_init (error);
        addr_index = 0;
        *h_aliases = mono_array_new_checked (domain, mono_get_string_class (), 0, error);
        return_val_if_nok (error, FALSE);
@@ -2682,12 +2682,8 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoString *f
                return FALSE;
        }
 
-       MONO_ENTER_GC_SAFE;
-
        mono_w32file_close (file);
 
-       MONO_EXIT_GC_SAFE;
-
        if (*werror)
                return FALSE;
 
index 6052538a5934337bca8ec30fe0f1b5c4a6346cbd..59888bbc64dc722b2d29ab611d8a06f6ee1a6d7b 100755 (executable)
@@ -391,6 +391,7 @@ if ENABLE_INTERPRETER
 interpreter_sources =  \
        interpreter/hacks.h             \
        interpreter/interp.h    \
+       interpreter/interp-internals.h  \
        interpreter/interp.c    \
        interpreter/mintops.h   \
        interpreter/mintops.def \
@@ -497,25 +498,45 @@ test_sources =                    \
        gc-test.cs \
        gshared.cs
 
+if NACL_CODEGEN
+test_sources += nacl.cs
+endif
 
-regtests_UNIVERSAL=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe basic-vectors.exe
-iregtests=basic.exe basic-float.exe basic-long.exe basic-calls.exe generics-interp.exe
-
-if FULL_AOT_TESTS
-regtests= \
-       $(regtests_UNIVERSAL)
+regtests_UNIVERSAL = \
+       basic.exe \
+       basic-float.exe \
+       basic-long.exe \
+       basic-calls.exe \
+       objects.exe \
+       arrays.exe \
+       basic-math.exe \
+       exceptions.exe \
+       iltests.exe \
+       devirtualization.exe \
+       generics.exe \
+       basic-simd.exe \
+       basic-vectors.exe
 
 if NACL_CODEGEN
-test_sources += nacl.cs
-regtests += nacl.exe
+regtests_UNIVERSAL += nacl.exe
 endif
 
-else
-regtests= \
-       $(regtests_UNIVERSAL) \
-       $(regtests_FULL_AOT_TESTS_BLACKLIST)
+regtests_DISABLED = 
+
+if FULL_AOT_TESTS
+regtests_DISABLED += 
 endif
 
+regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL))
+
+iregtests = \
+       basic.exe \
+       basic-float.exe \
+       basic-long.exe \
+       basic-calls.exe \
+       generics.exe \
+       objects.exe
+
 if X86
 arch_sources = $(x86_sources)
 arch_built=cpu-x86.h
@@ -758,13 +779,6 @@ gsharedvtcheck:
 
 fullaot_regtests = $(regtests) aot-tests.exe $(if $(GSHAREDVT),gshared.exe)
 
-# Skip aoting the tests that aren't compiled 
-# on the full aot profiles because they're skipped
-# on mobile profiles
-FULLAOT_LIBS_FULL_AOT_TESTS_BLACKLIST = \
-       Mono.Posix.dll \
-       System.Configuration.dll
-
 FULLAOT_LIBS_UNIVERSAL = \
        mscorlib.dll \
        System.Core.dll \
@@ -774,17 +788,23 @@ FULLAOT_LIBS_UNIVERSAL = \
        Mono.Simd.dll \
        Mono.Security.dll \
        System.Numerics.dll \
-       System.Numerics.Vectors.dll
+       System.Numerics.Vectors.dll \
+       Mono.Posix.dll \
+       System.Configuration.dll
+
+FULLAOT_LIBS_DISABLED =
 
 if FULL_AOT_TESTS
-FULLAOT_LIBS= \
-       $(FULLAOT_LIBS_UNIVERSAL)
-else
-FULLAOT_LIBS= \
-       $(FULLAOT_LIBS_UNIVERSAL) \
-       $(FULLAOT_LIBS_FULL_AOT_TESTS_BLACKLIST)
+# Skip aoting the tests that aren't compiled 
+# on the full aot profiles because they're skipped
+# on mobile profiles
+FULLAOT_LIBS_DISABLED += \
+       Mono.Posix.dll \
+       System.Configuration.dll
 endif
 
+FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL))
+
 FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp
 
 # This currently only works on amd64/arm
index 6e91638d881fe1f3f3f97a4cf2c9d97e12c9555b..6d4f50a42388fb4e9641557cf720f6c0756f0c50 100644 (file)
@@ -4330,7 +4330,9 @@ add_wrappers (MonoAotCompile *acfg)
                                        named += slen;
                                }
 
-                               wrapper = mono_marshal_get_managed_wrapper (method, klass, 0);
+                               wrapper = mono_marshal_get_managed_wrapper (method, klass, 0, &error);
+                               mono_error_assert_ok (&error);
+
                                add_method (acfg, wrapper);
                                if (export_name)
                                        g_hash_table_insert (acfg->export_names, wrapper, export_name);
index ed2b485a626d415b54fda77ef970106282fca802..ce87be85147787fadc4017bb32d96a9be54733ac 100644 (file)
@@ -257,7 +257,7 @@ load_image (MonoAotModule *amodule, int index, MonoError *error)
 
        g_assert (index < amodule->image_table_len);
 
-       mono_error_init (error);
+       error_init (error);
 
        if (amodule->image_table [index])
                return amodule->image_table [index];
@@ -374,7 +374,7 @@ decode_generic_inst (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoEr
        MonoGenericInst *inst;
        guint8 *p = buf;
 
-       mono_error_init (error);
+       error_init (error);
        type_argc = decode_value (p, &p);
        type_argv = g_new0 (MonoType*, type_argc);
 
@@ -401,7 +401,7 @@ decode_generic_context (MonoAotModule *module, MonoGenericContext *ctx, guint8 *
        guint8 *p = buf;
        guint8 *p2;
        int argc;
-       mono_error_init (error);
+       error_init (error);
 
        p2 = p;
        argc = decode_value (p, &p);
@@ -433,7 +433,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError
        guint8 *p = buf;
        int reftype;
 
-       mono_error_init (error);
+       error_init (error);
        reftype = decode_value (p, &p);
        if (reftype == 0) {
                *endbuf = p;
@@ -621,7 +621,7 @@ decode_type (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError *err
        MonoType *t;
 
        t = (MonoType *)g_malloc0 (sizeof (MonoType));
-       mono_error_init (error);
+       error_init (error);
 
        while (TRUE) {
                if (*p == MONO_TYPE_PINNED) {
@@ -852,7 +852,7 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
        guint8 *p = buf;
 
        memset (ref, 0, sizeof (MethodRef));
-       mono_error_init (error);
+       error_init (error);
 
        value = decode_value (p, &p);
        image_index = value >> 24;
@@ -1214,7 +1214,9 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                        klass = decode_klass_ref (module, p, &p, error);
                        if (!klass)
                                return FALSE;
-                       ref->method = mono_marshal_get_managed_wrapper (m, klass, 0);
+                       ref->method = mono_marshal_get_managed_wrapper (m, klass, 0, error);
+                       if (!mono_error_ok (error))
+                               return FALSE;
                        break;
                }
                default:
@@ -1338,7 +1340,7 @@ decode_resolve_method_ref_with_target (MonoAotModule *module, MonoMethod *target
 {
        MethodRef ref;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!decode_method_ref_with_target (module, &ref, target, buf, endbuf, error))
                return NULL;
@@ -2430,7 +2432,7 @@ mono_aot_get_method_from_vt_slot (MonoDomain *domain, MonoVTable *vtable, int sl
        gpointer addr;
        MonoError inner_error;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (MONO_CLASS_IS_INTERFACE (klass) || klass->rank || !amodule)
                return NULL;
@@ -3849,7 +3851,7 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
        guint8 *code = NULL, *info;
        gboolean res;
 
-       mono_error_init (error);
+       error_init (error);
 
        init_amodule_got (amodule);
 
@@ -4142,7 +4144,7 @@ init_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *method, M
        MonoJitInfo *jinfo = NULL;
        guint8 *code, *info;
 
-       mono_error_init (error);
+       error_init (error);
 
        code = (guint8 *)amodule->methods [method_index];
        info = &amodule->blob [mono_aot_get_offset (amodule->method_info_offsets, method_index)];
@@ -4353,7 +4355,7 @@ mono_aot_get_method_checked (MonoDomain *domain, MonoMethod *method, MonoError *
        gboolean cache_result = FALSE;
        MonoError inner_error;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (domain != mono_get_root_domain ())
                /* Non shared AOT code can't be used in other appdomains */
@@ -4619,7 +4621,7 @@ mono_aot_get_method_from_token (MonoDomain *domain, MonoImage *image, guint32 to
        int method_index;
        gpointer res;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!aot_module)
                return NULL;
@@ -4738,7 +4740,7 @@ mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code
        MonoMemPool *mp;
        gboolean using_gsharedvt = FALSE;
 
-       mono_error_init (error);
+       error_init (error);
 
        //printf ("DYN: %p %d\n", aot_module, plt_info_offset);
 
@@ -5837,7 +5839,7 @@ gpointer
 mono_aot_get_method_checked (MonoDomain *domain,
                                                         MonoMethod *method, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return NULL;
 }
 
@@ -5868,7 +5870,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr)
 gpointer
 mono_aot_get_method_from_token (MonoDomain *domain, MonoImage *image, guint32 token, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
        return NULL;
 }
 
@@ -5892,7 +5894,7 @@ mono_aot_patch_plt_entry (guint8 *code, guint8 *plt_entry, gpointer *got, mgreg_
 gpointer
 mono_aot_get_method_from_vt_slot (MonoDomain *domain, MonoVTable *vtable, int slot, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        return NULL;
 }
index 21779306d9684b992216e9403965b5ca04a82473..8f120de8683fd6b93dba923a01a2ff6686dabca4 100644 (file)
@@ -4150,7 +4150,7 @@ insert_breakpoint (MonoSeqPointInfo *seq_points, MonoDomain *domain, MonoJitInfo
        gboolean it_has_sp = FALSE;
 
        if (error)
-               mono_error_init (error);
+               error_init (error);
 
        mono_seq_point_iterator_init (&it, seq_points);
        while (mono_seq_point_iterator_next (&it)) {
@@ -4350,7 +4350,7 @@ set_bp_in_method (MonoDomain *domain, MonoMethod *method, MonoSeqPointInfo *seq_
        MonoJitInfo *ji;
 
        if (error)
-               mono_error_init (error);
+               error_init (error);
 
        code = mono_jit_find_compiled_method_with_jit_info (domain, method, &ji);
        if (!code) {
@@ -4396,7 +4396,7 @@ set_breakpoint (MonoMethod *method, long il_offset, EventRequest *req, MonoError
        int i;
 
        if (error)
-               mono_error_init (error);
+               error_init (error);
 
        // FIXME:
        // - suspend/resume the vm to prevent code patching problems
@@ -8008,7 +8008,7 @@ get_assembly_object_command (MonoDomain *domain, MonoAssembly *ass, Buffer *buf,
 {
        HANDLE_FUNCTION_ENTER();
        ErrorCode err = ERR_NONE;
-       mono_error_init (error);
+       error_init (error);
        MonoReflectionAssemblyHandle o = mono_assembly_get_object_handle (domain, ass, error);
        if (MONO_HANDLE_IS_NULL (o)) {
                err = ERR_INVALID_OBJECT;
@@ -8659,7 +8659,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
                MonoError error;
                GPtrArray *array;
 
-               mono_error_init (&error);
+               error_init (&error);
                array = mono_class_get_methods_by_name (klass, name, flags & ~BINDING_FLAGS_IGNORE_CASE, (flags & BINDING_FLAGS_IGNORE_CASE) != 0, TRUE, &error);
                if (!is_ok (&error)) {
                        mono_error_cleanup (&error);
index 357c1cd5057c99b612ccafba0c94f32a031ad6e9..860e1ca626fd48ee19f6ff11b4f3dd65e8b461d2 100644 (file)
@@ -1198,7 +1198,6 @@ mini_usage_jitdeveloper (void)
                 "    --single-method=OPTS   Runs regressions with only one method optimized with OPTS at any time\n"
                 "    --statfile FILE        Sets the stat file to FILE\n"
                 "    --stats                Print statistics about the JIT operations\n"
-                "    --wapi=hps|semdel|seminfo IO-layer maintenance\n"
                 "    --inject-async-exc METHOD OFFSET Inject an asynchronous exception at METHOD\n"
                 "    --verify-all           Run the verifier on all assemblies and methods\n"
                 "    --full-aot             Avoid JITting any code\n"
@@ -2067,7 +2066,7 @@ mono_main (int argc, char* argv[])
        case DO_REGRESSION:
 #ifdef ENABLE_INTERPRETER
                if (mono_use_interpreter) {
-                       if (interp_regression_list (2, argc -i, argv + i)) {
+                       if (mono_interp_regression_list (2, argc -i, argv + i)) {
                                g_print ("Regression ERRORS!\n");
                                // mini_cleanup (domain);
                                return 1;
@@ -2108,10 +2107,6 @@ mono_main (int argc, char* argv[])
                aname = argv [i];
                break;
        default:
-#ifdef ENABLE_INTERPRETER
-               if (mono_use_interpreter)
-                       g_error ("not yet");
-#endif
                if (argc - i < 1) {
                        mini_usage ();
                        mini_cleanup (domain);
diff --git a/mono/mini/generics-interp.cs b/mono/mini/generics-interp.cs
deleted file mode 100644 (file)
index ac06568..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Threading;
-using System.Threading.Tasks;
-
-#if __MOBILE__
-class GenericsTests
-#else
-class Tests
-#endif
-{
-       struct TestStruct {
-               public int i;
-               public int j;
-
-               public TestStruct (int i, int j) {
-                       this.i = i;
-                       this.j = j;
-               }
-       }
-
-#if !__MOBILE__
-       public static int Main (string[] args) {
-               return TestDriver.RunTests (typeof (Tests), args);
-       }
-#endif
-
-       public static int test_1_no_nullable_unbox ()
-       {
-               return Unbox<int> (1);
-       }
-
-       public static int test_1_nullable_unbox_null ()
-       {
-               return Unbox<int?> (null).HasValue ? 0 : 1;
-       }
-
-       public static int test_1_nullable_box ()
-       {
-               return (int) Box<int?> (1);
-       }
-
-       public static int test_1_nullable_box_null ()
-       {
-               return Box<int?> (null) == null ? 1 : 0;
-       }
-
-       public static int test_1_isinst_nullable ()
-       {
-               object o = 1;
-               return (o is int?) ? 1 : 0;
-       }
-
-       public static int test_1_nullable_unbox_vtype ()
-       {
-               return Unbox<TestStruct?> (new TestStruct (1, 2)).Value.i;
-       }
-
-
-       public static int test_1_nullable_unbox_null_vtype ()
-       {
-               return Unbox<TestStruct?> (null).HasValue ? 0 : 1;
-       }
-
-       public static int test_1_nullable_box_vtype ()
-       {
-               return ((TestStruct)(Box<TestStruct?> (new TestStruct (1, 2)))).i;
-       }
-
-       public static int test_1_nullable_box_null_vtype ()
-       {
-               return Box<TestStruct?> (null) == null ? 1 : 0;
-       }
-
-       public static int test_1_isinst_nullable_vtype ()
-       {
-               object o = new TestStruct (1, 2);
-               return (o is TestStruct?) ? 1 : 0;
-       }
-
-       public static int test_0_nullable_normal_unbox ()
-       {
-               int? i = 5;
-
-               object o = i;
-               // This uses unbox instead of unbox_any
-               int? j = (int?)o;
-
-               if (j != 5)
-                       return 1;
-
-               return 0;
-       }
-
-       public static void stelem_any<T> (T[] arr, T elem) {
-               arr [0] = elem;
-       }
-
-       public static T ldelem_any<T> (T[] arr) {
-               return arr [0];
-       }
-
-       public static int test_1_ldelem_stelem_any_int () {
-               int[] arr = new int [3];
-               stelem_any (arr, 1);
-
-               return ldelem_any (arr);
-       }
-
-       public static T return_ref<T> (ref T t) {
-               return t;
-       }
-
-       public static T ldelema_any<T> (T[] arr) {
-               return return_ref<T> (ref arr [0]);
-       }
-
-       public static int test_0_ldelema () {
-               string[] arr = new string [1];
-
-               arr [0] = "Hello";
-
-               if (ldelema_any <string> (arr) == "Hello")
-                       return 0;
-               else
-                       return 1;
-       }
-
-       public static T[,] newarr_multi<T> () {
-               return new T [1, 1];
-       }
-
-       public static int test_0_newarr_multi_dim () {
-               return newarr_multi<string> ().GetType () == typeof (string[,]) ? 0 : 1;
-       }
-
-       static object Box<T> (T t)
-       {
-               return t;
-       }
-
-       static T Unbox <T> (object o) {
-               return (T) o;
-       }
-}
index 018619449191a8cf24899b7d1cba6f55519a85d0..9defe79f3cc9ff701d1c4bd16da6c91db5f49653 100644 (file)
@@ -233,6 +233,7 @@ class Tests
                return 0;
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_generic_get_value_optimization_vtype () {
                TestStruct[] arr = new TestStruct[] { new TestStruct (100, 200), new TestStruct (300, 400) };
                IEnumerator<TestStruct> enumerator = GenericClass<TestStruct>.Y (arr);
@@ -426,6 +427,7 @@ class Tests
        }
 #endif
 
+       [Category ("!INTERPRETER")]
        public static int test_0_ldvirtftn_generic_method () {
                new GenericsTests ().ldvirtftn<string> ();
 
@@ -452,6 +454,7 @@ class Tests
        // This cannot be made to work with full-aot, since there it is impossible to
        // statically determine that Foo<string>.Bar <int> is needed, the code only
        // references IFoo.Bar<int>
+       [Category ("!INTERPRETER")]
        [Category ("!FULLAOT")]
        public static int test_0_generic_virtual_on_interfaces () {
                Foo<string>.count1 = 0;
@@ -477,6 +480,7 @@ class Tests
                return 0;
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_generic_virtual_on_interfaces_ref () {
                Foo<string>.count1 = 0;
                Foo<string>.count2 = 0;
@@ -516,6 +520,7 @@ class Tests
                Value_2 = 2
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_regress_550964_constrained_enum_long () {
         MyEnumUlong a = MyEnumUlong.Value_2;
         MyEnumUlong b = MyEnumUlong.Value_2;
@@ -534,6 +539,7 @@ class Tests
                }
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_fullaot_linq () {
                var allWords = new XElement [] { new XElement { Value = "one" } };
                var filteredWords = allWords.Where(kw => kw.Value.StartsWith("T"));
@@ -556,6 +562,7 @@ class Tests
                int c = ((ICollection<T>)arr).Count;
        }
 
+       [Category ("!INTERPRETER")]
        /* Test that treating arrays as generic collections works with full-aot */
        public static int test_0_fullaot_array_wrappers () {
                GenericsTests[] arr = new GenericsTests [10];
@@ -615,6 +622,7 @@ class Tests
                return typeof (T);
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_gshared_delegate_rgctx () {
                Func<Type> t = new Func<Type> (get_type<string>);
 
@@ -624,6 +632,7 @@ class Tests
                        return 1;
        }
 
+       [Category ("!INTERPRETER")]
        // Creating a delegate from a generic method from gshared code
        public static int test_0_gshared_delegate_from_gshared () {
                if (gshared_delegate_from_gshared <object> () != 0)
@@ -655,6 +664,7 @@ class Tests
                public delegate TRet Transform<TRet> (TKey key, TValue value);
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_bug_620864 () {
                var d = new Pair<string, Type>.Transform<KeyValuePair<string, Type>> (Pair<string, Type>.make_pair);
 
@@ -711,6 +721,7 @@ class Tests
                return 0;
        }
 
+       [Category ("!INTERPRETER")]
        [Category ("GSHAREDVT")]
        public static int test_6_partial_sharing_linq () {
                var messages = new List<Message> ();
@@ -721,6 +732,7 @@ class Tests
                return messages.Max(i => i.MessageID);
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_partial_shared_method_in_nonshared_class () {
                var c = new Class1<double> ();
                return (c.Foo<string> (5).GetType () == typeof (Class1<string>)) ? 0 : 1;
@@ -897,6 +909,7 @@ class Tests
                }
        }
 
+       [Category ("!INTERPRETER")]
        [Category ("!FULLAOT")]
        [Category ("!BITCODE")]
        public static int test_0_regress_668095_synchronized_gshared () {
@@ -915,6 +928,7 @@ class Tests
                }
        }
 
+       [Category ("!INTERPRETER")]
        [Category ("GSHAREDVT")]
        static int test_0_synchronized_gshared () {
                var c = new SyncClass<string> ();
@@ -951,6 +965,7 @@ class Tests
        }
 
        // #2155
+       [Category ("!INTERPRETER")]
        [Category ("GSHAREDVT")]
        public static int test_0_fullaot_sflda_cctor () {
                List<Doc> documents = new List<Doc>();
@@ -976,6 +991,7 @@ class Tests
     static List<A> sources = new List<A>();
 
        // #6112
+       [Category ("!INTERPRETER")]
     public static int test_0_fullaot_imt () {
         sources.Add(null);
         sources.Add(null);
@@ -997,6 +1013,7 @@ class Tests
        class BClass : AClass {
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_fullaot_variant_iface () {
                var arr = new BClass [10];
                var enumerable = (IEnumerable<AClass>)arr;
@@ -1028,6 +1045,7 @@ class Tests
                }
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_1_regress_constrained_iface_call_7571 () {
         var r = new Record [10];
         Foo2<Record>.Extract (r);
@@ -1038,6 +1056,7 @@ class Tests
                Val = 1
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_regress_constrained_iface_call_enum () {
                var r = new ConstrainedEnum [10];
                return Foo3<ConstrainedEnum>.CompareTo (r);
@@ -1097,6 +1116,7 @@ class Tests
        }
 #endif
 
+       [Category ("!INTERPRETER")]
        public static int test_0_delegate_callvirt_fullaot () {
                Func<string> f = delegate () { return "A"; };
         var f2 = (Func<Func<string>, string>)Delegate.CreateDelegate (typeof
@@ -1179,6 +1199,7 @@ class Tests
                return t.GetHashCode ();
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_constrained_partial_sharing () {
                string s;
 
@@ -1235,6 +1256,7 @@ class Tests
 
        static object delegate_8_args_res;
 
+       [Category ("!INTERPRETER")]
        public static int test_0_delegate_8_args () {
                delegate_8_args_res = null;
                Action<string, string, string, string, string, string, string,
index 95e1fff2bb42a59abeb32870870b8c718163494f..0b123e50cf686664138ce21ffb0faa23c1e549c1 100644 (file)
@@ -155,121 +155,6 @@ mono_draw_cfg (MonoCompile *cfg, FILE *fp)
        fprintf (fp, "}\n");
 }
 
-#if 0
-
-static void
-mono_print_label (FILE *fp, MonoInst *tree) {
-       int arity;
-
-       if (!tree)
-               return;
-
-       arity = mono_burg_arity [tree->opcode];
-
-       fprintf (fp, "\\ %s%s", arity? "(": "",  mono_inst_name (tree->opcode));
-
-       switch (tree->opcode) {
-       case OP_ICONST:
-               fprintf (fp, "[%ld]", (long)tree->inst_c0);
-               break;
-       case OP_I8CONST:
-               fprintf (fp, "[%lld]", (long long)tree->inst_l);
-               break;
-       case OP_R8CONST:
-               fprintf (fp, "[%f]", *(double*)tree->inst_p0);
-               break;
-       case OP_R4CONST:
-               fprintf (fp, "[%f]", *(float*)tree->inst_p0);
-               break;
-       case OP_ARG:
-       case OP_LOCAL:
-               fprintf (fp, "[%d]", (int)tree->inst_c0);
-               break;
-       case OP_REGOFFSET:
-               fprintf (fp, "[0x%x(%s)]", (int)tree->inst_offset, mono_arch_regname (tree->inst_basereg));
-               break;
-       case OP_REGVAR:
-               fprintf (fp, "[%s]", mono_arch_regname (tree->dreg));
-               break;
-       case CEE_NEWARR:
-               fprintf (fp, "[%s]",  tree->inst_newa_class->name);
-               mono_print_label (fp, tree->inst_newa_len);
-               break;
-       case OP_CALL:
-       case OP_CALL_MEMBASE:
-       case OP_FCALL:
-       case OP_FCALL_MEMBASE:
-       case OP_LCALL:
-       case OP_LCALL_MEMBASE:
-       case OP_VCALL:
-       case OP_VCALL_MEMBASE:
-       case OP_VOIDCALL:
-       case OP_VOIDCALL_MEMBASE: {
-               MonoCallInst *call = (MonoCallInst*)tree;
-               if (call->method) {
-                       if (mono_method_signature (call->method)->hasthis && tree->inst_left) {
-                               mono_print_label (fp, tree->inst_left);
-                       }
-                       fprintf (fp, "[%s]", call->method->name);
-               }
-               break;
-       }
-       case OP_PHI: {
-               int i;
-               fprintf (fp, "[%d\\ (", (int)tree->inst_c0);
-               for (i = 0; i < tree->inst_phi_args [0]; i++) {
-                       if (i)
-                               fprintf (fp, ",\\ ");
-                       fprintf (fp, "%d", tree->inst_phi_args [i + 1]);
-               }
-               fprintf (fp, ")]");
-               break;
-       }
-       case OP_NOP:
-       case OP_JMP:
-       case OP_BREAK:
-               break;
-       case OP_BR:
-               fprintf (fp, "[B%d]", tree->inst_target_bb->block_num);
-               break;
-       case OP_SWITCH:
-       case CEE_ISINST:
-       case CEE_CASTCLASS:
-       case OP_CALL_REG:
-       case OP_FCALL_REG:
-       case OP_LCALL_REG:
-       case OP_VCALL_REG:
-       case OP_VOIDCALL_REG:
-               mono_print_label (fp, tree->inst_left);
-               break;
-       case CEE_BNE_UN:
-       case CEE_BEQ:
-       case CEE_BLT:
-       case CEE_BLT_UN:
-       case CEE_BGT:
-       case CEE_BGT_UN:
-       case CEE_BGE:
-       case CEE_BGE_UN:
-       case CEE_BLE:
-       case CEE_BLE_UN:
-               fprintf (fp, "[B%dB%d]", tree->inst_true_bb->block_num, tree->inst_false_bb->block_num);
-               mono_print_label (fp, tree->inst_left);
-               break;
-       default:
-               if (arity) {
-                       mono_print_label (fp, tree->inst_left);
-                       if (arity > 1)
-                               mono_print_label (fp, tree->inst_right);
-               }
-               break;
-       }
-
-       if (arity)
-               fprintf (fp, ")");
-}
-
-#endif
-
 static void
 mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
 {
index 65151b07024e8d1a2199d9b76119cd07be48c527..e4323480388d18ed54d50e046ddc014aedb50217 100644 (file)
@@ -1026,7 +1026,7 @@ public class Tests
                return t.ToString ();
        }
 
-       enum AnEnum {
+       public enum AnEnum {
                One,
                Two
        };
@@ -1106,10 +1106,12 @@ public class Tests
 
        interface IConstrainedCalls {
                Pair<int, int> vtype_ret<T, T2>(T t, T2 t2) where T: IReturnVType;
+               AnEnum enum_ret<T, T2>(T t, T2 t2) where T: IReturnVType;
        }
 
        public interface IReturnVType {
                Pair<int, int> return_vtype ();
+               AnEnum return_enum ();
        }
 
        public class CConstrainedCalls : IConstrainedCalls {
@@ -1117,12 +1119,20 @@ public class Tests
                public Pair<int, int> vtype_ret<T, T2>(T t, T2 t2) where T : IReturnVType {
                        return t.return_vtype ();
                }
+
+               [MethodImplAttribute (MethodImplOptions.NoInlining)]
+               public AnEnum enum_ret<T, T2>(T t, T2 t2) where T : IReturnVType {
+                       return t.return_enum ();
+               }
        }
 
        class ReturnVType : IReturnVType {
                public Pair<int, int> return_vtype () {
                        return new Pair<int, int> () { First = 1, Second = 2 };
                }
+               public AnEnum return_enum () {
+                       return AnEnum.Two;
+               }
        }
 
        public static int test_0_constrained_vtype_ret () {
@@ -1133,6 +1143,14 @@ public class Tests
                return 0;
        }
 
+       public static int test_0_constrained_enum_ret () {
+               IConstrainedCalls c = new CConstrainedCalls ();
+               var r = c.enum_ret<ReturnVType, int> (new ReturnVType (), 1);
+               if (r != AnEnum.Two)
+                       return 1;
+               return 0;
+       }
+
        public struct Pair<T1, T2> {
                public T1 First;
                public T2 Second;
diff --git a/mono/mini/interpreter/interp-internals.h b/mono/mini/interpreter/interp-internals.h
new file mode 100644 (file)
index 0000000..603e20a
--- /dev/null
@@ -0,0 +1,128 @@
+#ifndef __MONO_MINI_INTERPRETER_INTERNALS_H__
+#define __MONO_MINI_INTERPRETER_INTERNALS_H__
+
+#include <setjmp.h>
+#include <glib.h>
+#include <mono/metadata/loader.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/metadata/class-internals.h>
+#include "config.h"
+
+enum {
+       VAL_I32     = 0,
+       VAL_DOUBLE  = 1,
+       VAL_I64     = 2,
+       VAL_VALUET  = 3,
+       VAL_POINTER = 4,
+       VAL_NATI    = 0 + VAL_POINTER,
+       VAL_MP      = 1 + VAL_POINTER,
+       VAL_TP      = 2 + VAL_POINTER,
+       VAL_OBJ     = 3 + VAL_POINTER
+};
+
+#if SIZEOF_VOID_P == 4
+typedef guint32 mono_u;
+typedef gint32  mono_i;
+#elif SIZEOF_VOID_P == 8
+typedef guint64 mono_u;
+typedef gint64  mono_i;
+#endif
+
+/*
+ * Value types are represented on the eval stack as pointers to the
+ * actual storage. The size field tells how much storage is allocated.
+ * A value type can't be larger than 16 MB.
+ */
+typedef struct {
+       union {
+               gint32 i;
+               gint64 l;
+               double f;
+               /* native size integer and pointer types */
+               gpointer p;
+               mono_u nati;
+               gpointer vt;
+       } data;
+#if defined(__ppc__) || defined(__powerpc__)
+       int pad;
+#endif
+} stackval;
+
+typedef struct _MonoInvocation MonoInvocation;
+
+typedef void (*MonoFuncV) (void);
+typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
+
+/* 
+ * Structure representing a method transformed for the interpreter 
+ * This is domain specific
+ */
+typedef struct _RuntimeMethod
+{
+       /* NOTE: These first two elements (method and
+          next_jit_code_hash) must be in the same order and at the
+          same offset as in MonoJitInfo, because of the jit_code_hash
+          internal hash table in MonoDomain. */
+       MonoMethod *method;
+       struct _RuntimeMethod *next_jit_code_hash;
+       guint32 locals_size;
+       guint32 args_size;
+       guint32 stack_size;
+       guint32 vt_stack_size;
+       guint32 alloca_size;
+       unsigned short *code;
+       unsigned short *new_body_start; /* after all STINARG instrs */
+       MonoPIFunc func;
+       int num_clauses;
+       MonoExceptionClause *clauses;
+       void **data_items;
+       int transformed;
+       guint32 *arg_offsets;
+       guint32 *local_offsets;
+       unsigned int param_count;
+       unsigned int hasthis;
+       unsigned int valuetype;
+} RuntimeMethod;
+
+struct _MonoInvocation {
+       MonoInvocation *parent; /* parent */
+       RuntimeMethod  *runtime_method; /* parent */
+       MonoMethod     *method; /* parent */
+       stackval       *retval; /* parent */
+       char           *args;
+       stackval       *stack_args; /* parent */
+       stackval       *stack;
+       stackval       *sp; /* For GC stack marking */
+       /* exception info */
+       unsigned char  invoke_trap;
+       const unsigned short  *ip;
+       MonoException     *ex;
+       MonoExceptionClause *ex_handler;
+};
+
+typedef struct {
+       MonoDomain *domain;
+       MonoInvocation *base_frame;
+       MonoInvocation *current_frame;
+       MonoInvocation *env_frame;
+       jmp_buf *current_env;
+       unsigned char search_for_handler;
+       unsigned char managed_code;
+} ThreadContext;
+
+extern int mono_interp_traceopt;
+
+MonoException *
+mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
+
+MonoDelegate*
+mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
+
+void
+mono_interp_transform_init (void);
+
+RuntimeMethod *
+mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error);
+
+#endif /* __MONO_MINI_INTERPRETER_INTERNALS_H__ */
index d3cfef356864d547e6952978de1c09dfefafb85a..2ec010502b821001ece92d2ae5d052dd1a40c8b4 100644 (file)
 #include <mono/metadata/mono-debug.h>
 
 #include "interp.h"
+#include "interp-internals.h"
 #include "mintops.h"
 #include "hacks.h"
 
 #include <mono/mini/mini.h>
+#include <mono/mini/jit-icalls.h>
 
 
 /* Mingw 2.1 doesnt need this any more, but leave it in for now for older versions */
@@ -105,7 +107,7 @@ static char* dump_args (MonoInvocation *inv);
 #if DEBUG_INTERP
 int mono_interp_traceopt = 2;
 /* If true, then we output the opcodes as we interpret them */
-static int global_tracing = 1;
+static int global_tracing = 2;
 
 static int debug_indent_level = 0;
 
@@ -257,7 +259,7 @@ RuntimeMethod*
 mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error)
 {
        RuntimeMethod *rtm;
-       mono_error_init (error);
+       error_init (error);
 
        mono_os_mutex_lock (&runtime_method_lookup_section);
        if ((rtm = mono_internal_hash_table_lookup (&domain->jit_code_hash, method))) {
@@ -304,6 +306,8 @@ get_virtual_method (MonoDomain *domain, RuntimeMethod *runtime_method, MonoObjec
                return ret;
        }
 
+       mono_class_setup_vtable (obj->vtable->klass);
+
        int slot = mono_method_get_vtable_slot (m);
        if (mono_class_is_interface (m->klass)) {
                g_assert (obj->vtable->klass != m->klass);
@@ -384,15 +388,11 @@ stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvo
                if (type->data.klass->enumtype) {
                        stackval_from_data (mono_class_enum_basetype (type->data.klass), result, data, pinvoke);
                        return;
-               } else {
-                       int size;
-                       
-                       if (pinvoke)
-                               size = mono_class_native_size (type->data.klass, NULL);
-                       else
-                               size = mono_class_value_size (type->data.klass, NULL);
-                       memcpy (result->data.vt, data, size);
-               }
+               } else
+                       mono_value_copy (result->data.vt, data, type->data.klass);
+               return;
+       case MONO_TYPE_GENERICINST:
+               stackval_from_data (&type->data.generic_class->container_class->byval_arg, result, data, pinvoke);
                return;
        default:
                g_warning ("got type 0x%02x", type->type);
@@ -479,16 +479,8 @@ stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
                if (type->data.klass->enumtype) {
                        stackval_to_data (mono_class_enum_basetype (type->data.klass), val, data, pinvoke);
                        return;
-               } else {
-                       int size;
-
-                       if (pinvoke)
-                               size = mono_class_native_size (type->data.klass, NULL);
-                       else
-                               size = mono_class_value_size (type->data.klass, NULL);
-
-                       memcpy (data, val->data.p, size);
-               }
+               } else
+                       mono_value_copy (data, val->data.vt, type->data.klass);
                return;
        case MONO_TYPE_GENERICINST:
                stackval_to_data (&type->data.generic_class->container_class->byval_arg, val, data, pinvoke);
@@ -756,6 +748,7 @@ static MethodArguments* build_args_from_sig (MonoMethodSignature *sig, MonoInvoc
                case MONO_TYPE_OBJECT:
                case MONO_TYPE_STRING:
                case MONO_TYPE_I8:
+               case MONO_TYPE_VALUETYPE:
                        margs->ilen++;
                        break;
                default:
@@ -766,8 +759,8 @@ static MethodArguments* build_args_from_sig (MonoMethodSignature *sig, MonoInvoc
        if (margs->ilen > 0)
                margs->iargs = g_malloc0 (sizeof (gpointer) * margs->ilen);
 
-       if (margs->ilen > 3)
-               g_error ("build_args_from_sig: TODO, more than two iregs: %d\n", margs->ilen);
+       if (margs->ilen > 6)
+               g_error ("build_args_from_sig: TODO, more than 6 iregs: %d\n", margs->ilen);
 
        if (margs->flen > 0)
                g_error ("build_args_from_sig: TODO, allocate floats: %d\n", margs->flen);
@@ -799,6 +792,7 @@ static MethodArguments* build_args_from_sig (MonoMethodSignature *sig, MonoInvoc
                case MONO_TYPE_OBJECT:
                case MONO_TYPE_STRING:
                case MONO_TYPE_I8:
+               case MONO_TYPE_VALUETYPE:
                        margs->iargs [int_i] = frame->stack_args [i].data.p;
 #if DEBUG_INTERP
                        g_print ("build_args_from_sig: margs->iargs[%d]: %p (frame @ %d)\n", int_i, margs->iargs[int_i], i);
@@ -1221,7 +1215,7 @@ get_trace_ips (MonoDomain *domain, MonoInvocation *top)
 #endif
 
 MonoObject*
-interp_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error)
+mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error)
 {
        MonoInvocation frame;
        ThreadContext * volatile context = mono_native_tls_get_value (thread_context_id);
@@ -1236,7 +1230,7 @@ interp_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoOb
        MonoInvocation *old_frame = NULL;
        jmp_buf env;
 
-       mono_error_init (error);
+       error_init (error);
 
        frame.ex = NULL;
 
@@ -1472,8 +1466,32 @@ static mono_mutex_t create_method_pointer_mutex;
 
 static GHashTable *method_pointer_hash = NULL;
 
+static MonoMethod *method_pointers [2] = {0};
+
+static MonoObject *
+mp_tramp_0 (MonoObject *this_obj, void **params, MonoObject **exc, void *compiled_method) {
+       MonoError error;
+       void *params_real[] = {this_obj, &params, &exc, &compiled_method};
+       MonoObject *ret = mono_interp_runtime_invoke (method_pointers [0], NULL, params_real, NULL, &error);
+       mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+       return ret;
+}
+
+static MonoObject *
+mp_tramp_1 (MonoObject *this_obj, void **params, MonoObject **exc, void *compiled_method) {
+       MonoError error;
+       void *params_real[] = {this_obj, &params, &exc, &compiled_method};
+       MonoObject *ret = mono_interp_runtime_invoke (method_pointers [1], NULL, params_real, NULL, &error);
+       mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+       return ret;
+}
+
+gpointer *mp_tramps[] = {(gpointer) mp_tramp_0, (gpointer) mp_tramp_1};
+
+static int tramps_used = 0;
+
 gpointer
-interp_create_method_pointer (MonoMethod *method, MonoError *error)
+mono_interp_create_method_pointer (MonoMethod *method, MonoError *error)
 {
        gpointer addr;
        MonoJitInfo *ji;
@@ -1503,10 +1521,13 @@ interp_create_method_pointer (MonoMethod *method, MonoError *error)
                mono_jit_info_table_add (mono_get_root_domain (), ji);
        }               
        else {
-               g_error ("FIXME: not available? figure out new API");
-#if 0
-               addr = mono_arch_create_method_pointer (method);
-#endif
+               g_assert (method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE);
+               g_assert (tramps_used < 2);
+
+               /* FIXME: needs locking */
+               method_pointers [tramps_used] = method;
+               addr = mp_tramps [tramps_used];
+               tramps_used++;
        }
 
        g_hash_table_insert (method_pointer_hash, method, addr);
@@ -1800,7 +1821,9 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
                        if (csignature->hasthis)
                                --sp;
                        child_frame.stack_args = sp;
-                       if (csignature->hasthis && mono_object_is_transparent_proxy (sp->data.p)) {
+
+                       /* `this' can be NULL for string:.ctor */
+                       if (csignature->hasthis && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
                                child_frame.runtime_method = mono_interp_get_runtime_method (context->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        } else if (child_frame.runtime_method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
@@ -1885,7 +1908,9 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
                        if (child_frame.runtime_method->hasthis)
                                --sp;
                        child_frame.stack_args = sp;
-                       if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->valuetype && mono_object_is_transparent_proxy (sp->data.p)) {
+
+                       /* `this' can be NULL for string:.ctor */
+                       if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->valuetype && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
                                child_frame.runtime_method = mono_interp_get_runtime_method (context->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
@@ -1960,7 +1985,9 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
                        child_frame.runtime_method = get_virtual_method (context->domain, child_frame.runtime_method, this_arg);
 
                        if (this_arg->vtable->klass->valuetype && child_frame.runtime_method->valuetype) {
-                               sp->data.p = (char *) this_arg + sizeof (MonoObject);
+                               /* unbox */
+                               gpointer *unboxed = mono_object_unbox (this_arg);
+                               stackval_from_data (&this_arg->vtable->klass->byval_arg, sp, (char *) unboxed, FALSE);
                        }
 
                        ves_exec_method_with_context (&child_frame, context);
@@ -2005,7 +2032,8 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
                        child_frame.runtime_method = get_virtual_method (context->domain, child_frame.runtime_method, this_arg);
 
                        if (this_arg->vtable->klass->valuetype && child_frame.runtime_method->valuetype) {
-                               sp->data.p = (char *) this_arg + sizeof (MonoObject);
+                               gpointer *unboxed = mono_object_unbox (this_arg);
+                               stackval_from_data (&this_arg->vtable->klass->byval_arg, sp, (char *) unboxed, FALSE);
                        }
 
                        ves_exec_method_with_context (&child_frame, context);
@@ -2362,10 +2390,12 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
                        ++ip;
                        sp[-1].data.l = *(gint64*)sp[-1].data.p;
                        MINT_IN_BREAK;
-               MINT_IN_CASE(MINT_LDIND_I)
-                       ++ip;
-                       sp[-1].data.p = *(gpointer*)sp[-1].data.p;
+               MINT_IN_CASE(MINT_LDIND_I) {
+                       guint16 offset = * (guint16 *)(ip + 1);
+                       sp[-1 - offset].data.p = *(gpointer*)sp[-1 - offset].data.p;
+                       ip += 2;
                        MINT_IN_BREAK;
+               }
                MINT_IN_CASE(MINT_LDIND_R4)
                        ++ip;
                        sp[-1].data.f = *(gfloat*)sp[-1].data.p;
@@ -2779,6 +2809,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
                                                mono_thread_interruption_checkpoint ();
                                        sp->data.p = o;
                                } else {
+                                       sp->data.p = NULL;
                                        child_frame.retval = &retval;
                                }
                        }
@@ -3033,94 +3064,24 @@ array_constructed:
                }
                MINT_IN_CASE(MINT_LDSFLDA) {
                        MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
-                       MonoVTable *vt = mono_class_vtable (context->domain, field->parent);
-                       gpointer addr;
-
-                       if (!vt->initialized) {
-                               frame->ip = ip;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
+                       sp->data.p = mono_class_static_field_address (context->domain, field);
                        ip += 2;
-
-                       if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
-                               sp->data.p = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
-                       else
-                               sp->data.p = (char*)(vt->vtable) + field->offset;
                        ++sp;
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_LDSFLD) {
-                       MonoVTable *vt;
-                       MonoClassField *field;
-                       gpointer addr;
-
-                       field = rtm->data_items[*(guint16 *)(ip + 1)];
-                       vt = rtm->data_items [*(guint16 *)(ip + 2)];
-                       if (!vt->initialized) {
-                               frame->ip = ip;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
-                       ip += 3;
-                       if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
-                               addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
-                       else
-                               addr = (char*)(vt->vtable) + field->offset;
-
+                       MonoClassField *field = rtm->data_items [* (guint16 *)(ip + 1)];
+                       gpointer addr = mono_class_static_field_address (context->domain, field);
                        stackval_from_data (field->type, sp, addr, FALSE);
-                       ++sp;
-                       MINT_IN_BREAK;
-               }
-               MINT_IN_CASE(MINT_LDSFLD_I4) {
-                       MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
-                       MonoVTable *vt = rtm->data_items [*(guint16 *)(ip + 2)];
-                       if (!vt->initialized) {
-                               frame->ip = ip;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
-                       ip += 3;
-                       sp->data.i = * (gint32 *)((char*)(vt->vtable) + field->offset);
-                       ++sp;
-                       MINT_IN_BREAK;
-               }
-               MINT_IN_CASE(MINT_LDSFLD_O) {
-                       MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
-                       MonoVTable *vt = rtm->data_items [*(guint16 *)(ip + 2)];
-                       if (!vt->initialized) {
-                               frame->ip = ip;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
-                       ip += 3;
-                       sp->data.p = * (gpointer *)((char*)(vt->vtable) + field->offset);
+                       ip += 2;
                        ++sp;
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_LDSFLD_VT) {
-                       MonoVTable *vt;
-                       MonoClassField *field;
-                       guint32 token;
-                       gpointer addr;
-                       int size;
-
-                       token = * (guint16 *)(ip + 1);
-                       size = READ32(ip + 2);
-                       field = rtm->data_items[token];
+                       MonoClassField *field = rtm->data_items [* (guint16 *)(ip + 1)];
+                       gpointer addr = mono_class_static_field_address (context->domain, field);
+                       int size = READ32 (ip + 2);
                        ip += 4;
-                                               
-                       vt = mono_class_vtable (context->domain, field->parent);
-                       if (!vt->initialized) {
-                               frame->ip = ip - 2;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
-                       
-                       if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
-                               addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
-                       else
-                               addr = (char*)(vt->vtable) + field->offset;
 
                        sp->data.p = vt_sp;
                        vt_sp += (size + 7) & ~7;
@@ -3129,54 +3090,19 @@ array_constructed:
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_STSFLD) {
-                       MonoVTable *vt;
-                       MonoClassField *field;
-                       guint32 token;
-                       gpointer addr;
-
-                       token = * (guint16 *)(ip + 1);
-                       field = rtm->data_items[token];
+                       MonoClassField *field = rtm->data_items [* (guint16 *)(ip + 1)];
+                       gpointer addr = mono_class_static_field_address (context->domain, field);
                        ip += 2;
                        --sp;
-
-                       vt = mono_class_vtable (context->domain, field->parent);
-                       if (!vt->initialized) {
-                               frame->ip = ip - 2;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
-                       
-                       if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
-                               addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
-                       else
-                               addr = (char*)(vt->vtable) + field->offset;
-
                        stackval_to_data (field->type, sp, addr, FALSE);
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_STSFLD_VT) {
-                       MonoVTable *vt;
-                       MonoClassField *field;
-                       guint32 token;
-                       gpointer addr;
-                       int size;
-
-                       token = * (guint16 *)(ip + 1);
-                       size = READ32(ip + 2);
-                       field = rtm->data_items[token];
+                       MonoClassField *field = rtm->data_items [* (guint16 *)(ip + 1)];
+                       gpointer addr = mono_class_static_field_address (context->domain, field);
+                       int size = READ32 (ip + 2);
                        ip += 4;
-                                               
-                       vt = mono_class_vtable (context->domain, field->parent);
-                       if (!vt->initialized) {
-                               frame->ip = ip - 2;
-                               mono_runtime_class_init_full (vt, &error);
-                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-                       }
-                       
-                       if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
-                               addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
-                       else
-                               addr = (char*)(vt->vtable) + field->offset;
+
                        --sp;
                        stackval_to_data (field->type, sp, addr, FALSE);
                        vt_sp -= (size + 7) & ~7;
@@ -3232,23 +3158,24 @@ array_constructed:
                        sp [-1].data.i = (mono_u)sp [-1].data.l;
                        ++ip;
                        MINT_IN_BREAK;
-               MINT_IN_CASE(MINT_BOX)
+               MINT_IN_CASE(MINT_BOX) {
                        c = rtm->data_items [* (guint16 *)(ip + 1)];
+                       guint16 offset = * (guint16 *)(ip + 2);
 
                        if (c->byval_arg.type == MONO_TYPE_VALUETYPE && !c->enumtype) {
                                int size = mono_class_value_size (c, NULL);
-                               sp [-1].data.p = mono_value_box_checked (context->domain, c, sp [-1].data.p, &error);
+                               sp [-1 - offset].data.p = mono_value_box_checked (context->domain, c, sp [-1 - offset].data.p, &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                                size = (size + 7) & ~7;
                                vt_sp -= size;
-                       }                               
-                       else {
-                               stackval_to_data (&c->byval_arg, &sp [-1], (char*)&sp [-1], FALSE);
-                               sp [-1].data.p = mono_value_box_checked (context->domain, c, &sp [-1], &error);
+                       } else {
+                               stackval_to_data (&c->byval_arg, &sp [-1 - offset], (char *) &sp [-1 - offset], FALSE);
+                               sp [-1 - offset].data.p = mono_value_box_checked (context->domain, c, &sp [-1 - offset], &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
-                       ip += 2;
+                       ip += 3;
                        MINT_IN_BREAK;
+               }
                MINT_IN_CASE(MINT_NEWARR)
                        sp [-1].data.p = (MonoObject*) mono_array_new_checked (context->domain, rtm->data_items[*(guint16 *)(ip + 1)], sp [-1].data.i, &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
@@ -3322,7 +3249,8 @@ array_constructed:
                MINT_IN_CASE(MINT_LDELEM_I)  /* fall through */
                MINT_IN_CASE(MINT_LDELEM_R4) /* fall through */
                MINT_IN_CASE(MINT_LDELEM_R8) /* fall through */
-               MINT_IN_CASE(MINT_LDELEM_REF) {
+               MINT_IN_CASE(MINT_LDELEM_REF) /* fall through */
+               MINT_IN_CASE(MINT_LDELEM_VT) {
                        MonoArray *o;
                        mono_u aindex;
 
@@ -3373,6 +3301,16 @@ array_constructed:
                        case MINT_LDELEM_REF:
                                sp [0].data.p = mono_array_get (o, gpointer, aindex);
                                break;
+                       case MINT_LDELEM_VT: {
+                               MonoClass *klass_vt = rtm->data_items [*(guint16 *) (ip + 1)];
+                               i32 = READ32 (ip + 2);
+                               char *src_addr = mono_array_addr_with_size ((MonoArray *) o, i32, aindex);
+                               sp [0].data.vt = vt_sp;
+                               stackval_from_data (&klass_vt->byval_arg, sp, src_addr, FALSE);
+                               vt_sp += (i32 + 7) & ~7;
+                               ip += 3;
+                               break;
+                       }
                        default:
                                ves_abort();
                        }
@@ -3388,7 +3326,8 @@ array_constructed:
                MINT_IN_CASE(MINT_STELEM_I8) /* fall through */
                MINT_IN_CASE(MINT_STELEM_R4) /* fall through */
                MINT_IN_CASE(MINT_STELEM_R8) /* fall through */
-               MINT_IN_CASE(MINT_STELEM_REF) {
+               MINT_IN_CASE(MINT_STELEM_REF) /* fall through */
+               MINT_IN_CASE(MINT_STELEM_VT) {
                        mono_u aindex;
 
                        sp -= 3;
@@ -3429,7 +3368,18 @@ array_constructed:
                                if (sp [2].data.p && !isinst_obj)
                                        THROW_EX (mono_get_exception_array_type_mismatch (), ip);
                                mono_array_set ((MonoArray *)o, gpointer, aindex, sp [2].data.p);
-                       } break;
+                               break;
+                       }
+                       case MINT_STELEM_VT: {
+                               MonoClass *klass_vt = rtm->data_items [*(guint16 *) (ip + 1)];
+                               i32 = READ32 (ip + 2);
+                               char *dst_addr = mono_array_addr_with_size ((MonoArray *) o, i32, aindex);
+
+                               stackval_to_data (&klass_vt->byval_arg, &sp [2], dst_addr, FALSE);
+                               vt_sp -= (i32 + 7) & ~7;
+                               ip += 3;
+                               break;
+                       }
                        default:
                                ves_abort();
                        }
@@ -4435,6 +4385,7 @@ interp_regression_step (MonoImage *image, int verbose, int *total_run, int *tota
 
        g_timer_start (timer);
        for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+               MonoObject *exc = NULL;
                MonoError error;
                MonoMethod *method = mono_get_method_checked (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL, NULL, &error);
                if (!method) {
@@ -4457,14 +4408,43 @@ interp_regression_step (MonoImage *image, int verbose, int *total_run, int *tota
                        } else {
                                filter = strcmp (method->name, name) == 0;
                        }
-               } else { // no filter
+               } else { /* no filter, check for `Category' attribute on method */
                        filter = TRUE;
+                       MonoCustomAttrInfo* ainfo = mono_custom_attrs_from_method_checked (method, &error);
+                       mono_error_cleanup (&error);
+
+                       if (ainfo) {
+                               int j;
+                               for (j = 0; j < ainfo->num_attrs && filter; ++j) {
+                                       MonoCustomAttrEntry *centry = &ainfo->attrs [j];
+                                       if (centry->ctor == NULL)
+                                               continue;
+
+                                       MonoClass *klass = centry->ctor->klass;
+                                       if (strcmp (klass->name, "CategoryAttribute"))
+                                               continue;
+
+                                       MonoObject *obj = mono_custom_attrs_get_attr_checked (ainfo, klass, &error);
+                                       /* FIXME: there is an ordering problem if there're multiple attributes, do this instead:
+                                        * MonoObject *obj = create_custom_attr (ainfo->image, centry->ctor, centry->data, centry->data_size, &error); */
+                                       mono_error_cleanup (&error);
+                                       MonoMethod *getter = mono_class_get_method_from_name (klass, "get_Category", -1);
+                                       MonoObject *str = mono_interp_runtime_invoke (getter, obj, NULL, &exc, &error);
+                                       mono_error_cleanup (&error);
+                                       char *utf8_str = mono_string_to_utf8_checked ((MonoString *) str, &error);
+                                       mono_error_cleanup (&error);
+                                       if (!strcmp (utf8_str, "!INTERPRETER")) {
+                                               g_print ("skip %s...\n", method->name);
+                                               filter = FALSE;
+                                       }
+                               }
+                       }
                }
                if (strncmp (method->name, "test_", 5) == 0 && filter) {
                        MonoError interp_error;
                        MonoObject *exc = NULL;
 
-                       result_obj = interp_mono_runtime_invoke (method, NULL, NULL, &exc, &interp_error);
+                       result_obj = mono_interp_runtime_invoke (method, NULL, NULL, &exc, &interp_error);
                        if (!mono_error_ok (&interp_error)) {
                                cfailed++;
                                g_print ("Test '%s' execution failed.\n", method->name);
@@ -4528,7 +4508,7 @@ interp_regression (MonoImage *image, int verbose, int *total_run)
 }
 
 int
-interp_regression_list (int verbose, int count, char *images [])
+mono_interp_regression_list (int verbose, int count, char *images [])
 {
        int i, total, total_run, run;
        
index e818af53e01c8670bf70371f33f7a3e413b0bf70..8c75b945b3fed0f1ad9a8acd974685d44a1d9186 100644 (file)
-#include <setjmp.h>
-#include <glib.h>
-#include <mono/metadata/loader.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/domain-internals.h>
-#include <mono/metadata/class-internals.h>
-#include "config.h"
-
-enum {
-       VAL_I32     = 0,
-       VAL_DOUBLE  = 1,
-       VAL_I64     = 2,
-       VAL_VALUET  = 3,
-       VAL_POINTER = 4,
-       VAL_NATI    = 0 + VAL_POINTER,
-       VAL_MP      = 1 + VAL_POINTER,
-       VAL_TP      = 2 + VAL_POINTER,
-       VAL_OBJ     = 3 + VAL_POINTER
-};
-
-#if SIZEOF_VOID_P == 4
-typedef guint32 mono_u;
-typedef gint32  mono_i;
-#elif SIZEOF_VOID_P == 8
-typedef guint64 mono_u;
-typedef gint64  mono_i;
-#endif
-
-/*
- * Value types are represented on the eval stack as pointers to the
- * actual storage. The size field tells how much storage is allocated.
- * A value type can't be larger than 16 MB.
- */
-typedef struct {
-       union {
-               gint32 i;
-               gint64 l;
-               double f;
-               /* native size integer and pointer types */
-               gpointer p;
-               mono_u nati;
-               gpointer vt;
-       } data;
-#if defined(__ppc__) || defined(__powerpc__)
-       int pad;
-#endif
-} stackval;
-
-typedef struct _MonoInvocation MonoInvocation;
-
-typedef void (*MonoFuncV) (void);
-typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
-
-/* 
- * Structure representing a method transformed for the interpreter 
- * This is domain specific
- */
-typedef struct _RuntimeMethod
-{
-       /* NOTE: These first two elements (method and
-          next_jit_code_hash) must be in the same order and at the
-          same offset as in MonoJitInfo, because of the jit_code_hash
-          internal hash table in MonoDomain. */
-       MonoMethod *method;
-       struct _RuntimeMethod *next_jit_code_hash;
-       guint32 locals_size;
-       guint32 args_size;
-       guint32 stack_size;
-       guint32 vt_stack_size;
-       guint32 alloca_size;
-       unsigned short *code;
-       unsigned short *new_body_start; /* after all STINARG instrs */
-       MonoPIFunc func;
-       int num_clauses;
-       MonoExceptionClause *clauses;
-       void **data_items;
-       int transformed;
-       guint32 *arg_offsets;
-       guint32 *local_offsets;
-       unsigned int param_count;
-       unsigned int hasthis;
-       unsigned int valuetype;
-} RuntimeMethod;
-
-struct _MonoInvocation {
-       MonoInvocation *parent; /* parent */
-       RuntimeMethod  *runtime_method; /* parent */
-       MonoMethod     *method; /* parent */
-       stackval       *retval; /* parent */
-       char           *args;
-       stackval       *stack_args; /* parent */
-       stackval       *stack;
-       stackval       *sp; /* For GC stack marking */
-       /* exception info */
-       unsigned char  invoke_trap;
-       const unsigned short  *ip;
-       MonoException     *ex;
-       MonoExceptionClause *ex_handler;
-};
-
-typedef struct {
-       MonoDomain *domain;
-       MonoInvocation *base_frame;
-       MonoInvocation *current_frame;
-       MonoInvocation *env_frame;
-       jmp_buf *current_env;
-       unsigned char search_for_handler;
-       unsigned char managed_code;
-} ThreadContext;
-
-void mono_init_icall (void);
-
-MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
-
-MonoDelegate*
-mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
+#ifndef __MONO_MINI_INTERPRETER_H__
+#define __MONO_MINI_INTERPRETER_H__
+#include <mono/mini/mini.h>
 
 int
-interp_regression_list (int verbose, int count, char *images []);
+mono_interp_regression_list (int verbose, int count, char *images []);
 
 void
-mono_interp_transform_init (void);
-
-static void inline stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke);
-static void inline stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke);
-void ves_exec_method (MonoInvocation *frame);
-
-/*
- * defined in an arch specific file.
- */
-MonoPIFunc
-mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor);
+mono_interp_init (void);
 
-RuntimeMethod *
-mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error);
+gpointer
+mono_interp_create_method_pointer (MonoMethod *method, MonoError *error);
 
-void *mono_arch_create_method_pointer (MonoMethod *method);
+MonoObject*
+mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error);
 
-extern int mono_interp_traceopt;
+#endif /* __MONO_MINI_INTERPRETER_H__ */
index 7ce21566f40e8dc1b3fdcf4af84286fd7d660076..a9ed29f4ae39681b912dda78c0c5d5e2a40c240f 100644 (file)
@@ -110,9 +110,7 @@ OPDEF(MINT_STFLD_VT, "stfld.vt", 4, MintOpShortAndInt)
 OPDEF(MINT_STRMFLD, "strmfld", 2, MintOpFieldToken)
 OPDEF(MINT_STRMFLD_VT, "strmfld.vt", 4, MintOpShortAndInt)
 
-OPDEF(MINT_LDSFLD, "ldsfld", 3, MintOpTwoShorts)
-OPDEF(MINT_LDSFLD_I4, "ldsfld.i4", 3, MintOpTwoShorts)
-OPDEF(MINT_LDSFLD_O, "ldsfld.o", 3, MintOpTwoShorts)
+OPDEF(MINT_LDSFLD, "ldsfld", 2, MintOpFieldToken)
 OPDEF(MINT_LDSFLD_VT, "ldsfld.vt", 4, MintOpShortAndInt)
 OPDEF(MINT_STSFLD, "stsfld", 2, MintOpUShortInt)
 OPDEF(MINT_STSFLD_VT, "stsfld.vt", 4, MintOpShortAndInt)
@@ -154,7 +152,7 @@ OPDEF(MINT_LDIND_U2, "ldind.u2", 1, MintOpNoArgs)
 OPDEF(MINT_LDIND_I4, "ldind.i4", 1, MintOpNoArgs)
 OPDEF(MINT_LDIND_U4, "ldind.u4", 1, MintOpNoArgs)
 OPDEF(MINT_LDIND_I8, "ldind.i8", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_I, "ldind.i", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_I, "ldind.i", 2, MintOpUShortInt)
 OPDEF(MINT_LDIND_R4, "ldind.r4", 1, MintOpNoArgs)
 OPDEF(MINT_LDIND_R8, "ldind.r8", 1, MintOpNoArgs)
 OPDEF(MINT_LDIND_REF, "ldind.ref", 1, MintOpNoArgs)
@@ -273,7 +271,7 @@ OPDEF(MINT_INITOBJ, "initobj", 3, MintOpInt)
 OPDEF(MINT_CASTCLASS, "castclass", 2, MintOpClassToken) 
 OPDEF(MINT_ISINST, "isinst", 2, MintOpClassToken) 
 OPDEF(MINT_NEWARR, "newarr", 2, MintOpClassToken) 
-OPDEF(MINT_BOX, "box", 2, MintOpClassToken) 
+OPDEF(MINT_BOX, "box", 3, MintOpTwoShorts)
 OPDEF(MINT_UNBOX, "unbox", 2, MintOpClassToken) 
 OPDEF(MINT_LDTOKEN, "ldtoken", 2, MintOpClassToken) /* not really */
 OPDEF(MINT_LDFTN, "ldftn", 2, MintOpMethodToken) 
@@ -297,6 +295,7 @@ OPDEF(MINT_LDELEM_I8, "ldelem.i8", 1, MintOpNoArgs)
 OPDEF(MINT_LDELEM_R4, "ldelem.r4", 1, MintOpNoArgs)
 OPDEF(MINT_LDELEM_R8, "ldelem.r8", 1, MintOpNoArgs)
 OPDEF(MINT_LDELEM_REF, "ldelem.ref", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_VT, "ldelem.vt", 4, MintOpShortAndInt)
 
 OPDEF(MINT_LDELEMA, "ldelema", 2, MintOpClassToken)
 
@@ -308,6 +307,7 @@ OPDEF(MINT_STELEM_I8, "stelem.i8", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_R4, "stelem.r4", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_R8, "stelem.r8", 1, MintOpNoArgs)
 OPDEF(MINT_STELEM_REF, "stelem.ref", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_VT, "stelem.vt", 4, MintOpShortAndInt)
 
 OPDEF(MINT_LDLEN, "ldlen", 1, MintOpNoArgs)
 
index d1257274ef2aa300b75a70cf18e60777819c1f22..149b45278501a1c8431a2004038564f7dc895383 100644 (file)
@@ -18,6 +18,7 @@
 #include <mono/mini/mini.h>
 
 #include "mintops.h"
+#include "interp-internals.h"
 #include "interp.h"
 
 // TODO: export from marshal.c
@@ -464,10 +465,17 @@ load_arg(TransformData *td, int n)
                        WRITE32 (td, &size);
                }
        } else {
-               ADD_CODE(td, MINT_LDARG_I1 + (mt - MINT_TYPE_I1));
-               ADD_CODE(td, td->rtm->arg_offsets [n]); /* FIX for large offset */
-               if (mt == MINT_TYPE_O)
-                       klass = mono_class_from_mono_type (type);
+               if (hasthis && n == 0) {
+                       mt = MINT_TYPE_P;
+                       ADD_CODE (td, MINT_LDARG_P);
+                       ADD_CODE (td, td->rtm->arg_offsets [n]); /* FIX for large offset */
+                       klass = NULL;
+               } else {
+                       ADD_CODE(td, MINT_LDARG_I1 + (mt - MINT_TYPE_I1));
+                       ADD_CODE(td, td->rtm->arg_offsets [n]); /* FIX for large offset */
+                       if (mt == MINT_TYPE_O)
+                               klass = mono_class_from_mono_type (type);
+               }
        }
        PUSH_TYPE(td, stack_type[mt], klass);
 }
@@ -516,12 +524,12 @@ store_inarg(TransformData *td, int n)
                type = mono_method_signature (td->method)->params [n - !!hasthis];
 
        int mt = mint_type (type);
+       if (hasthis && n == 0) {
+               ADD_CODE (td, MINT_STINARG_P);
+               ADD_CODE (td, n);
+               return;
+       }
        if (mt == MINT_TYPE_VT) {
-               if (hasthis && n == 0) {
-                       ADD_CODE (td, MINT_STINARG_P);
-                       ADD_CODE (td, n);
-                       return;
-               }
                MonoClass *klass = mono_class_from_mono_type (type);
                gint32 size;
                if (mono_method_signature (td->method)->pinvoke)
@@ -628,7 +636,7 @@ get_data_item_index (TransformData *td, void *ptr)
 }
 
 static void
-interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target_method, MonoDomain *domain, MonoGenericContext *generic_context, unsigned char *is_bb_start, int body_start_offset)
+interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target_method, MonoDomain *domain, MonoGenericContext *generic_context, unsigned char *is_bb_start, int body_start_offset, MonoClass *constrained_class)
 {
        MonoImage *image = method->klass->image;
        MonoMethodSignature *csignature;
@@ -678,6 +686,46 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
                csignature = mono_method_signature (target_method);
        }
 
+       if (constrained_class) {
+               if (constrained_class->enumtype && !strcmp (target_method->name, "GetHashCode")) {
+                       /* Use the corresponding method from the base type to avoid boxing */
+                       MonoType *base_type = mono_class_enum_basetype (constrained_class);
+                       g_assert (base_type);
+                       constrained_class = mono_class_from_mono_type (base_type);
+                       target_method = mono_class_get_method_from_name (constrained_class, target_method->name, 0);
+                       g_assert (target_method);
+               }
+       }
+
+       if (constrained_class) {
+               mono_class_setup_vtable (constrained_class);
+#if DEBUG_INTERP
+               g_print ("CONSTRAINED.CALLVIRT: %s::%s.  %s (%p) ->\n", target_method->klass->name, target_method->name, mono_signature_full_name (target_method->signature), target_method);
+#endif
+               target_method = mono_get_method_constrained_with_method (image, target_method, constrained_class, generic_context, &error);
+#if DEBUG_INTERP
+               g_print ("                    : %s::%s.  %s (%p)\n", target_method->klass->name, target_method->name, mono_signature_full_name (target_method->signature), target_method);
+#endif
+               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+               mono_class_setup_vtable (target_method->klass);
+
+               if (constrained_class->valuetype && (target_method->klass == mono_defaults.object_class || target_method->klass == mono_defaults.enum_class->parent || target_method->klass == mono_defaults.enum_class)) {
+                       ADD_CODE (td, MINT_BOX);
+                       ADD_CODE (td, get_data_item_index (td, constrained_class));
+                       ADD_CODE (td, csignature->param_count);
+               } else if (!constrained_class->valuetype) {
+                       /* managed pointer on the stack, we need to deref that puppy */
+                       ADD_CODE (td, MINT_LDIND_I);
+                       ADD_CODE (td, csignature->param_count);
+               } else {
+                       g_assert (target_method->klass->valuetype);
+                       virtual = FALSE;
+               }
+       }
+
+       if (target_method)
+               mono_class_init (target_method->klass);
+
        CHECK_STACK (td, csignature->param_count + csignature->hasthis);
        if (!calli && (!virtual || (target_method->flags & METHOD_ATTRIBUTE_VIRTUAL) == 0) &&
                (target_method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 && 
@@ -796,6 +844,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
        MonoImage *image = method->klass->image;
        MonoDomain *domain = mono_domain_get ();
        MonoGenericContext *generic_context = NULL;
+       MonoClass *constrained_class = NULL;
        MonoError error;
        int offset, mt;
        int i;
@@ -981,6 +1030,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                        td.ip += 2;
                        break;
                case CEE_LDARGA_S: {
+                       /* NOTE: n includes this */
                        int n = ((guint8 *)td.ip)[1];
                        if (n == 0 && signature->hasthis) {
                                g_error ("LDTHISA: NOPE");
@@ -988,7 +1038,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                        }
                        else {
                                ADD_CODE(&td, MINT_LDARGA);
-                               ADD_CODE(&td, td.rtm->arg_offsets [n - signature->hasthis]);
+                               ADD_CODE(&td, td.rtm->arg_offsets [n]);
                        }
                        PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
                        td.ip += 2;
@@ -1131,7 +1181,8 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                case CEE_CALLVIRT: /* Fall through */
                case CEE_CALLI:    /* Fall through */
                case CEE_CALL: {
-                       interp_transform_call (&td, method, NULL, domain, generic_context, is_bb_start, body_start_offset);
+                       interp_transform_call (&td, method, NULL, domain, generic_context, is_bb_start, body_start_offset, constrained_class);
+                       constrained_class = NULL;
                        break;
                }
                case CEE_RET: {
@@ -1333,6 +1384,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                case CEE_LDIND_I:
                        CHECK_STACK (&td, 1);
                        SIMPLE_OP (td, MINT_LDIND_I);
+                       ADD_CODE (&td, 0);
                        SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
                        break;
                case CEE_LDIND_R4:
@@ -1857,7 +1909,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                        } else if (mono_class_is_nullable (klass)) {
                                MonoMethod *target_method = mono_class_get_method_from_name (klass, "Unbox", 1);
                                /* td.ip is incremented by interp_transform_call */
-                               interp_transform_call (&td, method, target_method, domain, generic_context, is_bb_start, body_start_offset);
+                               interp_transform_call (&td, method, target_method, domain, generic_context, is_bb_start, body_start_offset, NULL);
                        } else {
                                int mt = mint_type (&klass->byval_arg);
                                ADD_CODE (&td, MINT_UNBOX);
@@ -1912,6 +1964,9 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                                int size = mono_class_value_size (klass, NULL);
                                size = (size + 7) & ~7;
                                td.vt_sp -= size;
+                               ADD_CODE (&td, MINT_VTRESULT);
+                               ADD_CODE (&td, 0);
+                               WRITE32 (&td, &size);
                        }
                        td.ip += 5;
                        SET_TYPE(td.sp - 1, stack_type [mt], field_klass);
@@ -1955,21 +2010,14 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                        ADD_CODE(&td, get_data_item_index (&td, field));
                        klass = NULL;
                        if (mt == MINT_TYPE_VT) {
-                               g_error ("data.klass");
-                               int size = mono_class_value_size (field->type->data.klass, NULL);
+                               MonoClass *klass = mono_class_from_mono_type (field->type);
+                               int size = mono_class_value_size (klass, NULL);
                                PUSH_VT(&td, size);
                                WRITE32(&td, &size);
                                klass = field->type->data.klass;
                        } else {
                                if (mt == MINT_TYPE_O) 
                                        klass = mono_class_from_mono_type (field->type);
-                               if (!domain->special_static_fields || !g_hash_table_lookup (domain->special_static_fields, field)) {
-                                       if (mt == MINT_TYPE_O)
-                                               td.new_ip [-2] = MINT_LDSFLD_O;
-                                       else if (mt == MINT_TYPE_I4)
-                                               td.new_ip [-2] = MINT_LDSFLD_I4;
-                               }
-                               ADD_CODE(&td, get_data_item_index (&td, mono_class_vtable (domain, field->parent)));
                        }
                        td.ip += 5;
                        PUSH_TYPE(&td, stack_type [mt], klass);
@@ -1982,10 +2030,10 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                        ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
                        ADD_CODE(&td, get_data_item_index (&td, field));
                        if (mt == MINT_TYPE_VT) {
-                               g_error ("data.klass");
-                               int size = mono_class_value_size (field->type->data.klass, NULL);
-                               POP_VT(&td, size);
-                               WRITE32(&td, &size);
+                               MonoClass *klass = mono_class_from_mono_type (field->type);
+                               int size = mono_class_value_size (klass, NULL);
+                               POP_VT (&td, size);
+                               WRITE32 (&td, &size);
                        }
                        td.ip += 5;
                        --td.sp;
@@ -2061,20 +2109,23 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                                klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
                        else
                                klass = mono_class_get_full (image, token, generic_context);
-                       g_assert (klass->valuetype);
 
                        if (mono_class_is_nullable (klass)) {
                                MonoMethod *target_method = mono_class_get_method_from_name (klass, "Box", 1);
                                /* td.ip is incremented by interp_transform_call */
-                               interp_transform_call (&td, method, target_method, domain, generic_context, is_bb_start, body_start_offset);
+                               interp_transform_call (&td, method, target_method, domain, generic_context, is_bb_start, body_start_offset, NULL);
+                       } else if (!klass->valuetype) {
+                               /* already boxed, do nothing. */
+                               td.ip += 5;
                        } else {
-                               if (klass->byval_arg.type == MONO_TYPE_VALUETYPE && !klass->enumtype) {
+                               if (mint_type (&klass->byval_arg) == MINT_TYPE_VT && !klass->enumtype) {
                                        size = mono_class_value_size (klass, NULL);
                                        size = (size + 7) & ~7;
                                        td.vt_sp -= size;
                                }
                                ADD_CODE(&td, MINT_BOX);
                                ADD_CODE(&td, get_data_item_index (&td, klass));
+                               ADD_CODE (&td, 0);
                                SET_TYPE(td.sp - 1, STACK_TYPE_O, klass);
                                td.ip += 5;
                        }
@@ -2204,6 +2255,17 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                                        --td.sp;
                                        SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
                                        break;
+                               case MINT_TYPE_VT: {
+                                       int size = mono_class_value_size (klass, NULL);
+                                       ENSURE_I4 (&td, 1);
+                                       SIMPLE_OP (td, MINT_LDELEM_VT);
+                                       ADD_CODE (&td, get_data_item_index (&td, klass));
+                                       WRITE32 (&td, &size);
+                                       --td.sp;
+                                       SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_VT);
+                                       PUSH_VT (&td, size);
+                                       break;
+                               }
                                default: {
                                        GString *res = g_string_new ("");
                                        mono_type_get_desc (res, &klass->byval_arg, TRUE);
@@ -2272,6 +2334,17 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                                case MINT_TYPE_I4:
                                        SIMPLE_OP (td, MINT_STELEM_I4);
                                        break;
+                               case MINT_TYPE_O:
+                                       SIMPLE_OP (td, MINT_STELEM_REF);
+                                       break;
+                               case MINT_TYPE_VT: {
+                                       int size = mono_class_value_size (klass, NULL);
+                                       SIMPLE_OP (td, MINT_STELEM_VT);
+                                       ADD_CODE (&td, get_data_item_index (&td, klass));
+                                       WRITE32 (&td, &size);
+                                       POP_VT (&td, size);
+                                       break;
+                               }
                                default: {
                                        GString *res = g_string_new ("");
                                        mono_type_get_desc (res, &klass->byval_arg, TRUE);
@@ -2521,7 +2594,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                        switch (*td.ip) {
                                case CEE_MONO_CALLI_EXTRA_ARG:
                                        /* Same as CEE_CALLI, llvm specific */
-                                       interp_transform_call (&td, method, NULL, domain, generic_context, is_bb_start, body_start_offset);
+                                       interp_transform_call (&td, method, NULL, domain, generic_context, is_bb_start, body_start_offset, NULL);
                                        break;
                                case CEE_MONO_ICALL: {
                                        guint32 token;
@@ -2765,7 +2838,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                                }
                                else {
                                        ADD_CODE(&td, MINT_LDARGA);
-                                       ADD_CODE(&td, td.rtm->arg_offsets [n - signature->hasthis]); /* FIX for large offsets */
+                                       ADD_CODE(&td, td.rtm->arg_offsets [n]); /* FIX for large offsets */
                                }
                                PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
                                td.ip += 3;
@@ -2834,16 +2907,12 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
                                td.sp -= 3;
                                ++td.ip;
                                break;
-#if 0
-                       case CEE_CONSTRAINED_: {
-                               guint32 token;
-                               /* FIXME: implement */
-                               ++ip;
-                               token = read32 (ip);
-                               ip += 4;
+                       case CEE_CONSTRAINED_:
+                               token = read32 (td.ip + 1);
+                               constrained_class = mono_class_get_full (image, token, generic_context);
+                               mono_class_init (constrained_class);
+                               td.ip += 5;
                                break;
-                       }
-#endif
                        case CEE_INITBLK:
                                CHECK_STACK(&td, 3);
                                ADD_CODE(&td, MINT_INITBLK);
index 7130aeab31cbb9ad51711ab2fc60287547ae1ca1..765d3096a1cd2707f02b2d45e89bb1b2a75f8943 100644 (file)
@@ -1332,7 +1332,7 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
        MonoMethod *m;
        int vt_slot, iface_offset;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (mono_class_is_interface (klass)) {
                MonoObject *this_obj;
@@ -1504,7 +1504,7 @@ resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method,
        gpointer addr, compiled_method, aot_addr;
        gboolean need_rgctx_tramp = FALSE, need_unbox_tramp = FALSE;
 
-       mono_error_init (error);
+       error_init (error);
        if (!this_obj)
                /* The caller will handle it */
                return NULL;
@@ -1588,7 +1588,7 @@ resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_a
        gpointer addr, compiled_method;
        gboolean need_unbox_tramp = FALSE;
 
-       mono_error_init (error);
+       error_init (error);
        /* Same as in common_call_trampoline () */
 
        /* Avoid loading metadata or creating a generic vtable if possible */
@@ -1915,7 +1915,7 @@ mono_throw_method_access (MonoMethod *callee, MonoMethod *caller)
        char *caller_name = mono_method_full_name (caller, 1);
        MonoError error;
 
-       mono_error_init (&error);
+       error_init (&error);
        mono_error_set_generic_error (&error, "System", "MethodAccessException", "Method `%s' is inaccessible from method `%s'\n", callee_name, caller_name);
        mono_error_set_pending_exception (&error);
        g_free (callee_name);
index c1fcd8c4593777884eb367a4328344cf55c1765b..5982e0c200851a771b00e243d5a71586c450c074 100644 (file)
@@ -4455,7 +4455,7 @@ handle_constrained_gsharedvt_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMe
         * pack the arguments into an array, and do the rest of the work in in an icall.
         */
        if (((cmethod->klass == mono_defaults.object_class) || mono_class_is_interface (cmethod->klass) || (!cmethod->klass->valuetype && cmethod->klass->image != mono_defaults.corlib)) &&
-               (MONO_TYPE_IS_VOID (fsig->ret) || MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_IS_REFERENCE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret) || mini_is_gsharedvt_type (fsig->ret)) &&
+               (MONO_TYPE_IS_VOID (fsig->ret) || MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_IS_REFERENCE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret) || mono_class_is_enum (mono_class_from_mono_type (fsig->ret)) || mini_is_gsharedvt_type (fsig->ret)) &&
                (fsig->param_count == 0 || (!fsig->hasthis && fsig->param_count == 1) || (fsig->param_count == 1 && (MONO_TYPE_IS_REFERENCE (fsig->params [0]) || fsig->params [0]->byref || mini_is_gsharedvt_type (fsig->params [0]))))) {
                MonoInst *args [16];
 
@@ -4507,7 +4507,7 @@ handle_constrained_gsharedvt_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMe
 
                if (mini_is_gsharedvt_type (fsig->ret)) {
                        ins = handle_unbox_gsharedvt (cfg, mono_class_from_mono_type (fsig->ret), ins);
-               } else if (MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret)) {
+               } else if (MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret) || mono_class_is_enum (mono_class_from_mono_type (fsig->ret))) {
                        MonoInst *add;
 
                        /* Unbox */
@@ -6713,7 +6713,7 @@ mini_get_method_allow_open (MonoMethod *m, guint32 token, MonoClass *klass, Mono
 {
        MonoMethod *method;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (m->wrapper_type != MONO_WRAPPER_NONE) {
                method = (MonoMethod *)mono_method_get_wrapper_data (m, token);
@@ -6770,7 +6770,7 @@ mini_get_signature (MonoMethod *method, guint32 token, MonoGenericContext *conte
 {
        MonoMethodSignature *fsig;
 
-       mono_error_init (error);
+       error_init (error);
        if (method->wrapper_type != MONO_WRAPPER_NONE) {
                fsig = (MonoMethodSignature *)mono_method_get_wrapper_data (method, token);
        } else {
@@ -11590,7 +11590,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                        tclass, MONO_RGCTX_INFO_REFLECTION_TYPE);
                                        } else if (cfg->compile_aot) {
                                                if (method->wrapper_type) {
-                                                       mono_error_init (&error); //got to do it since there are multiple conditionals below
+                                                       error_init (&error); //got to do it since there are multiple conditionals below
                                                        if (mono_class_get_checked (tclass->image, tclass->type_token, &error) == tclass && !generic_context) {
                                                                /* Special case for static synchronized wrappers */
                                                                EMIT_NEW_TYPE_FROM_HANDLE_CONST (cfg, ins, tclass->image, tclass->type_token, generic_context);
index 42715480b0005e5969b924da1773fd3b46488759..f85644d42ca6d5446732a7427bb27e48b48d9177 100644 (file)
@@ -1515,6 +1515,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
                        nwords = (align_size + sizeof (gpointer) -1 ) / sizeof (gpointer);
                        ainfo->storage = RegTypeStructByVal;
                        ainfo->struct_size = size;
+                       ainfo->align = align;
                        /* FIXME: align stack_size if needed */
                        if (eabi_supported) {
                                if (align >= 8 && (gr & 1))
@@ -2166,7 +2167,16 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
                        break;
                case RegTypeStructByVal:
                        lainfo->storage = LLVMArgAsIArgs;
-                       lainfo->nslots = ainfo->struct_size / sizeof (gpointer);
+                       if (eabi_supported && ainfo->align == 8) {
+                               /* LLVM models this by passing an int64 array */
+                               lainfo->nslots = ALIGN_TO (ainfo->struct_size, 8) / 8;
+                               lainfo->esize = 8;
+                       } else {
+                               lainfo->nslots = ainfo->struct_size / sizeof (gpointer);
+                               lainfo->esize = 4;
+                       }
+
+                       printf ("D: %d\n", ainfo->align);
                        break;
                case RegTypeStructByAddr:
                case RegTypeStructByAddrOnStack:
index 28678638b6c0e46c3592214e34b8093e399f4d39..31194f2e60d596b17facb97b744e482f3abb3864 100644 (file)
@@ -208,7 +208,7 @@ typedef struct {
        guint8  reg;
        ArgStorage  storage;
        /* RegTypeStructByVal */
-       gint32  struct_size;
+       gint32  struct_size, align;
        guint8  size    : 4; /* 1, 2, 4, 8, or regs used by RegTypeStructByVal */
 } ArgInfo;
 
index c390ee9ea6cae9ccd31f5ebf2f3a2e1e5075838b..e130eb59411d6d759ca059e13d4fff1c39a03365 100644 (file)
@@ -1375,7 +1375,7 @@ wrap_non_exception_throws (MonoMethod *m)
 static MonoArray*
 build_native_trace (MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 /* This puppy only makes sense on mobile, IOW, ARM. */
 #if defined (HAVE_BACKTRACE_SYMBOLS) && defined (TARGET_ARM)
        MonoArray *res;
@@ -1589,18 +1589,9 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, MonoObject *obj, gi
                                        ex_obj = obj;
 
                                if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
-                                       gboolean is_user_frame = method->wrapper_type == MONO_WRAPPER_NONE || method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD;
 #ifndef DISABLE_PERFCOUNTERS
                                        mono_perfcounters->exceptions_filters++;
 #endif
-                                       /*
-                                       Here's the thing, if this is a filter clause done by a wrapper like runtime invoke, we don't want to
-                                       trim the stackframe since if it returns FALSE we lose information.
-
-                                       FIXME Not 100% sure if it's a good idea even with user clauses.
-                                       */
-                                       if (is_user_frame)
-                                               setup_stack_trace (mono_ex, dynamic_methods, &trace_ips);
 
 #ifndef MONO_CROSS_COMPILE
 #ifdef MONO_CONTEXT_SET_LLVM_EXC_REG
@@ -1637,8 +1628,7 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, MonoObject *obj, gi
                                        filter_idx ++;
 
                                        if (filtered) {
-                                               if (!is_user_frame)
-                                                       setup_stack_trace (mono_ex, dynamic_methods, &trace_ips);
+                                               setup_stack_trace (mono_ex, dynamic_methods, &trace_ips);
                                                g_slist_free (dynamic_methods);
                                                /* mono_debugger_agent_handle_exception () needs this */
                                                mini_set_abort_threshold (ctx);
@@ -1648,7 +1638,7 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, MonoObject *obj, gi
                                }
 
                                MonoError isinst_error;
-                               mono_error_init (&isinst_error);
+                               error_init (&isinst_error);
                                if (ei->flags == MONO_EXCEPTION_CLAUSE_NONE && mono_object_isinst_checked (ex_obj, catch_class, &error)) {
                                        setup_stack_trace (mono_ex, dynamic_methods, &trace_ips);
                                        g_slist_free (dynamic_methods);
@@ -1956,7 +1946,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
                                        filter_idx ++;
                                }
 
-                               mono_error_init (&error);
+                               error_init (&error);
                                if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE && 
                                     mono_object_isinst_checked (ex_obj, catch_class, &error)) || filtered) {
                                        /*
@@ -2482,7 +2472,7 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
        if (handling_sigsegv && is_sigsegv)
                return;
 
-       if (mini_get_debug_options ()->suspend_on_sigsegv && is_sigsegv) {
+       if (mini_get_debug_options ()->suspend_on_native_crash) {
                mono_runtime_printf_err ("Received %s, suspending...", signal);
 #ifdef HOST_WIN32
                while (1)
index e29b80e2e30438dd1a0858ebe132864ce5ce008c..65ce24f3afc7bfbbf421b5676ae57c35cb9b48f4 100644 (file)
@@ -870,7 +870,7 @@ class_get_rgctx_template_oti (MonoClass *klass, int type_argc, guint32 slot, gbo
 static gpointer
 class_type_info (MonoDomain *domain, MonoClass *klass, MonoRgctxInfoType info_type, MonoError *error)
 {
-       mono_error_init (error);
+       error_init (error);
 
        switch (info_type) {
        case MONO_RGCTX_INFO_STATIC_DATA: {
@@ -1538,7 +1538,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
        gpointer data;
        gboolean temporary;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (!oti->data)
                return NULL;
@@ -2320,7 +2320,7 @@ fill_runtime_generic_context (MonoVTable *class_vtable, MonoRuntimeGenericContex
        int rgctx_index;
        gboolean do_free;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (rgctx);
 
@@ -2408,7 +2408,7 @@ mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot,
        MonoRuntimeGenericContext *rgctx;
        gpointer info;
 
-       mono_error_init (error);
+       error_init (error);
 
        mono_domain_lock (domain);
 
index 0e06bf13f89e66c30c8abced81def1968d00d386..e60d80a4ff2dfddda2329ed7005509e5c58b3990 100644 (file)
@@ -3782,7 +3782,7 @@ mono_arch_patch_code (MonoCompile *cfg, MonoMethod *method, MonoDomain *domain,
 {
        MonoJumpInfo *patch_info;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (patch_info = ji; patch_info; patch_info = patch_info->next) {
                unsigned char *ip = patch_info->ip.i + code;
index 563607f8c0fbeb4b48eba4b4103a1c94729623ff..745c29f13e48c77af959d7d831544421eda14bcf 100644 (file)
@@ -1431,7 +1431,10 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo *
                        pindex ++;
                        break;
                case LLVMArgAsIArgs:
-                       param_types [pindex] = LLVMArrayType (IntPtrType (), ainfo->nslots);
+                       if (ainfo->esize == 8)
+                               param_types [pindex] = LLVMArrayType (LLVMInt64Type (), ainfo->nslots);
+                       else
+                               param_types [pindex] = LLVMArrayType (IntPtrType (), ainfo->nslots);
                        pindex ++;
                        break;
                case LLVMArgVtypeByRef:
@@ -3490,7 +3493,10 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                }
                case LLVMArgAsIArgs:
                        g_assert (addresses [reg]);
-                       args [pindex] = LLVMBuildLoad (ctx->builder, convert (ctx, addresses [reg], LLVMPointerType (LLVMArrayType (IntPtrType (), ainfo->nslots), 0)), "");
+                       if (ainfo->esize == 8)
+                               args [pindex] = LLVMBuildLoad (ctx->builder, convert (ctx, addresses [reg], LLVMPointerType (LLVMArrayType (LLVMInt64Type (), ainfo->nslots), 0)), "");
+                       else
+                               args [pindex] = LLVMBuildLoad (ctx->builder, convert (ctx, addresses [reg], LLVMPointerType (LLVMArrayType (IntPtrType (), ainfo->nslots), 0)), "");
                        break;
                case LLVMArgVtypeAsScalar:
                        g_assert_not_reached ();
index 4742555d85146fa8b91faa741713483fbc558cc6..4eecb95e25bc1ed7e6ddbc5def91439dbaf392ed 100644 (file)
@@ -4539,7 +4539,7 @@ mono_arch_patch_code (MonoCompile *cfg, MonoMethod *method, MonoDomain *domain,
 {
        MonoJumpInfo *patch_info;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (patch_info = ji; patch_info; patch_info = patch_info->next) {
                unsigned char *ip = patch_info->ip.i + code;
index c65def26bab13a97247661a99e8be0b98ef2397d..bccd97d16a30f26b935ece4bae2b85f8d19c0c69 100644 (file)
@@ -1396,9 +1396,7 @@ MINI_OP(OP_ARM64_CBNZX, "arm64_cbnzx", NONE, IREG, NONE)
 #endif
 
 /* Same as OUTARG_VT, but has a dreg */
-#ifdef ENABLE_LLVM
 MINI_OP(OP_LLVM_OUTARG_VT,     "llvm_outarg_vt", IREG, VREG, NONE)
-#endif
 
 MINI_OP(OP_OBJC_GET_SELECTOR, "objc_get_selector", IREG, NONE, NONE)
 
index e59f98caccaeed539af8d22b88aec85ebd659829..4af328dc5d7d466360d306afcd293ac7b7011127 100644 (file)
@@ -4689,7 +4689,7 @@ mono_arch_patch_code (MonoCompile *cfg, MonoMethod *method, MonoDomain *domain,
        MonoJumpInfo *patch_info;
        gboolean compile_aot = !run_cctors;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (patch_info = ji; patch_info; patch_info = patch_info->next) {
                unsigned char *ip = patch_info->ip.i + code;
index d9a9dbb804149b71b60c3dc1882c34e7d08d1965..2ebf1c7873ab04004be1be89d89ce522209c00fe 100644 (file)
@@ -66,6 +66,7 @@
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/utils/checked-build.h>
 #include <mono/metadata/w32handle.h>
+#include <mono/metadata/threadpool.h>
 
 #include "mini.h"
 #include "seq-points.h"
 #endif
 #endif
 
+#ifdef ENABLE_INTERPRETER
+#include "interpreter/interp.h"
+#endif
+
 static guint32 default_opt = 0;
 static gboolean default_opt_set = FALSE;
 
@@ -1284,7 +1289,7 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
        unsigned char *ip = patch_info->ip.i + code;
        gconstpointer target = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        switch (patch_info->type) {
        case MONO_PATCH_INFO_BB:
@@ -1765,11 +1770,11 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoError *er
        MonoJitICallInfo *callinfo = NULL;
        WrapperInfo *winfo = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
 #ifdef ENABLE_INTERPRETER
        if (mono_use_interpreter)
-               return interp_create_method_pointer (method, error);
+               return mono_interp_create_method_pointer (method, error);
 #endif
 
        if (mono_llvm_only)
@@ -2273,7 +2278,7 @@ mono_llvmonly_runtime_invoke (MonoMethod *method, RuntimeInvokeInfo *info, void
        gpointer *param_refs;
        int i, pindex;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (info->gsharedvt_invoke);
 
@@ -2359,10 +2364,10 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
 
 #ifdef ENABLE_INTERPRETER
        if (mono_use_interpreter)
-               return interp_mono_runtime_invoke (method, obj, params, exc, error);
+               return mono_interp_runtime_invoke (method, obj, params, exc, error);
 #endif
 
-       mono_error_init (error);
+       error_init (error);
 
        if (obj == NULL && !(method->flags & METHOD_ATTRIBUTE_STATIC) && !method->string_ctor && (method->wrapper_type == 0)) {
                g_warning ("Ignoring invocation of an instance method on a NULL instance.\n");
@@ -2903,7 +2908,7 @@ mono_jit_create_remoting_trampoline (MonoDomain *domain, MonoMethod *method, Mon
        MonoMethod *nm;
        guint8 *addr = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        if ((method->flags & METHOD_ATTRIBUTE_VIRTUAL) && mono_method_signature (method)->generic_param_count) {
                return mono_create_specific_trampoline (method, MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING,
@@ -3138,8 +3143,8 @@ mini_parse_debug_option (const char *option)
                debug_options.break_on_unverified = TRUE;
        else if (!strcmp (option, "no-gdb-backtrace"))
                debug_options.no_gdb_backtrace = TRUE;
-       else if (!strcmp (option, "suspend-on-sigsegv"))
-               debug_options.suspend_on_sigsegv = TRUE;
+       else if (!strcmp (option, "suspend-on-native-crash") || !strcmp (option, "suspend-on-sigsegv"))
+               debug_options.suspend_on_native_crash = TRUE;
        else if (!strcmp (option, "suspend-on-exception"))
                debug_options.suspend_on_exception = TRUE;
        else if (!strcmp (option, "suspend-on-unhandled"))
@@ -3204,7 +3209,7 @@ mini_parse_debug_options (void)
 
                if (!mini_parse_debug_option (arg)) {
                        fprintf (stderr, "Invalid option for the MONO_DEBUG env variable: %s\n", arg);
-                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dont-free-domains', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'gen-seq-points', 'no-compact-seq-points', 'single-imm-size', 'init-stacks', 'casts', 'soft-breakpoints', 'check-pinvoke-callconv', 'use-fallback-tls', 'debug-domain-unload', 'partial-sharing', 'align-small-structs', 'native-debugger-break'\n");
+                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'suspend-on-native-crash', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dont-free-domains', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'gen-seq-points', 'no-compact-seq-points', 'single-imm-size', 'init-stacks', 'casts', 'soft-breakpoints', 'check-pinvoke-callconv', 'use-fallback-tls', 'debug-domain-unload', 'partial-sharing', 'align-small-structs', 'native-debugger-break'\n");
                        exit (1);
                }
        }
@@ -4106,6 +4111,8 @@ mini_cleanup (MonoDomain *domain)
        mono_runtime_cleanup (domain);
 #endif
 
+       mono_threadpool_cleanup ();
+
        mono_profiler_shutdown ();
 
        free_jit_tls_data ((MonoJitTlsData *)mono_tls_get_jit_tls ());
index 419c4bf51b5919157d3d81dfc0254ba74ba86679..d6e6bc42408637a697f6038972fcef2da6389e78 100644 (file)
@@ -5429,7 +5429,7 @@ mono_arch_patch_code (MonoCompile *cfg, MonoMethod *method, MonoDomain *domain,
 {
        MonoJumpInfo *patch_info;
 
-       mono_error_init (error);
+       error_init (error);
 
        for (patch_info = ji; patch_info; patch_info = patch_info->next) {
                unsigned char *ip = patch_info->ip.i + code;
index d02988845ae3019dd65b70e4586a3f8ca16a1a7e..88fd22fe9362301c02d7a969cfdd4a1e89f0e3ea 100644 (file)
@@ -3682,7 +3682,7 @@ mono_arch_patch_code (MonoCompile *cfg, MonoMethod *method, MonoDomain *domain,
 {
        MonoJumpInfo *patch_info;
 
-       mono_error_init (error);
+       error_init (error);
 
        /* FIXME: Move part of this to arch independent code */
        for (patch_info = ji; patch_info; patch_info = patch_info->next) {
index 7506b5ce80794164011318f39c951e60605844dd..c01f6eaebf4ab2f3bb6f0ebf03c5ca0c4deb8b8b 100644 (file)
@@ -167,7 +167,7 @@ mini_resolve_imt_method (MonoVTable *vt, gpointer *vtable_slot, MonoMethod *imt_
 
        g_assert (imt_slot < MONO_IMT_SIZE);
 
-       mono_error_init (error);
+       error_init (error);
        /* This has to be variance aware since imt_method can be from an interface that vt->klass doesn't directly implement */
        interface_offset = mono_class_interface_offset_with_variance (vt->klass, imt_method->klass, &variance_used);
        if (interface_offset < 0)
@@ -523,7 +523,7 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTable *
        gpointer *orig_vtable_slot, *vtable_slot_to_patch = NULL;
        MonoJitInfo *ji = NULL;
 
-       mono_error_init (error);
+       error_init (error);
 
        virtual_ = vt && (gpointer)vtable_slot > (gpointer)vt;
        imt_call = vt && (gpointer)vtable_slot < (gpointer)vt;
@@ -1133,7 +1133,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr
                if (!is_remote) {
                        sig = tramp_info->sig;
                        if (!(sig && method == tramp_info->method)) {
-                               mono_error_init (&err);
+                               error_init (&err);
                                sig = mono_method_signature_checked (method, &err);
                                if (!sig) {
                                        mono_error_set_pending_exception (&err);
@@ -1167,7 +1167,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr
        if (method) {
                sig = tramp_info->sig;
                if (!(sig && method == tramp_info->method)) {
-                       mono_error_init (&err);
+                       error_init (&err);
                        sig = mono_method_signature_checked (method, &err);
                        if (!sig) {
                                mono_error_set_pending_exception (&err);
@@ -1457,7 +1457,7 @@ mono_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean ad
        gpointer code;
        guint32 code_size = 0;
 
-       mono_error_init (error);
+       error_init (error);
 
        code = mono_jit_find_compiled_method_with_jit_info (domain, method, &ji);
        /*
@@ -1515,7 +1515,7 @@ mono_create_jit_trampoline (MonoDomain *domain, MonoMethod *method, MonoError *e
 {
        gpointer tramp;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (mono_aot_only) {
                if (mono_llvm_only && method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
@@ -1609,7 +1609,7 @@ mono_create_delegate_trampoline_info (MonoDomain *domain, MonoClass *klass, Mono
        tramp_info->impl_nothis = mono_arch_get_delegate_invoke_impl (mono_method_signature (invoke), FALSE);
        tramp_info->method = method;
        if (method) {
-               mono_error_init (&error);
+               error_init (&error);
                tramp_info->sig = mono_method_signature_checked (method, &error);
                tramp_info->need_rgctx_tramp = mono_method_needs_static_rgctx_invoke (method, FALSE);
        }
index c1e01d7c0bbf1e8fc065b20584e4ecd4568d6458..807cd5dd470cf7a2c230ede0b523020e1131d380 100644 (file)
@@ -3236,7 +3236,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
 
        if (cfg->gen_seq_points)
                cfg->seq_points = g_ptr_array_new ();
-       mono_error_init (&cfg->error);
+       error_init (&cfg->error);
 
        if (cfg->compile_aot && !try_generic_shared && (method->is_generic || mono_class_is_gtd (method->klass) || method_is_gshared)) {
                cfg->exception_type = MONO_EXCEPTION_GENERIC_SHARING_FAILED;
@@ -3278,7 +3278,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        }
        cfg->method_to_register = method_to_register;
 
-       mono_error_init (&err);
+       error_init (&err);
        sig = mono_method_signature_checked (cfg->method, &err);        
        if (!sig) {
                cfg->exception_type = MONO_EXCEPTION_TYPE_LOAD;
@@ -3604,6 +3604,10 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                cfg->disable_ssa = TRUE;
        }
 
+       if (cfg->num_varinfo > 10000 && !cfg->llvm_only)
+               /* Disable llvm for overly complex methods */
+               cfg->disable_ssa = TRUE;
+
        if (cfg->opt & MONO_OPT_LOOP) {
                MONO_TIME_TRACK (mono_jit_stats.jit_compile_dominator_info, mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM));
                MONO_TIME_TRACK (mono_jit_stats.jit_compute_natural_loops, mono_compute_natural_loops (cfg));
@@ -4062,7 +4066,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
        GTimer *jit_timer;
        MonoMethod *prof_method, *shared;
 
-       mono_error_init (error);
+       error_init (error);
 
        if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
            (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
index 47779970b616f83a01375bddababc7b018bdec97..d8e9f9ca547311b597c6fa42f6a1e599a26ec0b4 100644 (file)
@@ -826,7 +826,7 @@ typedef struct {
         * in the structure.
         */
        int nslots;
-       /* Only if storage == LLVMArgAsFpArgs/LLVMArgFpStruct (4/8) */
+       /* Only if storage == LLVMArgAsIArgs/LLVMArgAsFpArgs/LLVMArgFpStruct (4/8) */
        int esize;
        /* Parameter index in the LLVM signature */
        int pindex;
@@ -2085,12 +2085,6 @@ typedef struct {
        int type;
 } StackSlot;
 
-#if HAVE_ARRAY_ELEM_INIT
-extern const guint8 mono_burg_arity [];
-#else
-extern guint8 mono_burg_arity [];
-#endif
-
 extern const char MONO_ARCH_CPU_SPEC [];
 #define MONO_ARCH_CPU_SPEC_IDX_COMBINE(a) a ## _idx
 #define MONO_ARCH_CPU_SPEC_IDX(a) MONO_ARCH_CPU_SPEC_IDX_COMBINE(a)
@@ -2132,7 +2126,7 @@ typedef struct {
        gboolean better_cast_details;
        gboolean mdb_optimizations;
        gboolean no_gdb_backtrace;
-       gboolean suspend_on_sigsegv;
+       gboolean suspend_on_native_crash;
        gboolean suspend_on_exception;
        gboolean suspend_on_unhandled;
        gboolean dyn_runtime_invoke;
@@ -2820,12 +2814,7 @@ void    mono_arch_notify_pending_exc            (MonoThreadInfo *info);
 guint8* mono_arch_get_call_target               (guint8 *code);
 guint32 mono_arch_get_plt_info_offset           (guint8 *plt_entry, mgreg_t *regs, guint8 *code);
 GSList *mono_arch_get_trampolines               (gboolean aot);
-#ifdef ENABLE_INTERPRETER
-gpointer mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info);
-void mono_interp_init (void);
-gpointer interp_create_method_pointer (MonoMethod *method, MonoError *error);
-MonoObject* interp_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error);
-#endif
+gpointer mono_arch_get_enter_icall_trampoline   (MonoTrampInfo **info);
 
 /* Handle block guard */
 gpointer mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *clause, MonoContext *ctx, gpointer new_value);
index f378cd205975116ef86c5aefde7e4267d99b545b..3aa8a24aaf45ad48caba52720f067ee06133f6ad 100644 (file)
@@ -473,6 +473,7 @@ class Tests {
                return o.GetHashCode ();
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_unbox_trampoline2 () {
                int i = 12;
                object o = i;
@@ -622,6 +623,7 @@ class Tests {
                return 0;
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_multi_array_cast () {
                Duper[,] d = new Duper [1, 1];
                object[,] o = d;
@@ -888,18 +890,21 @@ class Tests {
                }
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_42_vtype_delegate () {
                var s = new VtypeVirtualDelStruct () { f = 42 };
                Func<int> f = s.return_field_nonvirt;
                return f ();
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_42_vtype_virtual_delegate () {
                IFaceVirtualDel s = new VtypeVirtualDelStruct () { f = 42 };
                Func<int> f = s.return_field;
                return f ();
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_1_store_decimal () {
                decimal[,] a = {{1}};
 
@@ -1418,6 +1423,7 @@ ncells ) {
                return 0;
        }
 
+       [Category ("!INTERPRETER")]
        static int test_0_array_get_set_soft_float () {
                float[,] arr = new float [2, 2];
                arr [0, 0] = 256f;
@@ -1578,6 +1584,7 @@ ncells ) {
                return mInstance;
        }
 
+       [Category ("!INTERPRETER")]
        static int test_0_synchronized () {
                getInstance ();
                return 0;
@@ -1746,6 +1753,7 @@ ncells ) {
                }
        }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_delegate_to_virtual_generic_on_ifaces () {
                IComparer2 c = new AClass ();
 
@@ -1768,6 +1776,7 @@ ncells ) {
 
        enum Mine { One, Two }
 
+       [Category ("!INTERPRETER")]
        public static int test_0_enum_gethashcode_opt () {
                int sum = 0;
         for (int i = 0; i < 1000000; ++i)
index a0294d7dd462a2db2c3efcfee3057d053844ab27..623783262034c2a9d18540b85dedffb41ef139a4 100644 (file)
@@ -223,6 +223,8 @@ mono_save_seq_point_info (MonoCompile *cfg)
                }
        }
 
+       g_free (seq_points);
+
        if (has_debug_data)
                g_free (next);
 
index d70788c6afb39ce430fcde647838b3ca7689e66b..d0b34b2781d177be5a558e56491edf369130ba84 100644 (file)
@@ -238,8 +238,13 @@ mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboole
                                if (var->opcode == OP_ARG)
                                        originals_used [idx] = TRUE;
 
-                               /* FIXME: */
-                               g_assert (stack_history_len < stack_history_size);
+                               if (stack_history_len + 128 > stack_history_size) {
+                                       stack_history_size += 1024;
+                                       RenameInfo *new_history = mono_mempool_alloc (cfg->mempool, sizeof (RenameInfo) * stack_history_size);
+                                       memcpy (new_history, stack_history, stack_history_len * sizeof (RenameInfo));
+                                       stack_history = new_history;
+                               }
+
                                stack_history [stack_history_len].var = stack [idx];
                                stack_history [stack_history_len].idx = idx;
                                stack_history_len ++;
index c86f9b5091587f95cd613b8753239ccdf64a35e6..b143645fb7d83c9d70d04ac4e9f6d2f9d81b9ded 100644 (file)
@@ -969,9 +969,8 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo
 
        return buf;
 }
+#endif /* !DISABLE_JIT */
 
-
-#ifdef ENABLE_INTERPRETER
 /*
  * mono_arch_get_enter_icall_trampoline:
  *
@@ -982,11 +981,13 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo
 gpointer
 mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
 {
-       guint8 *start = NULL, *code, *exits[4], *leave_tramp;
+#ifdef ENABLE_INTERPRETER
+       const int gregs_num = 6;
+       guint8 *start = NULL, *code, *exits [gregs_num], *leave_tramp;
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
-       static int arg_regs[] = {AMD64_ARG_REG1, AMD64_ARG_REG2, AMD64_ARG_REG3, AMD64_ARG_REG4};
-       int i;
+       static int arg_regs[] = {AMD64_ARG_REG1, AMD64_ARG_REG2, AMD64_ARG_REG3, AMD64_ARG_REG4, AMD64_R8, AMD64_R9};
+       int i, offset = 0;
 
        start = code = (guint8 *) mono_global_codeman_reserve (256);
 
@@ -1007,16 +1008,29 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
        /* load pointer to iregs into R11 */ // TODO: struct offset
        amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 8, 8);
 
-       for (i = 0; i < 4; i++) {
+       for (i = 0; i < gregs_num; i++) {
                amd64_test_reg_reg (code, AMD64_RAX, AMD64_RAX);
                exits [i] = code;
                x86_branch8 (code, X86_CC_Z, 0, FALSE);
 
-               amd64_mov_reg_membase (code, arg_regs [i], AMD64_R11, i * sizeof (gpointer), 8);
+#ifdef TARGET_WIN32
+               if (i < 4) {
+#else
+               if (i < 6) {
+#endif
+                       amd64_mov_reg_membase (code, arg_regs [i], AMD64_R11, i * sizeof (gpointer), 8);
+               } else {
+                       g_error ("not tested yet.");
+                       amd64_push_reg (code, AMD64_RAX);
+                       amd64_mov_reg_membase (code, AMD64_RAX, AMD64_R11, i * sizeof (gpointer), 8);
+                       amd64_mov_membase_reg (code, AMD64_RBP, offset, AMD64_RAX, sizeof (gpointer));
+                       offset += sizeof (gpointer);
+                       amd64_pop_reg (code, AMD64_RAX);
+               }
                amd64_dec_reg_size (code, AMD64_RAX, 1);
        }
 
-       for (i = 0; i < 4; i++) {
+       for (i = 0; i < gregs_num; i++) {
                x86_patch (exits [i], code);
        }
 
@@ -1049,9 +1063,11 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
                *info = mono_tramp_info_create ("enter_icall_trampoline", start, code - start, ji, unwind_ops);
 
        return start;
+#else
+       g_assert_not_reached ();
+       return NULL;
+#endif /* ENABLE_INTERPRETER */
 }
-#endif
-#endif /* !DISABLE_JIT */
 
 #ifdef DISABLE_JIT
 gpointer
@@ -1117,12 +1133,10 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo
        return NULL;
 }
 
-#ifdef ENABLE_INTERPRETER
 gpointer
 mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
 {
        g_assert_not_reached ();
        return NULL;
 }
-#endif
 #endif /* DISABLE_JIT */
index cc1930bcc2f443a65b4c536208051e89a119e94f..77c9413ac6c9a540283f3947a9a0a7b177968888 100644 (file)
@@ -330,7 +330,9 @@ marker_idle_func (void *data_untyped)
                if (data->private_gray_queue.num_sections > 16 && workers_finished && worker_awakenings < active_workers_num) {
                        /* We bound the number of worker awakenings just to be sure */
                        worker_awakenings++;
+                       mono_os_mutex_lock (&finished_lock);
                        sgen_workers_ensure_awake ();
+                       mono_os_mutex_unlock (&finished_lock);
                }
        } else {
                worker_try_finish (data);
@@ -424,7 +426,13 @@ sgen_workers_start_all_workers (SgenObjectOperations *object_ops_nopar, SgenObje
        worker_awakenings = 0;
        mono_memory_write_barrier ();
 
+       /*
+        * We expect workers to start finishing only after all of them were awaken.
+        * Otherwise we might think that we have fewer workers and use wrong context.
+        */
+       mono_os_mutex_lock (&finished_lock);
        sgen_workers_ensure_awake ();
+       mono_os_mutex_unlock (&finished_lock);
 }
 
 void
index 56aa99d09fce83d9777b155831ed78a6f5ec8cc7..5062f48d39cd0e7ec57f13591b9602ba0a40a7e4 100644 (file)
@@ -65,10 +65,14 @@ MCS = $(MCS_NO_LIB) -lib:$(CLASS)
 
 ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
 
-if FULL_AOT_TESTS
-TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)" --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
-else
 TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)"
+
+if FULL_AOT_TESTS
+TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
+endif
+
+if HYBRID_AOT_TESTS
+TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
 endif
 
 
@@ -478,7 +482,8 @@ BASE_TEST_CS_SRC=           \
        namedmutex-destroy-race.cs      \
        thread6.cs      \
        appdomain-threadpool-unload.cs  \
-       process-unref-race.cs
+       process-unref-race.cs   \
+       bug-46661.cs
 
 TEST_CS_SRC_DIST=      \
        $(BASE_TEST_CS_SRC)     \
@@ -929,16 +934,18 @@ EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
        $(ILASM) -out:$@ $<
 
 if !FULL_AOT_TESTS
-if !HYBRID_AOT_TESTS
 TEST_DRIVER_HARD_KILL_FEATURE=-r:Mono.Posix.dll
 endif
-endif
 
 if FULL_AOT_TESTS
 TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
 else
+if HYBRID_AOT_TESTS
+TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
+else
 TEST_DRIVER_DEPEND=TestDriver.dll
 endif
+endif
 
 %.exe: %.cs $(TEST_DRIVER_DEPEND)
        $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
@@ -947,7 +954,7 @@ endif
        $(MCS) -r:System.dll -target:library -out:$@ $<
 
 reference-loader.exe: reference-loader.cs TestingReferenceAssembly.dll TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_DEPEND)
-       $(MCS) -r:System.dll -r:TestDriver.dll -r:TestingReferenceAssembly.dll -r:TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ reference-loader.cs
+       $(MCS) -r:System.dll -r:TestDriver.dll -r:TestingReferenceAssembly.dll -r:TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $(srcdir)/reference-loader.cs
 
 TestingReferenceAssembly.dll: TestingReferenceAssembly.cs
        $(MCS) -target:library -out:$@ $<
@@ -994,8 +1001,12 @@ bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)
 if FULL_AOT_TESTS
 prereqs: $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
 else
+if HYBRID_AOT_TESTS
+prereqs: $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
+else
 prereqs: $(PREREQSI_IL) $(PREREQSI_CS)
 endif
+endif
 
 # Target to precompile the test executables
 tests: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la prereqs $(GSHARED_TESTS)
@@ -1039,6 +1050,9 @@ compile-tests:
 if FULL_AOT_TESTS
        $(MAKE) $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
 endif
+if HYBRID_AOT_TESTS
+       $(MAKE) $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
+endif
 
 # Remove empty .stdout and .stderr files for wrench
 rm-empty-logs:
@@ -1461,6 +1475,9 @@ test-inline-call-stack-library.dll: $(TEST_DRIVER_DEPEND) $(srcdir)/test-inline-
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 
 test-inline-call-stack.exe: $(TEST_DRIVER_DEPEND) test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
        $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
@@ -1508,6 +1525,9 @@ bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-8167
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 
 EXTRA_DIST += bug-36848-a.cs
 bug-36848.exe bug-36848-a.dll: $(srcdir)/bug-36848.cs $(srcdir)/bug-36848-a.cs
@@ -1517,6 +1537,9 @@ bug-36848.exe bug-36848-a.dll: $(srcdir)/bug-36848.cs $(srcdir)/bug-36848-a.cs
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 
 EXTRA_DIST += bug-81691-a.cs bug-81691-b.cs
 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
@@ -1532,6 +1555,9 @@ bug-81466-lib.dll: bug-81466-lib.il
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 bug-81466.exe: bug-81466.il bug-81466-lib.dll
        $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
 
@@ -1541,6 +1567,9 @@ bug-324535-il.dll : bug-324535-il.il
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 bug-324535.exe : bug-324535.cs bug-324535-il.dll
        $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
 
@@ -1550,6 +1579,9 @@ custom-modifiers-lib.dll: custom-modifiers-lib.il
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 custom-modifiers.2.exe: custom-modifiers.2.cs custom-modifiers-lib.dll
        $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.2.exe $(srcdir)/custom-modifiers.2.cs
 
@@ -1559,6 +1591,9 @@ bug-382986-lib.dll: bug-382986-lib.cs
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 
 bug-382986.exe: bug-382986.cs bug-382986-lib.dll
        $(MCS) -out:$@ -r:bug-382986-lib.dll $(srcdir)/bug-382986.cs
@@ -1586,6 +1621,9 @@ generic-unboxing.2.dll : generic-unboxing.2.il
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 
 EXTRA_DIST += generic-boxing.2.il
 generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
@@ -1593,6 +1631,9 @@ generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 
 EXTRA_DIST += generic-unbox.2.cs
 generic-unbox.2.exe : generic-unbox.2.cs generic-unboxing.2.dll
@@ -1608,6 +1649,9 @@ generic-delegate2-lib.2.dll : generic-delegate2-lib.2.il
 if FULL_AOT_TESTS
        $(RUNTIME) $(AOT_BUILD_FLAGS) $@
 endif
+if HYBRID_AOT_TESTS
+       $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
 generic-delegate2.2.exe : generic-delegate2.2.cs generic-delegate2-lib.2.dll
        $(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $(srcdir)/generic-delegate2.2.cs
 
@@ -1762,7 +1806,8 @@ UNHANDLED_EXCEPTION_255_TESTS =   \
        unhandled-exception-4.exe       \
        unhandled-exception-5.exe       \
        unhandled-exception-6.exe       \
-       unhandled-exception-7.exe
+       unhandled-exception-7.exe       \
+       unhandled-exception-8.exe
 
 test-unhandled-exception-2: $(UNHANDLED_EXCEPTION_1_TESTS) $(UNHANDLED_EXCEPTION_255_TESTS)
        $(MAKE) test-unhandled-exception-2-1-with-managed-handler
diff --git a/mono/tests/bug-46661.cs b/mono/tests/bug-46661.cs
new file mode 100644 (file)
index 0000000..fe88b57
--- /dev/null
@@ -0,0 +1,51 @@
+using System;
+using System.Linq;
+using System.IO;
+
+namespace ExceptionFilterTestLauncher
+{
+    class Program
+    {
+        public static object newObject = null;
+        public static bool SubTest(int i)
+        {
+            return newObject.GetHashCode() == i;
+        }
+
+        public static bool HandleException(Exception e)
+        {
+            return true;
+        }
+
+        public static bool Test2(int i)
+        {
+            bool test = true;
+            try
+            {
+                test = SubTest(i);
+            }
+            catch (Exception e) when (!HandleException(e))
+            {
+            }
+            return test;
+        }
+
+        static void Main(string[] args)
+        {
+            try
+            {
+                bool result = Test2(12345);
+            }
+            catch (Exception e)
+            {
+                // Before bug 46661 was fixed, the when would cut the stack trace, so Test(int) wouldn't show up
+                if(!e.StackTrace.Contains("SubTest"))
+                    throw new Exception("Stack trace doesn't reference SubTest function. Current stacktrace is " + e.StackTrace.ToString());
+                else
+                    // Correct result
+                    Environment.Exit(0);
+            }
+            throw new Exception("Exception should have been caught!");
+        }
+    }
+}
\ No newline at end of file
diff --git a/mono/tests/unhandled-exception-8.cs b/mono/tests/unhandled-exception-8.cs
new file mode 100644 (file)
index 0000000..7b4de0e
--- /dev/null
@@ -0,0 +1,24 @@
+
+using System;
+using System.Threading;
+
+class CustomException : Exception
+{
+}
+
+class Driver
+{
+       /* expected exit code: 255 */
+       public static void Main ()
+       {
+               if (Environment.GetEnvironmentVariable ("TEST_UNHANDLED_EXCEPTION_HANDLER") != null)
+                       AppDomain.CurrentDomain.UnhandledException += (s, e) => {};
+
+               ManualResetEvent mre = new ManualResetEvent(false);
+
+               ThreadPool.RegisterWaitForSingleObject (mre, (state, timedOut) => { throw new CustomException (); }, null, -1, true);
+               mre.Set();
+
+               Thread.Sleep (5000);
+       }
+}
\ No newline at end of file
index 25dd54a92576e995e679a27356d15ee6c9f19bea..ccad6f00ddb385a62e48f1cd831f690a00a11a6a 100755 (executable)
@@ -3414,7 +3414,7 @@ done
 
 ./make_exception_overlap_test.sh exception_entry_overlap_try_over_filter invalid ".try TRY_BLOCK_1 to FILTER_BLOCK_3_A filter FILTER_BLOCK_3 handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" "yes"
 
-#blocks start in the middle of an intruction
+#blocks start in the middle of an instruction
 ./make_exception_overlap_test.sh try_block_start_in_the_middle_of_a_instruction invalid ".try AFTER_PREFIX_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
 
 ./make_exception_overlap_test.sh catch_block_start_in_the_middle_of_a_instruction invalid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler AFTER_PREFIX_2 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END"
index 09926ffcd5f2266ce632b71bf837ec8dc73c9c5e..51524916490be41b7181cf2cb0c697f5745dcdd6 100644 (file)
@@ -245,7 +245,7 @@ mono_fatal_with_history (const char *msg, ...)
 #ifdef ENABLE_CHECKED_BUILD_GC
 
 void
-assert_gc_safe_mode (void)
+assert_gc_safe_mode (const char *file, int lineno)
 {
        if (!mono_check_mode_enabled (MONO_CHECK_MODE_GC))
                return;
@@ -254,19 +254,19 @@ assert_gc_safe_mode (void)
        int state;
 
        if (!cur)
-               mono_fatal_with_history ("Expected GC Safe mode but thread is not attached");
+               mono_fatal_with_history ("%s:%d: Expected GC Safe mode but thread is not attached", file, lineno);
 
        switch (state = mono_thread_info_current_state (cur)) {
        case STATE_BLOCKING:
        case STATE_BLOCKING_AND_SUSPENDED:
                break;
        default:
-               mono_fatal_with_history ("Expected GC Safe mode but was in %s state", mono_thread_state_name (state));
+               mono_fatal_with_history ("%s:%d: Expected GC Safe mode but was in %s state", file, lineno, mono_thread_state_name (state));
        }
 }
 
 void
-assert_gc_unsafe_mode (void)
+assert_gc_unsafe_mode (const char *file, int lineno)
 {
        if (!mono_check_mode_enabled (MONO_CHECK_MODE_GC))
                return;
@@ -275,7 +275,7 @@ assert_gc_unsafe_mode (void)
        int state;
 
        if (!cur)
-               mono_fatal_with_history ("Expected GC Unsafe mode but thread is not attached");
+               mono_fatal_with_history ("%s:%d: Expected GC Unsafe mode but thread is not attached", file, lineno);
 
        switch (state = mono_thread_info_current_state (cur)) {
        case STATE_RUNNING:
@@ -283,12 +283,12 @@ assert_gc_unsafe_mode (void)
        case STATE_SELF_SUSPEND_REQUESTED:
                break;
        default:
-               mono_fatal_with_history ("Expected GC Unsafe mode but was in %s state", mono_thread_state_name (state));
+               mono_fatal_with_history ("%s:%d: Expected GC Unsafe mode but was in %s state", file, lineno, mono_thread_state_name (state));
        }
 }
 
 void
-assert_gc_neutral_mode (void)
+assert_gc_neutral_mode (const char *file, int lineno)
 {
        if (!mono_check_mode_enabled (MONO_CHECK_MODE_GC))
                return;
@@ -297,7 +297,7 @@ assert_gc_neutral_mode (void)
        int state;
 
        if (!cur)
-               mono_fatal_with_history ("Expected GC Neutral mode but thread is not attached");
+               mono_fatal_with_history ("%s:%d: Expected GC Neutral mode but thread is not attached", file, lineno);
 
        switch (state = mono_thread_info_current_state (cur)) {
        case STATE_RUNNING:
@@ -307,7 +307,7 @@ assert_gc_neutral_mode (void)
        case STATE_BLOCKING_AND_SUSPENDED:
                break;
        default:
-               mono_fatal_with_history ("Expected GC Neutral mode but was in %s state", mono_thread_state_name (state));
+               mono_fatal_with_history ("%s:%d: Expected GC Neutral mode but was in %s state", file, lineno, mono_thread_state_name (state));
        }
 }
 
index 3dcbe286cca7ee4da0924ddf14f8e010e40607b7..8648fd81e432491355898297111d30b75fafa435 100644 (file)
@@ -106,15 +106,15 @@ Functions that can be called from both coop or preept modes.
 */
 
 #define MONO_REQ_GC_SAFE_MODE do {     \
-       assert_gc_safe_mode (); \
+       assert_gc_safe_mode (__FILE__, __LINE__);       \
 } while (0);
 
 #define MONO_REQ_GC_UNSAFE_MODE do {   \
-       assert_gc_unsafe_mode ();       \
+       assert_gc_unsafe_mode (__FILE__, __LINE__);     \
 } while (0);
 
 #define MONO_REQ_GC_NEUTRAL_MODE do {  \
-       assert_gc_neutral_mode ();      \
+       assert_gc_neutral_mode (__FILE__, __LINE__);    \
 } while (0);
 
 /* In a GC critical region, the thread is not allowed to switch to GC safe mode.
@@ -140,9 +140,9 @@ Functions that can be called from both coop or preept modes.
                assert_in_gc_critical_region(); \
        } while(0)
 
-void assert_gc_safe_mode (void);
-void assert_gc_unsafe_mode (void);
-void assert_gc_neutral_mode (void);
+void assert_gc_safe_mode (const char *file, int lineno);
+void assert_gc_unsafe_mode (const char *file, int lineno);
+void assert_gc_neutral_mode (const char *file, int lineno);
 
 void* critical_gc_region_begin(void);
 void critical_gc_region_end(void* token);
index 0d474ecf4846becdedd68426408764a71d304e09..3a6f44636c88a90af290d063274291f3fb432cd0 100644 (file)
@@ -139,7 +139,8 @@ typedef struct {
                 }                                                                                                                              \
        } while (0)
 #else
-#define MONO_CONTEXT_GET_CURRENT(ctx) \
+
+#define MONO_CONTEXT_GET_CURRENT_GREGS(ctx) \
        __asm__ __volatile__(   \
        "movl $0x0, %c[eax](%0)\n" \
        "mov %%ebx, %c[ebx](%0)\n" \
@@ -162,6 +163,40 @@ typedef struct {
                [esi] MONO_CONTEXT_OFFSET (esi, 0, mgreg_t), \
                [edi] MONO_CONTEXT_OFFSET (edi, 0, mgreg_t) \
        : "memory")
+
+#ifdef UCONTEXT_REG_XMM
+#define MONO_CONTEXT_GET_CURRENT_FREGS(ctx) \
+       do { \
+               __asm__ __volatile__ ( \
+                       "movups %%xmm0, %c[xmm0](%0)\n" \
+                       "movups %%xmm1, %c[xmm1](%0)\n" \
+                       "movups %%xmm2, %c[xmm2](%0)\n" \
+                       "movups %%xmm3, %c[xmm3](%0)\n" \
+                       "movups %%xmm4, %c[xmm4](%0)\n" \
+                       "movups %%xmm5, %c[xmm5](%0)\n" \
+                       "movups %%xmm6, %c[xmm6](%0)\n" \
+                       "movups %%xmm7, %c[xmm7](%0)\n" \
+                       : \
+                       : "a" (&(ctx)), \
+                               [xmm0] MONO_CONTEXT_OFFSET (fregs, X86_XMM0, MonoContextSimdReg), \
+                               [xmm1] MONO_CONTEXT_OFFSET (fregs, X86_XMM1, MonoContextSimdReg), \
+                               [xmm2] MONO_CONTEXT_OFFSET (fregs, X86_XMM2, MonoContextSimdReg), \
+                               [xmm3] MONO_CONTEXT_OFFSET (fregs, X86_XMM3, MonoContextSimdReg), \
+                               [xmm4] MONO_CONTEXT_OFFSET (fregs, X86_XMM4, MonoContextSimdReg), \
+                               [xmm5] MONO_CONTEXT_OFFSET (fregs, X86_XMM5, MonoContextSimdReg), \
+                               [xmm6] MONO_CONTEXT_OFFSET (fregs, X86_XMM6, MonoContextSimdReg), \
+                               [xmm7] MONO_CONTEXT_OFFSET (fregs, X86_XMM7, MonoContextSimdReg), \
+       } while (0)
+#else
+#define MONO_CONTEXT_GET_CURRENT_FREGS(ctx)
+#endif
+
+#define MONO_CONTEXT_GET_CURRENT(ctx) \
+    do {       \
+               MONO_CONTEXT_GET_CURRENT_GREGS(ctx);    \
+               MONO_CONTEXT_GET_CURRENT_FREGS(ctx);    \
+       } while (0)
+
 #endif
 
 #define MONO_ARCH_HAS_MONO_CONTEXT 1
index 55f84ffd8e8f1de87aab2c64464ebab9d3955ea6..2afe7fae2dee3bd5a00dce04e9399eeefee96668 100644 (file)
@@ -584,7 +584,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out)
        MonoString *assembly_name = NULL, *type_name = NULL, *method_name = NULL, *field_name = NULL, *msg = NULL;
        MonoDomain *domain = mono_domain_get ();
 
-       mono_error_init (error_out);
+       error_init (error_out);
 
        switch (error->error_code) {
        case MONO_ERROR_NONE:
@@ -780,7 +780,7 @@ void
 mono_error_move (MonoError *dest, MonoError *src)
 {
        memcpy (dest, src, sizeof (MonoErrorInternal));
-       mono_error_init (src);
+       error_init (src);
 }
 
 /**
index fa9caa6759e36bb2cecb619b19822f56e08520e2..88f986c509492da698af9bab26a91a6628e2d889 100644 (file)
@@ -57,6 +57,7 @@ typedef struct _MonoErrorBoxed MonoErrorBoxed;
 
 MONO_BEGIN_DECLS
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API void
 mono_error_init (MonoError *error);
 
index 7deca1275f5f26f39602ad5404a5d061ef5cc94a..046ef46d6b181684b2d86affafbff3d9ce4b1f46 100644 (file)
@@ -52,7 +52,7 @@ enum {
        MONO_LAZY_INIT_STATUS_CLEANED,
 };
 
-static inline void
+static inline gboolean
 mono_lazy_initialize (mono_lazy_init_t *lazy_init, void (*initialize) (void))
 {
        gint32 status;
@@ -62,7 +62,7 @@ mono_lazy_initialize (mono_lazy_init_t *lazy_init, void (*initialize) (void))
        status = *lazy_init;
 
        if (status >= MONO_LAZY_INIT_STATUS_INITIALIZED)
-               return;
+               return status == MONO_LAZY_INIT_STATUS_INITIALIZED;
        if (status == MONO_LAZY_INIT_STATUS_INITIALIZING
             || InterlockedCompareExchange (lazy_init, MONO_LAZY_INIT_STATUS_INITIALIZING, MONO_LAZY_INIT_STATUS_NOT_INITIALIZED)
                 != MONO_LAZY_INIT_STATUS_NOT_INITIALIZED
@@ -70,12 +70,13 @@ mono_lazy_initialize (mono_lazy_init_t *lazy_init, void (*initialize) (void))
                while (*lazy_init == MONO_LAZY_INIT_STATUS_INITIALIZING)
                        mono_thread_info_yield ();
                g_assert (InterlockedRead (lazy_init) >= MONO_LAZY_INIT_STATUS_INITIALIZED);
-               return;
+               return status == MONO_LAZY_INIT_STATUS_INITIALIZED;
        }
 
        initialize ();
 
        mono_atomic_store_release (lazy_init, MONO_LAZY_INIT_STATUS_INITIALIZED);
+       return TRUE;
 }
 
 static inline void
index 74d39ced0c0292f1c365af67aa5ad8fc8351e9a0..d81b4eb9168f050626d4afd5ab31628fd5d061fa 100755 (executable)
@@ -60,7 +60,7 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
                        return 1;
                }
 #else
-               if (fd > FD_SETSIZE) {
+               if (fd >= FD_SETSIZE) {
                        ufds [i].revents = MONO_POLLNVAL;
                        return 1;
                }
index 97f57cee4ee331024d2088ed9b5b04c53ac151f6..4ac99a8468512c38eefdc5ae76104f0e015f4ad0 100644 (file)
@@ -127,7 +127,7 @@ mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, Mon
 {
        MONO_WIN32_CRYPT_PROVIDER_HANDLE provider;
 
-       mono_error_init (error);
+       error_init (error);
 
        g_assert (handle);
        provider = (MONO_WIN32_CRYPT_PROVIDER_HANDLE) *handle;
index 884dc7f1600775ab0a2474b267f835f7ec23739a..a51253c1d86a1baee8fb210a5fcdf4640358443c 100644 (file)
@@ -51,7 +51,7 @@ get_entropy_from_egd (const char *path, guchar *buffer, int buffer_size, MonoErr
        guint offset = 0;
        int err = 0;
 
-       mono_error_init (error);
+       error_init (error);
        
        socket_fd = socket (PF_UNIX, SOCK_STREAM, 0);
        if (socket_fd < 0) {
@@ -155,7 +155,7 @@ mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, Mon
 {
        g_assert (handle);
 
-       mono_error_init (error);
+       error_init (error);
 
        if (use_egd) {
                const char *socket_path = g_getenv ("MONO_EGD_SOCKET");
@@ -224,7 +224,7 @@ mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, Mon
 {
        gint count = 0;
 
-       mono_error_init (error);
+       error_init (error);
        
        do {
                if (buffer_size - count >= sizeof (gint32) && RAND_MAX >= 0xFFFFFFFF) {
index 7f2748536830157d0179423a510f6c7e21e9b6da..ed6b1807a3a22a97bcba35b62862c27e3a09e670 100644 (file)
@@ -288,6 +288,12 @@ mono_threads_exit_gc_safe_region_unbalanced (gpointer cookie, gpointer *stackdat
        default:
                g_error ("Unknown thread state");
        }
+
+       if (info->async_target) {
+               info->async_target (info->user_data);
+               info->async_target = NULL;
+               info->user_data = NULL;
+       }
 }
 
 void
@@ -355,6 +361,12 @@ mono_threads_enter_gc_unsafe_region_unbalanced_with_info (MonoThreadInfo *info,
                g_error ("Unknown thread state");
        }
 
+       if (info->async_target) {
+               info->async_target (info->user_data);
+               info->async_target = NULL;
+               info->user_data = NULL;
+       }
+
        return info;
 }
 
index 5f719c161e365190573a59626e55b78f513b600f..76821d0d359980fb78176606d20a210f61b48b0f 100644 (file)
@@ -1005,8 +1005,12 @@ currently used only to deliver exceptions.
 void
 mono_thread_info_setup_async_call (MonoThreadInfo *info, void (*target_func)(void*), void *user_data)
 {
-       /* An async call can only be setup on an async suspended thread */
-       g_assert (mono_thread_info_run_state (info) == STATE_ASYNC_SUSPENDED);
+       if (!mono_threads_is_coop_enabled ()) {
+               /* In non-coop mode, an async call can only be setup on an async suspended thread, but in coop mode, a thread
+                * may be in blocking state, and will execute the async call when leaving the safepoint, leaving a gc safe
+                * region or entering a gc unsafe region */
+               g_assert (mono_thread_info_run_state (info) == STATE_ASYNC_SUSPENDED);
+       }
        /*FIXME this is a bad assert, we probably should do proper locking and fail if one is already set*/
        g_assert (!info->async_target);
        info->async_target = target_func;
@@ -1655,7 +1659,7 @@ mono_thread_info_wait_one_handle (MonoThreadHandle *thread_handle, guint32 timeo
 {
        MonoOSEventWaitRet res;
 
-       res = mono_os_event_wait_one (&thread_handle->event, timeout);
+       res = mono_os_event_wait_one (&thread_handle->event, timeout, alertable);
        if (res == MONO_OS_EVENT_WAIT_RET_SUCCESS_0)
                return MONO_THREAD_INFO_WAIT_RET_SUCCESS_0;
        else if (res == MONO_OS_EVENT_WAIT_RET_ALERTED)
@@ -1683,7 +1687,7 @@ mono_thread_info_wait_multiple_handle (MonoThreadHandle **thread_handles, gsize
        if (background_change_event)
                thread_events [nhandles ++] = background_change_event;
 
-       res = mono_os_event_wait_multiple (thread_events, nhandles, waitall, timeout);
+       res = mono_os_event_wait_multiple (thread_events, nhandles, waitall, timeout, alertable);
        if (res >= MONO_OS_EVENT_WAIT_RET_SUCCESS_0 && res <= MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + nhandles - 1)
                return MONO_THREAD_INFO_WAIT_RET_SUCCESS_0 + (res - MONO_OS_EVENT_WAIT_RET_SUCCESS_0);
        else if (res == MONO_OS_EVENT_WAIT_RET_ALERTED)
index b86ab331dbf7e2cab2180e69cef51ae5060c10a4..2f6b6c501037c6cd070612896455c227b3f2b9ae 100644 (file)
@@ -211,10 +211,10 @@ mono_bitset_count (const MonoBitSet *set) {
        for (i = 0; i < set->size / BITS_PER_CHUNK; ++i) {
                d = set->data [i];
 #ifdef __GNUC__
-               if (sizeof (gsize) == sizeof (unsigned long))
-                       count += __builtin_popcountl (d);
-               else
+               if (sizeof (gsize) == sizeof (unsigned int))
                        count += __builtin_popcount (d);
+               else
+                       count += __builtin_popcountll (d);
 #else
                while (d) {
                        count ++;
index 611cb76ffbc69038a739470bcad367cd6df8102a..b4a3e2f5afdf8dc083df00f30973be0d2a4349ea 100644 (file)
@@ -88,9 +88,9 @@ mono_os_event_reset (MonoOSEvent *event)
 }
 
 MonoOSEventWaitRet
-mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout, gboolean alertable)
 {
-       return mono_os_event_wait_multiple (&event, 1, TRUE, timeout);
+       return mono_os_event_wait_multiple (&event, 1, TRUE, timeout, alertable);
 }
 
 typedef struct {
@@ -113,7 +113,7 @@ signal_and_unref (gpointer user_data)
 }
 
 MonoOSEventWaitRet
-mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout)
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout, gboolean alertable)
 {
        MonoOSEventWaitRet ret;
        mono_cond_t signal_cond;
@@ -131,16 +131,18 @@ mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waita
        for (i = 0; i < nevents; ++i)
                g_assert (events [i]);
 
-       data = g_new0 (OSEventWaitData, 1);
-       data->ref = 2;
-       mono_os_event_init (&data->event, FALSE);
+       if (alertable) {
+               data = g_new0 (OSEventWaitData, 1);
+               data->ref = 2;
+               mono_os_event_init (&data->event, FALSE);
 
-       alerted = FALSE;
-       mono_thread_info_install_interrupt (signal_and_unref, data, &alerted);
-       if (alerted) {
-               mono_os_event_destroy (&data->event);
-               g_free (data);
-               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+               alerted = FALSE;
+               mono_thread_info_install_interrupt (signal_and_unref, data, &alerted);
+               if (alerted) {
+                       mono_os_event_destroy (&data->event);
+                       g_free (data);
+                       return MONO_OS_EVENT_WAIT_RET_ALERTED;
+               }
        }
 
        if (timeout != MONO_INFINITE_WAIT)
@@ -153,7 +155,8 @@ mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waita
        for (i = 0; i < nevents; ++i)
                g_ptr_array_add (events [i]->conds, &signal_cond);
 
-       g_ptr_array_add (data->event.conds, &signal_cond);
+       if (alertable)
+               g_ptr_array_add (data->event.conds, &signal_cond);
 
        for (;;) {
                gint count, lowest;
@@ -170,7 +173,7 @@ mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waita
                        }
                }
 
-               if (mono_os_event_is_signalled (&data->event))
+               if (alertable && mono_os_event_is_signalled (&data->event))
                        signalled = TRUE;
                else if (waitall)
                        signalled = (count == nevents);
@@ -206,23 +209,26 @@ done:
        for (i = 0; i < nevents; ++i)
                g_ptr_array_remove (events [i]->conds, &signal_cond);
 
-       g_ptr_array_remove (data->event.conds, &signal_cond);
+       if (alertable)
+               g_ptr_array_remove (data->event.conds, &signal_cond);
 
        mono_os_mutex_unlock (&signal_mutex);
 
        mono_os_cond_destroy (&signal_cond);
 
-       mono_thread_info_uninstall_interrupt (&alerted);
-       if (alerted) {
-               if (InterlockedDecrement ((gint32*) &data->ref) == 0) {
-                       mono_os_event_destroy (&data->event);
-                       g_free (data);
+       if (alertable) {
+               mono_thread_info_uninstall_interrupt (&alerted);
+               if (alerted) {
+                       if (InterlockedDecrement ((gint32*) &data->ref) == 0) {
+                               mono_os_event_destroy (&data->event);
+                               g_free (data);
+                       }
+                       return MONO_OS_EVENT_WAIT_RET_ALERTED;
                }
-               return MONO_OS_EVENT_WAIT_RET_ALERTED;
-       }
 
-       mono_os_event_destroy (&data->event);
-       g_free (data);
+               mono_os_event_destroy (&data->event);
+               g_free (data);
+       }
 
        return ret;
 }
index e28833c0d8f1141623cfe8ccbc41a65787fa83c7..33fb867d654e01ea6811ad317e7fd1bd24fc7262 100644 (file)
@@ -64,14 +64,14 @@ mono_os_event_reset (MonoOSEvent *event)
 }
 
 MonoOSEventWaitRet
-mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout, gboolean alertable)
 {
        DWORD res;
 
        g_assert (event);
        g_assert (event->handle);
 
-       res = WaitForSingleObjectEx (event->handle, timeout, TRUE);
+       res = WaitForSingleObjectEx (event->handle, timeout, alertable);
        if (res == WAIT_OBJECT_0)
                return MONO_OS_EVENT_WAIT_RET_SUCCESS_0;
        else if (res == WAIT_IO_COMPLETION)
@@ -85,7 +85,7 @@ mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
 }
 
 MonoOSEventWaitRet
-mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout)
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout, gboolean alertable)
 {
        DWORD res;
        gpointer handles [MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS];
@@ -96,7 +96,7 @@ mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waita
        g_assert (nevents <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS);
 
        if (nevents == 1)
-               return mono_os_event_wait_one (events [0], timeout);
+               return mono_os_event_wait_one (events [0], timeout, alertable);
 
        for (i = 0; i < nevents; ++i) {
                g_assert (events [i]);
@@ -104,7 +104,7 @@ mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waita
                handles [i] = events [i]->handle;
        }
 
-       res = WaitForMultipleObjectsEx (nevents, handles, waitall, timeout, TRUE);
+       res = WaitForMultipleObjectsEx (nevents, handles, waitall, timeout, alertable);
        if (res >= WAIT_OBJECT_0 && res < WAIT_OBJECT_0 + MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS)
                return MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + (res - WAIT_OBJECT_0);
        else if (res == WAIT_IO_COMPLETION)
index c3ca11b8504aa536845b6bca07fbe74a31e5ff9d..280b19ad8ac9cd263caf4d592911003e892597e3 100644 (file)
@@ -45,9 +45,9 @@ void
 mono_os_event_reset (MonoOSEvent *event);
 
 MonoOSEventWaitRet
-mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout);
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout, gboolean alertable);
 
 MonoOSEventWaitRet
-mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout);
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout, gboolean alertable);
 
 #endif /* _MONO_UTILS_OS_EVENT_H_ */
index 631aad2c5a8f315aca948b6ee64a5b4c32d04983..f16745292f51b9ea8239bda4efad0ec6e76bf8f1 100644 (file)
@@ -24,7 +24,7 @@
     </project>
     <project dir="class/System" library="System-basic">
       <boot>true</boot>
-      <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../class/lib/basic/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/basic/System.Xml.dll -r:./../../class/lib/basic/System.Configuration.dll -r:MonoSecurity=./../../class/lib/basic/Mono.Security.dll</flags>
+      <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../class/lib/basic/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/basic/System.Xml.dll -r:./../../class/lib/basic/System.Configuration.dll -r:MonoSecurity=./../../class/lib/basic/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/basic/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-build">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/build/System.Xml.dll -r:./../../class/lib/build/System.Configuration.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/build/System.Xml.dll -r:./../../class/lib/build/System.Configuration.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-build">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-build">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/build/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/build/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/secxml/System.dll</library_output>
     </project>
     <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/Mono.CSharp.dll</flags>
+      <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.dll</flags>
       <output>Microsoft.CSharp.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/Microsoft.CSharp.dll</library_output>
index 9e5348975ee9942cf5e67382621e8d738091b1f5..a5af6000994f25b954a24b20febb79356cf551b0 100644 (file)
@@ -3,8 +3,8 @@ class FsharpPackage(GitHubTarballPackage):
     def __init__(self):
         GitHubTarballPackage.__init__(self,
                                       'fsharp', 'fsharp',
-                                      '4.0.1.9',
-                                      '0a6c66a8f18eb8a5c4d0bfac61d883b6994a918a',
+                                      '4.0.1.20',
+                                      '9bd7c2420e06c1597ef5a37b6cb6e0f8d2911b10',
                                       configure='./configure --prefix="%{package_prefix}"')
 
         self.extra_stage_files = [
index c5f9afe44151ed5829003710d92c183cd25d9e5e..0d4e336a879945a336d1099639fb1c1e210baacc 100644 (file)
@@ -23,9 +23,9 @@ class IronLanguagesPackage(GitHubTarballPackage):
         self.ironpython = os.path.join(
             self.workspace, 'ironpython', 'bin') + os.sep
         self.sh(
-            'msbuild /p:Configuration=Release /p:OutDir="%{ironruby}" Solutions/Ruby.sln')
+            'xbuild /p:Configuration=Release /p:OutDir="%{ironruby}" Solutions/Ruby.sln')
         self.sh(
-            'msbuild /p:Configuration=Release /p:OutDir="%{ironpython}" Solutions/IronPython.Mono.sln')
+            'xbuild /p:Configuration=Release /p:OutDir="%{ironpython}" Solutions/IronPython.Mono.sln')
 
     def install_ruby_scripts(self, path, installdir):
         for cmd, ext in map(os.path.splitext, os.listdir(path)):
index 63bf814d92302443e558043aafeea27c519c615b..ed9de8174840f455d66a849a89cb377b9086b268 100644 (file)
@@ -46,11 +46,16 @@ class MonoMasterPackage(Package):
         self.configure = './autogen.sh --prefix="%{package_prefix}"'
 
         self.extra_stage_files = ['etc/mono/config']
+        self.custom_version_str = None
 
     def build(self):
         self.make = '%s EXTERNAL_MCS=%s EXTERNAL_RUNTIME=%s' % (
             self.make, self.profile.env.system_mcs, self.profile.env.system_mono)
-        Package.build(self)
+        Package.configure(self)
+
+        if self.custom_version_str is not None:
+            replace_in_file(os.path.join (self.workspace, 'config.h'), {self.version : self.custom_version_str})
+        Package.make(self)
 
     def prep(self):
         Package.prep(self)
index 0e16af1fa7991d173346a97c8e413cbe35c9ef47..3d123952f35168d771fbe222f1d111cc5efd1757 100644 (file)
@@ -5,7 +5,7 @@ class MSBuild (GitHubPackage):
 
     def __init__(self):
         GitHubPackage.__init__(self, 'mono', 'msbuild', '15.0',
-                               git_branch='xplat-c8p')
+                               git_branch='xplat-master')
 
     def build(self):
         self.sh('./cibuild.sh --scope Compile --target Mono --host Mono')
@@ -27,6 +27,17 @@ class MSBuild (GitHubPackage):
 
         self.sh('cp msbuild-mono-deploy.in %s/msbuild' % bindir)
 
+        xbuild_dir = os.path.join(self.staged_prefix, 'lib/mono/xbuild')
+        new_xbuild_tv_dir = os.path.join(xbuild_dir, self.version)
+        os.makedirs(new_xbuild_tv_dir)
+
+        self.sh('mv %s/Microsoft.Common.props %s' %
+                (new_location, new_xbuild_tv_dir))
+        self.sh('cp -R nuget-support/tv/ %s' % new_xbuild_tv_dir)
+        self.sh('cp -R nuget-support/tasks-targets/ %s/' % xbuild_dir)
+        for dep in glob.glob("%s/Microsoft/NuGet/*" % xbuild_dir):
+            self.sh('ln -s %s %s' % (dep, xbuild_dir))
+
         for line in fileinput.input('%s/msbuild' % bindir, inplace=True):
             line = line.replace('@bindir@', '%s/bin' % self.staged_prefix)
             line = line.replace(
@@ -35,10 +46,12 @@ class MSBuild (GitHubPackage):
                 self.staged_prefix)
             print line
 
-        for excluded in glob.glob("%s/*UnitTests*" % new_location):
-            self.rm(excluded)
+        patterns = ["*UnitTests*", "*xunit*", "NuGet*", "System.Runtime.InteropServices.RuntimeInformation.dll",
+                    "Roslyn/csc.exe*"]
+
+        for pattern in patterns:
+            for excluded in glob.glob("%s/%s" % (new_location, pattern)):
+                self.rm(excluded)
 
-        for excluded in glob.glob("%s/*xunit*" % new_location):
-            self.rm(excluded)
 
 MSBuild()
index ea36a654cae0aade9464bb6904697719c9741efa..fadd743d457614f800ec684d0d18cbd5de2d3dbe 100644 (file)
@@ -11,6 +11,7 @@ ccrewrite
 cccheck
 cert2spc
 certmgr
+cert-sync
 chktrust
 ClassInitGenerator
 csharp
diff --git a/packaging/MacSDK/patches/fsharp-fix-mdb-support.patch b/packaging/MacSDK/patches/fsharp-fix-mdb-support.patch
new file mode 100644 (file)
index 0000000..576942a
--- /dev/null
@@ -0,0 +1,29 @@
+commit 26e3e557e25b0ba5103dfb683050d2435f7708bb
+Author: Ankit Jain <ankit.jain@xamarin.com>
+Date:   Wed Feb 8 18:44:41 2017 -0500
+
+    [msbuild] Add support for .mdb files to be copied, with mono's msbuild
+
+    msbuild defaults to .pdb files as the default debug file extension.
+    Mono's msbuild has `$(_DebugFileExt)` property to override this. We need
+    to set that to `.mdb`, else the generated `.mdb` files won't get
+    copied/deployed.
+
+    But this feature is not upstream yet, so it is not present in upstream
+    F# yet.
+
+diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.targets
+index 82125d2..e7ddac2 100644
+--- a/src/fsharp/FSharp.Build/Microsoft.FSharp.targets
++++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.targets
+@@ -40,6 +40,10 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
+         <RootNamespace Condition="'$(RootNamespace)'==''">RootNamespace</RootNamespace>
+         <Actual32Bit Condition="'$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0'">false</Actual32Bit>
+         <Actual32Bit Condition="!('$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0')">$(Prefer32Bit)</Actual32Bit>
++
++        <!-- _DebugFileExt is not an upstream msbuild feature yet -->
++        <_DebugFileExt Condition="'$(FscDebugFileExt)' != ''">$(FscDebugFileExt)</_DebugFileExt>
++        <_DebugFileExt Condition="'$(_DebugFileExt)' == ''">.mdb</_DebugFileExt>
+     </PropertyGroup>
+
+     <!--
index 216e9f7bc0922f3dbef3800e8c314af35da3e73d..1c1587d2a814fe205ebac7ba59b4e76155e1d3ef 100644 (file)
@@ -9,7 +9,7 @@ class PCLReferenceAssembliesPackage(Package):
         Package.__init__(self,
                          name='PortableReferenceAssemblies',
                          version='2014-04-14',
-                         sources=['http://xamarin-storage/bot-provisioning/PortableReferenceAssemblies-2014-04-14.zip'])
+                         sources=['https://bosstoragemirror.blob.core.windows.net/bot-provisioning/PortableReferenceAssemblies-2014-04-14.zip'])
 
     def build(self):
         pass
index 119678f9e7575bc876ce092d0e9ce4e6d26262e7..270b70d0254209b33c08d5fa6e50c003ba0d8fdf 100755 (executable)
@@ -119,6 +119,8 @@ class MonoReleaseProfile(DarwinProfile):
             error('Prefix %s exists, and may interfere with the staged build. Please remove and try again.' % self.prefix)
 
         self.calculate_updateid()
+
+        self.mono_package.custom_version_str = self.FULL_VERSION
         trace(self.package_info('MDK'))
 
         self.dont_optimize = ['pixman']
@@ -281,6 +283,10 @@ class MonoReleaseProfile(DarwinProfile):
             working_dir, "PKGROOT", self.prefix[1:], "updateinfo")
         with open(updateinfo, "w") as updateinfo:
             updateinfo.write(guid + ' ' + self.updateid + "\n")
+        version_file = os.path.join(
+            working_dir, "PKGROOT", self.prefix[1:], "VERSION")
+        with open(version_file, "w") as version_file:
+            version_file.write(self.FULL_VERSION + "\n")
 
     def package_info(self, pkg_type):
         arch = self.bockbuild.cmd_options.arch
diff --git a/po/mcs/.gitattributes b/po/mcs/.gitattributes
new file mode 100644 (file)
index 0000000..813b603
--- /dev/null
@@ -0,0 +1 @@
+LINGUAS eol=lf
index 5751de4be9b6bf8c36b01cc6fd82ee31dc52ce58..2f03aa0e2ecf8e810e0fdc3855c4fa0e5cc41746 100644 (file)
@@ -1,4 +1 @@
-es
-ja
-de
-pt_BR
\ No newline at end of file
+es ja de pt_BR
\ No newline at end of file
diff --git a/runtime/.gitattributes b/runtime/.gitattributes
new file mode 100644 (file)
index 0000000..943f7e1
--- /dev/null
@@ -0,0 +1,3 @@
+monodis-wrapper.in     crlf=input
+mono-wrapper.in        crlf=input
+
index 30238150d93ca546c3ba77e37149970d7a664127..2166c5ce95c3144272d577900ed2275ba440971f 100644 (file)
@@ -6,3 +6,17 @@ monodocs2slashdoc      crlf=input
 mono-heapviz   crlf=input
 mono-package-runtime   crlf=input
 mono-test-install      crlf=input
+csc.in crlf=input
+dmcs.in        crlf=input
+gmcs.in        crlf=input
+mcs.in crlf=input
+mod.in crlf=input
+mono-configuration-crypto.in   crlf=input
+mono-find-provides.in  crlf=input
+mono-find-requires.in  crlf=input
+mono-service.in        crlf=input
+mono-symbolicate.in    crlf=input
+peverify.in    crlf=input
+script.in      crlf=input
+script_umask.in        crlf=input
+xbuild.in      crlf=input
index 13890c1051ff1b880ce6379ee7180651d6b73eb0..f8e2f2d79dec35f64fb31ef629b043b73f6135c8 100755 (executable)
@@ -50,7 +50,7 @@ if [ -x "/usr/bin/dpkg-architecture" ];
        EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
        #force build arch = dpkg arch, sometimes misdetected
        mkdir -p ~/.config/.mono/
-       wget -qO- http://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
+       wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
 fi
 
 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
diff --git a/scripts/mac-sdk-package.sh b/scripts/mac-sdk-package.sh
new file mode 100755 (executable)
index 0000000..29ad4e8
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash -e
+
+external/bockbuild/bb MacSDK --package