Merge pull request #2593 from ludovic-henry/coop-fix-native-to-managed
authorLudovic Henry <ludovic@xamarin.com>
Mon, 22 Feb 2016 11:23:34 +0000 (11:23 +0000)
committerLudovic Henry <ludovic@xamarin.com>
Mon, 22 Feb 2016 11:23:34 +0000 (11:23 +0000)
[coop] Fix native-to-managed wrapper

74 files changed:
README.md
configure.ac
mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
mcs/class/System.Drawing/Test/System.Drawing.Printing/PrintingServicesUnixTest.cs
mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
mcs/class/System.IO.Compression/ZipArchiveEntry.cs
mcs/class/System.ServiceModel/System.ServiceModel/WSDualHttpBinding.cs
mcs/class/System.Web.ApplicationServices/Makefile
mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.dll.sources
mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.txt [new file with mode: 0644]
mcs/class/System.Web.ApplicationServices/System.Web.Configuration/MembershipPasswordCompatibilityMode.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateStatus.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateUserException.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordException.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordFormat.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipProviderCollection.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipUserCollection.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipValidatePasswordEventHandler.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/ValidatePasswordEventArgs.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web/ApplicationServicesStrings.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Profile/DefaultProfile.cs [deleted file]
mcs/class/System.Web/System.Web.Profile/ProfileAuthenticationOption.cs [deleted file]
mcs/class/System.Web/System.Web.Profile/ProfileInfo.cs [deleted file]
mcs/class/System.Web/System.Web.Profile/ProfileInfoCollection.cs [deleted file]
mcs/class/System.Web/System.Web.UI.WebControls/IPostBackContainer.cs [deleted file]
mcs/class/System.Web/System.Web.UI/ICheckBoxControl.cs [deleted file]
mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs [deleted file]
mcs/class/System.Web/System.Web.UI/ITextControl.cs [deleted file]
mcs/class/System.Web/System.Web.dll.sources
mcs/class/WindowsBase/System.Windows.Threading/Dispatcher.cs
mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System/TimeZoneInfoTest.cs
mcs/tools/mkbundle/mkbundle.cs
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/class.h
mono/metadata/cominterop.c
mono/metadata/console-unix.c
mono/metadata/debug-helpers.c
mono/metadata/domain.c
mono/metadata/exception.c
mono/metadata/marshal.c
mono/metadata/metadata.c
mono/metadata/method-builder.c
mono/metadata/mono-mlist.c
mono/metadata/mono-security.c
mono/metadata/object-internals.h
mono/metadata/process.c
mono/metadata/security-manager.c
mono/metadata/sgen-mono.c
mono/metadata/socket-io.c
mono/metadata/threadpool-ms.c
mono/mini/aot-compiler.c
mono/mini/branch-opts.c
mono/mini/debugger-agent.c
mono/mini/llvm-jit.cpp
mono/mini/local-propagation.c
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-arm.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-ppc.c
mono/mini/mini-s390x.c
mono/mini/mini-sparc.c
mono/mini/mini-x86.c
mono/profiler/mono-profiler-iomap.c
mono/tests/load-exceptions.cs
mono/utils/mono-error.c

index 8305cb08b3f21e081b2f22c5be539246d941753c..7a7f3639f28ccefebc994e5d5f03cb0ae41f2ce1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -181,7 +181,7 @@ while `mono-sgen` uses the Simple Generational GC.
 * `--with-gc=[included, boehm, none]` - Selects the default Boehm
 garbage collector engine to use.
 
-  * *included*: (*slighty modified Boehm GC*) This is the default
+  * *included*: (*slightly modified Boehm GC*) This is the default
 value for the Boehm GC, and it's the most feature complete, it will
 allow Mono to use typed allocations and support the debugger.
 
index 94160c5fe0ac02e69d33275fae2d3935b2b29735..296c43c5431c2adda6b8741d09025b6c4c291b73 100644 (file)
@@ -2611,21 +2611,54 @@ if test "x$enable_llvm" = "xyes"; then
 
    if test "x$host_win32" = "xno"; then
 
+   # Should be something like '2.6' or '2.7svn'
+   llvm_version=`$LLVM_CONFIG --version`
+   llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
+   AC_MSG_CHECKING(LLVM version)
+   AC_MSG_RESULT($llvm_version $llvm_api_version)
+   if echo $llvm_version | grep -q 'mono'; then
+         if test "x$enable_llvm_version_check" == "xyes"; then
+                if test "$llvm_version" != "$expected_llvm_version"; then
+                       AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
+                fi
+         fi
+   else
+         AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
+   fi
+
    # The output of --cflags seems to include optimizations flags too
-   LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
-   LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+   if test $llvm_api_version -gt 100; then
+         # The --cflags argument includes all kinds of warnings -pendantic etc.
+         LLVM_CFLAGS="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+         LLVM_CXXFLAGS="-I$with_llvm/include -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+   else
+         LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+      LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+   fi
    # LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
    # from LLVM classes.
    LLVM_CXXFLAGS="$LLVM_CXXFLAGS -fno-rtti -fexceptions"
    LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
    # This might include empty lines
    LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
-   if test "x$host" != "x$target"; then
+   llvm_jit_supported=yes
+   if test $llvm_api_version -gt 100; then
+         # Based on llvm 3.9, only aot is currently supported
+         llvm_jit_supported=no
+   elif test "x$host" != "x$target"; then
+      # No need for jit libs
+         llvm_jit_supported=no
+   fi
+   if test $llvm_jit_supported = no; then
       # No need for jit libs
       LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter`
    else
       LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter jit mcjit $llvm_codegen`
    fi
+   if test "x$LLVM_LIBS" == "x"; then
+         echo "$LLVM_CONFIG --libs failed."
+         exit 1
+   fi
    LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_LIBS"
    # The c++ standard library used by llvm doesn't show up in $LLVM_SYSTEM_LIBS so add it manually
    if echo $LLVM_CXXFLAGS | grep -q -- '-stdlib=libc++'; then
@@ -2636,21 +2669,6 @@ if test "x$enable_llvm" = "xyes"; then
 
    expected_llvm_version="3.4svn-mono-mono/e656cac"
 
-   # Should be something like '2.6' or '2.7svn'
-   llvm_version=`$LLVM_CONFIG --version`
-   llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
-   AC_MSG_CHECKING(LLVM version)
-   AC_MSG_RESULT($llvm_version)
-   if echo $llvm_version | grep -q 'mono'; then
-         if test "x$enable_llvm_version_check" == "xyes"; then
-                if test "$llvm_version" != "$expected_llvm_version"; then
-                       AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
-                fi
-         fi
-   else
-         AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
-   fi
-
    else
        LLVM_CFLAGS="-I$with_llvm/include -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
        LLVM_CXXFLAGS="$LLVM_CFLAGS -std=gnu++11 -fvisibility-inlines-hidden -fno-rtti -Woverloaded-virtual -Wcast-qual"
index 8e172ad3a4d57b404fd04d6528d289f3c0ccdf57..e9e90c3e8347d0c498f1d997071962524dcdc54b 100644 (file)
@@ -299,6 +299,9 @@ namespace System.Drawing.Printing
                        CUPS_OPTIONS cups_options;
                        string option_name, option_value;
                        int cups_size = Marshal.SizeOf(typeof(CUPS_OPTIONS));
+
+                       LoadOptionList (ppd, "PageSize", paper_names, out defsize);
+                       LoadOptionList (ppd, "InputSlot", paper_sources, out defsource);
                        
                        for (int j = 0; j < numOptions; j++)
                        {
@@ -306,6 +309,8 @@ namespace System.Drawing.Printing
                                option_name = Marshal.PtrToStringAnsi(cups_options.name);
                                option_value = Marshal.PtrToStringAnsi(cups_options.val);
 
+                               if (option_name == "PageSize") defsize = option_value;
+                               else if (option_name == "InputSlot") defsource = option_value;
                                #if PrintDebug
                                Console.WriteLine("{0} = {1}", option_name, option_value);
                                #endif
@@ -314,9 +319,6 @@ namespace System.Drawing.Printing
 
                                options = (IntPtr) ((long)options + cups_size);
                        }
-                       
-                       LoadOptionList (ppd, "PageSize", paper_names, out defsize);
-                       LoadOptionList (ppd, "InputSlot", paper_sources, out defsource);
                }
                
                /// <summary>
index 4cc01193e823796921dfa8f850634882091301f2..e569716599975814af62d64efa7a1a75dc292d59 100644 (file)
@@ -99,7 +99,6 @@ namespace MonoTests.System.Drawing.Printing {
                                optionPtr = (IntPtr)((long)optionPtr + cupsOptionSize);
                        }
                        cupsFreeDests (1, destPtr);
-
                        return options;
                }
 
@@ -115,8 +114,9 @@ namespace MonoTests.System.Drawing.Printing {
                        var settings = new PrinterSettings () { PrinterName = PrinterSettings.InstalledPrinters [0] };
                        Assert.AreEqual (options ["PageSize"], settings.DefaultPageSettings.PaperSize.PaperName,
                                "Bug #602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934) not fixed (PaperSize)");
-                       Assert.AreEqual (options ["Resolution"], string.Format ("{0}dpi", settings.DefaultPageSettings.PrinterResolution.X),
-                               "Bug #602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934) not fixed (Resolution)");
+                       if (options.ContainsKey("Resolution"))
+                               Assert.AreEqual (options ["Resolution"], string.Format ("{0}dpi", settings.DefaultPageSettings.PrinterResolution.X),
+                                       "Bug #602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934) not fixed (Resolution)");
                }
 
                #endregion
index eacf2f6b3dda7072ae5ae8d495dc2e19c5f3895c..36903c675b4858391d77cc4354732ce4a12a8501 100644 (file)
@@ -114,6 +114,51 @@ namespace MonoTests.System.IO.Compression
                        File.Delete ("test.zip");
                }
 
+               [Test]
+               public void ZipOpenAndReopenEntry()
+               {
+                       try {
+                               File.Copy("archive.zip", "test.zip", overwrite: true);
+                               using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+                                       ZipArchiveMode.Update))
+                               {
+                                       var entry = archive.GetEntry("foo.txt");
+                                       Assert.IsNotNull(entry);
+
+                                       var stream = entry.Open();
+
+                                       try {
+                                               stream = entry.Open();
+                                       } catch (global::System.IO.IOException ex) {
+                                               return;
+                                       }
+
+                                       Assert.Fail();
+                               }
+                       } finally {
+                               File.Delete ("test.zip");
+                       }
+               }
+
+
+               [Test]
+               public void ZipOpenCloseAndReopenEntry()
+               {
+                       File.Copy("archive.zip", "test.zip", overwrite: true);
+                       using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+                               ZipArchiveMode.Update))
+                       {
+                               var entry = archive.GetEntry("foo.txt");
+                               Assert.IsNotNull(entry);
+
+                               var stream = entry.Open();
+                               stream.Dispose();
+                               stream = entry.Open();
+                       }
+
+                       File.Delete ("test.zip");
+               }
+
                [Test]
                public void ZipGetEntryDeleteReadMode()
                {
index cd783b8eb0c84b33b3f5a7492afb2496b28afde6..0bc69786418acd9e49b53a51b51dc7fe2dce320c 100644 (file)
@@ -29,10 +29,96 @@ using SharpCompress.Archive;
 
 namespace System.IO.Compression
 {
+       internal class ZipArchiveEntryStream : Stream, IDisposable
+       {
+               private readonly ZipArchiveEntry entry;
+               private readonly Stream stream;
+
+               public override bool CanRead {
+                       get { 
+                               return stream.CanRead;
+                       }
+               }
+
+               public override bool CanSeek {
+                       get {
+                               return stream.CanSeek;
+                       }
+               }
+
+               public override bool CanWrite {
+                       get {
+                               return stream.CanWrite;
+                       }
+               }
+
+               public override long Length {
+                       get {
+                               return stream.Length;
+                       }
+               }
+
+               public override long Position {
+                       get {
+                               return stream.Position;
+                       }
+                       set {
+                               stream.Position = value;
+                       }
+               }
+
+               public ZipArchiveEntryStream(ZipArchiveEntry entry, Stream stream)
+               {
+                       this.entry = entry;
+                       this.stream = stream;
+               }
+
+               public override void Flush ()
+               {
+                       stream.Flush();
+               }
+
+               public override long Seek (long offset, SeekOrigin origin)
+               {
+                       return stream.Seek(offset, origin);
+               }
+
+               public override void SetLength (long value)
+               {
+                       stream.SetLength(value);
+               }
+
+               public override int Read (byte[] buffer, int offset, int count)
+               {
+                       return stream.Read(buffer, offset, count);
+               }
+
+               public override void Write (byte[] buffer, int offset, int count)
+               {
+                       stream.Write(buffer, offset, count);
+               }
+
+               public new void Dispose()
+               {
+                       Dispose(true);
+                       GC.SuppressFinalize(this);
+                       base.Dispose();
+               }
+
+               protected override void Dispose(bool disposing)
+               {
+                       if (disposing) 
+                       {
+                               entry.openStream = null;
+                               stream.Dispose();
+                       }
+               }
+       }
+
        public class ZipArchiveEntry
        {
                readonly SharpCompress.Archive.Zip.ZipArchiveEntry entry;
-               private Stream openStream;
+               internal ZipArchiveEntryStream openStream;
                private bool wasDeleted;
 
                internal ZipArchiveEntry(ZipArchive     archive, SharpCompress.Archive.Zip.ZipArchiveEntry entry)
@@ -112,7 +198,7 @@ namespace System.IO.Compression
                        if (Archive.Mode == ZipArchiveMode.Create && openStream != null)
                                throw new IOException("The archive for this entry was opened with the Create mode, and this entry has already been written to.");
 
-                       openStream = entry.OpenEntryStream();
+                       openStream = new ZipArchiveEntryStream(this, entry.OpenEntryStream());
 
                        return openStream;
                }
index a531b34cf61ecc9e8bae4294d843b151b299830f..789a602e9df5bc0a9f30c1e7764ad1f9f4978ec5 100644 (file)
@@ -58,7 +58,12 @@ namespace System.ServiceModel
                {
                }
 
-               protected WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
+               public WSDualHttpBinding(string configName)
+                       : this (WSDualHttpSecurityMode.Message)
+               {
+               }
+
+               public WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
                {
                        security = new WSDualHttpSecurity (securityMode);
                }
index d7389f43e0d2a98ff28798be97789ff3e3da1969..cfd5e146ec09a907a8e1e27e2f67220f4254587d 100644 (file)
@@ -6,7 +6,9 @@ LIBRARY = System.Web.ApplicationServices.dll
 LIB_REFS = System System.Configuration
 LIB_MCS_FLAGS = -d:SYSTEM_WEB_APPLICATIONSERVICES
 
-EXTRA_DISTFILES = $(RESOURCE_FILES)
+RESOURCE_STRINGS = ./System.Web.ApplicationServices.txt
+
+EXTRA_DISTFILES = $(RESOURCE_FILES) $(RESOURCE_STRINGS)
 
 VALID_PROFILE := $(filter 4, $(FRAMEWORK_VERSION_MAJOR))
 ifndef VALID_PROFILE
index ce75cae57d678c31d6cb27c7ac2b37a6b7a0effa..de8e66df804be586ceba5072bb9657a576034994 100644 (file)
@@ -3,19 +3,21 @@ Assembly/AssemblyInfo.cs
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
 
-System.Web.Configuration/MembershipPasswordCompatibilityMode.cs
+../../../external/referencesource/System.Web.ApplicationServices/Configuration/MembershipPasswordCompatibilityMode.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/IMembershipAdapter.cs
 System.Web.Security/IMembershipHelper.cs
 
 System.Web.UI/KeyedList.cs
 System.Web.UI/KeyedListEnumerator.cs
-System.Web.Security/MembershipCreateStatus.cs
-System.Web.Security/MembershipCreateUserException.cs
-System.Web.Security/MembershipPasswordException.cs
-System.Web.Security/MembershipPasswordFormat.cs
-System.Web.Security/MembershipProviderCollection.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipCreateStatus.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipCreateUserException.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipPasswordException.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipPasswordFormat.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipProviderCollection.cs
 System.Web.Security/MembershipProvider.cs
-System.Web.Security/MembershipUserCollection.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipUserCollection.cs
 System.Web.Security/MembershipUser.cs
-System.Web.Security/MembershipValidatePasswordEventHandler.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipValidatePasswordEventHandler.cs
 System.Web.Security/RoleProvider.cs
-System.Web.Security/ValidatePasswordEventArgs.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/ValidatePasswordEventArgs.cs
+System.Web/ApplicationServicesStrings.cs
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.txt b/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.txt
new file mode 100644 (file)
index 0000000..26d1f17
--- /dev/null
@@ -0,0 +1,21 @@
+Can_not_use_encrypted_passwords_with_autogen_keys=You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.
+CustomLoader_ForbiddenByHost=The host forbids the use of custom loaders.
+CustomLoader_MustImplementICustomLoader=The provided type '{0}' must implement the ICustomLoader interface.
+CustomLoader_NoAttributeFound=The assembly '{0}' did not contain an assembly-level CustomLoaderAttribute.
+CustomLoader_NotInFullTrust=Custom loaders can only be used by fully-trusted applications.
+Membership_DuplicateEmail=The E-mail address is already in use.
+Membership_DuplicateProviderUserKey=The provider user key is already in use.
+Membership_DuplicateUserName=The username is already in use.
+Membership_InvalidAnswer=The password-answer supplied is invalid.
+Membership_InvalidEmail=The E-mail supplied is invalid.
+Membership_InvalidPassword=The password supplied is invalid.  Passwords must conform to the password strength requirements configured for the default provider.
+Membership_InvalidProviderUserKey=The provider user key supplied is invalid. It must be of type System.Guid.
+Membership_InvalidQuestion=The password-question supplied is invalid.  Note that the current provider configuration requires a valid password question and answer.  As a result, a CreateUser overload that accepts question and answer parameters must also be used.
+Membership_InvalidUserName=The username supplied is invalid.
+Membership_no_error=No Error.
+Membership_provider_name_invalid=The membership provider name specified is invalid.
+Membership_UserRejected=The user was rejected.
+Parameter_can_not_be_empty=The parameter '{0}' must not be empty.
+Platform_not_supported=This member is not supported on this platfom.
+Provider_Error=The Provider encountered an unknown error.
+Provider_must_implement_type=Provider must implement the class '{0}'.
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Configuration/MembershipPasswordCompatibilityMode.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Configuration/MembershipPasswordCompatibilityMode.cs
deleted file mode 100644 (file)
index 367108c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Web.Security.MembershipPasswordCompatibilityMode
-//
-// Authors:
-//    Marek Habersack <mhabersack@novell.com>
-//
-// Copyright (C) 2010 Novell, Inc (http://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 System.Web.Configuration
-{
-       public enum MembershipPasswordCompatibilityMode
-       {
-               Framework20,
-               Framework40
-       }
-}
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateStatus.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateStatus.cs
deleted file mode 100644 (file)
index 71fddb4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Web.Security.MembershipCreateStatus
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-// 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.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public enum MembershipCreateStatus
-       {
-               Success,
-               InvalidUserName,
-               InvalidPassword,
-               InvalidQuestion,
-               InvalidAnswer,
-               InvalidEmail,
-               DuplicateUserName,
-               DuplicateEmail,
-               UserRejected,
-               InvalidProviderUserKey,
-               DuplicateProviderUserKey,
-               ProviderError
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateUserException.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateUserException.cs
deleted file mode 100644 (file)
index a5f9e31..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Web.Security.MembershipCreateUserException
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       [Serializable]
-       public class MembershipCreateUserException : Exception
-       {
-               MembershipCreateStatus statusCode;
-               
-               public MembershipCreateUserException ()
-               {
-               }
-               
-               public MembershipCreateUserException (string message): base (message)
-               {
-               }
-               
-               public MembershipCreateUserException (string message, Exception innerException): base (message, innerException)
-               {
-               }
-               
-               protected MembershipCreateUserException (SerializationInfo info, StreamingContext context): base (info, context)
-               {
-                       info.AddValue ("statusCode", statusCode);
-               }
-               
-               public MembershipCreateUserException (MembershipCreateStatus statusCode) : base (statusCode.ToString ())
-               {
-                       this.statusCode = statusCode;
-               }
-               
-               public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
-               {
-                       base.GetObjectData (info, ctx);
-                       statusCode = (MembershipCreateStatus) info.GetValue ("statusCode", typeof(MembershipCreateStatus));
-               }
-               
-               public MembershipCreateStatus StatusCode {
-                       get { return statusCode; }
-               }
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordException.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordException.cs
deleted file mode 100644 (file)
index 5bf60eb..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Web.Security.MembershipPasswordException
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       [Serializable]
-       public class MembershipPasswordException : Exception
-       {
-               public MembershipPasswordException () : base () {}
-               public MembershipPasswordException (string message) : base (message) {}
-               public MembershipPasswordException (string message, Exception innerException) : base (message, innerException) {}
-               
-               protected MembershipPasswordException (SerializationInfo info, StreamingContext context): base (info, context)
-               {
-               }
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordFormat.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordFormat.cs
deleted file mode 100644 (file)
index 2948618..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Web.Security.MembershipPasswordFormat
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-//
-
-//
-// 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.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public enum MembershipPasswordFormat
-       {
-               Clear = 0, 
-               Hashed = 1,
-               Encrypted = 2
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipProviderCollection.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipProviderCollection.cs
deleted file mode 100644 (file)
index be25a05..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Web.Security.MembershipProviderCollection
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2003 Ben Maurer
-// 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.Configuration.Provider;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public sealed class MembershipProviderCollection : ProviderCollection
-       {
-               public override void Add (ProviderBase provider)
-               {
-                       if (provider == null)
-                               throw new ArgumentNullException ("provider");
-
-                       if (provider is MembershipProvider)
-                               base.Add (provider);
-                       else {
-                               throw new ArgumentException ("provider", Locale.GetText (
-                                       "Wrong type, expected {0}.", "MembershipProvider"));
-                       }
-               }
-               
-               public void CopyTo (MembershipProvider[] array, int index)
-               {
-                       base.CopyTo (array, index);
-               }
-               
-               public new MembershipProvider this [string name] {
-                       get { return (MembershipProvider) base [name]; }
-               }
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipUserCollection.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipUserCollection.cs
deleted file mode 100644 (file)
index bbb689f..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Web.Security.MembershipUserCollection
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-// Copyright (C) 2005-2010 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.Runtime.CompilerServices;
-using System.Web.UI;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       [Serializable]
-       public sealed class MembershipUserCollection : ICollection
-       {
-               public MembershipUserCollection ()
-               {
-               }
-               
-               public void Add (MembershipUser user)
-               {
-                       if (user == null)
-                               throw new ArgumentNullException ("user");
-
-                       CheckNotReadOnly ();
-                       store.Add (user.UserName, user);
-               }
-               
-               public void Clear ()
-               {
-                       CheckNotReadOnly ();
-                       store.Clear ();
-               }
-               
-               void ICollection.CopyTo (Array array, int index)
-               {
-                       store.Values.CopyTo (array, index);
-               }
-               
-               public void CopyTo (MembershipUser[] array, int index)
-               {
-                       store.Values.CopyTo (array, index);
-               }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return ((IEnumerable) store).GetEnumerator ();
-               }
-               
-               public void Remove (string name)
-               {
-                       CheckNotReadOnly ();
-                       store.Remove (name);
-               }
-               
-               public void SetReadOnly ()
-               {
-                       readOnly = true;
-               }
-               
-               public int Count {
-                       get { return store.Count; }
-               }
-               
-               public bool IsSynchronized {
-                       get { return false; }
-               }
-               
-               public MembershipUser this [string name] {
-                       get { return (MembershipUser) store [name]; }
-               }
-               
-               public object SyncRoot {
-                       get { return this; }
-               }
-               
-               void CheckNotReadOnly ()
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-               }
-               
-               KeyedList store = new KeyedList ();
-               bool readOnly = false;
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipValidatePasswordEventHandler.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipValidatePasswordEventHandler.cs
deleted file mode 100644 (file)
index 1c47511..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.Security.MembershipValidatePasswordEventHandler
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005 Novell, inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public delegate void MembershipValidatePasswordEventHandler (object sender, ValidatePasswordEventArgs e);
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/ValidatePasswordEventArgs.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/ValidatePasswordEventArgs.cs
deleted file mode 100644 (file)
index ea18903..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Web.Security.ValidatePasswordEventArgs
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005 Novell, inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public sealed class ValidatePasswordEventArgs: EventArgs
-       {
-               bool cancel;
-               Exception exception;
-               bool isNewUser;
-               string userName;
-               string password;
-               
-               public ValidatePasswordEventArgs (string userName, string password, bool isNewUser)
-               {
-                       this.isNewUser = isNewUser;
-                       this.userName = userName;
-                       this.password = password;
-               }
-               
-               public bool Cancel {
-                       get { return cancel; }
-                       set { cancel = value; }
-               }
-               
-               public Exception FailureInformation {
-                       get { return exception; }
-                       set { exception = value; }
-               }
-               
-               public bool IsNewUser {
-                       get { return isNewUser; }
-               }
-               
-               public string UserName {
-                       get { return userName; }
-               }
-               
-               public string Password {
-                       get { return password; }
-               }
-       }
-}
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web/ApplicationServicesStrings.cs b/mcs/class/System.Web.ApplicationServices/System.Web/ApplicationServicesStrings.cs
new file mode 100644 (file)
index 0000000..61fda8a
--- /dev/null
@@ -0,0 +1,29 @@
+namespace System.Web
+{
+    internal class ApplicationServicesStrings
+    {
+      internal const string Can_not_use_encrypted_passwords_with_autogen_keys = "You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.";
+      internal const string CustomLoader_ForbiddenByHost = "The host forbids the use of custom loaders.";
+      internal const string CustomLoader_MustImplementICustomLoader = "The provided type '{0}' must implement the ICustomLoader interface.";
+      internal const string CustomLoader_NoAttributeFound = "The assembly '{0}' did not contain an assembly-level CustomLoaderAttribute.";
+      internal const string CustomLoader_NotInFullTrust = "Custom loaders can only be used by fully-trusted applications (<trust level=\"Full\" />).";
+      internal const string Membership_DuplicateEmail = "The E-mail address is already in use.";
+      internal const string Membership_DuplicateProviderUserKey = "The provider user key is already in use.";
+      internal const string Membership_DuplicateUserName = "The username is already in use.";
+      internal const string Membership_InvalidAnswer = "The password-answer supplied is invalid.";
+      internal const string Membership_InvalidEmail = "The E-mail supplied is invalid.";
+      internal const string Membership_InvalidPassword = "The password supplied is invalid.  Passwords must conform to the password strength requirements configured for the default provider.";
+      internal const string Membership_InvalidProviderUserKey = "The provider user key supplied is invalid. It must be of type System.Guid.";
+      internal const string Membership_InvalidQuestion = "The password-question supplied is invalid.  Note that the current provider configuration requires a valid password question and answer.  As a result, a CreateUser overload that accepts question and answer parameters must also be used.";
+      internal const string Membership_InvalidUserName = "The username supplied is invalid.";
+      internal const string Membership_no_error = "No Error.";
+      internal const string Membership_provider_name_invalid = "The membership provider name specified is invalid.";
+      internal const string Membership_UserRejected = "The user was rejected.";
+      internal const string Parameter_can_not_be_empty = "The parameter '{0}' must not be empty.";
+      internal const string Platform_not_supported = "This member is not supported on the .NET Framework Client Profile.";
+      internal const string Provider_Error = "The Provider encountered an unknown error.";
+      internal const string Provider_must_implement_type = "Provider must implement the class '{0}'.";
+    }
+}
+
+
diff --git a/mcs/class/System.Web/System.Web.Profile/DefaultProfile.cs b/mcs/class/System.Web/System.Web.Profile/DefaultProfile.cs
deleted file mode 100644 (file)
index 4a4250f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Web.UI.WebControls.DefaultProfile.cs
-//
-// 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.
-//
-
-using System;
-using System.Configuration;
-
-namespace System.Web.Profile
-{
-       public class DefaultProfile : ProfileBase
-       {
-               [MonoTODO("Currently does nothing")]
-               public DefaultProfile ()
-               {
-               }
-       }
-
-}
-
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileAuthenticationOption.cs b/mcs/class/System.Web/System.Web.Profile/ProfileAuthenticationOption.cs
deleted file mode 100644 (file)
index 7899453..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Web.Profile.ProfileAuthenticationOption.cs
-//
-// Authors:
-//     Duncan Mak (duncan@ximian.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.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-namespace System.Web.Profile
-{
-        public enum ProfileAuthenticationOption
-        {
-                Anonymous = 0,
-                Authenticated = 1,
-                All = 2
-        }
-}
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileInfo.cs b/mcs/class/System.Web/System.Web.Profile/ProfileInfo.cs
deleted file mode 100644 (file)
index b347281..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Web.Profile.ProfileInfo.cs
-//
-// 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.
-//
-
-using System;
-
-namespace System.Web.Profile
-{
-       [Serializable]
-       public class ProfileInfo
-       {
-               string user_name;
-               bool is_anonymous;
-               DateTime last_activity_date;
-               DateTime last_updated_date;
-               int size;
-
-               protected ProfileInfo ()
-               {
-               }
-
-               public ProfileInfo (string username, 
-                                   bool isAnonymous, 
-                                   DateTime lastActivityDate, 
-                                   DateTime lastUpdatedDate, 
-                                   int size)
-               {
-                       user_name = username;
-                       is_anonymous = isAnonymous;
-                       last_activity_date = lastActivityDate;
-                       last_updated_date = lastUpdatedDate;
-                       this.size = size;
-               }
-
-               public virtual bool IsAnonymous
-               {
-                       get {
-                               return is_anonymous;
-                       }
-               }
-
-               public virtual DateTime LastActivityDate
-               {
-                       get {
-                               return last_activity_date;
-                       }
-               }
-
-               public virtual DateTime LastUpdatedDate {
-                       get {
-                               return last_updated_date;
-                       }
-               }
-
-               public virtual int Size {
-                       get {
-                               return size;
-                       }
-               }
-
-               public virtual string UserName {
-                       get {
-                               return user_name;
-                       }
-               }
-       }
-
-}
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileInfoCollection.cs b/mcs/class/System.Web/System.Web.Profile/ProfileInfoCollection.cs
deleted file mode 100644 (file)
index 545c235..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Web.Profile.ProfileInfoCollection.cs
-//
-// 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.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.Profile
-{
-       [Serializable]
-       public sealed class ProfileInfoCollection : ICollection, IEnumerable
-       {
-               public ProfileInfoCollection()
-               {
-                       list = new ArrayList ();
-               }
-
-               public void Add (ProfileInfo profileInfo)
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-
-                       list.Add (profileInfo);
-               }
-
-               public void Clear ()
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-
-                       list.Clear ();
-               }
-
-               public void CopyTo (System.Array array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public void CopyTo (ProfileInfo[ ] array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public IEnumerator GetEnumerator ()
-               {
-                       return list.GetEnumerator ();
-               }
-
-               public void Remove (string name)
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-
-                       for (int i = 0; i < list.Count; i ++) {
-                               ProfileInfo info = (ProfileInfo)list[i];
-                               if (info.UserName == name) {
-                                       list.Remove (i);
-                                       break;
-                               }
-                       }
-               }
-
-               public void SetReadOnly ()
-               {
-                       readOnly = true;
-               }
-
-               public int Count {
-                       get {
-                               return list.Count;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return false;
-                       }
-               }
-
-               public object SyncRoot {
-                       get {
-                               return this;
-                       }
-               }
-
-               public ProfileInfo this [string name] {
-                       get {
-                               for (int i = 0; i < list.Count; i ++) {
-                                       ProfileInfo info = (ProfileInfo)list[i];
-                                       if (info.UserName == name) {
-                                               return info;
-                                       }
-                               }
-
-                               return null;
-                       }
-               }
-
-               ArrayList list;
-               bool readOnly;
-       }
-
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IPostBackContainer.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IPostBackContainer.cs
deleted file mode 100644 (file)
index c00250c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Web.UI.WebControls.IPostBackContainer.cs
-//
-// Authors:
-//      Sanjay Gupta (gsanjay@novell.com)
-//
-// (C) 2004-2010 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.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
-       public interface IPostBackContainer
-       {
-               PostBackOptions GetPostBackOptions (IButtonControl control);
-       }
-}
-
-
diff --git a/mcs/class/System.Web/System.Web.UI/ICheckBoxControl.cs b/mcs/class/System.Web/System.Web.UI/ICheckBoxControl.cs
deleted file mode 100644 (file)
index 006804c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Web.UI.ICheckBoxControl.cs
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005-2010 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 System.Web.UI
-{
-       public interface ICheckBoxControl
-       {
-               bool Checked { get; set; }
-               event EventHandler CheckedChanged;
-       }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs b/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs
deleted file mode 100644 (file)
index 5ce8580..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.UI.IEditableTextControl.cs
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005-2010 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 System.Web.UI
-{
-       public interface IEditableTextControl: ITextControl
-       {
-               event EventHandler TextChanged;
-       }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/ITextControl.cs b/mcs/class/System.Web/System.Web.UI/ITextControl.cs
deleted file mode 100644 (file)
index f305916..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Web.UI.ITextControl.cs
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005-2010 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 System.Web.UI
-{
-       public interface ITextControl
-       {
-               string Text { get; set; }
-       }
-}
index 908e44292fe15f5def0e3214fe65985b84a6e100..09fe382000b5e9f1ace1e571617c279f1fea9ef6 100644 (file)
@@ -410,16 +410,15 @@ System.Web/ProcessModelInfo.cs
 System.Web/ProcessShutdownReason.cs
 System.Web/ProcessStatus.cs
 System.Web.Profile/CustomProviderDataAttribute.cs
-System.Web.Profile/DefaultProfile.cs
-System.Web.Profile/ProfileAuthenticationOption.cs
+../../../external/referencesource/System.Web/Profile/DefaultHttpProfile.cs
+../../../external/referencesource/System.Web/Profile/ProfileAuthenticationOptions.cs
 System.Web.Profile/ProfileAutoSaveEventArgs.cs
 System.Web.Profile/ProfileAutoSaveEventHandler.cs
 System.Web.Profile/ProfileBase.cs
 ../../../external/referencesource/System.Web/Profile/ProfileEventArgs.cs
 ../../../external/referencesource/System.Web/Profile/ProfileEventHandler.cs
 ../../../external/referencesource/System.Web/Profile/HttpProfileGroupBase.cs
-System.Web.Profile/ProfileInfoCollection.cs
-System.Web.Profile/ProfileInfo.cs
+../../../external/referencesource/System.Web/Profile/ProfileInfo.cs
 System.Web.Profile/ProfileManager.cs
 System.Web.Profile/ProfileMigrateEventArgs.cs
 System.Web.Profile/ProfileMigrateEventHandler.cs
@@ -620,7 +619,7 @@ System.Web.UI/HtmlTextWriter.cs
 ../../../external/referencesource/System.Web/UI/IBindableControl.cs
 ../../../external/referencesource/System.Web/UI/IBindableTemplate.cs
 ../../../external/referencesource/System.Web/UI/ICallbackEventHandler.cs
-System.Web.UI/ICheckBoxControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/ICheckBoxControl.cs
 ../../../external/referencesource/System.Web/UI/IControlBuilderAccessor.cs
 ../../../external/referencesource/System.Web/UI/IControlDesignerAccessor.cs
 ../../../external/referencesource/System.Web/UI/IDataBindingsAccessor.cs
@@ -628,7 +627,7 @@ System.Web.UI/ICheckBoxControl.cs
 ../../../external/referencesource/System.Web/UI/IDataSource.cs
 ../../../external/referencesource/System.Web/UI/IDataSourceViewSchemaAccessor.cs
 ../../../external/referencesource/System.Web/UI/IDReferencePropertyAttribute.cs
-System.Web.UI/IEditableTextControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/IEditableTextControl.cs
 ../../../external/referencesource/System.Web/UI/IExpressionsAccessor.cs
 ../../../external/referencesource/System.Web/UI/IFilterResolutionService.cs
 System.Web.UI/IgnoreUnknownContentAttribute.cs
@@ -653,7 +652,7 @@ System.Web.UI/IScriptManager.cs
 ../../../external/referencesource/System.Web/UI/IScriptResourceMapping.cs
 System.Web.UI/ITagNameToTypeMapper.cs
 ../../../external/referencesource/System.Web/UI/ITemplate.cs
-System.Web.UI/ITextControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/ITextControl.cs
 ../../../external/referencesource/System.Web/UI/IThemeResolutionService.cs
 ../../../external/referencesource/System.Web/UI/IUrlResolutionService.cs
 ../../../external/referencesource/System.Web/UI/IUserControlDesignerAccessor.cs
@@ -953,7 +952,7 @@ System.Web.UI.WebControls/ImageMap.cs
 ../../../external/referencesource/System.Web/UI/WebControls/ImageMapEventHandler.cs
 System.Web.UI.WebControls/IMenuRenderer.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IPersistedSelector.cs
-System.Web.UI.WebControls/IPostBackContainer.cs
+../../../external/referencesource/System.Web/UI/WebControls/IPostBackContainer.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IRepeatInfoUser.cs
 System.Web.UI.WebControls/LabelControlBuilder.cs
 System.Web.UI.WebControls/Label.cs
@@ -1264,6 +1263,7 @@ System.Web.UI/FileLevelMasterPageControlBuilder.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IDataBoundItemControl.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IDataBoundListControl.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IFieldControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/IRenderOuterTableControl.cs
 System.Web.UI.WebControls/IRenderOuterTable.cs
 System.Web.UI.WebControls/MenuListRenderer.cs
 ../../../external/referencesource/System.Web/UI/WebControls/MenuRenderingMode.cs
@@ -1420,7 +1420,6 @@ ReferenceSources/SR.cs
 ../../../external/referencesource/System.Web/Util/GCUtil.cs
 ../../../external/referencesource/System.Web/Util/SimpleRecyclingCache.cs
 ../../../external/referencesource/System.Web/Util/VersionUtil.cs
-
 ../../../external/referencesource/System.Web/Util/AppVerifierErrorCode.cs
 ../../../external/referencesource/System.Web/Util/DateTimeUtil.cs
 ../../../external/referencesource/System.Web/Util/hresults.cs
@@ -1430,4 +1429,23 @@ ReferenceSources/SR.cs
 ../../../external/referencesource/System.Web/Util/RegexUtil.cs
 ../../../external/referencesource/System.Web/Util/ObjectSet.cs
 ../../../external/referencesource/System.Web/Util/ParseHttpDate.cs
+../../../external/referencesource/System.Web/IntraPartitionAPIs/xsp/PerfCounterEnum.cs
+../../../external/referencesource/System.Web/misc/InvariantComparer.cs
+
+../../../external/referencesource/System.Web/ModelBinding/DictionaryHelpers.cs
+../../../external/referencesource/System.Web/ModelBinding/ValueProviderResult.cs
+../../../external/referencesource/System.Web/ModelBinding/ModelState.cs
+../../../external/referencesource/System.Web/ModelBinding/ModelStateDictionary.cs
+../../../external/referencesource/System.Web/ModelBinding/ModelBindingExecutionContext.cs
 
+../../../external/referencesource/System.Web/ModelBinding/IValueProvider.cs
+../../../external/referencesource/System.Web/ModelBinding/IValueProviderSource.cs
+../../../external/referencesource/System.Web/ModelBinding/IUnvalidatedValueProviderSource.cs
+../../../external/referencesource/System.Web/UI/IUpdatePanel.cs
+../../../external/referencesource/System.Web/Configuration/IServerConfig2.cs
+../../../external/referencesource/System.Web/UI/WebControls/IBorderPaddingControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/IEditableTextControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/IWizardSideBarListControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/WizardSideBarListControlItemEventArgs.cs
+../../../external/referencesource/System.Web/UI/WebControls/WizardSideBarListControlItem.cs
+../../../external/referencesource/System.Web/Security/Cryptography/ICryptoService.cs
index a28f7a29d0d3801f1b811d81e3dd1533a2c84a17..1eeb9c9a368866973e0da7f87009a0a1036ebf01 100644 (file)
@@ -1,22 +1,22 @@
 // TODO:
-//    DispatcherObject returned by BeginInvoke must allow:
-//       * Waiting until delegate is invoked.
-//       See: BeginInvoke documentation for details
+//     DispatcherObject returned by BeginInvoke must allow:
+//        * Waiting until delegate is invoked.
+//        See: BeginInvoke documentation for details
 //
-//    Implement the "Invoke" methods, they are currently not working.
+//     Implement the "Invoke" methods, they are currently not working.
 //
-//    Add support for disabling the dispatcher and resuming it.
-//    Add support for Waiting for new tasks to be pushed, so that we dont busy loop.
-//    Add support for aborting an operation (emit the hook.operationaborted too) 
+//     Add support for disabling the dispatcher and resuming it.
+//     Add support for Waiting for new tasks to be pushed, so that we dont busy loop.
+//     Add support for aborting an operation (emit the hook.operationaborted too) 
 //
 // Very confusing information about Shutdown: it states that shutdown is
 // not over, until all events are unwinded, and also states that all events
 // are aborted at that point.  See 'Dispatcher.InvokeShutdown' docs,
 //
 // Testing reveals that 
-//     -> InvokeShutdown() stops processing, even if events are available,
-//        there is no "unwinding" of events, even of higher priority events,
-//        they are just ignored.
+//      -> InvokeShutdown() stops processing, even if events are available,
+//             there is no "unwinding" of events, even of higher priority events,
+//             they are just ignored.
 //
 // The documentation for the Dispatcher family is poorly written, complete
 // sections are cut-and-pasted that add no value and the important pieces
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 // Copyright (c) 2006 Novell, Inc. (http://www.novell.com)
+// Copyright (c) 2016 Quamotion (http://quamotion.mobi)
 //
 // Authors:
 //     Miguel de Icaza (miguel@novell.com)
+//     Frederik Carlier (frederik.carlier@quamotion.mobi)
 //
 using System;
 using System.Collections;
@@ -181,6 +183,21 @@ namespace System.Windows.Threading {
                        return op;
                }
 
+               public DispatcherOperation InvokeAsync (Action callback)
+               {
+                       return this.BeginInvoke(callback);
+               }
+
+               public DispatcherOperation InvokeAsync (Action callback, DispatcherPriority priority)
+               {
+                       return this.BeginInvoke(callback, priority);
+               }
+
+               public DispatcherOperation InvokeAsync (Action callback, DispatcherPriority priority, CancellationToken cancellationToken)
+               {
+                       return this.BeginInvoke(callback, priority);
+               }
+
                public object Invoke (Delegate method, params object[] args)
                {
                        throw new NotImplementedException ();
@@ -521,32 +538,33 @@ namespace System.Windows.Threading {
 
                public void Enqueue (object obj)
                {
-                        if (size == array.Length)
-                                Grow ();
-                        array[tail] = obj;
-                        tail = (tail+1) % array.Length;
-                        size++;
+                       if (size == array.Length)
+                                       Grow ();
+                       array[tail] = obj;
+                       tail = (tail+1) % array.Length;
+                       size++;
                }
 
                public object Dequeue ()
-                {
-                        if (size < 1)
-                                throw new InvalidOperationException ();
-                        object result = array[head];
-                        array [head] = null;
-                        head = (head + 1) % array.Length;
-                        size--;
-                        return result;
-                }
-
-               void Grow () {
-                        int newc = array.Length * 2;
-                        object[] new_contents = new object[newc];
-                        array.CopyTo (new_contents, 0);
-                        array = new_contents;
-                        head = 0;
-                        tail = head + size;
-                }
+               {
+                       if (size < 1)
+                                       throw new InvalidOperationException ();
+                       object result = array[head];
+                       array [head] = null;
+                       head = (head + 1) % array.Length;
+                       size--;
+                       return result;
+               }
+
+               void Grow () 
+               {
+                       int newc = array.Length * 2;
+                       object[] new_contents = new object[newc];
+                       array.CopyTo (new_contents, 0);
+                       array = new_contents;
+                       head = 0;
+                       tail = head + size;
+               }
 
                public int Count {
                        get {
index 5c06c41ac2639922498a73828fd9acc353137067..36299db37d296d090cb5477c6a20fb8ee3745f46 100644 (file)
@@ -29,6 +29,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Security;
 using System.Threading;
+using System.Threading.Tasks;
 
 namespace System.Windows.Threading {
 
@@ -90,6 +91,12 @@ namespace System.Windows.Threading {
                        throw new NotImplementedException ();
                }
 
+               public Task Task {
+                       get {
+                               throw new NotImplementedException();
+                       }
+               }
+
                public DispatcherOperationStatus Status {
                        get {
                                return status;
index 6c58234d892289e057d42de6fb13da888b6fc681..81675b16232b327fa9b2cd836eda14b6441f616e 100644 (file)
@@ -736,7 +736,8 @@ namespace System
 
                public TimeSpan GetUtcOffset (DateTimeOffset dateTimeOffset)
                {
-                       throw new NotImplementedException ();
+                       bool isDST;
+                       return GetUtcOffset (dateTimeOffset.UtcDateTime, out isDST);
                }
 
                private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST)
index e8990a6013944c01356c76d5fcc2148302a5920c..3bb464fe83d588485c10b81541e2bf52236748a8 100644 (file)
@@ -1121,7 +1121,33 @@ namespace MonoTests.System
                                Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
                                Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
                        }
-               }
+
+                 [Test]
+                 public void  GetUtcOffset_FromDateTimeOffset ()
+                 {
+                         DateTimeOffset offset;
+
+                         offset = new DateTimeOffset(dst1Start, baseUtcOffset);
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst1Start_with_baseUtcOffset#before");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset), "dst1Start_with_baseUtcOffset#exact");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst1Start_with_baseUtcOffset#after");
+
+                         offset = new DateTimeOffset(dst1End, dstOffset + baseUtcOffset);
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst1End_with_dstOffset+baseUtcOffset#before");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset), "dst1End_with_dstOffset+baseUtcOffset#exact");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst1End_with_dstOffset+baseUtcOffset#after");
+
+                         offset = new DateTimeOffset(dst2Start, baseUtcOffset);
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst2Start_with_baseUtcOffset#before");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset), "dst2Start_with_baseUtcOffset#exact");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst2Start_with_baseUtcOffset#after");
+
+                         offset = new DateTimeOffset(dst2End, baseUtcOffset + dstOffset);
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst2End_with_dstOffset+baseUtcOffset#before");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset), "dst2End_with_dstOffset+baseUtcOffset#exact");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst2End_with_dstOffset+baseUtcOffset#after");
+                 }
+    }
 
                [TestFixture]
                public class GetDaylightChanges
index d243afc876c8e93d83f065e300fceaaae8d5a353..46c63cd9dfeff02e3431f06c12e0317b3b25f3be 100755 (executable)
@@ -353,10 +353,12 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
 
                        // The non-parallel part
                        byte [] buffer = new byte [8192];
+                       // everything other than a-zA-Z0-9_ needs to be escaped in asm symbols.
+                       var symbolEscapeRE = new System.Text.RegularExpressions.Regex ("[^\\w_]");
                        foreach (var url in files) {
                                string fname = LocateFile (new Uri (url).LocalPath);
                                string aname = Path.GetFileName (fname);
-                               string encoded = aname.Replace ("-", "_").Replace (".", "_");
+                               string encoded = symbolEscapeRE.Replace (aname, "_");
 
                                if (prog == null)
                                        prog = aname;
@@ -600,7 +602,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                                smonolib = "`pkg-config --variable=libdir mono-2`/libmono-2.0.a ";
                                        else
                                                smonolib = "-Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic ";
-                                       cmd = String.Format("{4} -o {2} -Wall `pkg-config --cflags mono-2` {0} {3} " +
+                                       cmd = String.Format("{4} -o '{2}' -Wall `pkg-config --cflags mono-2` {0} {3} " +
                                                "`pkg-config --libs-only-L mono-2` " + smonolib +
                                                "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1}",
                                                temp_c, temp_o, output, zlib, cc);
@@ -608,7 +610,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                else
                                {
 
-                                       cmd = String.Format("{4} " + debugging + " -o {2} -Wall {0} `pkg-config --cflags --libs mono-2` {3} {1}",
+                                       cmd = String.Format("{4} " + debugging + " -o '{2}' -Wall {0} `pkg-config --cflags --libs mono-2` {3} {1}",
                                                temp_c, temp_o, output, zlib, cc);
                                }
                                Execute (cmd);
index 961ff53416584106dd9672445f82853a423e5c2d..7bc9ab9c88163dee7e74afa2a3a0fa54b8a4f3a1 100644 (file)
@@ -118,6 +118,9 @@ get_shadow_assembly_location_base (MonoDomain *domain, MonoError *error);
 
 static MonoLoadFunc load_function = NULL;
 
+/* Lazy class loading functions */
+static GENERATE_GET_CLASS_WITH_CACHE (assembly, System.Reflection, Assembly)
+
 void
 mono_install_runtime_load (MonoLoadFunc func)
 {
@@ -256,11 +259,11 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT
 
        mono_thread_init (start_cb, attach_cb);
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
        setup = (MonoAppDomainSetup *) mono_object_new_pinned (domain, klass, error);
        return_if_nok (error);
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomain");
 
        ad = (MonoAppDomain *) mono_object_new_pinned (domain, klass, error);
        return_if_nok (error);
@@ -306,7 +309,7 @@ mono_get_corlib_version (void)
        MonoClassField *field;
        MonoObject *value;
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "Environment");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "Environment");
        mono_class_init (klass);
        field = mono_class_get_field_from_name (klass, "mono_corlib_version");
        if (!field)
@@ -357,8 +360,7 @@ mono_context_init_checked (MonoDomain *domain, MonoError *error)
 
        mono_error_init (error);
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
-
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
        context = (MonoAppContext *) mono_object_new_pinned (domain, klass, error);
        return_if_nok (error);
 
@@ -427,7 +429,7 @@ mono_domain_create_appdomain (char *friendly_name, char *configuration_file)
        MonoAppDomainSetup *setup;
        MonoClass *klass;
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
        setup = (MonoAppDomainSetup *) mono_object_new_checked (mono_domain_get (), klass, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
        setup->configuration_file = configuration_file != NULL ? mono_string_new (mono_domain_get (), configuration_file) : NULL;
@@ -467,7 +469,7 @@ copy_app_domain_setup (MonoDomain *domain, MonoAppDomainSetup *setup, MonoError
        mono_error_init (error);
 
        caller_domain = mono_domain_get ();
-       ads_class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       ads_class = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
 
        copy = (MonoAppDomainSetup*)mono_object_new_checked (domain, ads_class, error);
        return_val_if_nok (error, NULL);
@@ -510,7 +512,7 @@ mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetup *
 
        mono_error_init (error);
 
-       adclass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
+       adclass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomain");
 
        /* FIXME: pin all those objects */
        data = mono_domain_create();
@@ -957,17 +959,12 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad, MonoBoolean refonly
        MonoError error;
        MonoDomain *domain = ad->data; 
        MonoAssembly* ass;
-       static MonoClass *System_Reflection_Assembly;
        MonoArray *res;
        GSList *tmp;
        int i;
        GPtrArray *assemblies;
 
        mono_error_init (&error);
-       
-       if (!System_Reflection_Assembly)
-               System_Reflection_Assembly = mono_class_from_name (
-                       mono_defaults.corlib, "System.Reflection", "Assembly");
 
        /* 
         * Make a copy of the list of assemblies because we can't hold the assemblies
@@ -986,7 +983,7 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad, MonoBoolean refonly
        }
        mono_domain_assemblies_unlock (domain);
 
-       res = mono_array_new (domain, System_Reflection_Assembly, assemblies->len);
+       res = mono_array_new (domain, mono_class_get_assembly_class (), assemblies->len);
        for (i = 0; i < assemblies->len; ++i) {
                ass = (MonoAssembly *)g_ptr_array_index (assemblies, i);
                MonoReflectionAssembly *ass_obj = mono_assembly_get_object_checked (domain, ass, &error);
index fde74b06b7a9248adc026b939471555d9c2a9ae8..20373d0afcf3463233868e0569d99db662f47c02 100644 (file)
@@ -193,6 +193,9 @@ static mono_mutex_t assembly_binding_mutex;
 /* Loaded assembly binding info */
 static GSList *loaded_assembly_bindings = NULL;
 
+/* Class lazy loading functions */
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (internals_visible, System.Runtime.CompilerServices, InternalsVisibleToAttribute)
+
 static MonoAssembly*
 mono_assembly_invoke_search_hook_internal (MonoAssemblyName *aname, MonoAssembly *requesting, gboolean refonly, gboolean postload);
 static MonoAssembly*
@@ -1684,7 +1687,7 @@ free_item (gpointer val, gpointer user_data)
  * names in custom attributes.
  *
  * This is an internal method, we need this because when we load mscorlib
- * we do not have the mono_defaults.internals_visible_class loaded yet,
+ * we do not have the internals visible cattr loaded yet,
  * so we need to load these after we initialize the runtime. 
  *
  * LOCKING: Acquires the assemblies lock plus the loader lock.
@@ -1724,7 +1727,7 @@ mono_assembly_load_friends (MonoAssembly* ass)
                MonoAssemblyName *aname;
                const gchar *data;
                /* Do some sanity checking */
-               if (!attr->ctor || attr->ctor->klass != mono_defaults.internals_visible_class)
+               if (!attr->ctor || attr->ctor->klass != mono_class_try_get_internals_visible_class ())
                        continue;
                if (attr->data_size < 4)
                        continue;
index 28a25a1f8f7c68f9a4011e80f355cf4926940a27..ffd9749f383f4165a80a0fb67d92349b0d41be16 100644 (file)
@@ -1147,16 +1147,12 @@ typedef struct {
        MonoClass *typed_reference_class;
        MonoClass *argumenthandle_class;
        MonoClass *monitor_class;
-       MonoClass *runtimesecurityframe_class;
-       MonoClass *executioncontext_class;
-       MonoClass *internals_visible_class;
        MonoClass *generic_ilist_class;
        MonoClass *generic_nullable_class;
-       MonoClass *safehandle_class;
        MonoClass *handleref_class;
        MonoClass *attribute_class;
        MonoClass *customattribute_data_class;
-       MonoClass *critical_finalizer_object;
+       MonoClass *critical_finalizer_object; /* MAYBE NULL */
        MonoClass *generic_ireadonlylist_class;
        MonoClass *threadpool_wait_callback_class;
        MonoMethod *threadpool_perform_wait_callback_method;
@@ -1182,6 +1178,9 @@ mono_install_remoting_trampoline (MonoRemotingTrampoline func);
 #define GENERATE_GET_CLASS_WITH_CACHE_DECL(shortname) \
 MonoClass* mono_class_get_##shortname##_class (void);
 
+#define GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL(shortname) \
+MonoClass* mono_class_try_get_##shortname##_class (void);
+
 #define GENERATE_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
 MonoClass*     \
 mono_class_get_##shortname##_class (void)      \
@@ -1189,17 +1188,31 @@ mono_class_get_##shortname##_class (void)       \
        static MonoClass *tmp_class;    \
        MonoClass *klass = tmp_class;   \
        if (!klass) {   \
-               klass = mono_class_from_name (mono_defaults.corlib, #namespace, #name); \
-               g_assert (klass);       \
+               klass = mono_class_load_from_name (mono_defaults.corlib, #namespace, #name);    \
                mono_memory_barrier (); \
                tmp_class = klass;      \
        }       \
        return klass;   \
 }
 
-#define GENERATE_STATIC_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
-static GENERATE_GET_CLASS_WITH_CACHE (shortname,namespace,name)
+#define GENERATE_TRY_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
+MonoClass*     \
+mono_class_try_get_##shortname##_class (void)  \
+{      \
+       static volatile MonoClass *tmp_class;   \
+       static volatile gboolean inited;        \
+       MonoClass *klass = (MonoClass *)tmp_class;      \
+       mono_memory_barrier (); \
+       if (!inited) {  \
+               klass = mono_class_try_load_from_name (mono_defaults.corlib, #namespace, #name);        \
+               tmp_class = klass;      \
+               mono_memory_barrier (); \
+               inited = TRUE;  \
+       }       \
+       return klass;   \
+}
 
+GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL (safehandle)
 
 #ifndef DISABLE_COM
 
@@ -1477,4 +1490,10 @@ get_image_for_generic_param (MonoGenericParam *param);
 char *
 make_generic_name_string (MonoImage *image, int num);
 
+MonoClass *
+mono_class_load_from_name (MonoImage *image, const char* name_space, const char *name);
+
+MonoClass*
+mono_class_try_load_from_name (MonoImage *image, const char* name_space, const char *name);
+
 #endif /* __MONO_METADATA_CLASS_INTERNALS_H__ */
index 983f1ca4149d90e78ab62646b4c9983b3d2a415d..8648223d8a93b4d1f90623c1f6de9fdaedddf57a 100644 (file)
@@ -3102,15 +3102,15 @@ get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enume
        all_interfaces = eclass->rank && eclass->element_class->rank? FALSE: TRUE;
 
        if (!generic_icollection_class) {
-               generic_icollection_class = mono_class_from_name (mono_defaults.corlib,
+               generic_icollection_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "ICollection`1");
-               generic_ienumerable_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ienumerable_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IEnumerable`1");
-               generic_ienumerator_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ienumerator_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IEnumerator`1");
-               generic_ireadonlylist_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ireadonlylist_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IReadOnlyList`1");
-               generic_ireadonlycollection_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ireadonlycollection_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IReadOnlyCollection`1");
        }
 
@@ -6217,7 +6217,7 @@ make_generic_param_class (MonoGenericParam *param, MonoGenericParamInfo *pinfo)
                CHECKED_METADATA_WRITE_PTR ( klass->parent , pinfo->constraints [0] );
                pos++;
        } else if (pinfo && pinfo->flags & GENERIC_PARAMETER_ATTRIBUTE_VALUE_TYPE_CONSTRAINT) {
-               CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_class_from_name (mono_defaults.corlib, "System", "ValueType") );
+               CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_class_load_from_name (mono_defaults.corlib, "System", "ValueType") );
        } else {
                CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_defaults.object_class );
        }
@@ -6743,7 +6743,7 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
 
        /* for the building corlib use System.Array from it */
        if (image->assembly && assembly_is_dynamic (image->assembly) && image->assembly_name && strcmp (image->assembly_name, "mscorlib") == 0) {
-               parent = mono_class_from_name (image, "System", "Array");
+               parent = mono_class_load_from_name (image, "System", "Array");
                corlib_type = TRUE;
        } else {
                parent = mono_defaults.array_class;
@@ -7836,13 +7836,15 @@ return_nested_in (MonoClass *klass, char *nested)
 }
 
 static MonoClass*
-search_modules (MonoImage *image, const char *name_space, const char *name)
+search_modules (MonoImage *image, const char *name_space, const char *name, MonoError *error)
 {
        MonoTableInfo *file_table = &image->tables [MONO_TABLE_FILE];
        MonoImage *file_image;
        MonoClass *klass;
        int i;
 
+       mono_error_init (error);
+
        /* 
         * The EXPORTEDTYPES table only contains public types, so have to search the
         * modules as well.
@@ -7857,8 +7859,8 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
 
                file_image = mono_image_load_file_for_image (image, i + 1);
                if (file_image) {
-                       klass = mono_class_from_name (file_image, name_space, name);
-                       if (klass)
+                       klass = mono_class_from_name_checked (file_image, name_space, name, error);
+                       if (klass || !is_ok (error))
                                return klass;
                }
        }
@@ -7867,7 +7869,7 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
 }
 
 static MonoClass *
-mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, const char *name, MonoError *error, GHashTable* visited_images)
+mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, const char *name, GHashTable* visited_images, MonoError *error)
 {
        GHashTable *nspace_table;
        MonoImage *loaded_image;
@@ -7900,8 +7902,11 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
        if (get_class_from_name && image->tables [MONO_TABLE_EXPORTEDTYPE].rows == 0) {
                gboolean res = get_class_from_name (image, name_space, name, &klass);
                if (res) {
-                       if (!klass)
-                               klass = search_modules (image, name_space, name);
+                       if (!klass) {
+                               klass = search_modules (image, name_space, name, error);
+                               if (!is_ok (error))
+                                       return NULL;
+                       }
                        if (nested)
                                return klass ? return_nested_in (klass, nested) : NULL;
                        else
@@ -7924,15 +7929,15 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                for (i = 0; i < image->module_count; ++i) {
                        MonoImage *module = image->modules [i];
 
-                       klass = mono_class_from_name (module, name_space, name);
-                       if (klass)
+                       klass = mono_class_from_name_checked (module, name_space, name, error);
+                       if (klass || !is_ok (error))
                                return klass;
                }
        }
 
        if (!token) {
-               klass = search_modules (image, name_space, name);
-               if (klass)
+               klass = search_modules (image, name_space, name, error);
+               if (klass || !is_ok (error))
                        return klass;
        }
 
@@ -7953,7 +7958,7 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                        loaded_image = mono_assembly_load_module (image->assembly, impl >> MONO_IMPLEMENTATION_BITS);
                        if (!loaded_image)
                                return NULL;
-                       klass = mono_class_from_name_checked_aux (loaded_image, name_space, name, error, visited_images);
+                       klass = mono_class_from_name_checked_aux (loaded_image, name_space, name, visited_images, error);
                        if (nested)
                                return klass ? return_nested_in (klass, nested) : NULL;
                        return klass;
@@ -7966,9 +7971,9 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                        g_assert (image->references [assembly_idx - 1]);
                        if (image->references [assembly_idx - 1] == (gpointer)-1)
                                return NULL;                    
-                       klass = mono_class_from_name_checked_aux (image->references [assembly_idx - 1]->image, name_space, name, error, visited_images);
+                       klass = mono_class_from_name_checked_aux (image->references [assembly_idx - 1]->image, name_space, name, visited_images, error);
                        if (nested)
-                               return return_nested_in (klass, nested);
+                               return klass ? return_nested_in (klass, nested) : NULL;
                        return klass;
                } else {
                        g_assert_not_reached ();
@@ -7983,6 +7988,18 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
        return klass;
 }
 
+/**
+ * mono_class_from_name_checked:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * Obtains a MonoClass with a given namespace and a given name which
+ * is located in the given MonoImage.
+ *
+ * Works like mono_class_from_name, but error handling is tricky. It can return NULL and have no error
+ * set if the class was not found or it will return NULL and set the error if there was a loading error.
+ */
 MonoClass *
 mono_class_from_name_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error)
 {
@@ -7991,7 +8008,7 @@ mono_class_from_name_checked (MonoImage *image, const char* name_space, const ch
 
        visited_images = g_hash_table_new (g_direct_hash, g_direct_equal);
 
-       klass = mono_class_from_name_checked_aux (image, name_space, name, error, visited_images);
+       klass = mono_class_from_name_checked_aux (image, name_space, name, visited_images, error);
 
        g_hash_table_destroy (visited_images);
 
@@ -8025,6 +8042,56 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
        return klass;
 }
 
+/**
+ * mono_class_load_from_name:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * This function works exactly like mono_class_from_name but it will abort if the class is not found.
+ * This function should be used by the runtime for critical types to which there's no way to recover but crash
+ * If they are missing. Thing of System.Object or System.String.
+ */
+MonoClass *
+mono_class_load_from_name (MonoImage *image, const char* name_space, const char *name)
+{
+       MonoError error;
+       MonoClass *klass;
+
+       klass = mono_class_from_name_checked (image, name_space, name, &error);
+       if (!klass)
+               g_error ("Runtime critical type %s.%s not found", name_space, name);
+       if (!mono_error_ok (&error))
+               g_error ("Could not load runtime critical type %s.%s due to %s", name_space, name, mono_error_get_message (&error));
+       return klass;
+}
+
+/**
+ * mono_class_try_load_from_name:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * This function tries to load a type, returning the class was found or NULL otherwise.
+ * This function should be used by the runtime when probing for optional types, those that could have being linked out.
+ *
+ * Big design consideration. This function aborts if there was an error loading the type. This prevents us from missing
+ * a type that we would otherwise assume to be available but was not due some error.
+ *
+ */
+MonoClass*
+mono_class_try_load_from_name (MonoImage *image, const char* name_space, const char *name)
+{
+       MonoError error;
+       MonoClass *klass;
+
+       klass = mono_class_from_name_checked (image, name_space, name, &error);
+       if (!mono_error_ok (&error))
+               g_error ("Could not load runtime critical type %s.%s due to %s", name_space, name, mono_error_get_message (&error));
+       return klass;
+}
+
+
 /**
  * mono_class_is_subclass_of:
  * @klass: class to probe if it is a subclass of another one
@@ -10813,3 +10880,5 @@ mono_class_full_name (MonoClass *klass)
        return mono_type_full_name (&klass->byval_arg);
 }
 
+/* Declare all shared lazy type lookup functions */
+GENERATE_TRY_GET_CLASS_WITH_CACHE (safehandle, System.Runtime.InteropServices, SafeHandle)
index d9f315139b123d26407ec1d7b443270fb842fe27..3b5ca560b7939f3d9949ced2665018c2afdfc396 100644 (file)
@@ -26,10 +26,10 @@ mono_class_init            (MonoClass *klass);
 MONO_API MonoVTable *
 mono_class_vtable          (MonoDomain *domain, MonoClass *klass);
 
-MONO_API MonoClass *
+MONO_RT_EXTERNAL_ONLY MONO_API MonoClass *
 mono_class_from_name       (MonoImage *image, const char* name_space, const char *name);
 
-MONO_API MonoClass *
+MONO_RT_EXTERNAL_ONLY MONO_API MonoClass *
 mono_class_from_name_case  (MonoImage *image, const char* name_space, const char *name);
 
 MONO_API MonoMethod *
index 94a120360888dac2e17c2755809365f6b9fe2391..8d3f714f7a9cbc059fa975c1afa241416f7a7e28 100644 (file)
@@ -95,6 +95,10 @@ GENERATE_GET_CLASS_WITH_CACHE (iunknown,      Mono.Interop, IUnknown)
 GENERATE_GET_CLASS_WITH_CACHE (com_object, System, __ComObject)
 GENERATE_GET_CLASS_WITH_CACHE (variant,    System, Variant)
 
+static GENERATE_GET_CLASS_WITH_CACHE (interface_type_attribute, System.Runtime.InteropServices, InterfaceTypeAttribute)
+static GENERATE_GET_CLASS_WITH_CACHE (guid_attribute, System.Runtime.InteropServices, GuidAttribute)
+static GENERATE_GET_CLASS_WITH_CACHE (com_visible_attribute, System.Runtime.InteropServices, ComVisibleAttribute)
+
 /* Upon creation of a CCW, only allocate a weak handle and set the
  * reference count to 0. If the unmanaged client code decides to addref and
  * hold onto the CCW, I then allocate a strong handle. Once the reference count
@@ -177,7 +181,7 @@ mono_class_try_get_com_object_class (void)
        static gboolean inited;
        MonoClass *klass;
        if (!inited) {
-               klass = mono_class_from_name (mono_defaults.corlib, "System", "__ComObject");
+               klass = mono_class_load_from_name (mono_defaults.corlib, "System", "__ComObject");
                mono_memory_barrier ();
                tmp_class = klass;
                mono_memory_barrier ();
@@ -296,16 +300,13 @@ cominterop_object_is_rcw (MonoObject *obj)
 static int
 cominterop_get_com_slot_begin (MonoClass* klass)
 {
-       static MonoClass *interface_type_attribute = NULL;
        MonoCustomAttrInfo *cinfo = NULL;
        MonoInterfaceTypeAttribute* itf_attr = NULL; 
 
-       if (!interface_type_attribute)
-               interface_type_attribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "InterfaceTypeAttribute");
        cinfo = mono_custom_attrs_from_class (klass);
        if (cinfo) {
                MonoError error;
-               itf_attr = (MonoInterfaceTypeAttribute*)mono_custom_attrs_get_attr_checked (cinfo, interface_type_attribute, &error);
+               itf_attr = (MonoInterfaceTypeAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_get_interface_type_attribute_class (), &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
                if (!cinfo->cached)
                        mono_custom_attrs_free (cinfo);
@@ -404,17 +405,12 @@ cominterop_mono_string_to_guid (MonoString* string, guint8 *guid);
 static gboolean
 cominterop_class_guid (MonoClass* klass, guint8* guid)
 {
-       static MonoClass *GuidAttribute = NULL;
        MonoCustomAttrInfo *cinfo;
 
-       /* Handle the GuidAttribute */
-       if (!GuidAttribute)
-               GuidAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "GuidAttribute");
-
        cinfo = mono_custom_attrs_from_class (klass);   
        if (cinfo) {
                MonoError error;
-               MonoReflectionGuidAttribute *attr = (MonoReflectionGuidAttribute*)mono_custom_attrs_get_attr_checked (cinfo, GuidAttribute, &error);
+               MonoReflectionGuidAttribute *attr = (MonoReflectionGuidAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_get_guid_attribute_class (), &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
 
                if (!attr)
@@ -431,20 +427,15 @@ cominterop_class_guid (MonoClass* klass, guint8* guid)
 static gboolean
 cominterop_com_visible (MonoClass* klass)
 {
-       static MonoClass *ComVisibleAttribute = NULL;
        MonoError error;
        MonoCustomAttrInfo *cinfo;
        GPtrArray *ifaces;
        MonoBoolean visible = 1;
 
-       /* Handle the ComVisibleAttribute */
-       if (!ComVisibleAttribute)
-               ComVisibleAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "ComVisibleAttribute");
-
        cinfo = mono_custom_attrs_from_class (klass);
        if (cinfo) {
                MonoError error;
-               MonoReflectionComVisibleAttribute *attr = (MonoReflectionComVisibleAttribute*)mono_custom_attrs_get_attr_checked (cinfo, ComVisibleAttribute, &error);
+               MonoReflectionComVisibleAttribute *attr = (MonoReflectionComVisibleAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_get_guid_attribute_class (), &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
 
                if (attr)
@@ -618,7 +609,6 @@ mono_cominterop_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type,
        case MONO_MARSHAL_CONV_OBJECT_INTERFACE:
        case MONO_MARSHAL_CONV_OBJECT_IUNKNOWN:
        case MONO_MARSHAL_CONV_OBJECT_IDISPATCH: {
-               static MonoClass* com_interop_proxy_class = NULL;
                static MonoMethod* com_interop_proxy_get_proxy = NULL;
                static MonoMethod* get_transparent_proxy = NULL;
                guint32 pos_null = 0, pos_ccw = 0, pos_end = 0;
@@ -643,16 +633,14 @@ mono_cominterop_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type,
                mono_mb_emit_icall (mb, cominterop_get_ccw_object);
                pos_ccw = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S);
 
-               if (!com_interop_proxy_class)
-                       com_interop_proxy_class = mono_class_from_name (mono_defaults.corlib, "Mono.Interop", "ComInteropProxy");
                if (!com_interop_proxy_get_proxy)
-                       com_interop_proxy_get_proxy = mono_class_get_method_from_name_flags (com_interop_proxy_class, "GetProxy", 2, METHOD_ATTRIBUTE_PRIVATE);
+                       com_interop_proxy_get_proxy = mono_class_get_method_from_name_flags (mono_class_get_interop_proxy_class (), "GetProxy", 2, METHOD_ATTRIBUTE_PRIVATE);
 #ifndef DISABLE_REMOTING
                if (!get_transparent_proxy)
                        get_transparent_proxy = mono_class_get_method_from_name (mono_defaults.real_proxy_class, "GetTransparentProxy", 0);
 #endif
 
-               mono_mb_add_local (mb, &com_interop_proxy_class->byval_arg);
+               mono_mb_add_local (mb, &mono_class_get_interop_proxy_class ()->byval_arg);
 
                mono_mb_emit_ldloc (mb, 0);
                mono_mb_emit_byte (mb, CEE_LDIND_I);
@@ -1054,13 +1042,10 @@ mono_cominterop_get_invoke (MonoMethod *method)
        }
 
        if (!strcmp(method->name, ".ctor"))     {
-               static MonoClass *com_interop_proxy_class = NULL;
                static MonoMethod *cache_proxy = NULL;
 
-               if (!com_interop_proxy_class)
-                       com_interop_proxy_class = mono_class_from_name (mono_defaults.corlib, "Mono.Interop", "ComInteropProxy");
                if (!cache_proxy)
-                       cache_proxy = mono_class_get_method_from_name (com_interop_proxy_class, "CacheProxy", 0);
+                       cache_proxy = mono_class_get_method_from_name (mono_class_get_interop_proxy_class (), "CacheProxy", 0);
 
                mono_mb_emit_ldarg (mb, 0);
                mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp));
@@ -1925,7 +1910,7 @@ cominterop_get_ccw (MonoObject* object, MonoClass* itf)
        if (cinfo) {
                static MonoClass* coclass_attribute = NULL;
                if (!coclass_attribute)
-                       coclass_attribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "CoClassAttribute");
+                       coclass_attribute = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "CoClassAttribute");
                if (mono_custom_attrs_has_attr (cinfo, coclass_attribute)) {
                        g_assert(itf->interface_count && itf->interfaces[0]);
                        itf = itf->interfaces[0];
@@ -2469,7 +2454,7 @@ cominterop_ccw_get_ids_of_names (MonoCCWInterface* ccwe, gpointer riid,
 
        /* Handle DispIdAttribute */
        if (!ComDispIdAttribute)
-               ComDispIdAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "DispIdAttribute");
+               ComDispIdAttribute = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "DispIdAttribute");
 
        g_assert (object);
        klass = mono_object_class (object);
index 5a4d518c230720b5e985d3ea1d34edbb2dc5f7ab..f2105335356944ebf260012c0a1a2434e74047be 100644 (file)
@@ -231,7 +231,7 @@ do_console_cancel_event (void)
        if (!domain->domain)
                return;
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "Console");
+       klass = mono_class_try_load_from_name (mono_defaults.corlib, "System", "Console");
        if (klass == NULL)
                return;
 
index 86c3965365fe1a2ce97b98f12231109cbd479971..df32fb052af36efea073cd66d1d8e8f79a327a92 100644 (file)
@@ -538,7 +538,7 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
        }
 
        if (desc->name_space && desc->klass) {
-               klass = mono_class_from_name (image, desc->name_space, desc->klass);
+               klass = mono_class_try_load_from_name (image, desc->name_space, desc->klass);
                if (!klass)
                        return NULL;
                return mono_method_desc_search_in_class (desc, klass);
index e8f5dfc13bc3e069a9dd57a76542caff76b99e6a..9f2d9fbd81433be9d715311d2d995efc214b61c4 100644 (file)
@@ -624,258 +624,184 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
        }
        mono_defaults.corlib = mono_assembly_get_image (ass);
 
-       mono_defaults.object_class = mono_class_from_name (
+       mono_defaults.object_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Object");
-       g_assert (mono_defaults.object_class != 0);
 
-       mono_defaults.void_class = mono_class_from_name (
+       mono_defaults.void_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Void");
-       g_assert (mono_defaults.void_class != 0);
 
-       mono_defaults.boolean_class = mono_class_from_name (
+       mono_defaults.boolean_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Boolean");
-       g_assert (mono_defaults.boolean_class != 0);
 
-       mono_defaults.byte_class = mono_class_from_name (
+       mono_defaults.byte_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Byte");
-       g_assert (mono_defaults.byte_class != 0);
 
-       mono_defaults.sbyte_class = mono_class_from_name (
+       mono_defaults.sbyte_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "SByte");
-       g_assert (mono_defaults.sbyte_class != 0);
 
-       mono_defaults.int16_class = mono_class_from_name (
+       mono_defaults.int16_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Int16");
-       g_assert (mono_defaults.int16_class != 0);
 
-       mono_defaults.uint16_class = mono_class_from_name (
+       mono_defaults.uint16_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UInt16");
-       g_assert (mono_defaults.uint16_class != 0);
 
-       mono_defaults.int32_class = mono_class_from_name (
+       mono_defaults.int32_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Int32");
-       g_assert (mono_defaults.int32_class != 0);
 
-       mono_defaults.uint32_class = mono_class_from_name (
+       mono_defaults.uint32_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UInt32");
-       g_assert (mono_defaults.uint32_class != 0);
 
-       mono_defaults.uint_class = mono_class_from_name (
+       mono_defaults.uint_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UIntPtr");
-       g_assert (mono_defaults.uint_class != 0);
 
-       mono_defaults.int_class = mono_class_from_name (
+       mono_defaults.int_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "IntPtr");
-       g_assert (mono_defaults.int_class != 0);
 
-       mono_defaults.int64_class = mono_class_from_name (
+       mono_defaults.int64_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Int64");
-       g_assert (mono_defaults.int64_class != 0);
 
-       mono_defaults.uint64_class = mono_class_from_name (
+       mono_defaults.uint64_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UInt64");
-       g_assert (mono_defaults.uint64_class != 0);
 
-       mono_defaults.single_class = mono_class_from_name (
+       mono_defaults.single_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Single");
-       g_assert (mono_defaults.single_class != 0);
 
-       mono_defaults.double_class = mono_class_from_name (
+       mono_defaults.double_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Double");
-       g_assert (mono_defaults.double_class != 0);
 
-       mono_defaults.char_class = mono_class_from_name (
+       mono_defaults.char_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Char");
-       g_assert (mono_defaults.char_class != 0);
 
-       mono_defaults.string_class = mono_class_from_name (
+       mono_defaults.string_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "String");
-       g_assert (mono_defaults.string_class != 0);
 
-       mono_defaults.enum_class = mono_class_from_name (
+       mono_defaults.enum_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Enum");
-       g_assert (mono_defaults.enum_class != 0);
 
-       mono_defaults.array_class = mono_class_from_name (
+       mono_defaults.array_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Array");
-       g_assert (mono_defaults.array_class != 0);
 
-       mono_defaults.delegate_class = mono_class_from_name (
+       mono_defaults.delegate_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Delegate");
-       g_assert (mono_defaults.delegate_class != 0 );
 
-       mono_defaults.multicastdelegate_class = mono_class_from_name (
+       mono_defaults.multicastdelegate_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "MulticastDelegate");
-       g_assert (mono_defaults.multicastdelegate_class != 0 );
 
-       mono_defaults.asyncresult_class = mono_class_from_name (
+       mono_defaults.asyncresult_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.Remoting.Messaging", 
                "AsyncResult");
-       g_assert (mono_defaults.asyncresult_class != 0 );
 
-       mono_defaults.manualresetevent_class = mono_class_from_name (
+       mono_defaults.manualresetevent_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Threading", "ManualResetEvent");
-       g_assert (mono_defaults.manualresetevent_class != 0 );
 
-       mono_defaults.typehandle_class = mono_class_from_name (
+       mono_defaults.typehandle_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeTypeHandle");
-       g_assert (mono_defaults.typehandle_class != 0);
 
-       mono_defaults.methodhandle_class = mono_class_from_name (
+       mono_defaults.methodhandle_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeMethodHandle");
-       g_assert (mono_defaults.methodhandle_class != 0);
 
-       mono_defaults.fieldhandle_class = mono_class_from_name (
+       mono_defaults.fieldhandle_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeFieldHandle");
-       g_assert (mono_defaults.fieldhandle_class != 0);
 
-       mono_defaults.systemtype_class = mono_class_from_name (
+       mono_defaults.systemtype_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Type");
-       g_assert (mono_defaults.systemtype_class != 0);
 
-       mono_defaults.monotype_class = mono_class_from_name (
+       mono_defaults.monotype_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "MonoType");
-       g_assert (mono_defaults.monotype_class != 0);
 
-       mono_defaults.runtimetype_class = mono_class_from_name (
+       mono_defaults.runtimetype_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeType");
-       g_assert (mono_defaults.runtimetype_class != 0);
 
-       mono_defaults.exception_class = mono_class_from_name (
+       mono_defaults.exception_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Exception");
-       g_assert (mono_defaults.exception_class != 0);
 
-       mono_defaults.threadabortexception_class = mono_class_from_name (
+       mono_defaults.threadabortexception_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Threading", "ThreadAbortException");
-       g_assert (mono_defaults.threadabortexception_class != 0);
 
-       mono_defaults.thread_class = mono_class_from_name (
+       mono_defaults.thread_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Threading", "Thread");
-       g_assert (mono_defaults.thread_class != 0);
 
-       mono_defaults.internal_thread_class = mono_class_from_name (
+       mono_defaults.internal_thread_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Threading", "InternalThread");
-       if (!mono_defaults.internal_thread_class) {
-               /* This can happen with an old mscorlib */
-               fprintf (stderr, "Corlib too old for this runtime.\n");
-               fprintf (stderr, "Loaded from: %s\n",
-                                mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown");
-               exit (1);
-       }
 
-       mono_defaults.appdomain_class = mono_class_from_name (
+       mono_defaults.appdomain_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "AppDomain");
-       g_assert (mono_defaults.appdomain_class != 0);
 
 #ifndef DISABLE_REMOTING
-       mono_defaults.transparent_proxy_class = mono_class_from_name (
+       mono_defaults.transparent_proxy_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Runtime.Remoting.Proxies", "TransparentProxy");
-       g_assert (mono_defaults.transparent_proxy_class != 0);
 
-       mono_defaults.real_proxy_class = mono_class_from_name (
+       mono_defaults.real_proxy_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Runtime.Remoting.Proxies", "RealProxy");
-       g_assert (mono_defaults.real_proxy_class != 0);
 
-       mono_defaults.marshalbyrefobject_class =  mono_class_from_name (
+       mono_defaults.marshalbyrefobject_class =  mono_class_load_from_name (
                mono_defaults.corlib, "System", "MarshalByRefObject");
-       g_assert (mono_defaults.marshalbyrefobject_class != 0);
 
-       mono_defaults.iremotingtypeinfo_class = mono_class_from_name (
+       mono_defaults.iremotingtypeinfo_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.Remoting", "IRemotingTypeInfo");
-       g_assert (mono_defaults.iremotingtypeinfo_class != 0);
+
 #endif
 
-       mono_defaults.mono_method_message_class = mono_class_from_name (
+       mono_defaults.mono_method_message_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Runtime.Remoting.Messaging", "MonoMethodMessage");
-       g_assert (mono_defaults.mono_method_message_class != 0);
 
-       mono_defaults.field_info_class = mono_class_from_name (
+       mono_defaults.field_info_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Reflection", "FieldInfo");
-       g_assert (mono_defaults.field_info_class != 0);
 
-       mono_defaults.method_info_class = mono_class_from_name (
+       mono_defaults.method_info_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Reflection", "MethodInfo");
-       g_assert (mono_defaults.method_info_class != 0);
 
-       mono_defaults.stringbuilder_class = mono_class_from_name (
+       mono_defaults.stringbuilder_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Text", "StringBuilder");
-       g_assert (mono_defaults.stringbuilder_class != 0);
 
-       mono_defaults.math_class = mono_class_from_name (
+       mono_defaults.math_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Math");
-       g_assert (mono_defaults.math_class != 0);
 
-       mono_defaults.stack_frame_class = mono_class_from_name (
+       mono_defaults.stack_frame_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Diagnostics", "StackFrame");
-       g_assert (mono_defaults.stack_frame_class != 0);
 
-       mono_defaults.stack_trace_class = mono_class_from_name (
+       mono_defaults.stack_trace_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Diagnostics", "StackTrace");
-       g_assert (mono_defaults.stack_trace_class != 0);
 
-       mono_defaults.marshal_class = mono_class_from_name (
+       mono_defaults.marshal_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.InteropServices", "Marshal");
-       g_assert (mono_defaults.marshal_class != 0);
 
-       mono_defaults.typed_reference_class =  mono_class_from_name (
+       mono_defaults.typed_reference_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "TypedReference");
-       g_assert (mono_defaults.typed_reference_class != 0);
 
-       mono_defaults.argumenthandle_class =  mono_class_from_name (
+       mono_defaults.argumenthandle_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "RuntimeArgumentHandle");
-       g_assert (mono_defaults.argumenthandle_class != 0);
 
-       mono_defaults.monitor_class =  mono_class_from_name (
+       mono_defaults.monitor_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Threading", "Monitor");
-       g_assert (mono_defaults.monitor_class != 0);
-
-       mono_defaults.runtimesecurityframe_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Security", "RuntimeSecurityFrame");
-
-       mono_defaults.executioncontext_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Threading", "ExecutionContext");
-
-       mono_defaults.internals_visible_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Runtime.CompilerServices", "InternalsVisibleToAttribute");
-
-       mono_defaults.critical_finalizer_object = mono_class_from_name (
-               mono_defaults.corlib, "System.Runtime.ConstrainedExecution", "CriticalFinalizerObject");
-
        /*
-        * mscorlib needs a little help, only now it can load its friends list (after we have
-        * loaded the InternalsVisibleToAttribute), load it now
-        */
+       Not using GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL as this type is heavily checked by sgen when computing finalization.
+       */
+       mono_defaults.critical_finalizer_object = mono_class_try_load_from_name (mono_defaults.corlib,
+                       "System.Runtime.ConstrainedExecution", "CriticalFinalizerObject");
+
        mono_assembly_load_friends (ass);
-       
-       mono_defaults.safehandle_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Runtime.InteropServices", "SafeHandle");
 
-       mono_defaults.handleref_class = mono_class_from_name (
+       mono_defaults.handleref_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.InteropServices", "HandleRef");
 
-       mono_defaults.attribute_class = mono_class_from_name (
+       mono_defaults.attribute_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Attribute");
 
-       mono_defaults.customattribute_data_class = mono_class_from_name (
+       mono_defaults.customattribute_data_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Reflection", "CustomAttributeData");
 
        mono_class_init (mono_defaults.array_class);
-       mono_defaults.generic_nullable_class = mono_class_from_name (
+       mono_defaults.generic_nullable_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Nullable`1");
-       mono_defaults.generic_ilist_class = mono_class_from_name (
+       mono_defaults.generic_ilist_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Collections.Generic", "IList`1");
-       mono_defaults.generic_ireadonlylist_class = mono_class_from_name (
+       mono_defaults.generic_ireadonlylist_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Collections.Generic", "IReadOnlyList`1");
 
-       mono_defaults.threadpool_wait_callback_class = mono_class_from_name (
+       mono_defaults.threadpool_wait_callback_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Threading", "_ThreadPoolWaitCallback");
-       if (!mono_defaults.threadpool_wait_callback_class) {
-               /* This can happen with an old mscorlib */
-               fprintf (stderr, "Corlib too old for this runtime.\n");
-               fprintf (stderr, "Loaded from: %s\n",
-                                mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown");
-               exit (1);
-       }
+
        mono_defaults.threadpool_perform_wait_callback_method = mono_class_get_method_from_name (
                mono_defaults.threadpool_wait_callback_class, "PerformWaitCallback", 0);
 
index d97fa4286551920079e68e6d23b76d84a352ec3f..a66c9d723d15c63aa04c2d9d27ffafe3659c34b9 100644 (file)
@@ -64,7 +64,7 @@ mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
        MonoObject *o;
        MonoDomain *caller_domain = mono_domain_get ();
 
-       klass = mono_class_from_name (image, name_space, name);
+       klass = mono_class_load_from_name (image, name_space, name);
 
        o = mono_object_new_checked (domain, klass, &error);
        g_assert (o != NULL && mono_error_ok (&error)); /* FIXME don't swallow the error */
@@ -168,7 +168,7 @@ MonoException *
 mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
                                      const char *name, MonoString *a1, MonoString *a2)
 {
-       MonoClass *klass = mono_class_from_name (image, name_space, name);
+       MonoClass *klass = mono_class_load_from_name (image, name_space, name);
 
        return create_exception_two_strings (klass, a1, a2);
 }
@@ -583,8 +583,7 @@ mono_get_exception_type_initialization (const gchar *type_name, MonoException *i
        MonoMethod *method;
        gpointer iter;
 
-       klass = mono_class_from_name (mono_get_corlib (), "System", "TypeInitializationException");
-       g_assert (klass);
+       klass = mono_class_load_from_name (mono_get_corlib (), "System", "TypeInitializationException");
 
        mono_class_init (klass);
 
@@ -759,8 +758,8 @@ mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions
        MonoMethod *method;
        gpointer iter;
 
-       klass = mono_class_from_name (mono_get_corlib (), "System.Reflection", "ReflectionTypeLoadException");
-       g_assert (klass);
+       klass = mono_class_load_from_name (mono_get_corlib (), "System.Reflection", "ReflectionTypeLoadException");
+
        mono_class_init (klass);
 
        /* Find the Type[], Exception[] ctor */
@@ -798,8 +797,7 @@ mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception)
        MonoDomain *domain = mono_domain_get ();
        gpointer params [16];
 
-       klass = mono_class_from_name (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeWrappedException");
-       g_assert (klass);
+       klass = mono_class_load_from_name (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeWrappedException");
 
        o = mono_object_new_checked (domain, klass, &error);
        g_assert (o != NULL && mono_error_ok (&error)); /* FIXME don't swallow the error */
index 2249a2f2bd63ddb59362ac67670a1c1969574abd..82e0b9b69fb17d61e6f69e1cc8fed412c2c1e2db 100644 (file)
@@ -146,6 +146,8 @@ ves_icall_marshal_alloc (gulong size);
 /* Lazy class loading functions */
 static GENERATE_GET_CLASS_WITH_CACHE (string_builder, System.Text, StringBuilder)
 static GENERATE_GET_CLASS_WITH_CACHE (date_time, System, DateTime)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (unmanaged_function_pointer_attribute, System.Runtime.InteropServices, UnmanagedFunctionPointerAttribute)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (icustom_marshaler, System.Runtime.InteropServices, ICustomMarshaler)
 
 /* MonoMethod pointers to SafeHandle::DangerousAddRef and ::DangerousRelease */
 static MonoMethod *sh_dangerous_add_ref;
@@ -156,9 +158,9 @@ static void
 init_safe_handle ()
 {
        sh_dangerous_add_ref = mono_class_get_method_from_name (
-               mono_defaults.safehandle_class, "DangerousAddRef", 1);
+               mono_class_try_get_safehandle_class (), "DangerousAddRef", 1);
        sh_dangerous_release = mono_class_get_method_from_name (
-               mono_defaults.safehandle_class, "DangerousRelease", 0);
+               mono_class_try_get_safehandle_class (), "DangerousRelease", 0);
 }
 
 static void
@@ -394,15 +396,11 @@ mono_marshal_use_aot_wrappers (gboolean use)
 static void
 parse_unmanaged_function_pointer_attr (MonoClass *klass, MonoMethodPInvoke *piinfo)
 {
-       static MonoClass *UnmanagedFunctionPointerAttribute;
        MonoCustomAttrInfo *cinfo;
        MonoReflectionUnmanagedFunctionPointerAttribute *attr;
 
-       if (!UnmanagedFunctionPointerAttribute)
-               UnmanagedFunctionPointerAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
-
        /* The attribute is only available in Net 2.0 */
-       if (UnmanagedFunctionPointerAttribute) {
+       if (mono_class_try_get_unmanaged_function_pointer_attribute_class ()) {
                /* 
                 * The pinvoke attributes are stored in a real custom attribute so we have to
                 * construct it.
@@ -410,7 +408,7 @@ parse_unmanaged_function_pointer_attr (MonoClass *klass, MonoMethodPInvoke *piin
                cinfo = mono_custom_attrs_from_class (klass);
                if (cinfo && !mono_runtime_get_no_exec ()) {
                        MonoError error;
-                       attr = (MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr_checked (cinfo, UnmanagedFunctionPointerAttribute, &error);
+                       attr = (MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_try_get_unmanaged_function_pointer_attribute_class (), &error);
                        if (attr) {
                                piinfo->piflags = (attr->call_conv << 8) | (attr->charset ? (attr->charset - 1) * 2 : 1) | attr->set_last_error;
                        } else {
@@ -1807,7 +1805,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje
                return;
        }
 
-       if (klass != mono_defaults.safehandle_class) {
+       if (klass != mono_class_try_get_safehandle_class ()) {
                if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
                        char *msg = g_strdup_printf ("Type %s which is passed to unmanaged code must have a StructLayout attribute.",
                                                                                 mono_type_full_name (&klass->byval_arg));
@@ -1837,7 +1835,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje
                        usize = info->fields [i + 1].offset - info->fields [i].offset;
                }
 
-               if (klass != mono_defaults.safehandle_class){
+               if (klass != mono_class_try_get_safehandle_class ()){
                        /* 
                         * FIXME: Should really check for usize==0 and msize>0, but we apply 
                         * the layout to the managed structure as well.
@@ -4336,7 +4334,7 @@ emit_marshal_custom (EmitMarshalContext *m, int argnum, MonoType *t,
        int pos2;
 
        if (!ICustomMarshaler) {
-               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "ICustomMarshaler");
+               MonoClass *klass = mono_class_try_get_icustom_marshaler_class ();
                if (!klass) {
                        exception_msg = g_strdup ("Current profile doesn't support ICustomMarshaler");
                        goto handle_exception;
@@ -7070,8 +7068,8 @@ emit_marshal (EmitMarshalContext *m, int argnum, MonoType *t,
                        return mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
 #endif
 
-               if (mono_defaults.safehandle_class != NULL && t->data.klass &&
-                   mono_class_is_subclass_of (t->data.klass,  mono_defaults.safehandle_class, FALSE))
+               if (mono_class_try_get_safehandle_class () != NULL && t->data.klass &&
+                   mono_class_is_subclass_of (t->data.klass,  mono_class_try_get_safehandle_class (), FALSE))
                        return emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
                
                return emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
@@ -8044,7 +8042,6 @@ mono_marshal_set_callconv_from_modopt (MonoMethod *method, MonoMethodSignature *
 MonoMethod *
 mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t target_handle)
 {
-       static MonoClass *UnmanagedFunctionPointerAttribute;
        MonoMethodSignature *sig, *csig, *invoke_sig;
        MonoMethodBuilder *mb;
        MonoMethod *res, *invoke;
@@ -8099,12 +8096,8 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
 
        mono_marshal_set_callconv_from_modopt (invoke, csig);
 
-       /* Handle the UnmanagedFunctionPointerAttribute */
-       if (!UnmanagedFunctionPointerAttribute)
-               UnmanagedFunctionPointerAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
-
        /* The attribute is only available in Net 2.0 */
-       if (UnmanagedFunctionPointerAttribute) {
+       if (mono_class_try_get_unmanaged_function_pointer_attribute_class ()) {
                MonoCustomAttrInfo *cinfo;
                MonoCustomAttrEntry *attr;
 
@@ -8118,7 +8111,7 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
                if (cinfo) {
                        for (i = 0; i < cinfo->num_attrs; ++i) {
                                MonoClass *ctor_class = cinfo->attrs [i].ctor->klass;
-                               if (mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute)) {
+                               if (mono_class_has_parent (ctor_class, mono_class_try_get_unmanaged_function_pointer_attribute_class ())) {
                                        attr = &cinfo->attrs [i];
                                        break;
                                }
index 9c082de29c66488f90ab49aa65c04a25338ff2f0..7ff64f517ac012a0464202bbb8fb5ff84f0fc457 100644 (file)
@@ -5894,7 +5894,7 @@ handle_enum:
                        *conv = MONO_MARSHAL_CONV_DEL_FTN;
                        return MONO_NATIVE_FUNC;
                }
-               if (mono_defaults.safehandle_class && type->data.klass == mono_defaults.safehandle_class){
+               if (mono_class_try_get_safehandle_class () && type->data.klass == mono_class_try_get_safehandle_class ()){
                        *conv = MONO_MARSHAL_CONV_SAFEHANDLE;
                        return MONO_NATIVE_INT;
                }
index 23f8d5990952d0a176d19cbb1e26e1a0f305114a..5bbedbbb816a1f6c83c10568412c9ecbadaca2ad 100644 (file)
@@ -550,7 +550,7 @@ mono_mb_emit_exception_full (MonoMethodBuilder *mb, const char *exc_nspace, cons
 {
        MonoMethod *ctor = NULL;
 
-       MonoClass *mme = mono_class_from_name (mono_defaults.corlib, exc_nspace, exc_name);
+       MonoClass *mme = mono_class_load_from_name (mono_defaults.corlib, exc_nspace, exc_name);
        mono_class_init (mme);
        ctor = mono_class_get_method_from_name (mme, ".ctor", 0);
        g_assert (ctor);
index d82ca0c831f7a167d88d04d5ecd71990f1b1699f..7e90b652dd5901714b31f60bfb95725fd85a8404 100644 (file)
@@ -41,7 +41,7 @@ mono_mlist_alloc (MonoObject *data)
        MonoError error;
        MonoMList* res;
        if (!monolist_item_vtable) {
-               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoListItem");
+               MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoListItem");
                monolist_item_vtable = mono_class_vtable (mono_get_root_domain (), klass);
                g_assert (monolist_item_vtable);
        }
index 03cc519767a4172a258d86d922e7235213f2b17f..a27f82ecd292958c66ca56293c08d9b82009aadf 100644 (file)
@@ -956,7 +956,7 @@ void invoke_protected_memory_method (MonoArray *data, MonoObject *scope, gboolea
                }
        }
 
-       klass = mono_class_from_name (system_security_assembly,
+       klass = mono_class_load_from_name (system_security_assembly,
                                                                  "System.Security.Cryptography", "ProtectedMemory");
        method = mono_class_get_method_from_name (klass, encrypt ? "Protect" : "Unprotect", 2);
        params [0] = data;
index 45f93f157fa38747d06d25de3240c7eac1f9cb71..e5a86f3496291db7d57bf0af1f68f6dfdebcd75a 100644 (file)
 
 #ifdef __GNUC__
 
-/* namespace and name should be a constant */
-/* image must be mscorlib since other assemblies can be unloaded */
-#define mono_class_from_name_cached(image,namespace,name) ({ \
-                       static MonoClass *tmp_klass; \
-                       if (!tmp_klass) { \
-                               g_assert (image == mono_defaults.corlib); \
-                               tmp_klass = mono_class_from_name ((image), (namespace), (name)); \
-                               g_assert (tmp_klass); \
-                       }; \
-                       tmp_klass; })
 /* name should be a compile-time constant */
 #define mono_class_get_field_from_name_cached(klass,name) ({ \
                        static MonoClassField *tmp_field; \
 
 #else
 
-#define mono_class_from_name_cached(image,namespace,name) mono_class_from_name ((image), (namespace), (name))
 #define mono_class_get_field_from_name_cached(klass,name) mono_class_get_field_from_name ((klass), (name))
 #define mono_array_class_get_cached(eclass,rank) mono_array_class_get ((eclass), (rank))
 #define mono_array_new_cached(domain, eclass, size) mono_array_new_specific (mono_class_vtable ((domain), mono_array_class_get_cached ((eclass), 1)), (size))
index 1d2cd363c10fd4c93002429e50200c0d2035ba0e..dca9ccfc305eee7326111dad75a08ebf225465fa 100644 (file)
@@ -58,6 +58,34 @@ HANDLE ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
 
 static MonoImage *system_assembly=NULL;
 
+//Hand coded version that loads from system
+static MonoClass*
+mono_class_get_file_version_info_class (void)
+{
+       static MonoClass *tmp_class;
+       MonoClass *klass = tmp_class;
+       if (!klass) {
+               klass = mono_class_load_from_name (system_assembly, "System.Diagnostics", "FileVersionInfo");
+               mono_memory_barrier ();
+               tmp_class = klass;
+       }
+       return klass;
+}
+
+static MonoClass*
+mono_class_get_process_module_class (void)
+{
+       static MonoClass *tmp_class;
+       MonoClass *klass = tmp_class;
+       if (!klass) {
+               klass = mono_class_load_from_name (system_assembly, "System.Diagnostics", "ProcessModule");
+               mono_memory_barrier ();
+               tmp_class = klass;
+       }
+       return klass;
+}
+
+
 static guint32 unicode_chars (const gunichar2 *str)
 {
        guint32 len=0;
@@ -360,7 +388,6 @@ static void process_get_assembly_fileversion (MonoObject *filever, MonoAssembly
 static MonoObject* get_process_module (MonoAssembly *assembly, MonoClass *proc_class)
 {
        MonoError error;
-       static MonoClass *filever_class = NULL;
        MonoObject *item, *filever;
        MonoDomain *domain = mono_domain_get ();
        char *filename;
@@ -372,13 +399,7 @@ static MonoObject* get_process_module (MonoAssembly *assembly, MonoClass *proc_c
         */
        item = mono_object_new_checked (domain, proc_class, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
-
-       if (!filever_class)
-               filever_class = mono_class_from_name (system_assembly,
-                                           "System.Diagnostics",
-                                           "FileVersionInfo");
-
-       filever = mono_object_new_checked (domain, filever_class, &error);
+       filever = mono_object_new_checked (domain, mono_class_get_file_version_info_class (), &error);
        if (!mono_error_ok (&error)) goto leave;
 
        process_get_assembly_fileversion (filever, assembly);
@@ -400,7 +421,6 @@ leave:
 static MonoObject* process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2 *modulename, MonoClass *proc_class)
 {
        MonoError error;
-       static MonoClass *filever_class = NULL;
        MonoObject *item, *filever;
        MonoDomain *domain=mono_domain_get ();
        MODULEINFO modinfo;
@@ -410,13 +430,7 @@ static MonoObject* process_add_module (HANDLE process, HMODULE mod, gunichar2 *f
         */
        item=mono_object_new_checked (domain, proc_class, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
-
-       if (!filever_class)
-               filever_class=mono_class_from_name (system_assembly,
-                                           "System.Diagnostics",
-                                           "FileVersionInfo");
-
-       filever=mono_object_new_checked (domain, filever_class, &error);
+       filever = mono_object_new_checked (domain, mono_class_get_file_version_info_class (), &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
 
        process_get_fileversion (filever, filename);
@@ -475,7 +489,6 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        DWORD needed;
        guint32 count = 0, module_count = 0, assembly_count = 0;
        guint32 i, num_added = 0;
-       static MonoClass *proc_class = NULL;
        GPtrArray *assemblies = NULL;
        static HANDLE current_process = 0;
        
@@ -496,16 +509,13 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        }
 
        count = module_count + assembly_count; 
-       if (!proc_class)
-               proc_class = mono_class_from_name (system_assembly, "System.Diagnostics", "ProcessModule");
-
-       temp_arr = mono_array_new (mono_domain_get (), proc_class, count);
+       temp_arr = mono_array_new (mono_domain_get (), mono_class_get_process_module_class (), count);
 
        for (i = 0; i < module_count; i++) {
                if (GetModuleBaseName (process, mods[i], modname, MAX_PATH) &&
                                GetModuleFileNameEx (process, mods[i], filename, MAX_PATH)) {
                        MonoObject *module = process_add_module (process, mods[i],
-                                       filename, modname, proc_class);
+                                       filename, modname, mono_class_get_process_module_class ());
                        mono_array_setref (temp_arr, num_added++, module);
                }
        }
@@ -513,7 +523,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        if (assemblies) {
                for (i = 0; i < assembly_count; i++) {
                        MonoAssembly *ass = (MonoAssembly *)g_ptr_array_index (assemblies, i);
-                       MonoObject *module = get_process_module (ass, proc_class);
+                       MonoObject *module = get_process_module (ass, mono_class_get_process_module_class ());
                        mono_array_setref (temp_arr, num_added++, module);
                }
                g_ptr_array_free (assemblies, TRUE);
@@ -523,7 +533,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
                arr = temp_arr;
        } else {
                /* shorter version of the array */
-               arr = mono_array_new (mono_domain_get (), proc_class, num_added);
+               arr = mono_array_new (mono_domain_get (), mono_class_get_process_module_class (), num_added);
 
                for (i = 0; i < num_added; i++)
                        mono_array_setref (arr, i, mono_array_get (temp_arr, MonoObject*, i));
index 2de7972026a8921f987f14ccd1ea385abd5b3c2d..e3c3cbc82d57a033d5ba8ba57de299dd7468fdbc 100644 (file)
@@ -11,6 +11,7 @@
 
 /* Class lazy loading functions */
 static GENERATE_GET_CLASS_WITH_CACHE (security_manager, System.Security, SecurityManager)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (execution_context, System.Threading, ExecutionContext)
 
 static MonoSecurityMode mono_security_mode = MONO_SECURITY_MODE_NONE;
 
@@ -96,9 +97,10 @@ mono_get_context_capture_method (void)
                return NULL;
 
        /* older corlib revisions won't have the class (nor the method) */
-       if (mono_defaults.executioncontext_class && !method) {
-               mono_class_init (mono_defaults.executioncontext_class);
-               method = mono_class_get_method_from_name (mono_defaults.executioncontext_class, "Capture", 0);
+       MonoClass *execution_context = mono_class_try_get_execution_context_class ();
+       if (execution_context && !method) {
+               mono_class_init (execution_context);
+               method = mono_class_get_method_from_name (execution_context, "Capture", 0);
        }
 
        return method;
index 8f86228dce17bece01892b1e24934f67aa7af264..e070fed4ad436d1530110f0d72f23740bf334ab9 100644 (file)
@@ -1198,14 +1198,12 @@ create_allocator (int atype, gboolean slowpath)
                /* catch */
                clause->flags = MONO_EXCEPTION_CLAUSE_NONE;
                clause->try_len = mono_mb_get_pos (mb) - clause->try_offset;
-               clause->data.catch_class = mono_class_from_name (mono_defaults.corlib,
+               clause->data.catch_class = mono_class_load_from_name (mono_defaults.corlib,
                                "System", "OverflowException");
-               g_assert (clause->data.catch_class);
                clause->handler_offset = mono_mb_get_label (mb);
 
-               oom_exc_class = mono_class_from_name (mono_defaults.corlib,
+               oom_exc_class = mono_class_load_from_name (mono_defaults.corlib,
                                "System", "OutOfMemoryException");
-               g_assert (oom_exc_class);
                ctor = mono_class_get_method_from_name (oom_exc_class, ".ctor", 0);
                g_assert (ctor);
 
index 7ddf9d3e4686faa5023da5d0e7bdd947e45d8180..333c41975004a9cfb5be337a2302263215d3562e 100644 (file)
@@ -602,8 +602,7 @@ get_family_hint (void)
                socket_assembly = get_socket_assembly ();
                g_assert (socket_assembly);
 
-               socket_class = mono_class_from_name (socket_assembly, "System.Net.Sockets", "Socket");
-               g_assert (socket_class);
+               socket_class = mono_class_load_from_name (socket_assembly, "System.Net.Sockets", "Socket");
 
                ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4_supported");
                g_assert (ipv4_field);
@@ -832,8 +831,7 @@ create_object_from_sockaddr(struct sockaddr *saddr, int sa_size, gint32 *error)
 
        /* Build a System.Net.SocketAddress object instance */
        if (!domain->sockaddr_class) {
-               domain->sockaddr_class=mono_class_from_name (get_socket_assembly (), "System.Net", "SocketAddress");
-               g_assert (domain->sockaddr_class);
+               domain->sockaddr_class = mono_class_load_from_name (get_socket_assembly (), "System.Net", "SocketAddress");
        }
        sockaddr_obj=mono_object_new_checked(domain, domain->sockaddr_class, &merror);
        mono_error_raise_exception (&merror); /* FIXME don't raise here */
@@ -1978,7 +1976,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (SOCKET sock, g
        switch(name) {
        case SocketOptionName_Linger:
                /* build a System.Net.Sockets.LingerOption */
-               obj_class=mono_class_from_name(get_socket_assembly (),
+               obj_class = mono_class_load_from_name (get_socket_assembly (),
                                               "System.Net.Sockets",
                                               "LingerOption");
                obj=mono_object_new_checked(domain, obj_class, &merror);
@@ -2027,7 +2025,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (SOCKET sock, g
                        }
                }
                
-               obj_class = mono_class_from_name(mono_posix_image,
+               obj_class = mono_class_load_from_name (mono_posix_image,
                                                 "Mono.Posix",
                                                 "PeerCredData");
                obj = mono_object_new_checked(domain, obj_class, &merror);
index 82f9d75c83a871ba74c9c6f9a599f890e8a4590e..ba70e75ca01dec739b87af6e05b40fa883083ccf 100644 (file)
@@ -357,8 +357,7 @@ mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item)
        g_assert (work_item);
 
        if (!threadpool_class)
-               threadpool_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
-       g_assert (threadpool_class);
+               threadpool_class = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
 
        if (!unsafe_queue_custom_work_item_method)
                unsafe_queue_custom_work_item_method = mono_class_get_method_from_name (threadpool_class, "UnsafeQueueCustomWorkItem", 2);
@@ -1326,8 +1325,7 @@ mono_threadpool_ms_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMet
        MonoObject *state = NULL;
 
        if (!async_call_klass)
-               async_call_klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
-       g_assert (async_call_klass);
+               async_call_klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
 
        mono_lazy_initialize (&status, initialize);
 
index d8e6fca980c27d4d1034634aafeb723974218851..5d0cd89cfeb838e6affd664457f6b2b7dab665f0 100644 (file)
@@ -3609,7 +3609,7 @@ add_wrappers (MonoAotCompile *acfg)
                /* Assembly runtime-invoke (string, bool) [DoAssemblyResolve] */
                csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
                csig->hasthis = 1;
-               csig->ret = &(mono_class_from_name (
+               csig->ret = &(mono_class_load_from_name (
                                                                                        mono_defaults.corlib, "System.Reflection", "Assembly"))->byval_arg;
                csig->params [0] = &mono_defaults.string_class->byval_arg;
                csig->params [1] = &mono_defaults.boolean_class->byval_arg;
@@ -4279,14 +4279,13 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
 
                memset (&ctx, 0, sizeof (ctx));
 
-               icomparable = mono_class_from_name (mono_defaults.corlib, "System", "IComparable`1");
-               g_assert (icomparable);
+               icomparable = mono_class_load_from_name (mono_defaults.corlib, "System", "IComparable`1");
+
                args [0] = &tclass->byval_arg;
                ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
                if (mono_class_is_assignable_from (mono_class_inflate_generic_class (icomparable, &ctx), tclass)) {
-                       gcomparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericComparer`1");
-                       g_assert (gcomparer);
+                       gcomparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx), FALSE, "Comparer<T>");
                }
        }
@@ -4300,14 +4299,13 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
 
                memset (&ctx, 0, sizeof (ctx));
 
-               iface = mono_class_from_name (mono_defaults.corlib, "System", "IEquatable`1");
+               iface = mono_class_load_from_name (mono_defaults.corlib, "System", "IEquatable`1");
                g_assert (iface);
                args [0] = &tclass->byval_arg;
                ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
                if (mono_class_is_assignable_from (mono_class_inflate_generic_class (iface, &ctx), tclass)) {
-                       gcomparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericEqualityComparer`1");
-                       g_assert (gcomparer);
+                       gcomparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericEqualityComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx), FALSE, "EqualityComparer<T>");
                }
        }
@@ -4324,8 +4322,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
                        args [0] = &tclass->byval_arg;
                        ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer<T>");
                }
        }
@@ -4342,8 +4339,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
                        args [0] = &tclass->byval_arg;
                        ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
-                       comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "ObjectComparer`1");
-                       g_assert (comparer);
+                       comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "ObjectComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (comparer, &ctx), FALSE, "Comparer<T>");
                }
        }
@@ -4561,10 +4557,10 @@ add_generic_instances (MonoAotCompile *acfg)
                insts [ninsts ++] = &mono_defaults.boolean_class->byval_arg;
 
                /* Add GenericComparer<T> instances for primitive types for Enum.ToString () */
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "GenericComparer`1");
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "GenericComparer`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "GenericEqualityComparer`1");
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "GenericEqualityComparer`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
 
@@ -4579,24 +4575,20 @@ add_generic_instances (MonoAotCompile *acfg)
                        insts [ninsts ++] = &mono_defaults.uint32_class->byval_arg;
                        insts [ninsts ++] = &mono_defaults.uint16_class->byval_arg;
                        insts [ninsts ++] = &mono_defaults.byte_class->byval_arg;
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
                        add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE);
 
                        ninsts = 0;
                        insts [ninsts ++] = &mono_defaults.int16_class->byval_arg;
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "ShortEnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "ShortEnumEqualityComparer`1");
                        add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE);
 
                        ninsts = 0;
                        insts [ninsts ++] = &mono_defaults.sbyte_class->byval_arg;
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "SByteEnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "SByteEnumEqualityComparer`1");
                        add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE);
 
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1");
                        ninsts = 0;
                        insts [ninsts ++] = &mono_defaults.int64_class->byval_arg;
                        insts [ninsts ++] = &mono_defaults.uint64_class->byval_arg;
@@ -4605,13 +4597,15 @@ add_generic_instances (MonoAotCompile *acfg)
 
                /* Add instances of the array generic interfaces for primitive types */
                /* This will add instances of the InternalArray_ helper methods in Array too */
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "ICollection`1");
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "ICollection`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "IList`1");
+
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "IList`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "IEnumerable`1");
+
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "IEnumerable`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
 
@@ -4642,7 +4636,7 @@ add_generic_instances (MonoAotCompile *acfg)
                        MonoGenericContext ctx;
                        MonoType *args [16];
                        MonoMethod *m;
-                       MonoClass *interlocked_klass = mono_class_from_name (mono_defaults.corlib, "System.Threading", "Interlocked");
+                       MonoClass *interlocked_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "Interlocked");
                        gpointer iter = NULL;
 
                        while ((m = mono_class_get_methods (interlocked_klass, &iter))) {
@@ -4662,7 +4656,7 @@ add_generic_instances (MonoAotCompile *acfg)
                        MonoGenericContext ctx;
                        MonoType *args [16];
                        MonoMethod *m;
-                       MonoClass *volatile_klass = mono_class_from_name (mono_defaults.corlib, "System.Threading", "Volatile");
+                       MonoClass *volatile_klass = mono_class_try_load_from_name (mono_defaults.corlib, "System.Threading", "Volatile");
                        gpointer iter = NULL;
 
                        if (volatile_klass) {
@@ -5383,9 +5377,8 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
                MonoClass *ex_class;
 
                ex_class =
-                       mono_class_from_name (mono_defaults.exception_class->image,
+                       mono_class_load_from_name (mono_defaults.exception_class->image,
                                                                  "System", (const char *)patch_info->data.target);
-               g_assert (ex_class);
                encode_klass_ref (acfg, ex_class, p, &p);
                break;
        }
@@ -7927,7 +7920,6 @@ emit_llvm_file (MonoAotCompile *acfg)
         * then removing tailcallelim + the global opts.
         * strip-dead-prototypes deletes unused intrinsics definitions.
         */
-       //opts = g_strdup ("-simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -domtree -domfrontier -scalarrepl -simplify-libcalls -instcombine -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -domfrontier -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-deletion -loop-simplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -domtree -memdep -dse -adce -simplifycfg -domtree -verify");
        /* The dse pass is disabled because of #13734 and #17616 */
        /*
         * The dse bug is in DeadStoreElimination.cpp:isOverwrite ():
@@ -7943,7 +7935,11 @@ emit_llvm_file (MonoAotCompile *acfg)
                // FIXME: This doesn't work yet
                opts = g_strdup ("");
        else
+#if LLVM_API_VERSION > 100
+               opts = g_strdup ("-O2");
+#else
                opts = g_strdup ("-targetlibinfo -no-aa -basicaa -notti -instcombine -simplifycfg -inline-cost -inline -sroa -domtree -early-cse -lazy-value-info -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -indvars -loop-idiom -loop-deletion -loop-unroll -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -correlated-propagation -domtree -memdep -adce -simplifycfg -instcombine -strip-dead-prototypes -domtree -verify");
+#endif
        command = g_strdup_printf ("\"%sopt\" -f %s -o \"%s\" \"%s\"", acfg->aot_opts.llvm_path, opts, optbc, tempbc);
        aot_printf (acfg, "Executing opt: %s\n", command);
        if (execute_system (command) != 0)
@@ -7978,6 +7974,10 @@ emit_llvm_file (MonoAotCompile *acfg)
 
        g_string_append_printf (acfg->llc_args, " -mono-eh-frame-symbol=%s%s", acfg->user_symbol_prefix, acfg->llvm_eh_frame_symbol);
 
+#if LLVM_API_VERSION > 100
+       g_string_append_printf (acfg->llc_args, " -disable-tail-calls");
+#endif
+
 #if defined(TARGET_MACH) && defined(TARGET_ARM)
        /* ios requires PIC code now */
        g_string_append_printf (acfg->llc_args, " -relocation-model=pic");
index aeb11a0ff0e7ab327bac24441a82e0854a51cec2..1a4ea53fe1f9ecfa48455f4961f6e1c8f1283639 100644 (file)
@@ -44,7 +44,7 @@ mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, con
        if (bb->region == -1 || !MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_TRY))
                return NULL;
 
-       exclass = mono_class_from_name (mono_get_corlib (), "System", exname);
+       exclass = mono_class_load_from_name (mono_get_corlib (), "System", exname);
        /* search for the handler */
        for (i = 0; i < header->num_clauses; ++i) {
                clause = &header->clauses [i];
index 8eea1c3321397f2f34c069a1d4b2b1221a8e51b7..6b72d9571d8497909aa7fcb721f557d7b4ee70c3 100644 (file)
@@ -3328,18 +3328,14 @@ init_jit_info_dbg_attrs (MonoJitInfo *ji)
        if (ji->dbg_attrs_inited)
                return;
 
-       if (!hidden_klass) {
-               hidden_klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerHiddenAttribute");
-               g_assert (hidden_klass);
-       }
-       if (!step_through_klass) {
-               step_through_klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerStepThroughAttribute");
-               g_assert (step_through_klass);
-       }
-       if (!non_user_klass) {
-               non_user_klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerNonUserCodeAttribute");
-               g_assert (non_user_klass);
-       }
+       if (!hidden_klass)
+               hidden_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerHiddenAttribute");
+
+       if (!step_through_klass)
+               step_through_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerStepThroughAttribute");
+
+       if (!non_user_klass)
+               non_user_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerNonUserCodeAttribute");
 
        ainfo = mono_custom_attrs_from_method (jinfo_get_method (ji));
        if (ainfo) {
@@ -6957,7 +6953,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
                wait_for_suspend ();
 
 #ifdef TRY_MANAGED_SYSTEM_ENVIRONMENT_EXIT
-               env_class = mono_class_from_name (mono_defaults.corlib, "System", "Environment");
+               env_class = mono_class_try_load_from_name (mono_defaults.corlib, "System", "Environment");
                if (env_class)
                        exit_method = mono_class_get_method_from_name (env_class, "Exit", 1);
 #endif
index dc39414e557a05bf9a5538ced43a21c653aa90e4..d4ba5599049ef11e6221d7c565a9b3a0c76fcb06 100644 (file)
 
 #include "config.h"
 
+#include <llvm-c/Core.h>
+#include <llvm-c/ExecutionEngine.h>
+
+#include "mini-llvm-cpp.h"
+
+#if !defined(MONO_CROSS_COMPILE) && LLVM_API_VERSION < 100
+
 #include <stdint.h>
 
 #include <llvm/Support/raw_ostream.h>
 #include <llvm/IR/IRBuilder.h>
 #include <llvm/IR/Module.h>
 
-#include <llvm-c/Core.h>
-#include <llvm-c/ExecutionEngine.h>
-
-#include "mini-llvm-cpp.h"
-
-#ifndef MONO_CROSS_COMPILE
-
 using namespace llvm;
 
 static void (*unhandled_exception)() = default_mono_llvm_unhandled_exception;
index 5b11f776cf68e710b7ff891bdad6a89ab123c810..2120fa08728e6c39a3863b4ab80ce95dc3c5b499 100644 (file)
@@ -205,8 +205,8 @@ mono_local_cprop (MonoCompile *cfg)
        int initial_max_vregs = cfg->next_vreg;
 
        max = cfg->next_vreg;
-       defs = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * cfg->next_vreg + 1);
-       def_index = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * cfg->next_vreg + 1);
+       defs = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * cfg->next_vreg);
+       def_index = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * cfg->next_vreg);
        cfg->cbb = bb_opt = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock));
 
        for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
@@ -219,22 +219,28 @@ mono_local_cprop (MonoCompile *cfg)
                        int sregs [MONO_MAX_SRC_REGS];
                        int num_sregs, i;
 
-                       if ((ins->dreg != -1) && (ins->dreg < max)) {
-                               defs [ins->dreg] = NULL;
+                       if (ins->dreg != -1) {
 #if SIZEOF_REGISTER == 4
-                               defs [ins->dreg + 1] = NULL;
+                               const char *spec = INS_INFO (ins->opcode);
+                               if (spec [MONO_INST_DEST] == 'l') {
+                                       defs [ins->dreg + 1] = NULL;
+                                       defs [ins->dreg + 2] = NULL;
+                               }
 #endif
+                               defs [ins->dreg] = NULL;
                        }
 
                        num_sregs = mono_inst_get_src_registers (ins, sregs);
                        for (i = 0; i < num_sregs; ++i) {
                                int sreg = sregs [i];
-                               if (sreg < max) {
-                                       defs [sreg] = NULL;
 #if SIZEOF_REGISTER == 4
+                               const char *spec = INS_INFO (ins->opcode);
+                               if (spec [MONO_INST_SRC1 + i] == 'l') {
                                        defs [sreg + 1] = NULL;
-#endif
+                                       defs [sreg + 2] = NULL;
                                }
+#endif
+                               defs [sreg] = NULL;
                        }
                }
 
index 30a0234a723a4ff39aa37b4fc8017b11d7d421d6..d76f2085b9697f5d8576adc580146a57017a426c 100644 (file)
@@ -160,6 +160,7 @@ static MonoMethodSignature *helper_sig_llvmonly_imt_thunk;
 
 /* type loading helpers */
 static GENERATE_GET_CLASS_WITH_CACHE (runtime_helpers, System.Runtime.CompilerServices, RuntimeHelpers)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (debuggable_attribute, System.Diagnostics, DebuggableAttribute)
 
 /*
  * Instruction metadata
@@ -7895,7 +7896,7 @@ is_jit_optimizer_disabled (MonoMethod *m)
 {
        MonoAssembly *ass = m->klass->image->assembly;
        MonoCustomAttrInfo* attrs;
-       static MonoClass *klass;
+       MonoClass *klass;
        int i;
        gboolean val = FALSE;
 
@@ -7903,8 +7904,8 @@ is_jit_optimizer_disabled (MonoMethod *m)
        if (ass->jit_optimizer_disabled_inited)
                return ass->jit_optimizer_disabled;
 
-       if (!klass)
-               klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggableAttribute");
+       klass = mono_class_try_get_debuggable_attribute_class ();
+
        if (!klass) {
                /* Linked away */
                ass->jit_optimizer_disabled = FALSE;
index 66d6d5c648156269d88893732fb302ae66f9fe5e..56ca3d7aaebb01544516a507fbd924b81e5444d6 100644 (file)
@@ -7597,8 +7597,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
                        amd64_patch (patch_info->ip.i + cfg->native_code, code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        throw_ip = patch_info->ip.i;
 
                        //x86_breakpoint (code);
index b1ddb65fc8fc0fb228950edd88a1a38e40505fbc..c9b74ee958f6e8caf0bdee4b6a4b80931b5aa05e 100644 (file)
@@ -6802,8 +6802,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        }
                        arm_patch (ip, code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
 
                        ARM_MOV_REG_REG (code, ARMREG_R1, ARMREG_LR);
 #ifdef USE_JUMP_TABLES
index 6667530f9273ed42ea646b84b593f8b5241b78a5..43d192707def962b78813b6e639012497a263d1d 100644 (file)
@@ -2630,19 +2630,19 @@ mini_method_is_open (MonoMethod *method)
        return FALSE;
 }
 
+/* Lazy class loading functions */
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (iasync_state_machine, System.Runtime.CompilerServices, IAsyncStateMachine)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (async_state_machine_attribute, System.Runtime.CompilerServices, AsyncStateMachineAttribute)
+
+
 static G_GNUC_UNUSED gboolean
 is_async_state_machine_class (MonoClass *klass)
 {
-       static MonoClass *iclass;
-       static gboolean iclass_set;
+       MonoClass *iclass;
 
        return FALSE;
 
-       if (!iclass_set) {
-               iclass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "IAsyncStateMachine");
-               mono_memory_barrier ();
-               iclass_set = TRUE;
-       }
+       iclass = mono_class_try_get_iasync_state_machine_class ();
 
        if (iclass && klass->valuetype && mono_class_is_assignable_from (iclass, klass))
                return TRUE;
@@ -2655,16 +2655,11 @@ is_async_method (MonoMethod *method)
        MonoCustomAttrInfo *cattr;
        MonoMethodSignature *sig;
        gboolean res = FALSE;
-       static MonoClass *attr_class;
-       static gboolean attr_class_set;
+       MonoClass *attr_class;
 
        return FALSE;
 
-       if (!attr_class_set) {
-               attr_class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "AsyncStateMachineAttribute");
-               mono_memory_barrier ();
-               attr_class_set = TRUE;
-       }
+       attr_class = mono_class_try_get_iasync_state_machine_class ();
 
        /* Do less expensive checks first */
        sig = mono_method_signature (method);
index 54222c26698975ce20e00aed2ec952697d36454a..aee49d44b2125b324b9770b24fa29c9ba2fe96f9 100644 (file)
@@ -4188,8 +4188,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        guint8* buf;
                        guint64 exc_token_index;
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        exc_token_index = mono_metadata_token_index (exc_class->type_token);
                        throw_ip = cfg->native_code + patch_info->ip.i;
 
index f6c95a0cb361243c790e0d10878ac5759313c80f..1a65475f2121243848e69dbf483f23c2a6578fa1 100644 (file)
@@ -265,7 +265,7 @@ static void init_jit_module (MonoDomain *domain);
 static void emit_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder, const unsigned char *cil_code);
 static LLVMValueRef emit_dbg_subprogram (EmitContext *ctx, MonoCompile *cfg, LLVMValueRef method, const char *name);
 static void emit_dbg_info (MonoLLVMModule *module, const char *filename, const char *cu_name);
-
+static void emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *exc_type, LLVMValueRef cmp);
 
 static inline void
 set_failure (EmitContext *ctx, const char *message)
@@ -1866,8 +1866,19 @@ emit_load_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder
        const char *intrins_name;
        LLVMValueRef args [16], res;
        LLVMTypeRef addr_type;
+       gboolean use_intrinsics = TRUE;
 
+#if LLVM_API_VERSION > 100
        if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only) {
+               /* The llvm.mono.load/store intrinsics are not supported by this llvm version, emit an explicit null check instead */
+               LLVMValueRef cmp = LLVMBuildICmp (*builder_ref, LLVMIntEQ, addr, LLVMConstNull (LLVMTypeOf (addr)), "");
+               emit_cond_system_exception (ctx, bb, "NullReferenceException", cmp);
+               *builder_ref = ctx->builder;
+               use_intrinsics = FALSE;
+       }
+#endif
+
+       if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only && use_intrinsics) {
                LLVMAtomicOrdering ordering;
 
                switch (barrier) {
@@ -1955,8 +1966,19 @@ emit_store_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builde
 {
        const char *intrins_name;
        LLVMValueRef args [16];
+       gboolean use_intrinsics = TRUE;
 
+#if LLVM_API_VERSION > 100
        if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only) {
+               /* The llvm.mono.load/store intrinsics are not supported by this llvm version, emit an explicit null check instead */
+               LLVMValueRef cmp = LLVMBuildICmp (*builder_ref, LLVMIntEQ, addr, LLVMConstNull (LLVMTypeOf (addr)), "");
+               emit_cond_system_exception (ctx, bb, "NullReferenceException", cmp);
+               *builder_ref = ctx->builder;
+               use_intrinsics = FALSE;
+       }
+#endif
+
+       if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only && use_intrinsics) {
                LLVMAtomicOrdering ordering;
 
                switch (barrier) {
@@ -2035,8 +2057,7 @@ emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *ex
 
        LLVMBuildCondBr (ctx->builder, cmp, ex_bb, noex_bb);
 
-       exc_class = mono_class_from_name (mono_get_corlib (), "System", exc_type);
-       g_assert (exc_class);
+       exc_class = mono_class_load_from_name (mono_get_corlib (), "System", exc_type);
 
        /* Emit exception throwing code */
        ctx->builder = builder = create_builder (ctx);
@@ -4852,7 +4873,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        break;
                case OP_FCONV_TO_U1:
                case OP_RCONV_TO_U1:
-                       values [ins->dreg] = LLVMBuildZExt (builder, LLVMBuildFPToUI (builder, lhs, LLVMInt8Type (), dname), LLVMInt32Type (), "");
+                       values [ins->dreg] = LLVMBuildZExt (builder, LLVMBuildTrunc (builder, LLVMBuildFPToUI (builder, lhs, IntPtrType (), dname), LLVMInt8Type (), ""), LLVMInt32Type (), "");
                        break;
                case OP_FCONV_TO_I2:
                case OP_RCONV_TO_I2:
@@ -5014,7 +5035,9 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                 * they can't fail, allowing them to be hoisted out of loops.
                                 */
                                set_invariant_load_flag (values [ins->dreg]);
+#if LLVM_API_VERSION < 100
                                set_metadata_flag (values [ins->dreg], "mono.nofail.load");
+#endif
                        }
 
                        if (sext)
index 0b1265e9e7844b744df10536a41500bb5b1038f8..a5453a88e05ca98d64213755782cbbb9bdf325b6 100644 (file)
@@ -221,8 +221,7 @@ mips_emit_exc_by_name(guint8 *code, const char *name)
        gpointer addr;
        MonoClass *exc_class;
 
-       exc_class = mono_class_from_name (mono_defaults.corlib, "System", name);
-       g_assert (exc_class);
+       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", name);
 
        mips_load_const (code, mips_a0, exc_class->type_token);
        addr = mono_get_throw_corlib_exception ();
index 9e715e2dd71e52383fd04b63f250b2236dbd7ca9..c9116ff46e1e6a974f1e5391de97731bc38bd90e 100644 (file)
@@ -5621,8 +5621,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                                exc_throw_pos [i] = code;
                        }
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
 
                        ppc_patch (ip, code);
                        /*mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC_NAME, patch_info->data.target);*/
index a4a7776094c57ab7ee2372e50f8da6d51f4e4d2b..4cf7b4df7ad0a69e069da3f066ad2007e8b29b0e 100644 (file)
@@ -6077,10 +6077,9 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        /*-----------------------------------------------------*/
                        s390_patch_rel (ip + 2, (guint64) S390_RELATIVE(code,ip));
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, 
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib,
                                                          "System", 
                                                          patch_info->data.name);
-                       g_assert (exc_class);
                        throw_ip = patch_info->ip.i;
 
                        for (iExc = 0; iExc < nThrows; ++iExc)
index 7f99809d51f5bbfda35588899c28e3940d0abb3c..f791290851c2f393bee65d55f528c919f7c13dec 100644 (file)
@@ -4208,8 +4208,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
                        sparc_patch ((guint32*)(cfg->native_code + patch_info->ip.i), code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        type_idx = exc_class->type_token - MONO_TOKEN_TYPE_DEF;
                        throw_ip = patch_info->ip.i;
 
index 0407c7cc57e4d6a527a24d3a80d17c7deb754b8c..c772cf21305605e745e101c8e4b7bb8563bb0660 100644 (file)
@@ -5664,8 +5664,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
                        x86_patch (patch_info->ip.i + cfg->native_code, code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        throw_ip = patch_info->ip.i;
 
                        /* Find a throw sequence for the same exception class */
index 0dff9e980880e9e276e33182ceb53ea43ff693e4..7030a4b3e5fa4149528fda724c8c49e8fd51a321 100644 (file)
@@ -195,7 +195,7 @@ static inline void print_report (const gchar *format, ...)
        vfprintf (stdout, format, ap);
        fprintf (stdout, "\n");
        va_end (ap);
-       klass = mono_class_from_name (mono_get_corlib (), "System", "Environment");
+       klass = mono_class_load_from_name (mono_get_corlib (), "System", "Environment");
        mono_class_init (klass);
        prop = mono_class_get_property_from_name (klass, "StackTrace");
        str = (MonoString*)mono_property_get_value (prop, NULL, NULL, NULL);
index 97279d2fb6ddbd9e2dabf09dbb61ee5af68a174e..5bfa3a89da58104ebfd20516c665ed37dbf4bdb2 100644 (file)
@@ -350,7 +350,7 @@ public class Tests : LoadMissing {
                return 2;
        }
 
-       public static int Main () {
-               return TestDriver.RunTests (typeof (Tests));
+       public static int Main (string[] args) {
+               return TestDriver.RunTests (typeof (Tests), args);
        }
 }
index 768b169079f4b8f4a95dde7d593621761818333c..c37fc3d16cb8518dddfc115c9bf89c9512bbd599 100644 (file)
@@ -599,7 +599,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out)
                break;
 
        case MONO_ERROR_TYPE_LOAD:
-               if (error->type_name || error->assembly_name) {
+               if (error->type_name && error->assembly_name) {
                        type_name = get_type_name_as_mono_string (error, domain, error_out);
                        if (!mono_error_ok (error_out))
                                break;